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 |
|---|---|---|---|---|---|---|---|---|---|---|
rhuss/jolokia | agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java | MulticastUtil.sendQueryAndCollectAnswers | public static List<DiscoveryIncomingMessage> sendQueryAndCollectAnswers(DiscoveryOutgoingMessage pOutMsg, int pTimeout) throws IOException {
"""
Sent out a message to Jolokia's multicast group over all network interfaces supporting multicast request (and no
logging is used)
@param pOutMsg the message to send
... | java | public static List<DiscoveryIncomingMessage> sendQueryAndCollectAnswers(DiscoveryOutgoingMessage pOutMsg, int pTimeout) throws IOException {
return sendQueryAndCollectAnswers(pOutMsg, pTimeout, new QuietLogHandler());
} | [
"public",
"static",
"List",
"<",
"DiscoveryIncomingMessage",
">",
"sendQueryAndCollectAnswers",
"(",
"DiscoveryOutgoingMessage",
"pOutMsg",
",",
"int",
"pTimeout",
")",
"throws",
"IOException",
"{",
"return",
"sendQueryAndCollectAnswers",
"(",
"pOutMsg",
",",
"pTimeout",
... | Sent out a message to Jolokia's multicast group over all network interfaces supporting multicast request (and no
logging is used)
@param pOutMsg the message to send
@param pTimeout timeout used for how long to wait for discovery messages
@return list of received answers, never null
@throws IOException if something fa... | [
"Sent",
"out",
"a",
"message",
"to",
"Jolokia",
"s",
"multicast",
"group",
"over",
"all",
"network",
"interfaces",
"supporting",
"multicast",
"request",
"(",
"and",
"no",
"logging",
"is",
"used",
")"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/MulticastUtil.java#L54-L56 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java | StoryFinder.findClassNames | public List<String> findClassNames(String searchIn, List<String> includes, List<String> excludes) {
"""
Finds Java classes from a source path, allowing for includes/excludes,
and converts them to class names.
@param searchIn the path to search in
@param includes the List of include patterns, or <code>null</co... | java | public List<String> findClassNames(String searchIn, List<String> includes, List<String> excludes) {
return classNames(normalise(sort(scan(searchIn, includes, excludes))));
} | [
"public",
"List",
"<",
"String",
">",
"findClassNames",
"(",
"String",
"searchIn",
",",
"List",
"<",
"String",
">",
"includes",
",",
"List",
"<",
"String",
">",
"excludes",
")",
"{",
"return",
"classNames",
"(",
"normalise",
"(",
"sort",
"(",
"scan",
"("... | Finds Java classes from a source path, allowing for includes/excludes,
and converts them to class names.
@param searchIn the path to search in
@param includes the List of include patterns, or <code>null</code> if
none
@param excludes the List of exclude patterns, or <code>null</code> if
none
@return A List of class na... | [
"Finds",
"Java",
"classes",
"from",
"a",
"source",
"path",
"allowing",
"for",
"includes",
"/",
"excludes",
"and",
"converts",
"them",
"to",
"class",
"names",
"."
] | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java#L60-L62 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/MenuScreen.java | MenuScreen.setProperty | public void setProperty(String strProperty, String strValue) {
"""
Set this property.
@param strProperty The property key.
@param strValue The property value.
"""
if (DBParams.MENU.equalsIgnoreCase(strProperty))
this.setMenuProperty(strValue); // Special case
else
... | java | public void setProperty(String strProperty, String strValue)
{
if (DBParams.MENU.equalsIgnoreCase(strProperty))
this.setMenuProperty(strValue); // Special case
else
super.setProperty(strProperty, strValue);
} | [
"public",
"void",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
")",
"{",
"if",
"(",
"DBParams",
".",
"MENU",
".",
"equalsIgnoreCase",
"(",
"strProperty",
")",
")",
"this",
".",
"setMenuProperty",
"(",
"strValue",
")",
";",
"// Spec... | Set this property.
@param strProperty The property key.
@param strValue The property value. | [
"Set",
"this",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/MenuScreen.java#L122-L128 |
wigforss/Ka-Web | servlet/src/main/java/org/kasource/web/servlet/filter/NoCacheFilter.java | NoCacheFilter.setHeader | private void setHeader(HttpServletResponse response, String name, String value) {
"""
Set Cache header.
@param response The HttpResponse to set header on
@param name Name of the header to set
@param value Value of the header to set.
"""
if(response.containsHeader(value)) {
res... | java | private void setHeader(HttpServletResponse response, String name, String value) {
if(response.containsHeader(value)) {
response.setHeader(name, value);
} else {
response.addHeader(name, value);
}
} | [
"private",
"void",
"setHeader",
"(",
"HttpServletResponse",
"response",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"response",
".",
"containsHeader",
"(",
"value",
")",
")",
"{",
"response",
".",
"setHeader",
"(",
"name",
",",
"val... | Set Cache header.
@param response The HttpResponse to set header on
@param name Name of the header to set
@param value Value of the header to set. | [
"Set",
"Cache",
"header",
"."
] | train | https://github.com/wigforss/Ka-Web/blob/bb6d8eacbefdeb7c8c6bb6135e55939d968fa433/servlet/src/main/java/org/kasource/web/servlet/filter/NoCacheFilter.java#L81-L87 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/NetworkConfig.java | NetworkConfig.setPort | public NetworkConfig setPort(int port) {
"""
Sets the port the Hazelcast member will try to bind on.
A valid port value is between 0 and 65535.
A port number of 0 will let the system pick up an ephemeral port.
@param port the port the Hazelcast member will try to bind on
@return NetworkConfig the updated N... | java | public NetworkConfig setPort(int port) {
if (port < 0 || port > PORT_MAX) {
throw new IllegalArgumentException("Port out of range: " + port + ". Allowed range [0,65535]");
}
this.port = port;
return this;
} | [
"public",
"NetworkConfig",
"setPort",
"(",
"int",
"port",
")",
"{",
"if",
"(",
"port",
"<",
"0",
"||",
"port",
">",
"PORT_MAX",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Port out of range: \"",
"+",
"port",
"+",
"\". Allowed range [0,65535]\"... | Sets the port the Hazelcast member will try to bind on.
A valid port value is between 0 and 65535.
A port number of 0 will let the system pick up an ephemeral port.
@param port the port the Hazelcast member will try to bind on
@return NetworkConfig the updated NetworkConfig
@see #getPort()
@see #setPortAutoIncrement(... | [
"Sets",
"the",
"port",
"the",
"Hazelcast",
"member",
"will",
"try",
"to",
"bind",
"on",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/NetworkConfig.java#L99-L105 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/SQSSession.java | SQSSession.createQueue | @Override
public Queue createQueue(String queueName) throws JMSException {
"""
This does not create SQS Queue. This method is only to create JMS Queue Object.
Make sure the queue exists corresponding to the queueName.
@param queueName
@return a queue destination
@throws JMSException
If session is closed o... | java | @Override
public Queue createQueue(String queueName) throws JMSException {
checkClosed();
return new SQSQueueDestination(queueName, amazonSQSClient.getQueueUrl(queueName).getQueueUrl());
} | [
"@",
"Override",
"public",
"Queue",
"createQueue",
"(",
"String",
"queueName",
")",
"throws",
"JMSException",
"{",
"checkClosed",
"(",
")",
";",
"return",
"new",
"SQSQueueDestination",
"(",
"queueName",
",",
"amazonSQSClient",
".",
"getQueueUrl",
"(",
"queueName",... | This does not create SQS Queue. This method is only to create JMS Queue Object.
Make sure the queue exists corresponding to the queueName.
@param queueName
@return a queue destination
@throws JMSException
If session is closed or invalid queue is provided | [
"This",
"does",
"not",
"create",
"SQS",
"Queue",
".",
"This",
"method",
"is",
"only",
"to",
"create",
"JMS",
"Queue",
"Object",
".",
"Make",
"sure",
"the",
"queue",
"exists",
"corresponding",
"to",
"the",
"queueName",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/SQSSession.java#L633-L637 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/DeterminismHash.java | DeterminismHash.compareHashes | public static int compareHashes(int[] leftHashes, int[] rightHashes) {
"""
Compare two hash arrays return true if the same.
For now, just compares first integer value in array.
"""
assert(leftHashes != null);
assert(rightHashes != null);
assert(leftHashes.length >= 3);
assert... | java | public static int compareHashes(int[] leftHashes, int[] rightHashes) {
assert(leftHashes != null);
assert(rightHashes != null);
assert(leftHashes.length >= 3);
assert(rightHashes.length >= 3);
// Compare total checksum first
if (leftHashes[0] == rightHashes[0]) {
... | [
"public",
"static",
"int",
"compareHashes",
"(",
"int",
"[",
"]",
"leftHashes",
",",
"int",
"[",
"]",
"rightHashes",
")",
"{",
"assert",
"(",
"leftHashes",
"!=",
"null",
")",
";",
"assert",
"(",
"rightHashes",
"!=",
"null",
")",
";",
"assert",
"(",
"le... | Compare two hash arrays return true if the same.
For now, just compares first integer value in array. | [
"Compare",
"two",
"hash",
"arrays",
"return",
"true",
"if",
"the",
"same",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/DeterminismHash.java#L112-L135 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-personalization/src/main/java/eu/atos/sla/modaclouds/QosModels.java | QosModels.getActionParameter | public static Parameter getActionParameter(Action action, String paramName) {
"""
Returns the first parameter with attribute "name" equals to paramName; if
not found, NOT_FOUND_PARAMETER.
"""
for (Parameter param : action.getParameters()) {
if (paramName.equals(param.getName())) {
... | java | public static Parameter getActionParameter(Action action, String paramName) {
for (Parameter param : action.getParameters()) {
if (paramName.equals(param.getName())) {
return param;
}
}
return NOT_FOUND_PARAMETER;
} | [
"public",
"static",
"Parameter",
"getActionParameter",
"(",
"Action",
"action",
",",
"String",
"paramName",
")",
"{",
"for",
"(",
"Parameter",
"param",
":",
"action",
".",
"getParameters",
"(",
")",
")",
"{",
"if",
"(",
"paramName",
".",
"equals",
"(",
"pa... | Returns the first parameter with attribute "name" equals to paramName; if
not found, NOT_FOUND_PARAMETER. | [
"Returns",
"the",
"first",
"parameter",
"with",
"attribute",
"name",
"equals",
"to",
"paramName",
";",
"if",
"not",
"found",
"NOT_FOUND_PARAMETER",
"."
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-personalization/src/main/java/eu/atos/sla/modaclouds/QosModels.java#L71-L78 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java | Duration.plus | public Duration plus(long amountToAdd, TemporalUnit unit) {
"""
Returns a copy of this duration with the specified duration added.
<p>
The duration amount is measured in terms of the specified unit.
Only a subset of units are accepted by this method.
The unit must either have an {@linkplain TemporalUnit#isDura... | java | public Duration plus(long amountToAdd, TemporalUnit unit) {
Objects.requireNonNull(unit, "unit");
if (unit == DAYS) {
return plus(Math.multiplyExact(amountToAdd, SECONDS_PER_DAY), 0);
}
if (unit.isDurationEstimated()) {
throw new UnsupportedTemporalTypeException("... | [
"public",
"Duration",
"plus",
"(",
"long",
"amountToAdd",
",",
"TemporalUnit",
"unit",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"unit",
",",
"\"unit\"",
")",
";",
"if",
"(",
"unit",
"==",
"DAYS",
")",
"{",
"return",
"plus",
"(",
"Math",
".",
"m... | Returns a copy of this duration with the specified duration added.
<p>
The duration amount is measured in terms of the specified unit.
Only a subset of units are accepted by this method.
The unit must either have an {@linkplain TemporalUnit#isDurationEstimated() exact duration} or
be {@link ChronoUnit#DAYS} which is tr... | [
"Returns",
"a",
"copy",
"of",
"this",
"duration",
"with",
"the",
"specified",
"duration",
"added",
".",
"<p",
">",
"The",
"duration",
"amount",
"is",
"measured",
"in",
"terms",
"of",
"the",
"specified",
"unit",
".",
"Only",
"a",
"subset",
"of",
"units",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java#L689-L711 |
structr/structr | structr-core/src/main/java/org/structr/core/graph/SyncCommand.java | SyncCommand.exportToFile | public static void exportToFile(final DatabaseService graphDb, final String fileName, final String query, final boolean includeFiles) throws FrameworkException {
"""
Exports the whole structr database to a file with the given name.
@param graphDb
@param fileName
@param includeFiles
@throws FrameworkException... | java | public static void exportToFile(final DatabaseService graphDb, final String fileName, final String query, final boolean includeFiles) throws FrameworkException {
final App app = StructrApp.getInstance();
try (final Tx tx = app.tx()) {
final NodeFactory nodeFactory = new NodeFactory(SecurityContext.get... | [
"public",
"static",
"void",
"exportToFile",
"(",
"final",
"DatabaseService",
"graphDb",
",",
"final",
"String",
"fileName",
",",
"final",
"String",
"query",
",",
"final",
"boolean",
"includeFiles",
")",
"throws",
"FrameworkException",
"{",
"final",
"App",
"app",
... | Exports the whole structr database to a file with the given name.
@param graphDb
@param fileName
@param includeFiles
@throws FrameworkException | [
"Exports",
"the",
"whole",
"structr",
"database",
"to",
"a",
"file",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/SyncCommand.java#L175-L223 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/type/UnscaledDecimal128Arithmetic.java | UnscaledDecimal128Arithmetic.addUnsignedReturnOverflow | private static long addUnsignedReturnOverflow(Slice left, Slice right, Slice result, boolean resultNegative) {
"""
This method ignores signs of the left and right. Returns overflow value.
"""
// TODO: consider two 7 bytes operations
int l0 = getInt(left, 0);
int l1 = getInt(left, 1);
... | java | private static long addUnsignedReturnOverflow(Slice left, Slice right, Slice result, boolean resultNegative)
{
// TODO: consider two 7 bytes operations
int l0 = getInt(left, 0);
int l1 = getInt(left, 1);
int l2 = getInt(left, 2);
int l3 = getInt(left, 3);
int r0 = ge... | [
"private",
"static",
"long",
"addUnsignedReturnOverflow",
"(",
"Slice",
"left",
",",
"Slice",
"right",
",",
"Slice",
"result",
",",
"boolean",
"resultNegative",
")",
"{",
"// TODO: consider two 7 bytes operations",
"int",
"l0",
"=",
"getInt",
"(",
"left",
",",
"0"... | This method ignores signs of the left and right. Returns overflow value. | [
"This",
"method",
"ignores",
"signs",
"of",
"the",
"left",
"and",
"right",
".",
"Returns",
"overflow",
"value",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/type/UnscaledDecimal128Arithmetic.java#L371-L404 |
apache/flink | flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java | OrcBatchReader.fillRows | static int fillRows(Row[] rows, TypeDescription schema, VectorizedRowBatch batch, int[] selectedFields) {
"""
Fills an ORC batch into an array of Row.
@param rows The batch of rows need to be filled.
@param schema The schema of the ORC data.
@param batch The ORC data.
@param selectedFields The list of select... | java | static int fillRows(Row[] rows, TypeDescription schema, VectorizedRowBatch batch, int[] selectedFields) {
int rowsToRead = Math.min((int) batch.count(), rows.length);
List<TypeDescription> fieldTypes = schema.getChildren();
// read each selected field
for (int fieldIdx = 0; fieldIdx < selectedFields.length; f... | [
"static",
"int",
"fillRows",
"(",
"Row",
"[",
"]",
"rows",
",",
"TypeDescription",
"schema",
",",
"VectorizedRowBatch",
"batch",
",",
"int",
"[",
"]",
"selectedFields",
")",
"{",
"int",
"rowsToRead",
"=",
"Math",
".",
"min",
"(",
"(",
"int",
")",
"batch"... | Fills an ORC batch into an array of Row.
@param rows The batch of rows need to be filled.
@param schema The schema of the ORC data.
@param batch The ORC data.
@param selectedFields The list of selected ORC fields.
@return The number of rows that were filled. | [
"Fills",
"an",
"ORC",
"batch",
"into",
"an",
"array",
"of",
"Row",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L135-L146 |
qspin/qtaste | kernel/src/main/java/com/qspin/qtaste/tcom/db/impl/ResultSetXMLConverter.java | ResultSetXMLConverter.getResultSetAsXML | public static Document getResultSetAsXML(ResultSet rs, String tableName) throws Exception {
"""
Return an XML document containing the specified ResultSet.
@param rs The specified ResultSet
@return the XML document
@throws java.lang.Exception
"""
return getResultSetAsXML(rs, tableName, "");
} | java | public static Document getResultSetAsXML(ResultSet rs, String tableName) throws Exception {
return getResultSetAsXML(rs, tableName, "");
} | [
"public",
"static",
"Document",
"getResultSetAsXML",
"(",
"ResultSet",
"rs",
",",
"String",
"tableName",
")",
"throws",
"Exception",
"{",
"return",
"getResultSetAsXML",
"(",
"rs",
",",
"tableName",
",",
"\"\"",
")",
";",
"}"
] | Return an XML document containing the specified ResultSet.
@param rs The specified ResultSet
@return the XML document
@throws java.lang.Exception | [
"Return",
"an",
"XML",
"document",
"containing",
"the",
"specified",
"ResultSet",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/tcom/db/impl/ResultSetXMLConverter.java#L156-L158 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/mmax/MMAXAnnotation.java | MMAXAnnotation.setSegmentList | public void setSegmentList(int i, AnnotationSegment v) {
"""
indexed setter for segmentList - sets an indexed value - List of MMAX annotation segements that make up the MMAX annotation.
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (MMAXAnnotation_Type.featOk... | java | public void setSegmentList(int i, AnnotationSegment v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null)
jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRef... | [
"public",
"void",
"setSegmentList",
"(",
"int",
"i",
",",
"AnnotationSegment",
"v",
")",
"{",
"if",
"(",
"MMAXAnnotation_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"MMAXAnnotation_Type",
")",
"jcasType",
")",
".",
"casFeat_segmentList",
"==",
"null",
")",
"jcasT... | indexed setter for segmentList - sets an indexed value - List of MMAX annotation segements that make up the MMAX annotation.
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"segmentList",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"MMAX",
"annotation",
"segements",
"that",
"make",
"up",
"the",
"MMAX",
"annotation",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/mmax/MMAXAnnotation.java#L163-L167 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract1.java | Tesseract1.doOCR | @Override
public String doOCR(File inputFile, Rectangle rect) throws TesseractException {
"""
Performs OCR operation.
@param inputFile an image file
@param rect the bounding rectangle defines the region of the image to be
recognized. A rectangle of zero dimension or <code>null</code> indicates
the whole ... | java | @Override
public String doOCR(File inputFile, Rectangle rect) throws TesseractException {
try {
File imageFile = ImageIOHelper.getImageFile(inputFile);
String imageFileFormat = ImageIOHelper.getImageFileFormat(imageFile);
Iterator<ImageReader> readers = ImageIO.getImageRe... | [
"@",
"Override",
"public",
"String",
"doOCR",
"(",
"File",
"inputFile",
",",
"Rectangle",
"rect",
")",
"throws",
"TesseractException",
"{",
"try",
"{",
"File",
"imageFile",
"=",
"ImageIOHelper",
".",
"getImageFile",
"(",
"inputFile",
")",
";",
"String",
"image... | Performs OCR operation.
@param inputFile an image file
@param rect the bounding rectangle defines the region of the image to be
recognized. A rectangle of zero dimension or <code>null</code> indicates
the whole image.
@return the recognized text
@throws TesseractException | [
"Performs",
"OCR",
"operation",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L189-L229 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java | ModelSerializer.restoreComputationGraph | public static ComputationGraph restoreComputationGraph(@NonNull String path, boolean loadUpdater)
throws IOException {
"""
Load a computation graph from a file
@param path path to the model file, to get the computation graph from
@return the loaded computation graph
@throws IOException
"""
... | java | public static ComputationGraph restoreComputationGraph(@NonNull String path, boolean loadUpdater)
throws IOException {
return restoreComputationGraph(new File(path), loadUpdater);
} | [
"public",
"static",
"ComputationGraph",
"restoreComputationGraph",
"(",
"@",
"NonNull",
"String",
"path",
",",
"boolean",
"loadUpdater",
")",
"throws",
"IOException",
"{",
"return",
"restoreComputationGraph",
"(",
"new",
"File",
"(",
"path",
")",
",",
"loadUpdater",... | Load a computation graph from a file
@param path path to the model file, to get the computation graph from
@return the loaded computation graph
@throws IOException | [
"Load",
"a",
"computation",
"graph",
"from",
"a",
"file",
"@param",
"path",
"path",
"to",
"the",
"model",
"file",
"to",
"get",
"the",
"computation",
"graph",
"from",
"@return",
"the",
"loaded",
"computation",
"graph"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java#L451-L454 |
knowm/XChange | xchange-core/src/main/java/org/knowm/xchange/utils/Assert.java | Assert.hasLength | public static void hasLength(String input, int length, String message) {
"""
Asserts that a String is not null and of a certain length
@param input The input under test
@param message The message for any exception
"""
notNull(input, message);
if (input.trim().length() != length) {
throw new ... | java | public static void hasLength(String input, int length, String message) {
notNull(input, message);
if (input.trim().length() != length) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"hasLength",
"(",
"String",
"input",
",",
"int",
"length",
",",
"String",
"message",
")",
"{",
"notNull",
"(",
"input",
",",
"message",
")",
";",
"if",
"(",
"input",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"!=",
... | Asserts that a String is not null and of a certain length
@param input The input under test
@param message The message for any exception | [
"Asserts",
"that",
"a",
"String",
"is",
"not",
"null",
"and",
"of",
"a",
"certain",
"length"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-core/src/main/java/org/knowm/xchange/utils/Assert.java#L46-L52 |
js-lib-com/commons | src/main/java/js/util/Files.java | Files.removeDirectory | private static void removeDirectory(File directory) throws IOException {
"""
Utility method invoked recursively to remove directory files. This method traverses <code>directory</code> files
and remove them, one by one. If a child file is happen to be a directory this method invoked itself with child
directory as... | java | private static void removeDirectory(File directory) throws IOException
{
// File.listFiles() may return null is file is not a directory - condition already tested before entering this
// method
for(File file : directory.listFiles()) {
if(file.isDirectory()) {
removeDirectory(file);
... | [
"private",
"static",
"void",
"removeDirectory",
"(",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"// File.listFiles() may return null is file is not a directory - condition already tested before entering this\r",
"// method\r",
"for",
"(",
"File",
"file",
":",
"direct... | Utility method invoked recursively to remove directory files. This method traverses <code>directory</code> files
and remove them, one by one. If a child file is happen to be a directory this method invoked itself with child
directory as parameter. After child directory is clean-up iteration continue removing child dire... | [
"Utility",
"method",
"invoked",
"recursively",
"to",
"remove",
"directory",
"files",
".",
"This",
"method",
"traverses",
"<code",
">",
"directory<",
"/",
"code",
">",
"files",
"and",
"remove",
"them",
"one",
"by",
"one",
".",
"If",
"a",
"child",
"file",
"i... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L1062-L1075 |
JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/sets/OpenHashSet.java | OpenHashSet.compactAndRemove | private void compactAndRemove(final E[] buffer, final int mask, int removeHashIndex) {
"""
/*
implemented as per wiki suggested algo with minor adjustments.
"""
// remove(9a): [9a,9b,10a,9c,10b,11a,null] -> [9b,9c,10a,10b,null,11a,null]
removeHashIndex = removeHashIndex & mask;
int j =... | java | private void compactAndRemove(final E[] buffer, final int mask, int removeHashIndex) {
// remove(9a): [9a,9b,10a,9c,10b,11a,null] -> [9b,9c,10a,10b,null,11a,null]
removeHashIndex = removeHashIndex & mask;
int j = removeHashIndex;
while (true) {
int k;
E slotJ;
... | [
"private",
"void",
"compactAndRemove",
"(",
"final",
"E",
"[",
"]",
"buffer",
",",
"final",
"int",
"mask",
",",
"int",
"removeHashIndex",
")",
"{",
"// remove(9a): [9a,9b,10a,9c,10b,11a,null] -> [9b,9c,10a,10b,null,11a,null]",
"removeHashIndex",
"=",
"removeHashIndex",
"&... | /*
implemented as per wiki suggested algo with minor adjustments. | [
"/",
"*",
"implemented",
"as",
"per",
"wiki",
"suggested",
"algo",
"with",
"minor",
"adjustments",
"."
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/sets/OpenHashSet.java#L148-L181 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/WritableUtils.java | WritableUtils.cloneInto | @Deprecated
public static void cloneInto(Writable dst, Writable src) throws IOException {
"""
Make a copy of the writable object using serialiation to a buffer
@param dst the object to copy from
@param src the object to copy into, which is destroyed
@throws IOException
@deprecated use ReflectionUtils.cloneIn... | java | @Deprecated
public static void cloneInto(Writable dst, Writable src) throws IOException {
ReflectionUtils.cloneWritableInto(dst, src);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"cloneInto",
"(",
"Writable",
"dst",
",",
"Writable",
"src",
")",
"throws",
"IOException",
"{",
"ReflectionUtils",
".",
"cloneWritableInto",
"(",
"dst",
",",
"src",
")",
";",
"}"
] | Make a copy of the writable object using serialiation to a buffer
@param dst the object to copy from
@param src the object to copy into, which is destroyed
@throws IOException
@deprecated use ReflectionUtils.cloneInto instead. | [
"Make",
"a",
"copy",
"of",
"the",
"writable",
"object",
"using",
"serialiation",
"to",
"a",
"buffer"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/WritableUtils.java#L224-L227 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/api/JMapperAPI.java | JMapperAPI.targetAttribute | public static TargetAttribute targetAttribute(String name, String customGet, String customSet) {
"""
Permits to define a target attribute.
@param name target attribute name
@param customGet custom get method
@param customSet custom set method
@return an instance of TargetAttribute
"""
return new TargetAt... | java | public static TargetAttribute targetAttribute(String name, String customGet, String customSet){
return new TargetAttribute(name, customGet, customSet);
} | [
"public",
"static",
"TargetAttribute",
"targetAttribute",
"(",
"String",
"name",
",",
"String",
"customGet",
",",
"String",
"customSet",
")",
"{",
"return",
"new",
"TargetAttribute",
"(",
"name",
",",
"customGet",
",",
"customSet",
")",
";",
"}"
] | Permits to define a target attribute.
@param name target attribute name
@param customGet custom get method
@param customSet custom set method
@return an instance of TargetAttribute | [
"Permits",
"to",
"define",
"a",
"target",
"attribute",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/api/JMapperAPI.java#L107-L109 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/URIBuilder.java | URIBuilder.build | public URI build() {
"""
Returns a dataset or view URI encompassing the given constraints. The
referenced {@link Dataset} or {@link View} may be loaded again with
{@link Datasets#load(URI, Class)}.
@return a dataset or view URI
@since 0.17.0
"""
try {
return new URI((isView ? VIEW_SCHEME : DA... | java | public URI build() {
try {
return new URI((isView ? VIEW_SCHEME : DATASET_SCHEME) + ":" +
pattern.construct(options).toString());
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Could not build URI", e);
}
} | [
"public",
"URI",
"build",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"(",
"isView",
"?",
"VIEW_SCHEME",
":",
"DATASET_SCHEME",
")",
"+",
"\":\"",
"+",
"pattern",
".",
"construct",
"(",
"options",
")",
".",
"toString",
"(",
")",
")",
";",... | Returns a dataset or view URI encompassing the given constraints. The
referenced {@link Dataset} or {@link View} may be loaded again with
{@link Datasets#load(URI, Class)}.
@return a dataset or view URI
@since 0.17.0 | [
"Returns",
"a",
"dataset",
"or",
"view",
"URI",
"encompassing",
"the",
"given",
"constraints",
".",
"The",
"referenced",
"{",
"@link",
"Dataset",
"}",
"or",
"{",
"@link",
"View",
"}",
"may",
"be",
"loaded",
"again",
"with",
"{",
"@link",
"Datasets#load",
"... | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/URIBuilder.java#L212-L219 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.delimiterNext | public static final boolean delimiterNext(byte[] bytes, int startPos, byte[] delim) {
"""
Checks if the delimiter starts at the given start position of the byte array.
Attention: This method assumes that enough characters follow the start position for the delimiter check!
@param bytes The byte array that hol... | java | public static final boolean delimiterNext(byte[] bytes, int startPos, byte[] delim) {
for(int pos = 0; pos < delim.length; pos++) {
// check each position
if(delim[pos] != bytes[startPos+pos]) {
return false;
}
}
return true;
} | [
"public",
"static",
"final",
"boolean",
"delimiterNext",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"byte",
"[",
"]",
"delim",
")",
"{",
"for",
"(",
"int",
"pos",
"=",
"0",
";",
"pos",
"<",
"delim",
".",
"length",
";",
"pos",
"++"... | Checks if the delimiter starts at the given start position of the byte array.
Attention: This method assumes that enough characters follow the start position for the delimiter check!
@param bytes The byte array that holds the value.
@param startPos The index of the byte array where the check for the delimiter starts.... | [
"Checks",
"if",
"the",
"delimiter",
"starts",
"at",
"the",
"given",
"start",
"position",
"of",
"the",
"byte",
"array",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L148-L158 |
casmi/casmi | src/main/java/casmi/image/Image.java | Image.setA | public final void setA(double alpha, int x, int y) {
"""
Sets the alpha value of the pixel data in this Image.
@param alpha
The alpha value of the pixel.
@param x
The x-coordinate of the pixel.
@param y
The y-coordinate of the pixel.
"""
int[] pixels = ((DataBufferInt)img.getRaster().getDataBuf... | java | public final void setA(double alpha, int x, int y){
int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
int idx = x + y * width;
int tmpR = pixels[idx] >> 16 & 0x000000ff;
int tmpG = pixels[idx] >> 8 & 0x000000ff;
int tmpB = pixels[idx] & 0x000000ff;... | [
"public",
"final",
"void",
"setA",
"(",
"double",
"alpha",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"[",
"]",
"pixels",
"=",
"(",
"(",
"DataBufferInt",
")",
"img",
".",
"getRaster",
"(",
")",
".",
"getDataBuffer",
"(",
")",
")",
".",
"g... | Sets the alpha value of the pixel data in this Image.
@param alpha
The alpha value of the pixel.
@param x
The x-coordinate of the pixel.
@param y
The y-coordinate of the pixel. | [
"Sets",
"the",
"alpha",
"value",
"of",
"the",
"pixel",
"data",
"in",
"this",
"Image",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/image/Image.java#L382-L392 |
elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java | APRIORI.initializeSearchItemset | private boolean initializeSearchItemset(BitVector bv, int[] scratchi, int[] iters) {
"""
Initialize the scratch itemset.
@param bv Bit vector data source
@param scratchi Scratch itemset
@param iters Iterator array
@return {@code true} if the itemset had minimum length
"""
for(int i = 0; i < scratchi.... | java | private boolean initializeSearchItemset(BitVector bv, int[] scratchi, int[] iters) {
for(int i = 0; i < scratchi.length; i++) {
iters[i] = (i == 0) ? bv.iter() : bv.iterAdvance(iters[i - 1]);
if(iters[i] < 0) {
return false;
}
scratchi[i] = bv.iterDim(iters[i]);
}
return true... | [
"private",
"boolean",
"initializeSearchItemset",
"(",
"BitVector",
"bv",
",",
"int",
"[",
"]",
"scratchi",
",",
"int",
"[",
"]",
"iters",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"scratchi",
".",
"length",
";",
"i",
"++",
")",
"{"... | Initialize the scratch itemset.
@param bv Bit vector data source
@param scratchi Scratch itemset
@param iters Iterator array
@return {@code true} if the itemset had minimum length | [
"Initialize",
"the",
"scratch",
"itemset",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L500-L509 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/spex/SXDocument.java | SXDocument.addComment | public void addComment(String comment) throws IOException {
"""
Adds a comment to this document.
<b>WARNING:</b> This will close the last added tag, if applicable!
@param comment The comment line to be added.
"""
prepareToAddChildNode();
SXCommentNode commentNode = new SXCommentNode(comment, writer, 0,... | java | public void addComment(String comment) throws IOException {
prepareToAddChildNode();
SXCommentNode commentNode = new SXCommentNode(comment, writer, 0, tabString);
lastChildNode = commentNode;
} | [
"public",
"void",
"addComment",
"(",
"String",
"comment",
")",
"throws",
"IOException",
"{",
"prepareToAddChildNode",
"(",
")",
";",
"SXCommentNode",
"commentNode",
"=",
"new",
"SXCommentNode",
"(",
"comment",
",",
"writer",
",",
"0",
",",
"tabString",
")",
";... | Adds a comment to this document.
<b>WARNING:</b> This will close the last added tag, if applicable!
@param comment The comment line to be added. | [
"Adds",
"a",
"comment",
"to",
"this",
"document",
".",
"<b",
">",
"WARNING",
":",
"<",
"/",
"b",
">",
"This",
"will",
"close",
"the",
"last",
"added",
"tag",
"if",
"applicable!"
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/spex/SXDocument.java#L171-L175 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java | MsgDestEncodingUtilsImpl.setProperty | private static void setProperty(JmsDestination dest, String longName, int propIntValue, Object value) throws JMSException {
"""
setProperty
Set the given property to the given value on the given JmsDestination.
@param dest The JmsDestination whose property is to be set
@param longName ... | java | private static void setProperty(JmsDestination dest, String longName, int propIntValue, Object value) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setProperty", new Object[]{dest, longName, propIntValue, value});
switch (propIntValue) {
case PR_I... | [
"private",
"static",
"void",
"setProperty",
"(",
"JmsDestination",
"dest",
",",
"String",
"longName",
",",
"int",
"propIntValue",
",",
"Object",
"value",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",... | setProperty
Set the given property to the given value on the given JmsDestination.
@param dest The JmsDestination whose property is to be set
@param longName The name of the property to be set
@param propIntValue The name of the property to be set
@param value The val... | [
"setProperty",
"Set",
"the",
"given",
"property",
"to",
"the",
"given",
"value",
"on",
"the",
"given",
"JmsDestination",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java#L801-L861 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java | RequestUtil.getExtension | public static <T extends Enum> T getExtension(SlingHttpServletRequest request, T defaultValue) {
"""
Returns the enum value of the requests extension if appropriate otherwise the default value.
@param request the request object with the extension info
@param defaultValue the default enum value
@param <T>... | java | public static <T extends Enum> T getExtension(SlingHttpServletRequest request, T defaultValue) {
String extension = request.getRequestPathInfo().getExtension();
if (extension != null) {
Class type = defaultValue.getClass();
try {
T value = (T) T.valueOf(type, exte... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
">",
"T",
"getExtension",
"(",
"SlingHttpServletRequest",
"request",
",",
"T",
"defaultValue",
")",
"{",
"String",
"extension",
"=",
"request",
".",
"getRequestPathInfo",
"(",
")",
".",
"getExtension",
"(",
")",... | Returns the enum value of the requests extension if appropriate otherwise the default value.
@param request the request object with the extension info
@param defaultValue the default enum value
@param <T> the enum type derived from the default value | [
"Returns",
"the",
"enum",
"value",
"of",
"the",
"requests",
"extension",
"if",
"appropriate",
"otherwise",
"the",
"default",
"value",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java#L31-L43 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java | IOUtils.writeObjectToStream | public static void writeObjectToStream(final Object o, OutputStream out) {
"""
Serialize java object to an ObjectOutputStream. The stream remains open.
@param o
the java object
@param out
the output stream
"""
out = new BufferedOutputStream(out);
try {
final ObjectOutputStream oos = new Obj... | java | public static void writeObjectToStream(final Object o, OutputStream out) {
out = new BufferedOutputStream(out);
try {
final ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(o);
oos.flush();
} catch (final IOException e) {
e.printStackTrace();
}
} | [
"public",
"static",
"void",
"writeObjectToStream",
"(",
"final",
"Object",
"o",
",",
"OutputStream",
"out",
")",
"{",
"out",
"=",
"new",
"BufferedOutputStream",
"(",
"out",
")",
";",
"try",
"{",
"final",
"ObjectOutputStream",
"oos",
"=",
"new",
"ObjectOutputSt... | Serialize java object to an ObjectOutputStream. The stream remains open.
@param o
the java object
@param out
the output stream | [
"Serialize",
"java",
"object",
"to",
"an",
"ObjectOutputStream",
".",
"The",
"stream",
"remains",
"open",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java#L350-L359 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.setTimes | public void setTimes(String src, long mtime, long atime) throws IOException {
"""
set the modification and access time of a file
@throws FileNotFoundException if the path is not a file
"""
checkOpen();
clearFileStatusCache();
try {
namenode.setTimes(src, mtime, atime);
} catch(RemoteExc... | java | public void setTimes(String src, long mtime, long atime) throws IOException {
checkOpen();
clearFileStatusCache();
try {
namenode.setTimes(src, mtime, atime);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
File... | [
"public",
"void",
"setTimes",
"(",
"String",
"src",
",",
"long",
"mtime",
",",
"long",
"atime",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"clearFileStatusCache",
"(",
")",
";",
"try",
"{",
"namenode",
".",
"setTimes",
"(",
"src",
","... | set the modification and access time of a file
@throws FileNotFoundException if the path is not a file | [
"set",
"the",
"modification",
"and",
"access",
"time",
"of",
"a",
"file"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2552-L2562 |
SnappyDataInc/snappydata | core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/BloomCalculations.java | BloomCalculations.computeBucketsAndK | public static BloomSpecification computeBucketsAndK(double maxFalsePosProb) {
"""
Given a maximum tolerable false positive probability, compute a Bloom
specification which will give less than the specified false positive rate,
but minimize the number of buckets per element and the number of hash
functions used.... | java | public static BloomSpecification computeBucketsAndK(double maxFalsePosProb) {
// Handle the trivial cases
if (maxFalsePosProb >= probs[minBuckets][minK]) {
return new BloomSpecification(2, optKPerBuckets[2]);
}
if (maxFalsePosProb < probs[maxBuckets][maxK]) {
retu... | [
"public",
"static",
"BloomSpecification",
"computeBucketsAndK",
"(",
"double",
"maxFalsePosProb",
")",
"{",
"// Handle the trivial cases",
"if",
"(",
"maxFalsePosProb",
">=",
"probs",
"[",
"minBuckets",
"]",
"[",
"minK",
"]",
")",
"{",
"return",
"new",
"BloomSpecifi... | Given a maximum tolerable false positive probability, compute a Bloom
specification which will give less than the specified false positive rate,
but minimize the number of buckets per element and the number of hash
functions used. Because bandwidth (and therefore total bitvector size)
is considered more expensive than... | [
"Given",
"a",
"maximum",
"tolerable",
"false",
"positive",
"probability",
"compute",
"a",
"Bloom",
"specification",
"which",
"will",
"give",
"less",
"than",
"the",
"specified",
"false",
"positive",
"rate",
"but",
"minimize",
"the",
"number",
"of",
"buckets",
"pe... | train | https://github.com/SnappyDataInc/snappydata/blob/96fe3e37e9f8d407ab68ef9e394083960acad21d/core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/BloomCalculations.java#L114-L137 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLWriter.java | XMLWriter.getNodeAsString | @Nullable
public static String getNodeAsString (@Nonnull final Node aNode) {
"""
Convert the passed DOM node to an XML string using
{@link XMLWriterSettings#DEFAULT_XML_SETTINGS}. This is a specialized
version of {@link #getNodeAsString(Node, IXMLWriterSettings)}.
@param aNode
The node to be converted to a... | java | @Nullable
public static String getNodeAsString (@Nonnull final Node aNode)
{
return getNodeAsString (aNode, XMLWriterSettings.DEFAULT_XML_SETTINGS);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getNodeAsString",
"(",
"@",
"Nonnull",
"final",
"Node",
"aNode",
")",
"{",
"return",
"getNodeAsString",
"(",
"aNode",
",",
"XMLWriterSettings",
".",
"DEFAULT_XML_SETTINGS",
")",
";",
"}"
] | Convert the passed DOM node to an XML string using
{@link XMLWriterSettings#DEFAULT_XML_SETTINGS}. This is a specialized
version of {@link #getNodeAsString(Node, IXMLWriterSettings)}.
@param aNode
The node to be converted to a string. May not be <code>null</code> .
@return The string representation of the passed node.... | [
"Convert",
"the",
"passed",
"DOM",
"node",
"to",
"an",
"XML",
"string",
"using",
"{",
"@link",
"XMLWriterSettings#DEFAULT_XML_SETTINGS",
"}",
".",
"This",
"is",
"a",
"specialized",
"version",
"of",
"{",
"@link",
"#getNodeAsString",
"(",
"Node",
"IXMLWriterSettings... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLWriter.java#L232-L236 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java | OmemoManager.notifyOmemoMessageReceived | void notifyOmemoMessageReceived(Stanza stanza, OmemoMessage.Received decryptedMessage) {
"""
Notify all registered OmemoMessageListeners about a received OmemoMessage.
@param stanza original stanza
@param decryptedMessage decrypted OmemoMessage.
"""
for (OmemoMessageListener l : omemoMessageListene... | java | void notifyOmemoMessageReceived(Stanza stanza, OmemoMessage.Received decryptedMessage) {
for (OmemoMessageListener l : omemoMessageListeners) {
l.onOmemoMessageReceived(stanza, decryptedMessage);
}
} | [
"void",
"notifyOmemoMessageReceived",
"(",
"Stanza",
"stanza",
",",
"OmemoMessage",
".",
"Received",
"decryptedMessage",
")",
"{",
"for",
"(",
"OmemoMessageListener",
"l",
":",
"omemoMessageListeners",
")",
"{",
"l",
".",
"onOmemoMessageReceived",
"(",
"stanza",
","... | Notify all registered OmemoMessageListeners about a received OmemoMessage.
@param stanza original stanza
@param decryptedMessage decrypted OmemoMessage. | [
"Notify",
"all",
"registered",
"OmemoMessageListeners",
"about",
"a",
"received",
"OmemoMessage",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java#L834-L838 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSdense2csc | public static int cusparseSdense2csc(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer A,
int lda,
Pointer nnzPerCol,
Pointer cscSortedValA,
Pointer cscSortedRowIndA,
Pointer cscSortedColPtrA) {
"... | java | public static int cusparseSdense2csc(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer A,
int lda,
Pointer nnzPerCol,
Pointer cscSortedValA,
Pointer cscSortedRowIndA,
Pointer cscSortedColPtrA)
{
... | [
"public",
"static",
"int",
"cusparseSdense2csc",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"n",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"nnzPerCol",
",",
"Pointer",
"cscSortedValA",
",",
... | Description: This routine converts a dense matrix to a sparse matrix
in the CSC storage format, using the information computed by the
nnz routine. | [
"Description",
":",
"This",
"routine",
"converts",
"a",
"dense",
"matrix",
"to",
"a",
"sparse",
"matrix",
"in",
"the",
"CSC",
"storage",
"format",
"using",
"the",
"information",
"computed",
"by",
"the",
"nnz",
"routine",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L11387-L11400 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/NotificationsApi.java | NotificationsApi.subscribeWithHttpInfo | public ApiResponse<Void> subscribeWithHttpInfo() throws ApiException {
"""
CometD subscribe to channel
CometD handshake, see https://docs.cometd.org/current/reference/#_bayeux_meta_subscribe Current channels: <b>/statistics/v3/service</b> - information about service state <b>/statistics/v3/up... | java | public ApiResponse<Void> subscribeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = subscribeValidateBeforeCall(null, null);
return apiClient.execute(call);
} | [
"public",
"ApiResponse",
"<",
"Void",
">",
"subscribeWithHttpInfo",
"(",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"subscribeValidateBeforeCall",
"(",
"null",
",",
"null",
")",
";",
"return",
"apiClien... | CometD subscribe to channel
CometD handshake, see https://docs.cometd.org/current/reference/#_bayeux_meta_subscribe Current channels: <b>/statistics/v3/service</b> - information about service state <b>/statistics/v3/updates</b> - statistics updates
@return ApiResponse<Void>
@throws ApiE... | [
"CometD",
"subscribe",
"to",
"channel",
"CometD",
"handshake",
"see",
"https",
":",
"//",
"docs",
".",
"cometd",
".",
"org",
"/",
"current",
"/",
"reference",
"/",
"#_bayeux_meta_subscribe",
"Current",
"channels",
":",
"<",
";",
"b>",
";",
"/",
"statisti... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/NotificationsApi.java#L673-L676 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/support/AsyncConnectionPoolSupport.java | AsyncConnectionPoolSupport.createBoundedObjectPool | public static <T extends StatefulConnection<?, ?>> BoundedAsyncPool<T> createBoundedObjectPool(
Supplier<CompletionStage<T>> connectionSupplier, BoundedPoolConfig config) {
"""
Creates a new {@link BoundedAsyncPool} using the {@link Supplier}. Allocated instances are wrapped and must not be
returned w... | java | public static <T extends StatefulConnection<?, ?>> BoundedAsyncPool<T> createBoundedObjectPool(
Supplier<CompletionStage<T>> connectionSupplier, BoundedPoolConfig config) {
return createBoundedObjectPool(connectionSupplier, config, true);
} | [
"public",
"static",
"<",
"T",
"extends",
"StatefulConnection",
"<",
"?",
",",
"?",
">",
">",
"BoundedAsyncPool",
"<",
"T",
">",
"createBoundedObjectPool",
"(",
"Supplier",
"<",
"CompletionStage",
"<",
"T",
">",
">",
"connectionSupplier",
",",
"BoundedPoolConfig"... | Creates a new {@link BoundedAsyncPool} using the {@link Supplier}. Allocated instances are wrapped and must not be
returned with {@link AsyncPool#release(Object)}.
@param connectionSupplier must not be {@literal null}.
@param config must not be {@literal null}.
@param <T> connection type.
@return the connection pool. | [
"Creates",
"a",
"new",
"{",
"@link",
"BoundedAsyncPool",
"}",
"using",
"the",
"{",
"@link",
"Supplier",
"}",
".",
"Allocated",
"instances",
"are",
"wrapped",
"and",
"must",
"not",
"be",
"returned",
"with",
"{",
"@link",
"AsyncPool#release",
"(",
"Object",
")... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/support/AsyncConnectionPoolSupport.java#L88-L91 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java | Postconditions.checkPostconditionI | public static int checkPostconditionI(
final int value,
final boolean condition,
final IntFunction<String> describer) {
"""
An {@code int} specialized version of {@link #checkPostcondition(Object,
boolean, Function)}.
@param value The value
@param condition The predicate
@param describer The ... | java | public static int checkPostconditionI(
final int value,
final boolean condition,
final IntFunction<String> describer)
{
return innerCheckI(value, condition, describer);
} | [
"public",
"static",
"int",
"checkPostconditionI",
"(",
"final",
"int",
"value",
",",
"final",
"boolean",
"condition",
",",
"final",
"IntFunction",
"<",
"String",
">",
"describer",
")",
"{",
"return",
"innerCheckI",
"(",
"value",
",",
"condition",
",",
"describ... | An {@code int} specialized version of {@link #checkPostcondition(Object,
boolean, Function)}.
@param value The value
@param condition The predicate
@param describer The describer for the predicate
@return value
@throws PostconditionViolationException If the predicate is false | [
"An",
"{",
"@code",
"int",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPostcondition",
"(",
"Object",
"boolean",
"Function",
")",
"}",
"."
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java#L403-L409 |
wcm-io/wcm-io-tooling | maven/plugins/i18n-maven-plugin/src/main/java/io/wcm/maven/plugins/i18n/TransformMojo.java | TransformMojo.writeTargetI18nFile | private void writeTargetI18nFile(SlingI18nMap i18nMap, File targetfile, OutputFormat selectedOutputFormat) throws IOException, JSONException {
"""
Writes mappings to file in Sling compatible JSON format.
@param i18nMap mappings
@param targetfile target file
@param selectedOutputFormat Output format
@throws IOE... | java | private void writeTargetI18nFile(SlingI18nMap i18nMap, File targetfile, OutputFormat selectedOutputFormat) throws IOException, JSONException {
if (selectedOutputFormat == OutputFormat.XML) {
FileUtils.fileWrite(targetfile, CharEncoding.UTF_8, i18nMap.getI18nXmlString());
}
else if (selectedOutputForma... | [
"private",
"void",
"writeTargetI18nFile",
"(",
"SlingI18nMap",
"i18nMap",
",",
"File",
"targetfile",
",",
"OutputFormat",
"selectedOutputFormat",
")",
"throws",
"IOException",
",",
"JSONException",
"{",
"if",
"(",
"selectedOutputFormat",
"==",
"OutputFormat",
".",
"XM... | Writes mappings to file in Sling compatible JSON format.
@param i18nMap mappings
@param targetfile target file
@param selectedOutputFormat Output format
@throws IOException
@throws JSONException | [
"Writes",
"mappings",
"to",
"file",
"in",
"Sling",
"compatible",
"JSON",
"format",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/maven/plugins/i18n-maven-plugin/src/main/java/io/wcm/maven/plugins/i18n/TransformMojo.java#L224-L235 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java | ST_RemoveRepeatedPoints.removeRepeatedPoints | public static Geometry removeRepeatedPoints(Geometry geometry) throws SQLException, SQLException, SQLException, SQLException {
"""
Returns a version of the given geometry with duplicated points removed.
@param geometry
@return
@throws java.sql.SQLException
"""
return removeDuplicateCoordinates(geo... | java | public static Geometry removeRepeatedPoints(Geometry geometry) throws SQLException, SQLException, SQLException, SQLException {
return removeDuplicateCoordinates(geometry, 0);
} | [
"public",
"static",
"Geometry",
"removeRepeatedPoints",
"(",
"Geometry",
"geometry",
")",
"throws",
"SQLException",
",",
"SQLException",
",",
"SQLException",
",",
"SQLException",
"{",
"return",
"removeDuplicateCoordinates",
"(",
"geometry",
",",
"0",
")",
";",
"}"
] | Returns a version of the given geometry with duplicated points removed.
@param geometry
@return
@throws java.sql.SQLException | [
"Returns",
"a",
"version",
"of",
"the",
"given",
"geometry",
"with",
"duplicated",
"points",
"removed",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java#L56-L58 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java | VirtualNetworkLinksInner.beginUpdate | public VirtualNetworkLinkInner beginUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) {
"""
Updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The name of the resource group.
@param... | java | public VirtualNetworkLinkInner beginUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch).toBlocking... | [
"public",
"VirtualNetworkLinkInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
",",
"String",
"virtualNetworkLinkName",
",",
"VirtualNetworkLinkInner",
"parameters",
",",
"String",
"ifMatch",
")",
"{",
"return",
"beginUpdateWithSer... | Updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param virtualNetworkLinkName The name of the virtual network link.
@param parameters Parameters supplied to th... | [
"Updates",
"a",
"virtual",
"network",
"link",
"to",
"the",
"specified",
"Private",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java#L767-L769 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java | AbstractMessage.fromJSON | public static <T extends BasicMessage> T fromJSON(String json, Class<T> clazz) {
"""
Convenience static method that converts a JSON string to a particular message object.
@param json the JSON string
@param clazz the class whose instance is represented by the JSON string
@return the message object that was r... | java | public static <T extends BasicMessage> T fromJSON(String json, Class<T> clazz) {
try {
Method buildObjectMapperForDeserializationMethod = findBuildObjectMapperForDeserializationMethod(clazz);
final ObjectMapper mapper = (ObjectMapper) buildObjectMapperForDeserializationMethod.invoke(nul... | [
"public",
"static",
"<",
"T",
"extends",
"BasicMessage",
">",
"T",
"fromJSON",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"Method",
"buildObjectMapperForDeserializationMethod",
"=",
"findBuildObjectMapperForDeserializationMeth... | Convenience static method that converts a JSON string to a particular message object.
@param json the JSON string
@param clazz the class whose instance is represented by the JSON string
@return the message object that was represented by the JSON string | [
"Convenience",
"static",
"method",
"that",
"converts",
"a",
"JSON",
"string",
"to",
"a",
"particular",
"message",
"object",
"."
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java#L66-L79 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/Minutes.java | Minutes.ofHours | public static Minutes ofHours(int hours) {
"""
Obtains a {@code Minutes} representing the number of minutes
equivalent to a number of hours.
<p>
The resulting amount will be minute-based, with the number of minutes
equal to the number of hours multiplied by 60.
@param hours the number of hours, positive or... | java | public static Minutes ofHours(int hours) {
if (hours == 0) {
return ZERO;
}
return new Minutes(Math.multiplyExact(hours, MINUTES_PER_HOUR));
} | [
"public",
"static",
"Minutes",
"ofHours",
"(",
"int",
"hours",
")",
"{",
"if",
"(",
"hours",
"==",
"0",
")",
"{",
"return",
"ZERO",
";",
"}",
"return",
"new",
"Minutes",
"(",
"Math",
".",
"multiplyExact",
"(",
"hours",
",",
"MINUTES_PER_HOUR",
")",
")"... | Obtains a {@code Minutes} representing the number of minutes
equivalent to a number of hours.
<p>
The resulting amount will be minute-based, with the number of minutes
equal to the number of hours multiplied by 60.
@param hours the number of hours, positive or negative
@return the amount with the input hours converte... | [
"Obtains",
"a",
"{",
"@code",
"Minutes",
"}",
"representing",
"the",
"number",
"of",
"minutes",
"equivalent",
"to",
"a",
"number",
"of",
"hours",
".",
"<p",
">",
"The",
"resulting",
"amount",
"will",
"be",
"minute",
"-",
"based",
"with",
"the",
"number",
... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/Minutes.java#L131-L136 |
victims/victims-lib-java | src/main/java/com/redhat/victims/database/VictimsSQL.java | VictimsSQL.constructInStringsQuery | protected String constructInStringsQuery(String query, Set<String> values) {
"""
Given a an sql query containing the string "IN (?)" and a set of strings,
this method constructs a query by safely replacing the first occurence of
"IN (?)" with "IN ('v1','v2'...)", where v1,v2,.. are in values.
@param query
@p... | java | protected String constructInStringsQuery(String query, Set<String> values) {
String replace = "IN (?)";
assert query.lastIndexOf(replace) == query.indexOf(replace);
String sql = query.replace("IN (?)", "IN (%s)");
StringBuffer list = new StringBuffer();
for (String value : value... | [
"protected",
"String",
"constructInStringsQuery",
"(",
"String",
"query",
",",
"Set",
"<",
"String",
">",
"values",
")",
"{",
"String",
"replace",
"=",
"\"IN (?)\"",
";",
"assert",
"query",
".",
"lastIndexOf",
"(",
"replace",
")",
"==",
"query",
".",
"indexO... | Given a an sql query containing the string "IN (?)" and a set of strings,
this method constructs a query by safely replacing the first occurence of
"IN (?)" with "IN ('v1','v2'...)", where v1,v2,.. are in values.
@param query
@param values
@return | [
"Given",
"a",
"an",
"sql",
"query",
"containing",
"the",
"string",
"IN",
"(",
"?",
")",
"and",
"a",
"set",
"of",
"strings",
"this",
"method",
"constructs",
"a",
"query",
"by",
"safely",
"replacing",
"the",
"first",
"occurence",
"of",
"IN",
"(",
"?",
")... | train | https://github.com/victims/victims-lib-java/blob/ccd0e2fcc409bb6cdfc5de411c3bb202c9095f8b/src/main/java/com/redhat/victims/database/VictimsSQL.java#L177-L192 |
Red5/red5-server-common | src/main/java/org/red5/server/Server.java | Server.addMapping | public boolean addMapping(String hostName, String contextPath, String globalName) {
"""
Map key (host + / + context path) and global scope name
@param hostName
Host name
@param contextPath
Context path
@param globalName
Global scope name
@return true if mapping was added, false if already exist
"""
... | java | public boolean addMapping(String hostName, String contextPath, String globalName) {
log.info("Add mapping global: {} host: {} context: {}", new Object[] { globalName, hostName, contextPath });
final String key = getKey(hostName, contextPath);
log.debug("Add mapping: {} => {}", key, globalName... | [
"public",
"boolean",
"addMapping",
"(",
"String",
"hostName",
",",
"String",
"contextPath",
",",
"String",
"globalName",
")",
"{",
"log",
".",
"info",
"(",
"\"Add mapping global: {} host: {} context: {}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"globalName",
",",
... | Map key (host + / + context path) and global scope name
@param hostName
Host name
@param contextPath
Context path
@param globalName
Global scope name
@return true if mapping was added, false if already exist | [
"Map",
"key",
"(",
"host",
"+",
"/",
"+",
"context",
"path",
")",
"and",
"global",
"scope",
"name"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/Server.java#L209-L214 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java | Group.foundGroupFormat | boolean foundGroupFormat(Map<String,?> map, String pkgFormat) {
"""
Search if the given map has given the package format.
@param map Map to be searched.
@param pkgFormat The pacakge format to search.
@return true if package name format found in the map, else false.
"""
if (map.containsKey(pkgFor... | java | boolean foundGroupFormat(Map<String,?> map, String pkgFormat) {
if (map.containsKey(pkgFormat)) {
configuration.message.error("doclet.Same_package_name_used", pkgFormat);
return true;
}
return false;
} | [
"boolean",
"foundGroupFormat",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"map",
",",
"String",
"pkgFormat",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
"(",
"pkgFormat",
")",
")",
"{",
"configuration",
".",
"message",
".",
"error",
"(",
"\"doclet.Sam... | Search if the given map has given the package format.
@param map Map to be searched.
@param pkgFormat The pacakge format to search.
@return true if package name format found in the map, else false. | [
"Search",
"if",
"the",
"given",
"map",
"has",
"given",
"the",
"package",
"format",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java#L157-L163 |
EsotericSoftware/kryo | src/com/esotericsoftware/kryo/util/GenericsUtil.java | GenericsUtil.resolveTypeParameters | static public Type[] resolveTypeParameters (Class fromClass, Class toClass, Type type) {
"""
Resolves type variables for the type parameters of the specified type by using the class hierarchy between the specified
classes.
@param toClass Must be a sub class of fromClass.
@return Null if the type has no type par... | java | static public Type[] resolveTypeParameters (Class fromClass, Class toClass, Type type) {
// Type which has a type parameter, eg ArrayList<T>.
if (type instanceof ParameterizedType) {
Type[] actualArgs = ((ParameterizedType)type).getActualTypeArguments();
int n = actualArgs.length;
Type[] generics = new Typ... | [
"static",
"public",
"Type",
"[",
"]",
"resolveTypeParameters",
"(",
"Class",
"fromClass",
",",
"Class",
"toClass",
",",
"Type",
"type",
")",
"{",
"// Type which has a type parameter, eg ArrayList<T>.",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
... | Resolves type variables for the type parameters of the specified type by using the class hierarchy between the specified
classes.
@param toClass Must be a sub class of fromClass.
@return Null if the type has no type parameters, else contains Class entries for type parameters that were resolved and
TypeVariable entries ... | [
"Resolves",
"type",
"variables",
"for",
"the",
"type",
"parameters",
"of",
"the",
"specified",
"type",
"by",
"using",
"the",
"class",
"hierarchy",
"between",
"the",
"specified",
"classes",
"."
] | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/util/GenericsUtil.java#L120-L141 |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrDocumentContainerPage.java | CmsSolrDocumentContainerPage.extractContent | @Override
public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsException {
"""
Returns the raw text content of a VFS resource of type <code>CmsResourceTypeContainerPage</code>.<p>
@see org.opencms.search.documents.I_CmsSearchExtractor#extra... | java | @Override
public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsException {
return extractContent(cms, resource, index, null);
} | [
"@",
"Override",
"public",
"I_CmsExtractionResult",
"extractContent",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"I_CmsSearchIndex",
"index",
")",
"throws",
"CmsException",
"{",
"return",
"extractContent",
"(",
"cms",
",",
"resource",
",",
"index"... | Returns the raw text content of a VFS resource of type <code>CmsResourceTypeContainerPage</code>.<p>
@see org.opencms.search.documents.I_CmsSearchExtractor#extractContent(CmsObject, CmsResource, I_CmsSearchIndex) | [
"Returns",
"the",
"raw",
"text",
"content",
"of",
"a",
"VFS",
"resource",
"of",
"type",
"<code",
">",
"CmsResourceTypeContainerPage<",
"/",
"code",
">",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrDocumentContainerPage.java#L86-L91 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createNicePartialMock | public static <T> T createNicePartialMock(Class<T> type, String methodName, Class<?>[] methodParameterTypes,
Object... constructorArguments) {
"""
A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of t... | java | public static <T> T createNicePartialMock(Class<T> type, String methodName, Class<?>[] methodParameterTypes,
Object... constructorArguments) {
Constructor<?> constructor = WhiteboxImpl.findUniqueConstructorOrThrowException(type, constructorArguments);
Constr... | [
"public",
"static",
"<",
"T",
">",
"T",
"createNicePartialMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"methodParameterTypes",
",",
"Object",
"...",
"constructorArguments",
")",
"{",
"Const... | A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock). Use this to handle overloaded methods. The mock object created
will support mocking of final and native methods and invokes a specific
constructor based on the supplied a... | [
"A",
"utility",
"method",
"that",
"may",
"be",
"used",
"to",
"nicely",
"mock",
"several",
"methods",
"in",
"an",
"easy",
"way",
"(",
"by",
"just",
"passing",
"in",
"the",
"method",
"names",
"of",
"the",
"method",
"you",
"wish",
"to",
"mock",
")",
".",
... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1033-L1039 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java | WTree.processCustomIdNodeMapping | private void processCustomIdNodeMapping(final Map<String, TreeItemIdNode> map, final TreeItemIdNode node) {
"""
Iterate over the custom tree structure to add entries to the map.
@param map the map of custom items and their node
@param node the current node being processed
"""
String itemId = node.getItem... | java | private void processCustomIdNodeMapping(final Map<String, TreeItemIdNode> map, final TreeItemIdNode node) {
String itemId = node.getItemId();
if (!Util.empty(itemId)) {
map.put(itemId, node);
}
for (TreeItemIdNode childItem : node.getChildren()) {
processCustomIdNodeMapping(map, childItem);
}
} | [
"private",
"void",
"processCustomIdNodeMapping",
"(",
"final",
"Map",
"<",
"String",
",",
"TreeItemIdNode",
">",
"map",
",",
"final",
"TreeItemIdNode",
"node",
")",
"{",
"String",
"itemId",
"=",
"node",
".",
"getItemId",
"(",
")",
";",
"if",
"(",
"!",
"Uti... | Iterate over the custom tree structure to add entries to the map.
@param map the map of custom items and their node
@param node the current node being processed | [
"Iterate",
"over",
"the",
"custom",
"tree",
"structure",
"to",
"add",
"entries",
"to",
"the",
"map",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java#L1176-L1185 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java | DeploymentsInner.exportTemplateAsync | public Observable<DeploymentExportResultInner> exportTemplateAsync(String resourceGroupName, String deploymentName) {
"""
Exports the template used for specified deployment.
@param resourceGroupName The name of the resource group. The name is case insensitive.
@param deploymentName The name of the deployment f... | java | public Observable<DeploymentExportResultInner> exportTemplateAsync(String resourceGroupName, String deploymentName) {
return exportTemplateWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1<ServiceResponse<DeploymentExportResultInner>, DeploymentExportResultInner>() {
@Overrid... | [
"public",
"Observable",
"<",
"DeploymentExportResultInner",
">",
"exportTemplateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"deploymentName",
")",
"{",
"return",
"exportTemplateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"deploymentName",
")",
"... | Exports the template used for specified deployment.
@param resourceGroupName The name of the resource group. The name is case insensitive.
@param deploymentName The name of the deployment from which to get the template.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to... | [
"Exports",
"the",
"template",
"used",
"for",
"specified",
"deployment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java#L855-L862 |
davetcc/tcMenu | tcMenuCodePluginApi/src/main/java/com/thecoderscorner/menu/pluginapi/model/FunctionCallBuilder.java | FunctionCallBuilder.requiresHeader | public FunctionCallBuilder requiresHeader(String headerName, boolean useQuotes) {
"""
Add a requirement that a header file needs to be included for this to work
@param headerName the name of the header including .h
@param useQuotes true for quotes, false for triangle brackets.
@return this for chaining
"""
... | java | public FunctionCallBuilder requiresHeader(String headerName, boolean useQuotes) {
headers.add(new HeaderDefinition(headerName, useQuotes, HeaderDefinition.PRIORITY_NORMAL));
return this;
} | [
"public",
"FunctionCallBuilder",
"requiresHeader",
"(",
"String",
"headerName",
",",
"boolean",
"useQuotes",
")",
"{",
"headers",
".",
"add",
"(",
"new",
"HeaderDefinition",
"(",
"headerName",
",",
"useQuotes",
",",
"HeaderDefinition",
".",
"PRIORITY_NORMAL",
")",
... | Add a requirement that a header file needs to be included for this to work
@param headerName the name of the header including .h
@param useQuotes true for quotes, false for triangle brackets.
@return this for chaining | [
"Add",
"a",
"requirement",
"that",
"a",
"header",
"file",
"needs",
"to",
"be",
"included",
"for",
"this",
"to",
"work"
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuCodePluginApi/src/main/java/com/thecoderscorner/menu/pluginapi/model/FunctionCallBuilder.java#L65-L68 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.setUserInfo | public WebSocket setUserInfo(String id, String password) {
"""
Set the credentials to connect to the WebSocket endpoint.
@param id
The ID.
@param password
The password.
@return
{@code this} object.
"""
mHandshakeBuilder.setUserInfo(id, password);
return this;
} | java | public WebSocket setUserInfo(String id, String password)
{
mHandshakeBuilder.setUserInfo(id, password);
return this;
} | [
"public",
"WebSocket",
"setUserInfo",
"(",
"String",
"id",
",",
"String",
"password",
")",
"{",
"mHandshakeBuilder",
".",
"setUserInfo",
"(",
"id",
",",
"password",
")",
";",
"return",
"this",
";",
"}"
] | Set the credentials to connect to the WebSocket endpoint.
@param id
The ID.
@param password
The password.
@return
{@code this} object. | [
"Set",
"the",
"credentials",
"to",
"connect",
"to",
"the",
"WebSocket",
"endpoint",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L1540-L1545 |
UrielCh/ovh-java-sdk | ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java | ApiOvhMsServices.serviceName_account_userPrincipalName_PUT | public void serviceName_account_userPrincipalName_PUT(String serviceName, String userPrincipalName, OvhAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /msServices/{serviceName}/account/{userPrincipalName}
@param body [required] New object properties
@param serviceName [required] ... | java | public void serviceName_account_userPrincipalName_PUT(String serviceName, String userPrincipalName, OvhAccount body) throws IOException {
String qPath = "/msServices/{serviceName}/account/{userPrincipalName}";
StringBuilder sb = path(qPath, serviceName, userPrincipalName);
exec(qPath, "PUT", sb.toString(), body);... | [
"public",
"void",
"serviceName_account_userPrincipalName_PUT",
"(",
"String",
"serviceName",
",",
"String",
"userPrincipalName",
",",
"OvhAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/msServices/{serviceName}/account/{userPrincipalName}\"",
... | Alter this object properties
REST: PUT /msServices/{serviceName}/account/{userPrincipalName}
@param body [required] New object properties
@param serviceName [required] The internal name of your Active Directory organization
@param userPrincipalName [required] User Principal Name
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java#L451-L455 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java | AbstractManagedConnectionPool.destroyAndRemoveConnectionListener | protected void destroyAndRemoveConnectionListener(ConnectionListener cl, Collection<ConnectionListener> listeners) {
"""
Destroy and remove a connection listener
@param cl The connection listener
@param listeners The listeners
"""
try
{
pool.destroyConnectionListener(cl);
}
c... | java | protected void destroyAndRemoveConnectionListener(ConnectionListener cl, Collection<ConnectionListener> listeners)
{
try
{
pool.destroyConnectionListener(cl);
}
catch (ResourceException e)
{
// TODO:
cl.setState(ZOMBIE);
}
finally
{
... | [
"protected",
"void",
"destroyAndRemoveConnectionListener",
"(",
"ConnectionListener",
"cl",
",",
"Collection",
"<",
"ConnectionListener",
">",
"listeners",
")",
"{",
"try",
"{",
"pool",
".",
"destroyConnectionListener",
"(",
"cl",
")",
";",
"}",
"catch",
"(",
"Res... | Destroy and remove a connection listener
@param cl The connection listener
@param listeners The listeners | [
"Destroy",
"and",
"remove",
"a",
"connection",
"listener"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java#L165-L180 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java | AbstractXbaseSemanticSequencer.sequence_XForLoopExpression | protected void sequence_XForLoopExpression(ISerializationContext context, XForLoopExpression semanticObject) {
"""
Contexts:
XExpression returns XForLoopExpression
XAssignment returns XForLoopExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XForLoopExpression
XOrExpression returns XForLoopExpression
... | java | protected void sequence_XForLoopExpression(ISerializationContext context, XForLoopExpression semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XFOR_LOOP_EXPRESSION__DECLARED_PARAM) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProv... | [
"protected",
"void",
"sequence_XForLoopExpression",
"(",
"ISerializationContext",
"context",
",",
"XForLoopExpression",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
"semanti... | Contexts:
XExpression returns XForLoopExpression
XAssignment returns XForLoopExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XForLoopExpression
XOrExpression returns XForLoopExpression
XOrExpression.XBinaryOperation_1_0_0_0 returns XForLoopExpression
XAndExpression returns XForLoopExpression
XAndExpression.XB... | [
"Contexts",
":",
"XExpression",
"returns",
"XForLoopExpression",
"XAssignment",
"returns",
"XForLoopExpression",
"XAssignment",
".",
"XBinaryOperation_1_1_0_0_0",
"returns",
"XForLoopExpression",
"XOrExpression",
"returns",
"XForLoopExpression",
"XOrExpression",
".",
"XBinaryOper... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L953-L967 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.renderRowUpdateScript | public void renderRowUpdateScript(final FacesContext context, final Set<String> dirtyRows) {
"""
Adds eval scripts to the ajax response to update the rows dirtied by the most recent successful update request.
@param context the FacesContext
@param dirtyRows the set of dirty rows
"""
final String js... | java | public void renderRowUpdateScript(final FacesContext context, final Set<String> dirtyRows) {
final String jsVar = resolveWidgetVar();
final StringBuilder eval = new StringBuilder();
for (final String rowKey : dirtyRows) {
setRowVar(context, rowKey);
final int rowIndex = ... | [
"public",
"void",
"renderRowUpdateScript",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"Set",
"<",
"String",
">",
"dirtyRows",
")",
"{",
"final",
"String",
"jsVar",
"=",
"resolveWidgetVar",
"(",
")",
";",
"final",
"StringBuilder",
"eval",
"=",
"new"... | Adds eval scripts to the ajax response to update the rows dirtied by the most recent successful update request.
@param context the FacesContext
@param dirtyRows the set of dirty rows | [
"Adds",
"eval",
"scripts",
"to",
"the",
"ajax",
"response",
"to",
"update",
"the",
"rows",
"dirtied",
"by",
"the",
"most",
"recent",
"successful",
"update",
"request",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L1047-L1095 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbXaResourceImpl.java | WSRdbXaResourceImpl.traceXAException | public final XAException traceXAException(XAException xae, Class<?> callerClass) {
"""
Method to translate the XAResource stuff, including the error code.
@param xae
@param callerClass
@return
"""
String detailedMessage = ivManagedConnection.mcf.helper.getXAExceptionContents(xae);
Tr.er... | java | public final XAException traceXAException(XAException xae, Class<?> callerClass) {
String detailedMessage = ivManagedConnection.mcf.helper.getXAExceptionContents(xae);
Tr.error(tc, "DISPLAY_XAEX_CONTENT", detailedMessage);
Tr.error(tc, "THROW_XAEXCEPTION", new Object[]
{ AdapterUtil.... | [
"public",
"final",
"XAException",
"traceXAException",
"(",
"XAException",
"xae",
",",
"Class",
"<",
"?",
">",
"callerClass",
")",
"{",
"String",
"detailedMessage",
"=",
"ivManagedConnection",
".",
"mcf",
".",
"helper",
".",
"getXAExceptionContents",
"(",
"xae",
... | Method to translate the XAResource stuff, including the error code.
@param xae
@param callerClass
@return | [
"Method",
"to",
"translate",
"the",
"XAResource",
"stuff",
"including",
"the",
"error",
"code",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbXaResourceImpl.java#L1153-L1162 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.getIntHeader | @Deprecated
public static int getIntHeader(HttpMessage message, String name) {
"""
@deprecated Use {@link #getInt(CharSequence)} instead.
@see #getIntHeader(HttpMessage, CharSequence)
"""
return getIntHeader(message, (CharSequence) name);
} | java | @Deprecated
public static int getIntHeader(HttpMessage message, String name) {
return getIntHeader(message, (CharSequence) name);
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"getIntHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
")",
"{",
"return",
"getIntHeader",
"(",
"message",
",",
"(",
"CharSequence",
")",
"name",
")",
";",
"}"
] | @deprecated Use {@link #getInt(CharSequence)} instead.
@see #getIntHeader(HttpMessage, CharSequence) | [
"@deprecated",
"Use",
"{",
"@link",
"#getInt",
"(",
"CharSequence",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L709-L712 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/FTPClient.java | FTPClient.setRestartMarker | public void setRestartMarker(RestartData restartData)
throws IOException, ServerException {
"""
Sets restart parameter of the next transfer.
@param restartData marker to use
@exception ServerException if the file does not exist or
an error occured.
"""
Command cmd = new Command("REST",... | java | public void setRestartMarker(RestartData restartData)
throws IOException, ServerException {
Command cmd = new Command("REST", restartData.toFtpCmdArgument());
Reply reply = null;
try {
reply = controlChannel.exchange(cmd);
} catch (FTPReplyParseException e) {
... | [
"public",
"void",
"setRestartMarker",
"(",
"RestartData",
"restartData",
")",
"throws",
"IOException",
",",
"ServerException",
"{",
"Command",
"cmd",
"=",
"new",
"Command",
"(",
"\"REST\"",
",",
"restartData",
".",
"toFtpCmdArgument",
"(",
")",
")",
";",
"Reply"... | Sets restart parameter of the next transfer.
@param restartData marker to use
@exception ServerException if the file does not exist or
an error occured. | [
"Sets",
"restart",
"parameter",
"of",
"the",
"next",
"transfer",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/FTPClient.java#L1169-L1183 |
PureSolTechnologies/extended-objects-titan | titan/src/main/java/com/puresoltechnologies/xo/titan/impl/GremlinManager.java | GremlinManager.getGremlinExpression | public static <QL> GremlinExpression getGremlinExpression(QL expression,
Map<String, Object> parameters) {
"""
This is a helper method to extract the Gremlin expression.
@param expression
is the object which comes in from
DatastoreSession#executeQuery(Object, java.util.Map).
@param parameters
is a Map ... | java | public static <QL> GremlinExpression getGremlinExpression(QL expression,
Map<String, Object> parameters) {
GremlinExpression gremlinExpression = null;
if (expression instanceof String) {
gremlinExpression = new GremlinExpression("", (String) expression);
} else if (expression instanceof Gremlin) {
Gre... | [
"public",
"static",
"<",
"QL",
">",
"GremlinExpression",
"getGremlinExpression",
"(",
"QL",
"expression",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"GremlinExpression",
"gremlinExpression",
"=",
"null",
";",
"if",
"(",
"expression",
... | This is a helper method to extract the Gremlin expression.
@param expression
is the object which comes in from
DatastoreSession#executeQuery(Object, java.util.Map).
@param parameters
is a Map of parameters.
@return A {@link String} containing a Gremlin expression is returned.
@param <QL>
is the query language. | [
"This",
"is",
"a",
"helper",
"method",
"to",
"extract",
"the",
"Gremlin",
"expression",
"."
] | train | https://github.com/PureSolTechnologies/extended-objects-titan/blob/26c091f04d03d858af7c97230c71f7f7205b4519/titan/src/main/java/com/puresoltechnologies/xo/titan/impl/GremlinManager.java#L33-L58 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java | ApiOvhDedicatednas.serviceName_partition_partitionName_GET | public OvhPartition serviceName_partition_partitionName_GET(String serviceName, String partitionName) throws IOException {
"""
Get this object properties
REST: GET /dedicated/nas/{serviceName}/partition/{partitionName}
@param serviceName [required] The internal name of your storage
@param partitionName [requi... | java | public OvhPartition serviceName_partition_partitionName_GET(String serviceName, String partitionName) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}";
StringBuilder sb = path(qPath, serviceName, partitionName);
String resp = exec(qPath, "GET", sb.toString(), null);
r... | [
"public",
"OvhPartition",
"serviceName_partition_partitionName_GET",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nas/{serviceName}/partition/{partitionName}\"",
";",
"StringBuilder",
"sb"... | Get this object properties
REST: GET /dedicated/nas/{serviceName}/partition/{partitionName}
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java#L194-L199 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java | RunsInner.listAsync | public Observable<Page<RunInner>> listAsync(final String resourceGroupName, final String registryName) {
"""
Gets all the runs for a registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws Illega... | java | public Observable<Page<RunInner>> listAsync(final String resourceGroupName, final String registryName) {
return listWithServiceResponseAsync(resourceGroupName, registryName)
.map(new Func1<ServiceResponse<Page<RunInner>>, Page<RunInner>>() {
@Override
public Page<RunI... | [
"public",
"Observable",
"<",
"Page",
"<",
"RunInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
")",
... | Gets all the runs for a registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<RunInner> ob... | [
"Gets",
"all",
"the",
"runs",
"for",
"a",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java#L147-L155 |
wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.buildJsonSchemaRefForModel | private String buildJsonSchemaRefForModel(Class<?> modelClass, File artifactFile) {
"""
Check if JAR file has a doc domain path and corresponding schema file and then builds a documenation path for it.
@param modelClass Model calss
@param artifactFile JAR artifact's file
@return JSON schema path or null
"""... | java | private String buildJsonSchemaRefForModel(Class<?> modelClass, File artifactFile) {
try {
ZipFile zipFile = new ZipFile(artifactFile);
String halDocsDomainPath = getHalDocsDomainPath(zipFile);
if (halDocsDomainPath != null && hasJsonSchemaFile(zipFile, modelClass)) {
return JsonSchemaBundl... | [
"private",
"String",
"buildJsonSchemaRefForModel",
"(",
"Class",
"<",
"?",
">",
"modelClass",
",",
"File",
"artifactFile",
")",
"{",
"try",
"{",
"ZipFile",
"zipFile",
"=",
"new",
"ZipFile",
"(",
"artifactFile",
")",
";",
"String",
"halDocsDomainPath",
"=",
"ge... | Check if JAR file has a doc domain path and corresponding schema file and then builds a documenation path for it.
@param modelClass Model calss
@param artifactFile JAR artifact's file
@return JSON schema path or null | [
"Check",
"if",
"JAR",
"file",
"has",
"a",
"doc",
"domain",
"path",
"and",
"corresponding",
"schema",
"file",
"and",
"then",
"builds",
"a",
"documenation",
"path",
"for",
"it",
"."
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L266-L279 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsHighlightingBorder.java | CmsHighlightingBorder.setPosition | public void setPosition(int height, int width, int positionLeft, int positionTop) {
"""
Sets the border position.<p>
@param height the height
@param width the width
@param positionLeft the absolute left position
@param positionTop the absolute top position
"""
positionLeft -= m_borderOffset;
... | java | public void setPosition(int height, int width, int positionLeft, int positionTop) {
positionLeft -= m_borderOffset;
// make sure highlighting does not introduce additional horizontal scroll-bars
if ((m_positioningParent == null) && (positionLeft < 0)) {
// position left should not ... | [
"public",
"void",
"setPosition",
"(",
"int",
"height",
",",
"int",
"width",
",",
"int",
"positionLeft",
",",
"int",
"positionTop",
")",
"{",
"positionLeft",
"-=",
"m_borderOffset",
";",
"// make sure highlighting does not introduce additional horizontal scroll-bars",
"if"... | Sets the border position.<p>
@param height the height
@param width the width
@param positionLeft the absolute left position
@param positionTop the absolute top position | [
"Sets",
"the",
"border",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsHighlightingBorder.java#L256-L278 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/sas/SasUtils.java | SasUtils.createReader | public static BufferedReader createReader(File file) throws IOException {
"""
Creates a reader from the given file. Support GZIP compressed files.
@param file file to read
@return reader
"""
InputStream is = new FileInputStream(file);
if (file.getName().toLowerCase().endsWith(".gz"))
... | java | public static BufferedReader createReader(File file) throws IOException {
InputStream is = new FileInputStream(file);
if (file.getName().toLowerCase().endsWith(".gz"))
is = new GZIPInputStream(is);
return new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
} | [
"public",
"static",
"BufferedReader",
"createReader",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"if",
"(",
"file",
".",
"getName",
"(",
")",
".",
"toLowerCase",
"(",
"... | Creates a reader from the given file. Support GZIP compressed files.
@param file file to read
@return reader | [
"Creates",
"a",
"reader",
"from",
"the",
"given",
"file",
".",
"Support",
"GZIP",
"compressed",
"files",
"."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/sas/SasUtils.java#L38-L43 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.expandLine | public static String expandLine(CharSequence self, int tabStop) {
"""
Expands all tabs into spaces. Assumes the CharSequence represents a single line of text.
@param self A line to expand
@param tabStop The number of spaces a tab represents
@return The expanded toString() of this CharSequence
@see #expandLin... | java | public static String expandLine(CharSequence self, int tabStop) {
String s = self.toString();
int index;
while ((index = s.indexOf('\t')) != -1) {
StringBuilder builder = new StringBuilder(s);
int count = tabStop - index % tabStop;
builder.deleteCharAt(index);... | [
"public",
"static",
"String",
"expandLine",
"(",
"CharSequence",
"self",
",",
"int",
"tabStop",
")",
"{",
"String",
"s",
"=",
"self",
".",
"toString",
"(",
")",
";",
"int",
"index",
";",
"while",
"(",
"(",
"index",
"=",
"s",
".",
"indexOf",
"(",
"'",... | Expands all tabs into spaces. Assumes the CharSequence represents a single line of text.
@param self A line to expand
@param tabStop The number of spaces a tab represents
@return The expanded toString() of this CharSequence
@see #expandLine(String, int)
@since 1.8.2 | [
"Expands",
"all",
"tabs",
"into",
"spaces",
".",
"Assumes",
"the",
"CharSequence",
"represents",
"a",
"single",
"line",
"of",
"text",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L819-L830 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.addUserAsync | public Observable<Void> addUserAsync(String poolId, String nodeId, ComputeNodeUser user) {
"""
Adds a user account to the specified compute node.
You can add a user account to a node only when it is in the idle or running state.
@param poolId The ID of the pool that contains the compute node.
@param nodeId Th... | java | public Observable<Void> addUserAsync(String poolId, String nodeId, ComputeNodeUser user) {
return addUserWithServiceResponseAsync(poolId, nodeId, user).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeAddUserHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeade... | [
"public",
"Observable",
"<",
"Void",
">",
"addUserAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"ComputeNodeUser",
"user",
")",
"{",
"return",
"addUserWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
",",
"user",
")",
".",
"map",
"(",
... | Adds a user account to the specified compute node.
You can add a user account to a node only when it is in the idle or running state.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the machine on which you want to create a user account.
@param user The user account to be creat... | [
"Adds",
"a",
"user",
"account",
"to",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"add",
"a",
"user",
"account",
"to",
"a",
"node",
"only",
"when",
"it",
"is",
"in",
"the",
"idle",
"or",
"running",
"state",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L207-L214 |
Red5/red5-server-common | src/main/java/org/red5/server/util/FileUtil.java | FileUtil.makeDirectory | public static boolean makeDirectory(String directory, boolean createParents) throws IOException {
"""
Create a directory. The parent directories will be created if <i>createParents</i> is passed as true.
@param directory
directory
@param createParents
whether to create all parents
@return true if directory ... | java | public static boolean makeDirectory(String directory, boolean createParents) throws IOException {
boolean created = false;
File dir = new File(directory);
if (createParents) {
created = dir.mkdirs();
if (created) {
log.debug("Directory created: {}", ... | [
"public",
"static",
"boolean",
"makeDirectory",
"(",
"String",
"directory",
",",
"boolean",
"createParents",
")",
"throws",
"IOException",
"{",
"boolean",
"created",
"=",
"false",
";",
"File",
"dir",
"=",
"new",
"File",
"(",
"directory",
")",
";",
"if",
"(",... | Create a directory. The parent directories will be created if <i>createParents</i> is passed as true.
@param directory
directory
@param createParents
whether to create all parents
@return true if directory was created; false if it already existed
@throws IOException
if we cannot create directory | [
"Create",
"a",
"directory",
".",
"The",
"parent",
"directories",
"will",
"be",
"created",
"if",
"<i",
">",
"createParents<",
"/",
"i",
">",
"is",
"passed",
"as",
"true",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L269-L289 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PropertyBuilder.java | PropertyBuilder.buildSignature | public void buildSignature(XMLNode node, Content propertyDocTree) {
"""
Build the signature.
@param node the XML element that specifies which components to document
@param propertyDocTree the content tree to which the documentation will be added
"""
propertyDocTree.addContent(
write... | java | public void buildSignature(XMLNode node, Content propertyDocTree) {
propertyDocTree.addContent(
writer.getSignature((MethodDoc) properties.get(currentPropertyIndex)));
} | [
"public",
"void",
"buildSignature",
"(",
"XMLNode",
"node",
",",
"Content",
"propertyDocTree",
")",
"{",
"propertyDocTree",
".",
"addContent",
"(",
"writer",
".",
"getSignature",
"(",
"(",
"MethodDoc",
")",
"properties",
".",
"get",
"(",
"currentPropertyIndex",
... | Build the signature.
@param node the XML element that specifies which components to document
@param propertyDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"signature",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PropertyBuilder.java#L182-L185 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java | MultipleOutputs.getNamedOutputsList | public static List<String> getNamedOutputsList(JobConf conf) {
"""
Returns list of channel names.
@param conf job conf
@return List of channel Names
"""
List<String> names = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(conf.get(NAMED_OUTPUTS, ""), " ");
while (st.hasMoreTok... | java | public static List<String> getNamedOutputsList(JobConf conf) {
List<String> names = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(conf.get(NAMED_OUTPUTS, ""), " ");
while (st.hasMoreTokens()) {
names.add(st.nextToken());
}
return names;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getNamedOutputsList",
"(",
"JobConf",
"conf",
")",
"{",
"List",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer"... | Returns list of channel names.
@param conf job conf
@return List of channel Names | [
"Returns",
"list",
"of",
"channel",
"names",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java#L204-L211 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.unsetUserAsFuture | public FutureAPIResponse unsetUserAsFuture(String uid, List<String> properties)
throws IOException {
"""
Sends an unset user properties request. Same as {@link #unsetUserAsFuture(String, List,
DateTime) unsetUserAsFuture(String, List<String>, DateTime)} except event time is not
specified and recorded... | java | public FutureAPIResponse unsetUserAsFuture(String uid, List<String> properties)
throws IOException {
return unsetUserAsFuture(uid, properties, new DateTime());
} | [
"public",
"FutureAPIResponse",
"unsetUserAsFuture",
"(",
"String",
"uid",
",",
"List",
"<",
"String",
">",
"properties",
")",
"throws",
"IOException",
"{",
"return",
"unsetUserAsFuture",
"(",
"uid",
",",
"properties",
",",
"new",
"DateTime",
"(",
")",
")",
";"... | Sends an unset user properties request. Same as {@link #unsetUserAsFuture(String, List,
DateTime) unsetUserAsFuture(String, List<String>, DateTime)} except event time is not
specified and recorded as the time when the function is called. | [
"Sends",
"an",
"unset",
"user",
"properties",
"request",
".",
"Same",
"as",
"{"
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L368-L371 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDao.java | BranchDao.updateManualBaseline | public int updateManualBaseline(DbSession dbSession, String uuid, @Nullable String analysisUuid) {
"""
Set or unset the uuid of the manual baseline analysis by updating the manual_baseline_analysis_uuid column, if:
- the specified uuid exists
- and the specified uuid corresponds to a long-living branch (includ... | java | public int updateManualBaseline(DbSession dbSession, String uuid, @Nullable String analysisUuid) {
long now = system2.now();
return mapper(dbSession).updateManualBaseline(uuid, analysisUuid == null || analysisUuid.isEmpty() ? null : analysisUuid, now);
} | [
"public",
"int",
"updateManualBaseline",
"(",
"DbSession",
"dbSession",
",",
"String",
"uuid",
",",
"@",
"Nullable",
"String",
"analysisUuid",
")",
"{",
"long",
"now",
"=",
"system2",
".",
"now",
"(",
")",
";",
"return",
"mapper",
"(",
"dbSession",
")",
".... | Set or unset the uuid of the manual baseline analysis by updating the manual_baseline_analysis_uuid column, if:
- the specified uuid exists
- and the specified uuid corresponds to a long-living branch (including the main branch)
@return the number of rows that were updated | [
"Set",
"or",
"unset",
"the",
"uuid",
"of",
"the",
"manual",
"baseline",
"analysis",
"by",
"updating",
"the",
"manual_baseline_analysis_uuid",
"column",
"if",
":"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDao.java#L75-L78 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/CollidableUpdater.java | CollidableUpdater.getOffsetY | private static int getOffsetY(Collision collision, Mirror mirror) {
"""
Get the vertical offset.
@param collision The collision reference.
@param mirror The mirror used.
@return The offset value depending of mirror.
"""
if (mirror == Mirror.VERTICAL)
{
return -collision.getO... | java | private static int getOffsetY(Collision collision, Mirror mirror)
{
if (mirror == Mirror.VERTICAL)
{
return -collision.getOffsetY();
}
return collision.getOffsetY();
} | [
"private",
"static",
"int",
"getOffsetY",
"(",
"Collision",
"collision",
",",
"Mirror",
"mirror",
")",
"{",
"if",
"(",
"mirror",
"==",
"Mirror",
".",
"VERTICAL",
")",
"{",
"return",
"-",
"collision",
".",
"getOffsetY",
"(",
")",
";",
"}",
"return",
"coll... | Get the vertical offset.
@param collision The collision reference.
@param mirror The mirror used.
@return The offset value depending of mirror. | [
"Get",
"the",
"vertical",
"offset",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/CollidableUpdater.java#L156-L163 |
bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlBlockedDataReaderDAO.java | CqlBlockedDataReaderDAO.newRecordFromCql | private Record newRecordFromCql(Key key, Iterable<Row> rows, Placement placement, String rowKey) {
"""
Creates a Record instance for a given key and list of rows. All rows must be from the same Cassandra row;
in other words, it is expected that row.getBytesUnsafe(ROW_KEY_RESULT_SET_COLUMN) returns the same value... | java | private Record newRecordFromCql(Key key, Iterable<Row> rows, Placement placement, String rowKey) {
Session session = placement.getKeyspace().getCqlSession();
ProtocolVersion protocolVersion = session.getCluster().getConfiguration().getProtocolOptions().getProtocolVersion();
CodecRegistry codecRe... | [
"private",
"Record",
"newRecordFromCql",
"(",
"Key",
"key",
",",
"Iterable",
"<",
"Row",
">",
"rows",
",",
"Placement",
"placement",
",",
"String",
"rowKey",
")",
"{",
"Session",
"session",
"=",
"placement",
".",
"getKeyspace",
"(",
")",
".",
"getCqlSession"... | Creates a Record instance for a given key and list of rows. All rows must be from the same Cassandra row;
in other words, it is expected that row.getBytesUnsafe(ROW_KEY_RESULT_SET_COLUMN) returns the same value for
each row in rows. | [
"Creates",
"a",
"Record",
"instance",
"for",
"a",
"given",
"key",
"and",
"list",
"of",
"rows",
".",
"All",
"rows",
"must",
"be",
"from",
"the",
"same",
"Cassandra",
"row",
";",
"in",
"other",
"words",
"it",
"is",
"expected",
"that",
"row",
".",
"getByt... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlBlockedDataReaderDAO.java#L248-L258 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java | MultiPolygon.fromPolygons | public static MultiPolygon fromPolygons(@NonNull List<Polygon> polygons) {
"""
Create a new instance of this class by defining a list of {@link Polygon} objects and passing
that list in as a parameter in this method. The Polygons should comply with the GeoJson
specifications described in the documentation.
@p... | java | public static MultiPolygon fromPolygons(@NonNull List<Polygon> polygons) {
List<List<List<Point>>> coordinates = new ArrayList<>(polygons.size());
for (Polygon polygon : polygons) {
coordinates.add(polygon.coordinates());
}
return new MultiPolygon(TYPE, null, coordinates);
} | [
"public",
"static",
"MultiPolygon",
"fromPolygons",
"(",
"@",
"NonNull",
"List",
"<",
"Polygon",
">",
"polygons",
")",
"{",
"List",
"<",
"List",
"<",
"List",
"<",
"Point",
">>>",
"coordinates",
"=",
"new",
"ArrayList",
"<>",
"(",
"polygons",
".",
"size",
... | Create a new instance of this class by defining a list of {@link Polygon} objects and passing
that list in as a parameter in this method. The Polygons should comply with the GeoJson
specifications described in the documentation.
@param polygons a list of Polygons which make up this MultiPolygon
@return a new instance ... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"{",
"@link",
"Polygon",
"}",
"objects",
"and",
"passing",
"that",
"list",
"in",
"as",
"a",
"parameter",
"in",
"this",
"method",
".",
"The",
"Polygons",
"should... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java#L109-L115 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/webhook/WebhookDeliveryDao.java | WebhookDeliveryDao.selectByWebhookUuid | public List<WebhookDeliveryLiteDto> selectByWebhookUuid(DbSession dbSession, String webhookUuid, int offset, int limit) {
"""
All the deliveries for the specified webhook. Results are ordered by descending date.
"""
return mapper(dbSession).selectByWebhookUuid(webhookUuid, new RowBounds(offset, limit));
... | java | public List<WebhookDeliveryLiteDto> selectByWebhookUuid(DbSession dbSession, String webhookUuid, int offset, int limit) {
return mapper(dbSession).selectByWebhookUuid(webhookUuid, new RowBounds(offset, limit));
} | [
"public",
"List",
"<",
"WebhookDeliveryLiteDto",
">",
"selectByWebhookUuid",
"(",
"DbSession",
"dbSession",
",",
"String",
"webhookUuid",
",",
"int",
"offset",
",",
"int",
"limit",
")",
"{",
"return",
"mapper",
"(",
"dbSession",
")",
".",
"selectByWebhookUuid",
... | All the deliveries for the specified webhook. Results are ordered by descending date. | [
"All",
"the",
"deliveries",
"for",
"the",
"specified",
"webhook",
".",
"Results",
"are",
"ordered",
"by",
"descending",
"date",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/webhook/WebhookDeliveryDao.java#L45-L47 |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/TQRootBean.java | TQRootBean.rawOrEmpty | public R rawOrEmpty(String raw, Collection<?> values) {
"""
Only add the raw expression if the values is not null or empty.
<p>
This is a pure convenience expression to make it nicer to deal with the pattern where we use
raw() expression with a subquery and only want to add the subquery predicate when the colle... | java | public R rawOrEmpty(String raw, Collection<?> values) {
peekExprList().rawOrEmpty(raw, values);
return root;
} | [
"public",
"R",
"rawOrEmpty",
"(",
"String",
"raw",
",",
"Collection",
"<",
"?",
">",
"values",
")",
"{",
"peekExprList",
"(",
")",
".",
"rawOrEmpty",
"(",
"raw",
",",
"values",
")",
";",
"return",
"root",
";",
"}"
] | Only add the raw expression if the values is not null or empty.
<p>
This is a pure convenience expression to make it nicer to deal with the pattern where we use
raw() expression with a subquery and only want to add the subquery predicate when the collection
of values is not empty.
</p>
<h3>Without inOrEmpty()</h3>
<pre... | [
"Only",
"add",
"the",
"raw",
"expression",
"if",
"the",
"values",
"is",
"not",
"null",
"or",
"empty",
".",
"<p",
">",
"This",
"is",
"a",
"pure",
"convenience",
"expression",
"to",
"make",
"it",
"nicer",
"to",
"deal",
"with",
"the",
"pattern",
"where",
... | train | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQRootBean.java#L1040-L1043 |
OpenTSDB/opentsdb | src/tsd/HttpJsonSerializer.java | HttpJsonSerializer.parseLastPointQueryV1 | public LastPointQuery parseLastPointQueryV1() {
"""
Parses a last data point query
@return A LastPointQuery to work with
@throws JSONException if parsing failed
@throws BadRequestException if the content was missing or parsing failed
"""
final String json = query.getContent();
if (json == null || js... | java | public LastPointQuery parseLastPointQueryV1() {
final String json = query.getContent();
if (json == null || json.isEmpty()) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Missing message content",
"Supply valid JSON formatted data in the body of your request");
}
... | [
"public",
"LastPointQuery",
"parseLastPointQueryV1",
"(",
")",
"{",
"final",
"String",
"json",
"=",
"query",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"json",
"==",
"null",
"||",
"json",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"BadRequestE... | Parses a last data point query
@return A LastPointQuery to work with
@throws JSONException if parsing failed
@throws BadRequestException if the content was missing or parsing failed | [
"Parses",
"a",
"last",
"data",
"point",
"query"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L289-L301 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoin/NativeSecp256k1.java | NativeSecp256k1.verify | public static boolean verify(byte[] data, byte[] signature, byte[] pub) throws AssertFailException {
"""
Verifies the given secp256k1 signature in native code. Calling when enabled == false is undefined (probably
library not loaded)
@param data The data which was signed, must be exactly 32 bytes
@param signat... | java | public static boolean verify(byte[] data, byte[] signature, byte[] pub) throws AssertFailException {
Preconditions.checkArgument(data.length == 32 && signature.length <= 520 && pub.length <= 520);
ByteBuffer byteBuff = nativeECDSABuffer.get();
if (byteBuff == null || byteBuff.capacity() < 520) ... | [
"public",
"static",
"boolean",
"verify",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"signature",
",",
"byte",
"[",
"]",
"pub",
")",
"throws",
"AssertFailException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"data",
".",
"length",
"==",
... | Verifies the given secp256k1 signature in native code. Calling when enabled == false is undefined (probably
library not loaded)
@param data The data which was signed, must be exactly 32 bytes
@param signature The signature
@param pub The public key which did the signing | [
"Verifies",
"the",
"given",
"secp256k1",
"signature",
"in",
"native",
"code",
".",
"Calling",
"when",
"enabled",
"==",
"false",
"is",
"undefined",
"(",
"probably",
"library",
"not",
"loaded",
")"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoin/NativeSecp256k1.java#L55-L75 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/util/ManifestUtil.java | ManifestUtil.getDatastoreName | public static String[] getDatastoreName(String pathManifest) throws InitializationException {
"""
Recovered the datastoreName form Manifest.
@param pathManifest the manifest path.
@return the datastoreName.
@throws InitializationException if an error happens while XML is reading.
"""
String[] dat... | java | public static String[] getDatastoreName(String pathManifest) throws InitializationException {
String[] datastoreName = {""};
try {
Document document = getDocument(pathManifest);
// Search for the limit properties and connectorName
Object result = getResult(document, ... | [
"public",
"static",
"String",
"[",
"]",
"getDatastoreName",
"(",
"String",
"pathManifest",
")",
"throws",
"InitializationException",
"{",
"String",
"[",
"]",
"datastoreName",
"=",
"{",
"\"\"",
"}",
";",
"try",
"{",
"Document",
"document",
"=",
"getDocument",
"... | Recovered the datastoreName form Manifest.
@param pathManifest the manifest path.
@return the datastoreName.
@throws InitializationException if an error happens while XML is reading. | [
"Recovered",
"the",
"datastoreName",
"form",
"Manifest",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/util/ManifestUtil.java#L57-L77 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.between | public static long between(Date beginDate, Date endDate, DateUnit unit, boolean isAbs) {
"""
判断两个日期相差的时长
@param beginDate 起始日期
@param endDate 结束日期
@param unit 相差的单位:相差 天{@link DateUnit#DAY}、小时{@link DateUnit#HOUR} 等
@param isAbs 日期间隔是否只保留绝对值正数
@return 日期差
@since 3.3.1
"""
return new DateBetween(begi... | java | public static long between(Date beginDate, Date endDate, DateUnit unit, boolean isAbs) {
return new DateBetween(beginDate, endDate, isAbs).between(unit);
} | [
"public",
"static",
"long",
"between",
"(",
"Date",
"beginDate",
",",
"Date",
"endDate",
",",
"DateUnit",
"unit",
",",
"boolean",
"isAbs",
")",
"{",
"return",
"new",
"DateBetween",
"(",
"beginDate",
",",
"endDate",
",",
"isAbs",
")",
".",
"between",
"(",
... | 判断两个日期相差的时长
@param beginDate 起始日期
@param endDate 结束日期
@param unit 相差的单位:相差 天{@link DateUnit#DAY}、小时{@link DateUnit#HOUR} 等
@param isAbs 日期间隔是否只保留绝对值正数
@return 日期差
@since 3.3.1 | [
"判断两个日期相差的时长"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1242-L1244 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java | ServiceEndpointPoliciesInner.updateAsync | public Observable<ServiceEndpointPolicyInner> updateAsync(String resourceGroupName, String serviceEndpointPolicyName) {
"""
Updates service Endpoint Policies.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of the service endpoint policy.
@throws IllegalArgum... | java | public Observable<ServiceEndpointPolicyInner> updateAsync(String resourceGroupName, String serviceEndpointPolicyName) {
return updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName).map(new Func1<ServiceResponse<ServiceEndpointPolicyInner>, ServiceEndpointPolicyInner>() {
@Over... | [
"public",
"Observable",
"<",
"ServiceEndpointPolicyInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serviceEndpointPolicyName",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serviceEndpointPolicyName",
")"... | Updates service Endpoint Policies.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of the service endpoint policy.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"service",
"Endpoint",
"Policies",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java#L636-L643 |
alkacon/opencms-core | src/org/opencms/ade/configuration/formatters/CmsFormatterConfigurationCache.java | CmsFormatterConfigurationCache.parseSettingsConfig | private void parseSettingsConfig(CmsResource resource, Map<CmsUUID, List<CmsXmlContentProperty>> settingConfigs) {
"""
Helper method for parsing a settings configuration file.<p>
@param resource the resource to parse
@param settingConfigs the map in which the result should be stored, with the structure id of t... | java | private void parseSettingsConfig(CmsResource resource, Map<CmsUUID, List<CmsXmlContentProperty>> settingConfigs) {
List<CmsXmlContentProperty> settingConfig = new ArrayList<>();
try {
CmsFile settingFile = m_cms.readFile(resource);
CmsXmlContent settingContent = CmsXmlContentFa... | [
"private",
"void",
"parseSettingsConfig",
"(",
"CmsResource",
"resource",
",",
"Map",
"<",
"CmsUUID",
",",
"List",
"<",
"CmsXmlContentProperty",
">",
">",
"settingConfigs",
")",
"{",
"List",
"<",
"CmsXmlContentProperty",
">",
"settingConfig",
"=",
"new",
"ArrayLis... | Helper method for parsing a settings configuration file.<p>
@param resource the resource to parse
@param settingConfigs the map in which the result should be stored, with the structure id of the resource as the key | [
"Helper",
"method",
"for",
"parsing",
"a",
"settings",
"configuration",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/formatters/CmsFormatterConfigurationCache.java#L407-L425 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.copyStreamSafely | public static void copyStreamSafely( InputStream in, ByteArrayOutputStream os ) throws IOException {
"""
Copies the content from in into os.
<p>
This method closes the input stream.
<i>os</i> does not need to be closed.
</p>
@param in an input stream (not null)
@param os an output stream (not null)
@throw... | java | public static void copyStreamSafely( InputStream in, ByteArrayOutputStream os ) throws IOException {
try {
copyStreamUnsafelyUseWithCaution( in, os );
} finally {
in.close();
}
} | [
"public",
"static",
"void",
"copyStreamSafely",
"(",
"InputStream",
"in",
",",
"ByteArrayOutputStream",
"os",
")",
"throws",
"IOException",
"{",
"try",
"{",
"copyStreamUnsafelyUseWithCaution",
"(",
"in",
",",
"os",
")",
";",
"}",
"finally",
"{",
"in",
".",
"cl... | Copies the content from in into os.
<p>
This method closes the input stream.
<i>os</i> does not need to be closed.
</p>
@param in an input stream (not null)
@param os an output stream (not null)
@throws IOException if an error occurred | [
"Copies",
"the",
"content",
"from",
"in",
"into",
"os",
".",
"<p",
">",
"This",
"method",
"closes",
"the",
"input",
"stream",
".",
"<i",
">",
"os<",
"/",
"i",
">",
"does",
"not",
"need",
"to",
"be",
"closed",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L332-L340 |
UrielCh/ovh-java-sdk | ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java | ApiOvhService.serviceId_renew_POST | public OvhRenewOrder serviceId_renew_POST(String serviceId, Boolean dryRun, String duration, Long[] services) throws IOException {
"""
Create a renew order
REST: POST /service/{serviceId}/renew
@param serviceId [required] Service Id
@param dryRun [required] Indicates if renew order is generated
@param durati... | java | public OvhRenewOrder serviceId_renew_POST(String serviceId, Boolean dryRun, String duration, Long[] services) throws IOException {
String qPath = "/service/{serviceId}/renew";
StringBuilder sb = path(qPath, serviceId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "dryRun", dryRun);
add... | [
"public",
"OvhRenewOrder",
"serviceId_renew_POST",
"(",
"String",
"serviceId",
",",
"Boolean",
"dryRun",
",",
"String",
"duration",
",",
"Long",
"[",
"]",
"services",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/service/{serviceId}/renew\"",
";",
... | Create a renew order
REST: POST /service/{serviceId}/renew
@param serviceId [required] Service Id
@param dryRun [required] Indicates if renew order is generated
@param duration [required] Renew duration
@param services [required] List of services to renew
API beta | [
"Create",
"a",
"renew",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java#L111-L120 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CurrencyLocalizationUrl.java | CurrencyLocalizationUrl.deleteCurrencyExchangeRateUrl | public static MozuUrl deleteCurrencyExchangeRateUrl(String currencyCode, String toCurrencyCode) {
"""
Get Resource Url for DeleteCurrencyExchangeRate
@param currencyCode The three character ISOÂ currency code, such as USDÂ for US Dollars.
@param toCurrencyCode
@return String Resource Url
"""
UrlFormatte... | java | public static MozuUrl deleteCurrencyExchangeRateUrl(String currencyCode, String toCurrencyCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}/exchangerates/{toCurrencyCode}");
formatter.formatUrl("currencyCode", currencyCode);
formatter.formatUrl("toCurrencyCode... | [
"public",
"static",
"MozuUrl",
"deleteCurrencyExchangeRateUrl",
"(",
"String",
"currencyCode",
",",
"String",
"toCurrencyCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/currency/{currencyCode}/exchangerates/{toCurrency... | Get Resource Url for DeleteCurrencyExchangeRate
@param currencyCode The three character ISOÂ currency code, such as USDÂ for US Dollars.
@param toCurrencyCode
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteCurrencyExchangeRate"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CurrencyLocalizationUrl.java#L140-L146 |
Red5/red5-io | src/main/java/org/red5/io/mp3/impl/MP3Stream.java | MP3Stream.calculateDuration | private static float calculateDuration(int layer, int sampleRate) {
"""
Calculates the duration of a MPEG frame based on the given parameters.
@param layer
the layer
@param sampleRate
the sample rate
@return the duration of this frame in milliseconds
"""
int sampleCount = (layer == AudioFrame.LA... | java | private static float calculateDuration(int layer, int sampleRate) {
int sampleCount = (layer == AudioFrame.LAYER_1) ? SAMPLE_COUNT_L1 : SAMPLE_COUNT_L2;
return (1000.0f / sampleRate) * sampleCount;
} | [
"private",
"static",
"float",
"calculateDuration",
"(",
"int",
"layer",
",",
"int",
"sampleRate",
")",
"{",
"int",
"sampleCount",
"=",
"(",
"layer",
"==",
"AudioFrame",
".",
"LAYER_1",
")",
"?",
"SAMPLE_COUNT_L1",
":",
"SAMPLE_COUNT_L2",
";",
"return",
"(",
... | Calculates the duration of a MPEG frame based on the given parameters.
@param layer
the layer
@param sampleRate
the sample rate
@return the duration of this frame in milliseconds | [
"Calculates",
"the",
"duration",
"of",
"a",
"MPEG",
"frame",
"based",
"on",
"the",
"given",
"parameters",
"."
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/mp3/impl/MP3Stream.java#L329-L332 |
mbeiter/util | db/src/main/java/org/beiter/michael/db/DataSourceFactory.java | DataSourceFactory.loadDriver | private static void loadDriver(final String driver) throws FactoryException {
"""
Make sure that the database driver exists
@param driver The JDBC driver class to load
@throws FactoryException When the driver cannot be loaded
"""
// assert in private method
assert driver != null : "The dri... | java | private static void loadDriver(final String driver) throws FactoryException {
// assert in private method
assert driver != null : "The driver cannot be null";
LOG.debug("Loading the database driver '" + driver + "'");
// make sure the driver is available
try {
Clas... | [
"private",
"static",
"void",
"loadDriver",
"(",
"final",
"String",
"driver",
")",
"throws",
"FactoryException",
"{",
"// assert in private method",
"assert",
"driver",
"!=",
"null",
":",
"\"The driver cannot be null\"",
";",
"LOG",
".",
"debug",
"(",
"\"Loading the da... | Make sure that the database driver exists
@param driver The JDBC driver class to load
@throws FactoryException When the driver cannot be loaded | [
"Make",
"sure",
"that",
"the",
"database",
"driver",
"exists"
] | train | https://github.com/mbeiter/util/blob/490fcebecb936e00c2f2ce2096b679b2fd10865e/db/src/main/java/org/beiter/michael/db/DataSourceFactory.java#L211-L226 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java | ByteConverter.int8 | public static long int8(byte[] bytes, int idx) {
"""
Parses a long value from the byte array.
@param bytes The byte array to parse.
@param idx The starting index of the parse in the byte array.
@return parsed long value.
"""
return
((long) (bytes[idx + 0] & 255) << 56)
+ ((long) (b... | java | public static long int8(byte[] bytes, int idx) {
return
((long) (bytes[idx + 0] & 255) << 56)
+ ((long) (bytes[idx + 1] & 255) << 48)
+ ((long) (bytes[idx + 2] & 255) << 40)
+ ((long) (bytes[idx + 3] & 255) << 32)
+ ((long) (bytes[idx + 4] & 255) << 24)
... | [
"public",
"static",
"long",
"int8",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"idx",
")",
"{",
"return",
"(",
"(",
"long",
")",
"(",
"bytes",
"[",
"idx",
"+",
"0",
"]",
"&",
"255",
")",
"<<",
"56",
")",
"+",
"(",
"(",
"long",
")",
"(",
"b... | Parses a long value from the byte array.
@param bytes The byte array to parse.
@param idx The starting index of the parse in the byte array.
@return parsed long value. | [
"Parses",
"a",
"long",
"value",
"from",
"the",
"byte",
"array",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java#L26-L36 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/model/trace/Node.java | Node.addControlFlowCorrelationId | public Node addControlFlowCorrelationId(String id) {
"""
This method adds a control flow scoped correlation id.
@param id The id
@return The node
"""
this.correlationIds.add(new CorrelationIdentifier(Scope.ControlFlow, id));
return this;
} | java | public Node addControlFlowCorrelationId(String id) {
this.correlationIds.add(new CorrelationIdentifier(Scope.ControlFlow, id));
return this;
} | [
"public",
"Node",
"addControlFlowCorrelationId",
"(",
"String",
"id",
")",
"{",
"this",
".",
"correlationIds",
".",
"add",
"(",
"new",
"CorrelationIdentifier",
"(",
"Scope",
".",
"ControlFlow",
",",
"id",
")",
")",
";",
"return",
"this",
";",
"}"
] | This method adds a control flow scoped correlation id.
@param id The id
@return The node | [
"This",
"method",
"adds",
"a",
"control",
"flow",
"scoped",
"correlation",
"id",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/model/trace/Node.java#L266-L269 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CompactCharArray.java | CompactCharArray.setElementAt | @Deprecated
public void setElementAt(char start, char end, char value) {
"""
Set new values for a range of Unicode character.
@param start the starting offset of the range
@param end the ending offset of the range
@param value the new mapped value
@deprecated This API is ICU internal only.
@hide draft /... | java | @Deprecated
public void setElementAt(char start, char end, char value)
{
int i;
if (isCompact) {
expand();
}
for (i = start; i <= end; ++i) {
values[i] = value;
touchBlock(i >> BLOCKSHIFT, value);
}
} | [
"@",
"Deprecated",
"public",
"void",
"setElementAt",
"(",
"char",
"start",
",",
"char",
"end",
",",
"char",
"value",
")",
"{",
"int",
"i",
";",
"if",
"(",
"isCompact",
")",
"{",
"expand",
"(",
")",
";",
"}",
"for",
"(",
"i",
"=",
"start",
";",
"i... | Set new values for a range of Unicode character.
@param start the starting offset of the range
@param end the ending offset of the range
@param value the new mapped value
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"Set",
"new",
"values",
"for",
"a",
"range",
"of",
"Unicode",
"character",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CompactCharArray.java#L170-L181 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java | ExamplePointFeatureTracker.updateGUI | private void updateGUI(SimpleImageSequence<T> sequence) {
"""
Draw tracked features in blue, or red if they were just spawned.
"""
BufferedImage orig = sequence.getGuiImage();
Graphics2D g2 = orig.createGraphics();
// draw tracks with semi-unique colors so you can track individual points with your eyes
... | java | private void updateGUI(SimpleImageSequence<T> sequence) {
BufferedImage orig = sequence.getGuiImage();
Graphics2D g2 = orig.createGraphics();
// draw tracks with semi-unique colors so you can track individual points with your eyes
for( PointTrack p : tracker.getActiveTracks(null) ) {
int red = (int)(2.5*(p.... | [
"private",
"void",
"updateGUI",
"(",
"SimpleImageSequence",
"<",
"T",
">",
"sequence",
")",
"{",
"BufferedImage",
"orig",
"=",
"sequence",
".",
"getGuiImage",
"(",
")",
";",
"Graphics2D",
"g2",
"=",
"orig",
".",
"createGraphics",
"(",
")",
";",
"// draw trac... | Draw tracked features in blue, or red if they were just spawned. | [
"Draw",
"tracked",
"features",
"in",
"blue",
"or",
"red",
"if",
"they",
"were",
"just",
"spawned",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/tracking/ExamplePointFeatureTracker.java#L107-L127 |
headius/invokebinder | src/main/java/com/headius/invokebinder/transform/Transform.java | Transform.buildPrimitiveJava | protected static void buildPrimitiveJava(StringBuilder builder, Object value) {
"""
Build Java code to represent a literal primitive.
This will append L or F as appropriate for long and float primitives.
@param builder the builder in which to generate the code
@param value the primitive value to generate fr... | java | protected static void buildPrimitiveJava(StringBuilder builder, Object value) {
builder.append(value.toString());
if (value.getClass() == Float.class) builder.append('F');
if (value.getClass() == Long.class) builder.append('L');
} | [
"protected",
"static",
"void",
"buildPrimitiveJava",
"(",
"StringBuilder",
"builder",
",",
"Object",
"value",
")",
"{",
"builder",
".",
"append",
"(",
"value",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"value",
".",
"getClass",
"(",
")",
"==",
"Flo... | Build Java code to represent a literal primitive.
This will append L or F as appropriate for long and float primitives.
@param builder the builder in which to generate the code
@param value the primitive value to generate from | [
"Build",
"Java",
"code",
"to",
"represent",
"a",
"literal",
"primitive",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/transform/Transform.java#L109-L113 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_user_userId_changeProperties_POST | public OvhTask serviceName_user_userId_changeProperties_POST(String serviceName, Long userId, Boolean canManageIpFailOvers, Boolean canManageNetwork, Boolean canManageRights, String email, String firstName, Boolean fullAdminRo, String lastName, Boolean nsxRight, String phoneNumber, Boolean receiveAlerts, Boolean tokenV... | java | public OvhTask serviceName_user_userId_changeProperties_POST(String serviceName, Long userId, Boolean canManageIpFailOvers, Boolean canManageNetwork, Boolean canManageRights, String email, String firstName, Boolean fullAdminRo, String lastName, Boolean nsxRight, String phoneNumber, Boolean receiveAlerts, Boolean tokenV... | [
"public",
"OvhTask",
"serviceName_user_userId_changeProperties_POST",
"(",
"String",
"serviceName",
",",
"Long",
"userId",
",",
"Boolean",
"canManageIpFailOvers",
",",
"Boolean",
"canManageNetwork",
",",
"Boolean",
"canManageRights",
",",
"String",
"email",
",",
"String",... | Change Private Cloud user properties
REST: POST /dedicatedCloud/{serviceName}/user/{userId}/changeProperties
@param fullAdminRo [required] Defines if the user is a full admin in readonly
@param canManageNetwork [required] Defines if the user can manage the network
@param canManageRights [required] Defines if the user ... | [
"Change",
"Private",
"Cloud",
"user",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L801-L818 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAdvisorsInner.java | ServerAdvisorsInner.createOrUpdateAsync | public Observable<AdvisorInner> createOrUpdateAsync(String resourceGroupName, String serverName, String advisorName, AutoExecuteStatus autoExecuteValue) {
"""
Creates or updates a server advisor.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from t... | java | public Observable<AdvisorInner> createOrUpdateAsync(String resourceGroupName, String serverName, String advisorName, AutoExecuteStatus autoExecuteValue) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, advisorName, autoExecuteValue).map(new Func1<ServiceResponse<AdvisorInner>, Advi... | [
"public",
"Observable",
"<",
"AdvisorInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"advisorName",
",",
"AutoExecuteStatus",
"autoExecuteValue",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync"... | Creates or updates a server advisor.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param advisorName The name of the Server Advisor.
@param autoExecuteValue Gets... | [
"Creates",
"or",
"updates",
"a",
"server",
"advisor",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAdvisorsInner.java#L398-L405 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/accesscontrol/CLIAccessControl.java | CLIAccessControl.getAccessControl | public static ModelNode getAccessControl(ModelControllerClient client, OperationRequestAddress address, boolean operations) {
"""
Executed read-resource-description and returns access-control info.
Returns null in case there was any kind of problem.
@param client
@param address
@return
"""
return... | java | public static ModelNode getAccessControl(ModelControllerClient client, OperationRequestAddress address, boolean operations) {
return getAccessControl(client, null, address, operations);
} | [
"public",
"static",
"ModelNode",
"getAccessControl",
"(",
"ModelControllerClient",
"client",
",",
"OperationRequestAddress",
"address",
",",
"boolean",
"operations",
")",
"{",
"return",
"getAccessControl",
"(",
"client",
",",
"null",
",",
"address",
",",
"operations",... | Executed read-resource-description and returns access-control info.
Returns null in case there was any kind of problem.
@param client
@param address
@return | [
"Executed",
"read",
"-",
"resource",
"-",
"description",
"and",
"returns",
"access",
"-",
"control",
"info",
".",
"Returns",
"null",
"in",
"case",
"there",
"was",
"any",
"kind",
"of",
"problem",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/accesscontrol/CLIAccessControl.java#L86-L88 |
ops4j/org.ops4j.pax.web | pax-web-undertow/src/main/java/org/ops4j/pax/web/service/undertow/internal/PathMatcher.java | PathMatcher.addPrefixPath | public synchronized PathMatcher addPrefixPath(final String path, final T handler) {
"""
Adds a path prefix and a handler for that path. If the path does not start
with a / then one will be prepended.
<p>
The match is done on a prefix bases, so registering /foo will also match /bar. Exact
path matches are taken... | java | public synchronized PathMatcher addPrefixPath(final String path, final T handler) {
if (path.isEmpty()) {
throw UndertowMessages.MESSAGES.pathMustBeSpecified();
}
final String normalizedPath = URLUtils.normalizeSlashes(path);
if (PathMatcher.STRING_PATH_SEPARATOR.equals(normalizedPath)) {
if (this.defau... | [
"public",
"synchronized",
"PathMatcher",
"addPrefixPath",
"(",
"final",
"String",
"path",
",",
"final",
"T",
"handler",
")",
"{",
"if",
"(",
"path",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"UndertowMessages",
".",
"MESSAGES",
".",
"pathMustBeSpecified",
... | Adds a path prefix and a handler for that path. If the path does not start
with a / then one will be prepended.
<p>
The match is done on a prefix bases, so registering /foo will also match /bar. Exact
path matches are taken into account first.
<p>
If / is specified as the path then it will replace the default handler.
... | [
"Adds",
"a",
"path",
"prefix",
"and",
"a",
"handler",
"for",
"that",
"path",
".",
"If",
"the",
"path",
"does",
"not",
"start",
"with",
"a",
"/",
"then",
"one",
"will",
"be",
"prepended",
".",
"<p",
">",
"The",
"match",
"is",
"done",
"on",
"a",
"pre... | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-undertow/src/main/java/org/ops4j/pax/web/service/undertow/internal/PathMatcher.java#L108-L140 |
liferay/com-liferay-commerce | commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java | CommercePaymentMethodGroupRelPersistenceImpl.removeByG_A | @Override
public void removeByG_A(long groupId, boolean active) {
"""
Removes all the commerce payment method group rels where groupId = ? and active = ? from the database.
@param groupId the group ID
@param active the active
"""
for (CommercePaymentMethodGroupRel commercePaymentMethodGroupRel :... | java | @Override
public void removeByG_A(long groupId, boolean active) {
for (CommercePaymentMethodGroupRel commercePaymentMethodGroupRel : findByG_A(
groupId, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commercePaymentMethodGroupRel);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_A",
"(",
"long",
"groupId",
",",
"boolean",
"active",
")",
"{",
"for",
"(",
"CommercePaymentMethodGroupRel",
"commercePaymentMethodGroupRel",
":",
"findByG_A",
"(",
"groupId",
",",
"active",
",",
"QueryUtil",
".",
"ALL... | Removes all the commerce payment method group rels where groupId = ? and active = ? from the database.
@param groupId the group ID
@param active the active | [
"Removes",
"all",
"the",
"commerce",
"payment",
"method",
"group",
"rels",
"where",
"groupId",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java#L1357-L1363 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.beginsWithUppercaseLetter | public static Validator<CharSequence> beginsWithUppercaseLetter(
@NonNull final Context context) {
"""
Creates and returns a validator, which allows to validate texts to ensure, that they begin
with an uppercase letter. Empty texts are also accepted.
@param context
The context, which should be use... | java | public static Validator<CharSequence> beginsWithUppercaseLetter(
@NonNull final Context context) {
return new BeginsWithUppercaseLetterValidator(context, R.string.default_error_message);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"beginsWithUppercaseLetter",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
")",
"{",
"return",
"new",
"BeginsWithUppercaseLetterValidator",
"(",
"context",
",",
"R",
".",
"string",
".",
"default_error_... | Creates and returns a validator, which allows to validate texts to ensure, that they begin
with an uppercase letter. Empty texts are also accepted.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be null
@return The valida... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"begin",
"with",
"an",
"uppercase",
"letter",
".",
"Empty",
"texts",
"are",
"also",
"accepted",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L823-L826 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/Seconds.java | Seconds.ofMinutes | public static Seconds ofMinutes(int minutes) {
"""
Obtains a {@code Seconds} representing the number of seconds
equivalent to a number of hours.
<p>
The resulting amount will be second-based, with the number of seconds
equal to the number of minutes multiplied by 60.
@param minutes the number of minutes, p... | java | public static Seconds ofMinutes(int minutes) {
if (minutes == 0) {
return ZERO;
}
return new Seconds(Math.multiplyExact(minutes, SECONDS_PER_MINUTE));
} | [
"public",
"static",
"Seconds",
"ofMinutes",
"(",
"int",
"minutes",
")",
"{",
"if",
"(",
"minutes",
"==",
"0",
")",
"{",
"return",
"ZERO",
";",
"}",
"return",
"new",
"Seconds",
"(",
"Math",
".",
"multiplyExact",
"(",
"minutes",
",",
"SECONDS_PER_MINUTE",
... | Obtains a {@code Seconds} representing the number of seconds
equivalent to a number of hours.
<p>
The resulting amount will be second-based, with the number of seconds
equal to the number of minutes multiplied by 60.
@param minutes the number of minutes, positive or negative
@return the amount with the input minutes ... | [
"Obtains",
"a",
"{",
"@code",
"Seconds",
"}",
"representing",
"the",
"number",
"of",
"seconds",
"equivalent",
"to",
"a",
"number",
"of",
"hours",
".",
"<p",
">",
"The",
"resulting",
"amount",
"will",
"be",
"second",
"-",
"based",
"with",
"the",
"number",
... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/Seconds.java#L156-L161 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.