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 |
|---|---|---|---|---|---|---|---|---|---|---|
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java | CSSColorHelper.getRGBAColorValue | @Nonnull
@Nonempty
public static String getRGBAColorValue (final int nRed, final int nGreen, final int nBlue, final float fOpacity) {
"""
Get the passed values as CSS RGBA color value
@param nRed
Red - is scaled to 0-255
@param nGreen
Green - is scaled to 0-255
@param nBlue
Blue - is scaled to 0-255
@... | java | @Nonnull
@Nonempty
public static String getRGBAColorValue (final int nRed, final int nGreen, final int nBlue, final float fOpacity)
{
return new StringBuilder (24).append (CCSSValue.PREFIX_RGBA_OPEN)
.append (getRGBValue (nRed))
.append (',')
... | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"String",
"getRGBAColorValue",
"(",
"final",
"int",
"nRed",
",",
"final",
"int",
"nGreen",
",",
"final",
"int",
"nBlue",
",",
"final",
"float",
"fOpacity",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
... | Get the passed values as CSS RGBA color value
@param nRed
Red - is scaled to 0-255
@param nGreen
Green - is scaled to 0-255
@param nBlue
Blue - is scaled to 0-255
@param fOpacity
Opacity to use - is scaled to 0-1.
@return The CSS string to use | [
"Get",
"the",
"passed",
"values",
"as",
"CSS",
"RGBA",
"color",
"value"
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java#L392-L406 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | container/runtime/src/main/java/org/wildfly/swarm/container/runtime/RuntimeServer.java | RuntimeServer.visitFractions | private <T> void visitFractions(Container container, T context, FractionProcessor<T> fn) {
"""
Wraps common iteration pattern over fraction and server configurations
@param container
@param context processing context (i.e. accumulator)
@param fn a {@link org.wildfly.swarm.container.runtime.RuntimeSer... | java | private <T> void visitFractions(Container container, T context, FractionProcessor<T> fn) {
OUTER:
for (ServerConfiguration eachConfig : this.configList) {
boolean found = false;
INNER:
for (Fraction eachFraction : container.fractions()) {
if (eachConfi... | [
"private",
"<",
"T",
">",
"void",
"visitFractions",
"(",
"Container",
"container",
",",
"T",
"context",
",",
"FractionProcessor",
"<",
"T",
">",
"fn",
")",
"{",
"OUTER",
":",
"for",
"(",
"ServerConfiguration",
"eachConfig",
":",
"this",
".",
"configList",
... | Wraps common iteration pattern over fraction and server configurations
@param container
@param context processing context (i.e. accumulator)
@param fn a {@link org.wildfly.swarm.container.runtime.RuntimeServer.FractionProcessor} instance | [
"Wraps",
"common",
"iteration",
"pattern",
"over",
"fraction",
"and",
"server",
"configurations"
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/container/runtime/src/main/java/org/wildfly/swarm/container/runtime/RuntimeServer.java#L577-L594 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getTimeInstance | static final public DateFormat getTimeInstance(Calendar cal, int timeStyle) {
"""
Creates a {@link DateFormat} object that can be used to format times in
the calendar system specified by <code>cal</code>.
@param cal The calendar system for which a time format is desired.
@param timeStyle The type of time fo... | java | static final public DateFormat getTimeInstance(Calendar cal, int timeStyle) {
return getTimeInstance(cal, timeStyle, ULocale.getDefault(Category.FORMAT));
} | [
"static",
"final",
"public",
"DateFormat",
"getTimeInstance",
"(",
"Calendar",
"cal",
",",
"int",
"timeStyle",
")",
"{",
"return",
"getTimeInstance",
"(",
"cal",
",",
"timeStyle",
",",
"ULocale",
".",
"getDefault",
"(",
"Category",
".",
"FORMAT",
")",
")",
"... | Creates a {@link DateFormat} object that can be used to format times in
the calendar system specified by <code>cal</code>.
@param cal The calendar system for which a time format is desired.
@param timeStyle The type of time format desired. This can be
{@link DateFormat#SHORT}, {@link DateFormat#MEDIUM},
etc.
@see ... | [
"Creates",
"a",
"{",
"@link",
"DateFormat",
"}",
"object",
"that",
"can",
"be",
"used",
"to",
"format",
"times",
"in",
"the",
"calendar",
"system",
"specified",
"by",
"<code",
">",
"cal<",
"/",
"code",
">",
".",
"@param",
"cal",
"The",
"calendar",
"syste... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1918-L1920 |
icode/ameba | src/main/java/ameba/message/internal/MessageHelper.java | MessageHelper.getHeaderString | public static String getHeaderString(MultivaluedMap<String, Object> headers, String name) {
"""
<p>getHeaderString.</p>
@param headers a {@link javax.ws.rs.core.MultivaluedMap} object.
@param name a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
return HeaderUtils.... | java | public static String getHeaderString(MultivaluedMap<String, Object> headers, String name) {
return HeaderUtils.asHeaderString(headers.get(name), RuntimeDelegate.getInstance());
} | [
"public",
"static",
"String",
"getHeaderString",
"(",
"MultivaluedMap",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"String",
"name",
")",
"{",
"return",
"HeaderUtils",
".",
"asHeaderString",
"(",
"headers",
".",
"get",
"(",
"name",
")",
",",
"Runtime... | <p>getHeaderString.</p>
@param headers a {@link javax.ws.rs.core.MultivaluedMap} object.
@param name a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"getHeaderString",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/MessageHelper.java#L77-L79 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java | FilterQuery.addRangeFilter | public <T> void addRangeFilter(String field, T minValue, T maxValue) {
"""
Alternative to filter, which accepts a range of items to filter.
For instance, the field might be a year, and minValue 2000 and maxValue 2009
this filter will return records between the supplied ranges (inclusive)
@param field
@param mi... | java | public <T> void addRangeFilter(String field, T minValue, T maxValue){
if(minValue instanceof String){
if(StringUtils.isEmpty(field) || StringUtils.isEmpty((String) minValue) || StringUtils.isEmpty((String) maxValue)){
throw new IllegalArgumentException("Expected all attributes to be ... | [
"public",
"<",
"T",
">",
"void",
"addRangeFilter",
"(",
"String",
"field",
",",
"T",
"minValue",
",",
"T",
"maxValue",
")",
"{",
"if",
"(",
"minValue",
"instanceof",
"String",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"field",
")",
"||",... | Alternative to filter, which accepts a range of items to filter.
For instance, the field might be a year, and minValue 2000 and maxValue 2009
this filter will return records between the supplied ranges (inclusive)
@param field
@param minValue
@param maxValue | [
"Alternative",
"to",
"filter",
"which",
"accepts",
"a",
"range",
"of",
"items",
"to",
"filter",
".",
"For",
"instance",
"the",
"field",
"might",
"be",
"a",
"year",
"and",
"minValue",
"2000",
"and",
"maxValue",
"2009",
"this",
"filter",
"will",
"return",
"r... | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java#L119-L131 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/singlefile/SingleFileJournalReader.java | SingleFileJournalReader.readJournalEntry | @Override
public synchronized ConsumerJournalEntry readJournalEntry()
throws JournalException, XMLStreamException {
"""
Advance past any white space, and then see whether we have any more
JournalEntry tags. If we don't, just return null.
"""
if (!open) {
return null;
... | java | @Override
public synchronized ConsumerJournalEntry readJournalEntry()
throws JournalException, XMLStreamException {
if (!open) {
return null;
}
if (!advancedPastHeader) {
advanceIntoFile();
advancedPastHeader = true;
}
XMLEven... | [
"@",
"Override",
"public",
"synchronized",
"ConsumerJournalEntry",
"readJournalEntry",
"(",
")",
"throws",
"JournalException",
",",
"XMLStreamException",
"{",
"if",
"(",
"!",
"open",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"advancedPastHeader",
")"... | Advance past any white space, and then see whether we have any more
JournalEntry tags. If we don't, just return null. | [
"Advance",
"past",
"any",
"white",
"space",
"and",
"then",
"see",
"whether",
"we",
"have",
"any",
"more",
"JournalEntry",
"tags",
".",
"If",
"we",
"don",
"t",
"just",
"return",
"null",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/singlefile/SingleFileJournalReader.java#L128-L159 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java | SparkUtils.writeObjectToFile | public static void writeObjectToFile(String path, Object toWrite, SparkContext sc) throws IOException {
"""
Write an object to HDFS (or local) using default Java object serialization
@param path Path to write the object to
@param toWrite Object to write
@param sc Spark context
"""
FileSyst... | java | public static void writeObjectToFile(String path, Object toWrite, SparkContext sc) throws IOException {
FileSystem fileSystem = FileSystem.get(sc.hadoopConfiguration());
try (BufferedOutputStream bos = new BufferedOutputStream(fileSystem.create(new Path(path)))) {
ObjectOutputStream oos = ne... | [
"public",
"static",
"void",
"writeObjectToFile",
"(",
"String",
"path",
",",
"Object",
"toWrite",
",",
"SparkContext",
"sc",
")",
"throws",
"IOException",
"{",
"FileSystem",
"fileSystem",
"=",
"FileSystem",
".",
"get",
"(",
"sc",
".",
"hadoopConfiguration",
"(",... | Write an object to HDFS (or local) using default Java object serialization
@param path Path to write the object to
@param toWrite Object to write
@param sc Spark context | [
"Write",
"an",
"object",
"to",
"HDFS",
"(",
"or",
"local",
")",
"using",
"default",
"Java",
"object",
"serialization"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java#L206-L212 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cdn/CdnClient.java | CdnClient.setDomainOrigin | public SetDomainOriginResponse setDomainOrigin(SetDomainOriginRequest request) {
"""
Update origin of specified domain acceleration.
@param request The request containing all of the options related to the domain.
@return Result of the setDomainOrigin operation returned by the service.
"""
checkNotN... | java | public SetDomainOriginResponse setDomainOrigin(SetDomainOriginRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), "config");
internalRequest.addParameter("... | [
"public",
"SetDomainOriginResponse",
"setDomainOrigin",
"(",
"SetDomainOriginRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"reques... | Update origin of specified domain acceleration.
@param request The request containing all of the options related to the domain.
@return Result of the setDomainOrigin operation returned by the service. | [
"Update",
"origin",
"of",
"specified",
"domain",
"acceleration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L318-L324 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java | MetadataCache.getCacheMediaDetails | private MediaDetails getCacheMediaDetails() throws IOException {
"""
Retrieves the details about the media from which a metadata cache was created, if available. This will only
return a non-{@code null} value for caches created by Beat Link 0.4.1 or later.
@return the details about the media from which the cac... | java | private MediaDetails getCacheMediaDetails() throws IOException {
ZipEntry zipEntry = zipFile.getEntry(CACHE_DETAILS_ENTRY);
if (zipEntry == null) {
return null; // No details available.
}
InputStream is = zipFile.getInputStream(zipEntry);
try {
DataInputS... | [
"private",
"MediaDetails",
"getCacheMediaDetails",
"(",
")",
"throws",
"IOException",
"{",
"ZipEntry",
"zipEntry",
"=",
"zipFile",
".",
"getEntry",
"(",
"CACHE_DETAILS_ENTRY",
")",
";",
"if",
"(",
"zipEntry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"// ... | Retrieves the details about the media from which a metadata cache was created, if available. This will only
return a non-{@code null} value for caches created by Beat Link 0.4.1 or later.
@return the details about the media from which the cache was created or {@code null} if unknown
@throws IOException if there is a ... | [
"Retrieves",
"the",
"details",
"about",
"the",
"media",
"from",
"which",
"a",
"metadata",
"cache",
"was",
"created",
"if",
"available",
".",
"This",
"will",
"only",
"return",
"a",
"non",
"-",
"{",
"@code",
"null",
"}",
"value",
"for",
"caches",
"created",
... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java#L477-L495 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/BaseAsset.java | BaseAsset.createLink | public Link createLink(String name, String url, boolean onMenu, Map<String, Object> attributes) {
"""
Create a link that belongs to this asset.
@param name The name of the link.
@param url The url of the link.
@param onMenu True if the link is visible on this asset's detail page
menu.
@para... | java | public Link createLink(String name, String url, boolean onMenu, Map<String, Object> attributes) {
return getInstance().create().link(name, this, url, onMenu, attributes);
} | [
"public",
"Link",
"createLink",
"(",
"String",
"name",
",",
"String",
"url",
",",
"boolean",
"onMenu",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"link",
"(",
... | Create a link that belongs to this asset.
@param name The name of the link.
@param url The url of the link.
@param onMenu True if the link is visible on this asset's detail page
menu.
@param attributes additional attributes for the Link.
@return created Link. | [
"Create",
"a",
"link",
"that",
"belongs",
"to",
"this",
"asset",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/BaseAsset.java#L227-L229 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java | Matrix.setMatrix | public void setMatrix(int i0, int i1, int[] c, Matrix X) {
"""
Set a submatrix.
@param i0 Initial row index
@param i1 Final row index
@param c Array of column indices.
@param X A(i0:i1,c(:))
@throws ArrayIndexOutOfBoundsException Submatrix indices
"""
try
{
for (int i = i0;... | java | public void setMatrix(int i0, int i1, int[] c, Matrix X)
{
try
{
for (int i = i0; i <= i1; i++)
{
for (int j = 0; j < c.length; j++)
{
A[i][c[j]] = X.get(i - i0, j);
}
}
}
catch (A... | [
"public",
"void",
"setMatrix",
"(",
"int",
"i0",
",",
"int",
"i1",
",",
"int",
"[",
"]",
"c",
",",
"Matrix",
"X",
")",
"{",
"try",
"{",
"for",
"(",
"int",
"i",
"=",
"i0",
";",
"i",
"<=",
"i1",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
... | Set a submatrix.
@param i0 Initial row index
@param i1 Final row index
@param c Array of column indices.
@param X A(i0:i1,c(:))
@throws ArrayIndexOutOfBoundsException Submatrix indices | [
"Set",
"a",
"submatrix",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L583-L599 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Image.java | Image.scaleAbsolute | public void scaleAbsolute(float newWidth, float newHeight) {
"""
Scale the image to an absolute width and an absolute height.
@param newWidth
the new width
@param newHeight
the new height
"""
plainWidth = newWidth;
plainHeight = newHeight;
float[] matrix = matrix();
scaledWidth = matrix[DX] - mat... | java | public void scaleAbsolute(float newWidth, float newHeight) {
plainWidth = newWidth;
plainHeight = newHeight;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
} | [
"public",
"void",
"scaleAbsolute",
"(",
"float",
"newWidth",
",",
"float",
"newHeight",
")",
"{",
"plainWidth",
"=",
"newWidth",
";",
"plainHeight",
"=",
"newHeight",
";",
"float",
"[",
"]",
"matrix",
"=",
"matrix",
"(",
")",
";",
"scaledWidth",
"=",
"matr... | Scale the image to an absolute width and an absolute height.
@param newWidth
the new width
@param newHeight
the new height | [
"Scale",
"the",
"image",
"to",
"an",
"absolute",
"width",
"and",
"an",
"absolute",
"height",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Image.java#L1241-L1248 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/Collections.java | Collections.anyIn | public static SatisfiesBuilder anyIn(String variable, Expression expression) {
"""
Create an ANY comprehension with a first IN range.
ANY is a range predicate that allows you to test a Boolean condition over the
elements or attributes of a collection, object, or objects. It uses the IN and WITHIN operators to ... | java | public static SatisfiesBuilder anyIn(String variable, Expression expression) {
return new SatisfiesBuilder(x("ANY"), variable, expression, true);
} | [
"public",
"static",
"SatisfiesBuilder",
"anyIn",
"(",
"String",
"variable",
",",
"Expression",
"expression",
")",
"{",
"return",
"new",
"SatisfiesBuilder",
"(",
"x",
"(",
"\"ANY\"",
")",
",",
"variable",
",",
"expression",
",",
"true",
")",
";",
"}"
] | Create an ANY comprehension with a first IN range.
ANY is a range predicate that allows you to test a Boolean condition over the
elements or attributes of a collection, object, or objects. It uses the IN and WITHIN operators to range through
the collection. IN ranges in the direct elements of its array expression, WIT... | [
"Create",
"an",
"ANY",
"comprehension",
"with",
"a",
"first",
"IN",
"range",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/Collections.java#L155-L157 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.extractTimeUnit | private TimeUnit extractTimeUnit(String name, String defaultValue) {
"""
Extracts the TimeUnit from the name.
@param name
@param defaultValue
@return the extracted TimeUnit
"""
String value = getString(name, defaultValue);
try {
final String[] s = value.split(" ", 2);
... | java | private TimeUnit extractTimeUnit(String name, String defaultValue) {
String value = getString(name, defaultValue);
try {
final String[] s = value.split(" ", 2);
return TimeUnit.valueOf(s[1].trim().toUpperCase());
} catch (Exception e) {
throw new PippoRuntimeE... | [
"private",
"TimeUnit",
"extractTimeUnit",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getString",
"(",
"name",
",",
"defaultValue",
")",
";",
"try",
"{",
"final",
"String",
"[",
"]",
"s",
"=",
"value",
".",
"s... | Extracts the TimeUnit from the name.
@param name
@param defaultValue
@return the extracted TimeUnit | [
"Extracts",
"the",
"TimeUnit",
"from",
"the",
"name",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L985-L993 |
javers/javers | javers-core/src/main/java/org/javers/common/properties/PropertyConfiguration.java | PropertyConfiguration.getEnumProperty | public <T extends Enum<T>> T getEnumProperty(String propertyKey, Class<T> enumType) {
"""
assembles mandatory enum property from {@link #properties} bag
@throws JaversException UNDEFINED_PROPERTY
@throws JaversException MALFORMED_PROPERTY
"""
return PropertiesUtil.getEnumProperty(properties, property... | java | public <T extends Enum<T>> T getEnumProperty(String propertyKey, Class<T> enumType) {
return PropertiesUtil.getEnumProperty(properties, propertyKey, enumType);
} | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnumProperty",
"(",
"String",
"propertyKey",
",",
"Class",
"<",
"T",
">",
"enumType",
")",
"{",
"return",
"PropertiesUtil",
".",
"getEnumProperty",
"(",
"properties",
",",
"propertyKey",
"... | assembles mandatory enum property from {@link #properties} bag
@throws JaversException UNDEFINED_PROPERTY
@throws JaversException MALFORMED_PROPERTY | [
"assembles",
"mandatory",
"enum",
"property",
"from",
"{"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/common/properties/PropertyConfiguration.java#L33-L35 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java | FieldScopeLogic.subScope | @Override
public final FieldScopeLogic subScope(
Descriptor rootDescriptor, FieldDescriptorOrUnknown fieldDescriptorOrUnknown) {
"""
Returns a {@code FieldScopeLogic} to handle the message pointed to by this descriptor.
<p>Subclasses which can return non-recursive {@link FieldScopeResult}s must override... | java | @Override
public final FieldScopeLogic subScope(
Descriptor rootDescriptor, FieldDescriptorOrUnknown fieldDescriptorOrUnknown) {
FieldScopeResult result = policyFor(rootDescriptor, fieldDescriptorOrUnknown);
if (result.recursive()) {
return result.included() ? all() : none();
} else {
re... | [
"@",
"Override",
"public",
"final",
"FieldScopeLogic",
"subScope",
"(",
"Descriptor",
"rootDescriptor",
",",
"FieldDescriptorOrUnknown",
"fieldDescriptorOrUnknown",
")",
"{",
"FieldScopeResult",
"result",
"=",
"policyFor",
"(",
"rootDescriptor",
",",
"fieldDescriptorOrUnkno... | Returns a {@code FieldScopeLogic} to handle the message pointed to by this descriptor.
<p>Subclasses which can return non-recursive {@link FieldScopeResult}s must override {@link
#subScopeImpl} to implement those cases. | [
"Returns",
"a",
"{",
"@code",
"FieldScopeLogic",
"}",
"to",
"handle",
"the",
"message",
"pointed",
"to",
"by",
"this",
"descriptor",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java#L66-L75 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsPushButton.java | CmsPushButton.setUpFace | public void setUpFace(String text, String imageClass) {
"""
Sets the up face text and image.<p>
@param text the up face text to set, set to <code>null</code> to not show any
@param imageClass the up face image class to use, set to <code>null</code> to not show any
"""
m_text = text;
m_imag... | java | public void setUpFace(String text, String imageClass) {
m_text = text;
m_imageClass = imageClass;
getUpFace().setHTML(getFaceHtml(text, imageClass));
} | [
"public",
"void",
"setUpFace",
"(",
"String",
"text",
",",
"String",
"imageClass",
")",
"{",
"m_text",
"=",
"text",
";",
"m_imageClass",
"=",
"imageClass",
";",
"getUpFace",
"(",
")",
".",
"setHTML",
"(",
"getFaceHtml",
"(",
"text",
",",
"imageClass",
")",... | Sets the up face text and image.<p>
@param text the up face text to set, set to <code>null</code> to not show any
@param imageClass the up face image class to use, set to <code>null</code> to not show any | [
"Sets",
"the",
"up",
"face",
"text",
"and",
"image",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsPushButton.java#L411-L416 |
UrielCh/ovh-java-sdk | ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java | ApiOvhSupport.tickets_ticketId_score_POST | public void tickets_ticketId_score_POST(Long ticketId, String score, String scoreComment) throws IOException {
"""
Set ticket score
REST: POST /support/tickets/{ticketId}/score
@param ticketId [required] internal ticket identifier
@param scoreComment [required] ticket comment about the score
@param score [re... | java | public void tickets_ticketId_score_POST(Long ticketId, String score, String scoreComment) throws IOException {
String qPath = "/support/tickets/{ticketId}/score";
StringBuilder sb = path(qPath, ticketId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "score", score);
addBody(o, "scoreCo... | [
"public",
"void",
"tickets_ticketId_score_POST",
"(",
"Long",
"ticketId",
",",
"String",
"score",
",",
"String",
"scoreComment",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/support/tickets/{ticketId}/score\"",
";",
"StringBuilder",
"sb",
"=",
"path"... | Set ticket score
REST: POST /support/tickets/{ticketId}/score
@param ticketId [required] internal ticket identifier
@param scoreComment [required] ticket comment about the score
@param score [required] ticket score | [
"Set",
"ticket",
"score"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java#L119-L126 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java | HazelcastInstanceFactory.getInstanceName | public static String getInstanceName(String instanceName, Config config) {
"""
Return real name for the hazelcast instance's instance
@param instanceName - template of the name
@param config - config
@return - real hazelcast instance's name
"""
String name = instanceName;
if (n... | java | public static String getInstanceName(String instanceName, Config config) {
String name = instanceName;
if (name == null || name.trim().length() == 0) {
name = createInstanceName(config);
}
return name;
} | [
"public",
"static",
"String",
"getInstanceName",
"(",
"String",
"instanceName",
",",
"Config",
"config",
")",
"{",
"String",
"name",
"=",
"instanceName",
";",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
... | Return real name for the hazelcast instance's instance
@param instanceName - template of the name
@param config - config
@return - real hazelcast instance's name | [
"Return",
"real",
"name",
"for",
"the",
"hazelcast",
"instance",
"s",
"instance"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java#L175-L183 |
Netflix/netflix-commons | netflix-eventbus/src/main/java/com/netflix/eventbus/impl/EventBusImpl.java | EventBusImpl.findEventConsumerForSubscriberMethod | private EventConsumer findEventConsumerForSubscriberMethod(SubscriberInfo subscriberInfo, String callDescription) {
"""
Finds the {@link EventConsumer} instance registered with this event bus, for the passed <code>subscriberMethod</code>
@param subscriberInfo Subscriber information.
@param callDescription Desc... | java | private EventConsumer findEventConsumerForSubscriberMethod(SubscriberInfo subscriberInfo, String callDescription) {
Method subscriberMethod = subscriberInfo.getSubscriberMethod();
Subscribe subscribeAnnotation = subscriberMethod.getAnnotation(Subscribe.class);
if (null == subscribeAnnotation) {
... | [
"private",
"EventConsumer",
"findEventConsumerForSubscriberMethod",
"(",
"SubscriberInfo",
"subscriberInfo",
",",
"String",
"callDescription",
")",
"{",
"Method",
"subscriberMethod",
"=",
"subscriberInfo",
".",
"getSubscriberMethod",
"(",
")",
";",
"Subscribe",
"subscribeAn... | Finds the {@link EventConsumer} instance registered with this event bus, for the passed <code>subscriberMethod</code>
@param subscriberInfo Subscriber information.
@param callDescription Description of the original call for which this method is invoked. This is used for
logging.
@return The {@link EventConsumer} inst... | [
"Finds",
"the",
"{",
"@link",
"EventConsumer",
"}",
"instance",
"registered",
"with",
"this",
"event",
"bus",
"for",
"the",
"passed",
"<code",
">",
"subscriberMethod<",
"/",
"code",
">"
] | train | https://github.com/Netflix/netflix-commons/blob/7a158af76906d4a9b753e9344ce3e7abeb91dc01/netflix-eventbus/src/main/java/com/netflix/eventbus/impl/EventBusImpl.java#L511-L532 |
haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTUtil.java | PICTUtil.readPascalString | public static String readPascalString(final DataInput pStream) throws IOException {
"""
Reads a Pascal String from the given stream.
The input stream must be positioned at the length byte of the text,
which can thus be a maximum of 255 characters long.
@param pStream the input stream
@return the text read
... | java | public static String readPascalString(final DataInput pStream) throws IOException {
// Get as many bytes as indicated by byte count
int length = pStream.readUnsignedByte();
byte[] bytes = new byte[length];
pStream.readFully(bytes, 0, length);
return new String(bytes, ENCODING);... | [
"public",
"static",
"String",
"readPascalString",
"(",
"final",
"DataInput",
"pStream",
")",
"throws",
"IOException",
"{",
"// Get as many bytes as indicated by byte count",
"int",
"length",
"=",
"pStream",
".",
"readUnsignedByte",
"(",
")",
";",
"byte",
"[",
"]",
"... | Reads a Pascal String from the given stream.
The input stream must be positioned at the length byte of the text,
which can thus be a maximum of 255 characters long.
@param pStream the input stream
@return the text read
@throws IOException if an I/O exception occurs during reading | [
"Reads",
"a",
"Pascal",
"String",
"from",
"the",
"given",
"stream",
".",
"The",
"input",
"stream",
"must",
"be",
"positioned",
"at",
"the",
"length",
"byte",
"of",
"the",
"text",
"which",
"can",
"thus",
"be",
"a",
"maximum",
"of",
"255",
"characters",
"l... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTUtil.java#L126-L134 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/Muxer.java | Muxer.getNextRelativePts | protected long getNextRelativePts(long absPts, int trackIndex) {
"""
Return a relative pts given an absolute pts and trackIndex.
This method advances the state of the Muxer, and must only
be called once per call to {@link #writeSampleData(android.media.MediaCodec, int, int, java.nio.ByteBuffer, android.media.M... | java | protected long getNextRelativePts(long absPts, int trackIndex) {
if (mFirstPts == 0) {
mFirstPts = absPts;
return 0;
}
return getSafePts(absPts - mFirstPts, trackIndex);
} | [
"protected",
"long",
"getNextRelativePts",
"(",
"long",
"absPts",
",",
"int",
"trackIndex",
")",
"{",
"if",
"(",
"mFirstPts",
"==",
"0",
")",
"{",
"mFirstPts",
"=",
"absPts",
";",
"return",
"0",
";",
"}",
"return",
"getSafePts",
"(",
"absPts",
"-",
"mFir... | Return a relative pts given an absolute pts and trackIndex.
This method advances the state of the Muxer, and must only
be called once per call to {@link #writeSampleData(android.media.MediaCodec, int, int, java.nio.ByteBuffer, android.media.MediaCodec.BufferInfo)}. | [
"Return",
"a",
"relative",
"pts",
"given",
"an",
"absolute",
"pts",
"and",
"trackIndex",
"."
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/Muxer.java#L164-L170 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.deletePatternsAsync | public Observable<OperationStatus> deletePatternsAsync(UUID appId, String versionId, List<UUID> patternIds) {
"""
Deletes the patterns with the specified IDs.
@param appId The application ID.
@param versionId The version ID.
@param patternIds The patterns IDs.
@throws IllegalArgumentException thrown if param... | java | public Observable<OperationStatus> deletePatternsAsync(UUID appId, String versionId, List<UUID> patternIds) {
return deletePatternsWithServiceResponseAsync(appId, versionId, patternIds).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public OperationStatus ... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deletePatternsAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"UUID",
">",
"patternIds",
")",
"{",
"return",
"deletePatternsWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
... | Deletes the patterns with the specified IDs.
@param appId The application ID.
@param versionId The version ID.
@param patternIds The patterns IDs.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Deletes",
"the",
"patterns",
"with",
"the",
"specified",
"IDs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java#L595-L602 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.setUsersOrganizationalUnit | public void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user)
throws CmsException {
"""
Moves an user to the given organizational unit.<p>
@param dbc the current db context
@param orgUnit the organizational unit to add the resource to
@param user the user that is to... | java | public void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user)
throws CmsException {
if (!getGroupsOfUser(dbc, user.getName(), false).isEmpty()) {
throw new CmsDbConsistencyException(
Messages.get().container(Messages.ERR_ORGUNIT_MOVE_USER_... | [
"public",
"void",
"setUsersOrganizationalUnit",
"(",
"CmsDbContext",
"dbc",
",",
"CmsOrganizationalUnit",
"orgUnit",
",",
"CmsUser",
"user",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"!",
"getGroupsOfUser",
"(",
"dbc",
",",
"user",
".",
"getName",
"(",
")",... | Moves an user to the given organizational unit.<p>
@param dbc the current db context
@param orgUnit the organizational unit to add the resource to
@param user the user that is to be moved to the organizational unit
@throws CmsException if something goes wrong
@see org.opencms.security.CmsOrgUnitManager#setUsersOrgan... | [
"Moves",
"an",
"user",
"to",
"the",
"given",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9038-L9061 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeResultEntry | protected void writeResultEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
"""
Write query result whether successful or not.
<p>default: Success: True,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@sinc... | java | protected void writeResultEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Success:");
sb.append(execInfo.isSuccess() ? "True" : "False");
sb.append(", ");
} | [
"protected",
"void",
"writeResultEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"Success:\"",
")",
";",
"sb",
".",
"append",
"(",
"execInfo",
".... | Write query result whether successful or not.
<p>default: Success: True,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"query",
"result",
"whether",
"successful",
"or",
"not",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L142-L146 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/DownloadCallable.java | DownloadCallable.truncateDestinationFileIfNecessary | private void truncateDestinationFileIfNecessary() {
"""
If only partial part object is merged into the dstFile(due to pause
operation), adjust the file length so that the part starts writing from
the correct position.
"""
RandomAccessFile raf = null;
if (!FileLocks.lock(dstfile)) {
... | java | private void truncateDestinationFileIfNecessary() {
RandomAccessFile raf = null;
if (!FileLocks.lock(dstfile)) {
throw new FileLockException("Fail to lock " + dstfile);
}
try {
raf = new RandomAccessFile(dstfile, "rw");
if (lastFullyMergedPartNumber =... | [
"private",
"void",
"truncateDestinationFileIfNecessary",
"(",
")",
"{",
"RandomAccessFile",
"raf",
"=",
"null",
";",
"if",
"(",
"!",
"FileLocks",
".",
"lock",
"(",
"dstfile",
")",
")",
"{",
"throw",
"new",
"FileLockException",
"(",
"\"Fail to lock \"",
"+",
"d... | If only partial part object is merged into the dstFile(due to pause
operation), adjust the file length so that the part starts writing from
the correct position. | [
"If",
"only",
"partial",
"part",
"object",
"is",
"merged",
"into",
"the",
"dstFile",
"(",
"due",
"to",
"pause",
"operation",
")",
"adjust",
"the",
"file",
"length",
"so",
"that",
"the",
"part",
"starts",
"writing",
"from",
"the",
"correct",
"position",
"."... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/DownloadCallable.java#L190-L215 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2/CloudTasksClient.java | CloudTasksClient.updateQueue | public final Queue updateQueue(Queue queue, FieldMask updateMask) {
"""
Updates a queue.
<p>This method creates the queue if it does not exist and updates the queue if it does exist.
<p>Queues created with this method allow tasks to live for a maximum of 31 days. After a task
is 31 days old, the task will b... | java | public final Queue updateQueue(Queue queue, FieldMask updateMask) {
UpdateQueueRequest request =
UpdateQueueRequest.newBuilder().setQueue(queue).setUpdateMask(updateMask).build();
return updateQueue(request);
} | [
"public",
"final",
"Queue",
"updateQueue",
"(",
"Queue",
"queue",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateQueueRequest",
"request",
"=",
"UpdateQueueRequest",
".",
"newBuilder",
"(",
")",
".",
"setQueue",
"(",
"queue",
")",
".",
"setUpdateMask",
"(",
... | Updates a queue.
<p>This method creates the queue if it does not exist and updates the queue if it does exist.
<p>Queues created with this method allow tasks to live for a maximum of 31 days. After a task
is 31 days old, the task will be deleted regardless of whether it was dispatched or not.
<p>WARNING: Using this ... | [
"Updates",
"a",
"queue",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2/CloudTasksClient.java#L572-L577 |
TheHortonMachine/hortonmachine | modules/src/main/java/org/hortonmachine/modules/Raster.java | Raster.setValueAt | public void setValueAt( int col, int row, double value ) {
"""
Sets a raster value if the raster is writable.
@param col
@param row
@param value
"""
if (makeNew) {
if (isInRaster(col, row)) {
((WritableRandomIter) iter).setSample(col, row, 0, value);
} else ... | java | public void setValueAt( int col, int row, double value ) {
if (makeNew) {
if (isInRaster(col, row)) {
((WritableRandomIter) iter).setSample(col, row, 0, value);
} else {
throw new RuntimeException("Setting value outside of raster.");
}
... | [
"public",
"void",
"setValueAt",
"(",
"int",
"col",
",",
"int",
"row",
",",
"double",
"value",
")",
"{",
"if",
"(",
"makeNew",
")",
"{",
"if",
"(",
"isInRaster",
"(",
"col",
",",
"row",
")",
")",
"{",
"(",
"(",
"WritableRandomIter",
")",
"iter",
")"... | Sets a raster value if the raster is writable.
@param col
@param row
@param value | [
"Sets",
"a",
"raster",
"value",
"if",
"the",
"raster",
"is",
"writable",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/modules/src/main/java/org/hortonmachine/modules/Raster.java#L282-L292 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tools/ContextTools.java | ContextTools.getPlainTextContext | public String getPlainTextContext(int fromPos, int toPos, String contents) {
"""
Get a plain text context that uses {@code ^} characters in a new line as a marker of the
given string region. Ignores {@link #setEscapeHtml(boolean)}.
@since 2.3
"""
String text = contents.replace('\n', ' ').replace('\r', ' ... | java | public String getPlainTextContext(int fromPos, int toPos, String contents) {
String text = contents.replace('\n', ' ').replace('\r', ' ').replace('\t', ' ');
// calculate context region:
int startContent = fromPos - contextSize;
String prefix = "...";
String postfix = "...";
String markerPrefix ... | [
"public",
"String",
"getPlainTextContext",
"(",
"int",
"fromPos",
",",
"int",
"toPos",
",",
"String",
"contents",
")",
"{",
"String",
"text",
"=",
"contents",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
".",
"replace",
"(",
"'",
"'",
",",
"'",... | Get a plain text context that uses {@code ^} characters in a new line as a marker of the
given string region. Ignores {@link #setEscapeHtml(boolean)}.
@since 2.3 | [
"Get",
"a",
"plain",
"text",
"context",
"that",
"uses",
"{"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tools/ContextTools.java#L83-L103 |
igniterealtime/REST-API-Client | src/main/java/org/igniterealtime/restclient/RestApiClient.java | RestApiClient.getChatRooms | public MUCRoomEntities getChatRooms(Map<String, String> queryParams) {
"""
Gets the chat rooms.
@param queryParams
the query params
@return the chat rooms
"""
return restClient.get("chatrooms", MUCRoomEntities.class, queryParams);
} | java | public MUCRoomEntities getChatRooms(Map<String, String> queryParams) {
return restClient.get("chatrooms", MUCRoomEntities.class, queryParams);
} | [
"public",
"MUCRoomEntities",
"getChatRooms",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"queryParams",
")",
"{",
"return",
"restClient",
".",
"get",
"(",
"\"chatrooms\"",
",",
"MUCRoomEntities",
".",
"class",
",",
"queryParams",
")",
";",
"}"
] | Gets the chat rooms.
@param queryParams
the query params
@return the chat rooms | [
"Gets",
"the",
"chat",
"rooms",
"."
] | train | https://github.com/igniterealtime/REST-API-Client/blob/fd544dd770ec2ababa47fef51579522ddce09f05/src/main/java/org/igniterealtime/restclient/RestApiClient.java#L179-L181 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_route_routeId_DELETE | public void serviceName_tcp_route_routeId_DELETE(String serviceName, Long routeId) throws IOException {
"""
Delete this TCP route
REST: DELETE /ipLoadbalancing/{serviceName}/tcp/route/{routeId}
@param serviceName [required] The internal name of your IP load balancing
@param routeId [required] Id of your route... | java | public void serviceName_tcp_route_routeId_DELETE(String serviceName, Long routeId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/route/{routeId}";
StringBuilder sb = path(qPath, serviceName, routeId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_tcp_route_routeId_DELETE",
"(",
"String",
"serviceName",
",",
"Long",
"routeId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/tcp/route/{routeId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(... | Delete this TCP route
REST: DELETE /ipLoadbalancing/{serviceName}/tcp/route/{routeId}
@param serviceName [required] The internal name of your IP load balancing
@param routeId [required] Id of your route | [
"Delete",
"this",
"TCP",
"route"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1334-L1338 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingnewssearch/src/main/java/com/microsoft/azure/cognitiveservices/search/newssearch/implementation/BingNewsImpl.java | BingNewsImpl.searchAsync | public Observable<NewsModel> searchAsync(String query, SearchOptionalParameter searchOptionalParameter) {
"""
The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers th... | java | public Observable<NewsModel> searchAsync(String query, SearchOptionalParameter searchOptionalParameter) {
return searchWithServiceResponseAsync(query, searchOptionalParameter).map(new Func1<ServiceResponse<NewsModel>, NewsModel>() {
@Override
public NewsModel call(ServiceResponse<NewsMod... | [
"public",
"Observable",
"<",
"NewsModel",
">",
"searchAsync",
"(",
"String",
"query",
",",
"SearchOptionalParameter",
"searchOptionalParameter",
")",
"{",
"return",
"searchWithServiceResponseAsync",
"(",
"query",
",",
"searchOptionalParameter",
")",
".",
"map",
"(",
"... | The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make req... | [
"The",
"News",
"Search",
"API",
"lets",
"you",
"send",
"a",
"search",
"query",
"to",
"Bing",
"and",
"get",
"back",
"a",
"list",
"of",
"news",
"that",
"are",
"relevant",
"to",
"the",
"search",
"query",
".",
"This",
"section",
"provides",
"technical",
"det... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingnewssearch/src/main/java/com/microsoft/azure/cognitiveservices/search/newssearch/implementation/BingNewsImpl.java#L112-L119 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java | Settings.getString | @CheckForNull
public String getString(String key) {
"""
The effective value of the specified property. Can return
{@code null} if the property is not set and has no
defined default value.
<p>
If the property is encrypted with a secret key,
then the returned value is decrypted.
</p>
@throws IllegalStateE... | java | @CheckForNull
public String getString(String key) {
String effectiveKey = definitions.validKey(key);
Optional<String> value = getRawString(effectiveKey);
if (!value.isPresent()) {
// default values cannot be encrypted, so return value as-is.
return getDefaultValue(effectiveKey);
}
if (... | [
"@",
"CheckForNull",
"public",
"String",
"getString",
"(",
"String",
"key",
")",
"{",
"String",
"effectiveKey",
"=",
"definitions",
".",
"validKey",
"(",
"key",
")",
";",
"Optional",
"<",
"String",
">",
"value",
"=",
"getRawString",
"(",
"effectiveKey",
")",... | The effective value of the specified property. Can return
{@code null} if the property is not set and has no
defined default value.
<p>
If the property is encrypted with a secret key,
then the returned value is decrypted.
</p>
@throws IllegalStateException if value is encrypted but fails to be decrypted. | [
"The",
"effective",
"value",
"of",
"the",
"specified",
"property",
".",
"Can",
"return",
"{",
"@code",
"null",
"}",
"if",
"the",
"property",
"is",
"not",
"set",
"and",
"has",
"no",
"defined",
"default",
"value",
".",
"<p",
">",
"If",
"the",
"property",
... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java#L142-L158 |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/antlr/RecognizerErrorHandler.java | RecognizerErrorHandler.getErrorMessage | public static String getErrorMessage(
final Logger log,
final BaseRecognizer recognizer,
final RecognitionException e,
final String superMessage,
final String[] tokenNames) {
"""
Format an error message as expected by ANTLR. It is basically the
same erro... | java | public static String getErrorMessage(
final Logger log,
final BaseRecognizer recognizer,
final RecognitionException e,
final String superMessage,
final String[] tokenNames) {
if (log.isDebugEnabled()) {
List < ? > stack = BaseRecognizer.get... | [
"public",
"static",
"String",
"getErrorMessage",
"(",
"final",
"Logger",
"log",
",",
"final",
"BaseRecognizer",
"recognizer",
",",
"final",
"RecognitionException",
"e",
",",
"final",
"String",
"superMessage",
",",
"final",
"String",
"[",
"]",
"tokenNames",
")",
... | Format an error message as expected by ANTLR. It is basically the
same error message that ANTL BaseRecognizer generates with some
additional data.
Also used to log debugging information.
@param log the logger to use at debug time
@param recognizer the lexer or parser who generated the error
@param e the exception that ... | [
"Format",
"an",
"error",
"message",
"as",
"expected",
"by",
"ANTLR",
".",
"It",
"is",
"basically",
"the",
"same",
"error",
"message",
"that",
"ANTL",
"BaseRecognizer",
"generates",
"with",
"some",
"additional",
"data",
".",
"Also",
"used",
"to",
"log",
"debu... | train | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/antlr/RecognizerErrorHandler.java#L51-L82 |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBufferAccessor.java | SharedBufferAccessor.removeNode | private void removeNode(NodeId node, SharedBufferNode sharedBufferNode) throws Exception {
"""
Removes the {@code SharedBufferNode}, when the ref is decreased to zero, and also
decrease the ref of the edge on this node.
@param node id of the entry
@param sharedBufferNode the node body to be removed
@throws E... | java | private void removeNode(NodeId node, SharedBufferNode sharedBufferNode) throws Exception {
sharedBuffer.removeEntry(node);
EventId eventId = node.getEventId();
releaseEvent(eventId);
for (SharedBufferEdge sharedBufferEdge : sharedBufferNode.getEdges()) {
releaseNode(sharedBufferEdge.getTarget());
}
} | [
"private",
"void",
"removeNode",
"(",
"NodeId",
"node",
",",
"SharedBufferNode",
"sharedBufferNode",
")",
"throws",
"Exception",
"{",
"sharedBuffer",
".",
"removeEntry",
"(",
"node",
")",
";",
"EventId",
"eventId",
"=",
"node",
".",
"getEventId",
"(",
")",
";"... | Removes the {@code SharedBufferNode}, when the ref is decreased to zero, and also
decrease the ref of the edge on this node.
@param node id of the entry
@param sharedBufferNode the node body to be removed
@throws Exception Thrown if the system cannot access the state. | [
"Removes",
"the",
"{",
"@code",
"SharedBufferNode",
"}",
"when",
"the",
"ref",
"is",
"decreased",
"to",
"zero",
"and",
"also",
"decrease",
"the",
"ref",
"of",
"the",
"edge",
"on",
"this",
"node",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBufferAccessor.java#L256-L264 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.shiftingWindowAveragingLong | public static DoubleStream shiftingWindowAveragingLong(LongStream longStream, int rollingFactor) {
"""
<p>Generates a stream that is computed from a provided long stream by first rolling it in the same
way as the <code>roll()</code> method does. The average is then computed on each substream, to
form the final d... | java | public static DoubleStream shiftingWindowAveragingLong(LongStream longStream, int rollingFactor) {
Objects.requireNonNull(longStream);
RollingOfLongSpliterator ofLongSpliterator = RollingOfLongSpliterator.of(longStream.spliterator(), rollingFactor);
return StreamSupport.stream(ofLongSpliterator... | [
"public",
"static",
"DoubleStream",
"shiftingWindowAveragingLong",
"(",
"LongStream",
"longStream",
",",
"int",
"rollingFactor",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"longStream",
")",
";",
"RollingOfLongSpliterator",
"ofLongSpliterator",
"=",
"RollingOfLongSp... | <p>Generates a stream that is computed from a provided long stream by first rolling it in the same
way as the <code>roll()</code> method does. The average is then computed on each substream, to
form the final double stream. No boxing / unboxing is conducted in the process.
<p>The resulting stream has the same number of... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"is",
"computed",
"from",
"a",
"provided",
"long",
"stream",
"by",
"first",
"rolling",
"it",
"in",
"the",
"same",
"way",
"as",
"the",
"<code",
">",
"roll",
"()",
"<",
"/",
"code",
">",
"method",
"does",
... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L626-L633 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java | HttpRequestHandler.handleGetRequest | public JSONAware handleGetRequest(String pUri, String pPathInfo, Map<String, String[]> pParameterMap) {
"""
Handle a GET request
@param pUri URI leading to this request
@param pPathInfo path of the request
@param pParameterMap parameters of the GET request @return the response
"""
String pathInfo... | java | public JSONAware handleGetRequest(String pUri, String pPathInfo, Map<String, String[]> pParameterMap) {
String pathInfo = extractPathInfo(pUri, pPathInfo);
JmxRequest jmxReq =
JmxRequestFactory.createGetRequest(pathInfo,getProcessingParameter(pParameterMap));
if (backendManager... | [
"public",
"JSONAware",
"handleGetRequest",
"(",
"String",
"pUri",
",",
"String",
"pPathInfo",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"pParameterMap",
")",
"{",
"String",
"pathInfo",
"=",
"extractPathInfo",
"(",
"pUri",
",",
"pPathInfo",
")"... | Handle a GET request
@param pUri URI leading to this request
@param pPathInfo path of the request
@param pParameterMap parameters of the GET request @return the response | [
"Handle",
"a",
"GET",
"request"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L75-L87 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/SimpleAttributeDefinition.java | SimpleAttributeDefinition.parseAndSetParameter | public void parseAndSetParameter(final String value, final ModelNode operation, final XMLStreamReader reader) throws XMLStreamException {
"""
Creates a {@link ModelNode} using the given {@code value} after first validating the node
against {@link #getValidator() this object's validator}, and then stores it in the... | java | public void parseAndSetParameter(final String value, final ModelNode operation, final XMLStreamReader reader) throws XMLStreamException {
ModelNode paramVal = parse(value, reader);
operation.get(getName()).set(paramVal);
} | [
"public",
"void",
"parseAndSetParameter",
"(",
"final",
"String",
"value",
",",
"final",
"ModelNode",
"operation",
",",
"final",
"XMLStreamReader",
"reader",
")",
"throws",
"XMLStreamException",
"{",
"ModelNode",
"paramVal",
"=",
"parse",
"(",
"value",
",",
"reade... | Creates a {@link ModelNode} using the given {@code value} after first validating the node
against {@link #getValidator() this object's validator}, and then stores it in the given {@code operation}
model node as a key/value pair whose key is this attribute's {@link #getName() name}.
<p>
If {@code value} is {@code null} ... | [
"Creates",
"a",
"{",
"@link",
"ModelNode",
"}",
"using",
"the",
"given",
"{",
"@code",
"value",
"}",
"after",
"first",
"validating",
"the",
"node",
"against",
"{",
"@link",
"#getValidator",
"()",
"this",
"object",
"s",
"validator",
"}",
"and",
"then",
"sto... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/SimpleAttributeDefinition.java#L116-L119 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.sqlProjection | protected void sqlProjection(String sql, List<String> columnAliases, List<Type> types) {
"""
Adds a sql projection to the criteria
@param sql SQL projecting
@param columnAliases List of column aliases for the projected values
@param types List of types for the projected values
"""
projectionList.a... | java | protected void sqlProjection(String sql, List<String> columnAliases, List<Type> types) {
projectionList.add(Projections.sqlProjection(sql, columnAliases.toArray(new String[columnAliases.size()]), types.toArray(new Type[types.size()])));
} | [
"protected",
"void",
"sqlProjection",
"(",
"String",
"sql",
",",
"List",
"<",
"String",
">",
"columnAliases",
",",
"List",
"<",
"Type",
">",
"types",
")",
"{",
"projectionList",
".",
"add",
"(",
"Projections",
".",
"sqlProjection",
"(",
"sql",
",",
"column... | Adds a sql projection to the criteria
@param sql SQL projecting
@param columnAliases List of column aliases for the projected values
@param types List of types for the projected values | [
"Adds",
"a",
"sql",
"projection",
"to",
"the",
"criteria"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L174-L176 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/live/internal/MeetMeManager.java | MeetMeManager.getOrCreateRoomImpl | MeetMeRoomImpl getOrCreateRoomImpl(String roomNumber) {
"""
Returns the room with the given number or creates a new one if none is
there yet.
@param roomNumber number of the room to get or create.
@return the room with the given number.
"""
MeetMeRoomImpl room;
boolean created = false;
... | java | MeetMeRoomImpl getOrCreateRoomImpl(String roomNumber)
{
MeetMeRoomImpl room;
boolean created = false;
synchronized (rooms)
{
room = rooms.get(roomNumber);
if (room == null)
{
room = new MeetMeRoomImpl(server, roomNumber);
... | [
"MeetMeRoomImpl",
"getOrCreateRoomImpl",
"(",
"String",
"roomNumber",
")",
"{",
"MeetMeRoomImpl",
"room",
";",
"boolean",
"created",
"=",
"false",
";",
"synchronized",
"(",
"rooms",
")",
"{",
"room",
"=",
"rooms",
".",
"get",
"(",
"roomNumber",
")",
";",
"if... | Returns the room with the given number or creates a new one if none is
there yet.
@param roomNumber number of the room to get or create.
@return the room with the given number. | [
"Returns",
"the",
"room",
"with",
"the",
"given",
"number",
"or",
"creates",
"a",
"new",
"one",
"if",
"none",
"is",
"there",
"yet",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/live/internal/MeetMeManager.java#L378-L401 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.createFileBase64 | public static <T extends File> T createFileBase64(final SecurityContext securityContext, final String rawData, final Class<T> t) throws FrameworkException, IOException {
"""
Create a new image node from image data encoded in base64 format.
If the given string is an uuid of an existing file, transform it into
t... | java | public static <T extends File> T createFileBase64(final SecurityContext securityContext, final String rawData, final Class<T> t) throws FrameworkException, IOException {
Base64URIData uriData = new Base64URIData(rawData);
return createFile(securityContext, uriData.getBinaryData(), uriData.getContentType(), t);
... | [
"public",
"static",
"<",
"T",
"extends",
"File",
">",
"T",
"createFileBase64",
"(",
"final",
"SecurityContext",
"securityContext",
",",
"final",
"String",
"rawData",
",",
"final",
"Class",
"<",
"T",
">",
"t",
")",
"throws",
"FrameworkException",
",",
"IOExcept... | Create a new image node from image data encoded in base64 format.
If the given string is an uuid of an existing file, transform it into
the target class.
@param <T>
@param securityContext
@param rawData
@param t defaults to File.class if null
@return file
@throws FrameworkException
@throws IOException | [
"Create",
"a",
"new",
"image",
"node",
"from",
"image",
"data",
"encoded",
"in",
"base64",
"format",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L110-L116 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBaseToolbar.java | JBaseToolbar.init | public void init(Object parent, Object record) {
"""
Constructor.
@param parent The parent screen.
@param record (null for a toolbar).
"""
super.init(parent, record);
this.setOpaque(false);
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
this.addButtons();
} | java | public void init(Object parent, Object record)
{
super.init(parent, record);
this.setOpaque(false);
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
this.addButtons();
} | [
"public",
"void",
"init",
"(",
"Object",
"parent",
",",
"Object",
"record",
")",
"{",
"super",
".",
"init",
"(",
"parent",
",",
"record",
")",
";",
"this",
".",
"setOpaque",
"(",
"false",
")",
";",
"this",
".",
"setLayout",
"(",
"new",
"BoxLayout",
"... | Constructor.
@param parent The parent screen.
@param record (null for a toolbar). | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBaseToolbar.java#L48-L54 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/parser/GosuParserFactoryImpl.java | GosuParserFactoryImpl.createParser | public IGosuParser createParser(
ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint ) {
"""
Creates an IGosuParser appropriate for parsing and executing Gosu.
@param symTable The symbol table the parser uses to parse and execute script.
@return A parser appropriate for parsing G... | java | public IGosuParser createParser(
ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint )
{
IGosuParser parser = new GosuParser( symTable, scriptabilityConstraint );
return parser;
} | [
"public",
"IGosuParser",
"createParser",
"(",
"ISymbolTable",
"symTable",
",",
"IScriptabilityModifier",
"scriptabilityConstraint",
")",
"{",
"IGosuParser",
"parser",
"=",
"new",
"GosuParser",
"(",
"symTable",
",",
"scriptabilityConstraint",
")",
";",
"return",
"parser"... | Creates an IGosuParser appropriate for parsing and executing Gosu.
@param symTable The symbol table the parser uses to parse and execute script.
@return A parser appropriate for parsing Gosu source. | [
"Creates",
"an",
"IGosuParser",
"appropriate",
"for",
"parsing",
"and",
"executing",
"Gosu",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/parser/GosuParserFactoryImpl.java#L64-L69 |
json-path/JsonPath | json-path/src/main/java/com/jayway/jsonpath/Criteria.java | Criteria.and | public Criteria and(String key) {
"""
Static factory method to create a Criteria using the provided key
@param key ads new filed to criteria
@return the criteria builder
"""
checkComplete();
return new Criteria(this.criteriaChain, ValueNode.toValueNode(prefixPath(key)));
} | java | public Criteria and(String key) {
checkComplete();
return new Criteria(this.criteriaChain, ValueNode.toValueNode(prefixPath(key)));
} | [
"public",
"Criteria",
"and",
"(",
"String",
"key",
")",
"{",
"checkComplete",
"(",
")",
";",
"return",
"new",
"Criteria",
"(",
"this",
".",
"criteriaChain",
",",
"ValueNode",
".",
"toValueNode",
"(",
"prefixPath",
"(",
"key",
")",
")",
")",
";",
"}"
] | Static factory method to create a Criteria using the provided key
@param key ads new filed to criteria
@return the criteria builder | [
"Static",
"factory",
"method",
"to",
"create",
"a",
"Criteria",
"using",
"the",
"provided",
"key"
] | train | https://github.com/json-path/JsonPath/blob/5a09489c3252b74bbf81992aadb3073be59c04f9/json-path/src/main/java/com/jayway/jsonpath/Criteria.java#L109-L112 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CharList.java | CharList.anyMatch | public <E extends Exception> boolean anyMatch(Try.CharPredicate<E> filter) throws E {
"""
Returns whether any elements of this List match the provided predicate.
@param filter
@return
"""
return anyMatch(0, size(), filter);
} | java | public <E extends Exception> boolean anyMatch(Try.CharPredicate<E> filter) throws E {
return anyMatch(0, size(), filter);
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"anyMatch",
"(",
"Try",
".",
"CharPredicate",
"<",
"E",
">",
"filter",
")",
"throws",
"E",
"{",
"return",
"anyMatch",
"(",
"0",
",",
"size",
"(",
")",
",",
"filter",
")",
";",
"}"
] | Returns whether any elements of this List match the provided predicate.
@param filter
@return | [
"Returns",
"whether",
"any",
"elements",
"of",
"this",
"List",
"match",
"the",
"provided",
"predicate",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CharList.java#L976-L978 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggerHistoriesInner.java | WorkflowTriggerHistoriesInner.getAsync | public Observable<WorkflowTriggerHistoryInner> getAsync(String resourceGroupName, String workflowName, String triggerName, String historyName) {
"""
Gets a workflow trigger history.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger... | java | public Observable<WorkflowTriggerHistoryInner> getAsync(String resourceGroupName, String workflowName, String triggerName, String historyName) {
return getWithServiceResponseAsync(resourceGroupName, workflowName, triggerName, historyName).map(new Func1<ServiceResponse<WorkflowTriggerHistoryInner>, WorkflowTrigg... | [
"public",
"Observable",
"<",
"WorkflowTriggerHistoryInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"triggerName",
",",
"String",
"historyName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceG... | Gets a workflow trigger history.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger name.
@param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a run.
@throws IllegalArgumentException... | [
"Gets",
"a",
"workflow",
"trigger",
"history",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggerHistoriesInner.java#L387-L394 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/EmbedBuilder.java | EmbedBuilder.setAuthor | public EmbedBuilder setAuthor(String name, String url) {
"""
Sets the Author of the embed. The author appears in the top left of the embed and can have a small
image beside it along with the author's name being made clickable by way of providing a url.
This convenience method just sets the name and the url.
<... | java | public EmbedBuilder setAuthor(String name, String url)
{
return setAuthor(name, url, null);
} | [
"public",
"EmbedBuilder",
"setAuthor",
"(",
"String",
"name",
",",
"String",
"url",
")",
"{",
"return",
"setAuthor",
"(",
"name",
",",
"url",
",",
"null",
")",
";",
"}"
] | Sets the Author of the embed. The author appears in the top left of the embed and can have a small
image beside it along with the author's name being made clickable by way of providing a url.
This convenience method just sets the name and the url.
<p><b><a href="http://i.imgur.com/JgZtxIM.png">Example</a></b>
@param ... | [
"Sets",
"the",
"Author",
"of",
"the",
"embed",
".",
"The",
"author",
"appears",
"in",
"the",
"top",
"left",
"of",
"the",
"embed",
"and",
"can",
"have",
"a",
"small",
"image",
"beside",
"it",
"along",
"with",
"the",
"author",
"s",
"name",
"being",
"made... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/EmbedBuilder.java#L562-L565 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/AbstractFileLookup.java | AbstractFileLookup.lookupFile | @Override
public InputStream lookupFile(String filename, ClassLoader cl) {
"""
Looks up the file, see : {@link DefaultFileLookup}.
@param filename might be the name of the file (too look it up in the class path) or an url to a file.
@return an input stream to the file or null if nothing found through all lo... | java | @Override
public InputStream lookupFile(String filename, ClassLoader cl) {
try {
return lookupFileStrict( filename, cl );
}
catch (FileNotFoundException e) {
return null;
}
} | [
"@",
"Override",
"public",
"InputStream",
"lookupFile",
"(",
"String",
"filename",
",",
"ClassLoader",
"cl",
")",
"{",
"try",
"{",
"return",
"lookupFileStrict",
"(",
"filename",
",",
"cl",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
"{",
... | Looks up the file, see : {@link DefaultFileLookup}.
@param filename might be the name of the file (too look it up in the class path) or an url to a file.
@return an input stream to the file or null if nothing found through all lookup steps. | [
"Looks",
"up",
"the",
"file",
"see",
":",
"{",
"@link",
"DefaultFileLookup",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/AbstractFileLookup.java#L31-L39 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaAdmin.java | CoronaAdmin.restartTaskTracker | private int restartTaskTracker(boolean forceFlag, int batchSize) throws IOException {
"""
Command to ask the Cluster Manager to restart all the task tracker
@param forceFlag if CM shall ignore all previous restart requests
@exception IOException
@return Returns 0 where no exception is thrown.
"""
// G... | java | private int restartTaskTracker(boolean forceFlag, int batchSize) throws IOException {
// Get the current configuration
CoronaConf conf = new CoronaConf(getConf());
InetSocketAddress address = NetUtils.createSocketAddr(conf
.getClusterManagerAddress());
TFramedTransport transport = new TFramedTr... | [
"private",
"int",
"restartTaskTracker",
"(",
"boolean",
"forceFlag",
",",
"int",
"batchSize",
")",
"throws",
"IOException",
"{",
"// Get the current configuration",
"CoronaConf",
"conf",
"=",
"new",
"CoronaConf",
"(",
"getConf",
"(",
")",
")",
";",
"InetSocketAddres... | Command to ask the Cluster Manager to restart all the task tracker
@param forceFlag if CM shall ignore all previous restart requests
@exception IOException
@return Returns 0 where no exception is thrown. | [
"Command",
"to",
"ask",
"the",
"Cluster",
"Manager",
"to",
"restart",
"all",
"the",
"task",
"tracker"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaAdmin.java#L105-L130 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.beginCreateOrUpdateAsync | public Observable<VirtualNetworkTapInner> beginCreateOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) {
"""
Creates or updates a Virtual Network Tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of the virtual network tap.
@param pa... | java | public Observable<VirtualNetworkTapInner> beginCreateOrUpdateAsync(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).map(new Func1<ServiceResponse<VirtualNetworkTapInner>, VirtualNetworkTapInn... | [
"public",
"Observable",
"<",
"VirtualNetworkTapInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
",",
"VirtualNetworkTapInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resource... | Creates or updates a Virtual Network Tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of the virtual network tap.
@param parameters Parameters supplied to the create or update virtual network tap operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Creates",
"or",
"updates",
"a",
"Virtual",
"Network",
"Tap",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L464-L471 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/XmlHttpResponse.java | XmlHttpResponse.checkXPaths | public XPathCheckResult checkXPaths(Map<String, Object> values, Map<String, String> expressionsToCheck) {
"""
Checks whether input values are present at correct locations in the response.
@param values keyName -> value, input parameters supplied to get request.
@param expressionsToCheck xpath -> keyName, each xp... | java | public XPathCheckResult checkXPaths(Map<String, Object> values, Map<String, String> expressionsToCheck) {
XPathCheckResult result;
String content = getResponse();
if (content == null) {
result = new XPathCheckResult();
result.setMismatchDetail("NOK: no response available.... | [
"public",
"XPathCheckResult",
"checkXPaths",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
",",
"Map",
"<",
"String",
",",
"String",
">",
"expressionsToCheck",
")",
"{",
"XPathCheckResult",
"result",
";",
"String",
"content",
"=",
"getResponse",
"("... | Checks whether input values are present at correct locations in the response.
@param values keyName -> value, input parameters supplied to get request.
@param expressionsToCheck xpath -> keyName, each xpath in this map is expected
to evaluate to the value present in values for that key (i.e. values[keyName])
@return OK... | [
"Checks",
"whether",
"input",
"values",
"are",
"present",
"at",
"correct",
"locations",
"in",
"the",
"response",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/XmlHttpResponse.java#L143-L155 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.isKeyUsed | public static boolean isKeyUsed(final Jedis jedis, final String key) {
"""
Determines if the queue identified by the given key is used.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key is used, false otherwise
"""
return !NONE.equalsIgnoreCase(j... | java | public static boolean isKeyUsed(final Jedis jedis, final String key) {
return !NONE.equalsIgnoreCase(jedis.type(key));
} | [
"public",
"static",
"boolean",
"isKeyUsed",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"return",
"!",
"NONE",
".",
"equalsIgnoreCase",
"(",
"jedis",
".",
"type",
"(",
"key",
")",
")",
";",
"}"
] | Determines if the queue identified by the given key is used.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key is used, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"is",
"used",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L150-L152 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/PropertyTypes.java | PropertyTypes.createTranslator | public static DPTXlator createTranslator(int dataType, byte[] data)
throws KNXException {
"""
Utility method, like {@link #createTranslator(int)}, with the additional
capability to set the data to be used by the DPT translator.
<p>
@param dataType property data type to get the associated translator for
@p... | java | public static DPTXlator createTranslator(int dataType, byte[] data)
throws KNXException
{
final DPTXlator t = createTranslator(dataType);
t.setData(data);
return t;
} | [
"public",
"static",
"DPTXlator",
"createTranslator",
"(",
"int",
"dataType",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"KNXException",
"{",
"final",
"DPTXlator",
"t",
"=",
"createTranslator",
"(",
"dataType",
")",
";",
"t",
".",
"setData",
"(",
"data",
... | Utility method, like {@link #createTranslator(int)}, with the additional
capability to set the data to be used by the DPT translator.
<p>
@param dataType property data type to get the associated translator for
@param data array with KNX DPT formatted data, the number of contained items is
determined by the used DPT
@r... | [
"Utility",
"method",
"like",
"{",
"@link",
"#createTranslator",
"(",
"int",
")",
"}",
"with",
"the",
"additional",
"capability",
"to",
"set",
"the",
"data",
"to",
"be",
"used",
"by",
"the",
"DPT",
"translator",
".",
"<p",
">"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/PropertyTypes.java#L447-L453 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contract/config/ConfigurationBuilder.java | ConfigurationBuilder.getConfiguration | public TransportsConfiguration getConfiguration(String configFileLocation) {
"""
Get the {@code TransportsConfiguration} represented by a particular configuration file.
@param configFileLocation configuration file location
@return TransportsConfiguration represented by a particular configuration file
"""
... | java | public TransportsConfiguration getConfiguration(String configFileLocation) {
TransportsConfiguration transportsConfiguration;
File file = new File(configFileLocation);
if (file.exists()) {
try (Reader in = new InputStreamReader(new FileInputStream(file), StandardCharsets.ISO_8859_1)... | [
"public",
"TransportsConfiguration",
"getConfiguration",
"(",
"String",
"configFileLocation",
")",
"{",
"TransportsConfiguration",
"transportsConfiguration",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"configFileLocation",
")",
";",
"if",
"(",
"file",
".",
"exists"... | Get the {@code TransportsConfiguration} represented by a particular configuration file.
@param configFileLocation configuration file location
@return TransportsConfiguration represented by a particular configuration file | [
"Get",
"the",
"{",
"@code",
"TransportsConfiguration",
"}",
"represented",
"by",
"a",
"particular",
"configuration",
"file",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contract/config/ConfigurationBuilder.java#L76-L97 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ClassUtils.java | ClassUtils.getField | public static Field getField(Class<?> type, String fieldName) {
"""
Gets a Field object representing the named field on the specified class. This method will recursively search
up the class hierarchy of the specified class until the Object class is reached. If the named field is found
then a Field object repre... | java | public static Field getField(Class<?> type, String fieldName) {
try {
return type.getDeclaredField(fieldName);
}
catch (NoSuchFieldException cause) {
if (type.getSuperclass() != null) {
return getField(type.getSuperclass(), fieldName);
}
throw new FieldNotFoundException(ca... | [
"public",
"static",
"Field",
"getField",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getDeclaredField",
"(",
"fieldName",
")",
";",
"}",
"catch",
"(",
"NoSuchFieldException",
"cause",
")",
... | Gets a Field object representing the named field on the specified class. This method will recursively search
up the class hierarchy of the specified class until the Object class is reached. If the named field is found
then a Field object representing the class field is returned, otherwise a NoSuchFieldException is th... | [
"Gets",
"a",
"Field",
"object",
"representing",
"the",
"named",
"field",
"on",
"the",
"specified",
"class",
".",
"This",
"method",
"will",
"recursively",
"search",
"up",
"the",
"class",
"hierarchy",
"of",
"the",
"specified",
"class",
"until",
"the",
"Object",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ClassUtils.java#L298-L311 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGButton.java | SVGButton.setTitle | public void setTitle(String title, String textcolor) {
"""
Set the button title
@param title Button title
@param textcolor Color
"""
this.title = title;
if(titlecss == null) {
titlecss = new CSSClass(this, "text");
titlecss.setStatement(SVGConstants.CSS_TEXT_ANCHOR_PROPERTY, SVGConstant... | java | public void setTitle(String title, String textcolor) {
this.title = title;
if(titlecss == null) {
titlecss = new CSSClass(this, "text");
titlecss.setStatement(SVGConstants.CSS_TEXT_ANCHOR_PROPERTY, SVGConstants.CSS_MIDDLE_VALUE);
titlecss.setStatement(SVGConstants.CSS_FILL_PROPERTY, textcolor)... | [
"public",
"void",
"setTitle",
"(",
"String",
"title",
",",
"String",
"textcolor",
")",
"{",
"this",
".",
"title",
"=",
"title",
";",
"if",
"(",
"titlecss",
"==",
"null",
")",
"{",
"titlecss",
"=",
"new",
"CSSClass",
"(",
"this",
",",
"\"text\"",
")",
... | Set the button title
@param title Button title
@param textcolor Color | [
"Set",
"the",
"button",
"title"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGButton.java#L155-L163 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/backup_policy.java | backup_policy.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
backup_policy_responses result = (backup_policy_responses) service.get_... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
backup_policy_responses result = (backup_policy_responses) service.get_payload_formatter().string_to_resource(backup_policy_responses.class, response);
if(result.errorcode != 0)
{
if (result.error... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"backup_policy_responses",
"result",
"=",
"(",
"backup_policy_responses",
")",
"service",
".",
"get_payload_fo... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/backup_policy.java#L223-L240 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OrientResourceAuthorizationStrategy.java | OrientResourceAuthorizationStrategy.checkResources | public boolean checkResources(Map<String, OrientPermission[]> resources, Action action) {
"""
Check that current user has access to all mentioned resources
@param resources map with {@link OrientPermission}s to check
@param action {@link Action} to check for
@return true if access is allowed
"""
for (Map.... | java | public boolean checkResources(Map<String, OrientPermission[]> resources, Action action)
{
for (Map.Entry<String, OrientPermission[]> entry : resources.entrySet()) {
if(!checkResource(entry.getKey(), action, entry.getValue())) return false;
}
return true;
} | [
"public",
"boolean",
"checkResources",
"(",
"Map",
"<",
"String",
",",
"OrientPermission",
"[",
"]",
">",
"resources",
",",
"Action",
"action",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"OrientPermission",
"[",
"]",
">",
"entry",
":"... | Check that current user has access to all mentioned resources
@param resources map with {@link OrientPermission}s to check
@param action {@link Action} to check for
@return true if access is allowed | [
"Check",
"that",
"current",
"user",
"has",
"access",
"to",
"all",
"mentioned",
"resources"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OrientResourceAuthorizationStrategy.java#L110-L116 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java | TopicPattern.topicSkipForward | static boolean topicSkipForward(char[] chars, int[] cursor) {
"""
Skip forward to the next separator character
@param chars the characters to be examined
@param cursor the int[2] { start, end } "cursor" describing the area to be examined
@return true if something was skipped, false if nothing could be skipped
... | java | static boolean topicSkipForward(char[] chars, int[] cursor) {
if (cursor[0] == cursor[1])
return false;
while (cursor[0] < cursor[1] && chars[cursor[0]] != MatchSpace.SUBTOPIC_SEPARATOR_CHAR)
cursor[0]++;
return true;
} | [
"static",
"boolean",
"topicSkipForward",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"[",
"]",
"cursor",
")",
"{",
"if",
"(",
"cursor",
"[",
"0",
"]",
"==",
"cursor",
"[",
"1",
"]",
")",
"return",
"false",
";",
"while",
"(",
"cursor",
"[",
"0",
"... | Skip forward to the next separator character
@param chars the characters to be examined
@param cursor the int[2] { start, end } "cursor" describing the area to be examined
@return true if something was skipped, false if nothing could be skipped | [
"Skip",
"forward",
"to",
"the",
"next",
"separator",
"character"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java#L62-L68 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/SparseLongArray.java | SparseLongArray.put | public void put(int key, long value) {
"""
Adds a mapping from the specified key to the specified value,
replacing the previous mapping from the specified key if there
was one.
"""
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0) {
mValues[i] = value;
... | java | public void put(int key, long value) {
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0) {
mValues[i] = value;
} else {
i = ~i;
if (mSize >= mKeys.length) {
growKeyAndValueArrays(mSize + 1);
}
if (... | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"long",
"value",
")",
"{",
"int",
"i",
"=",
"ContainerHelpers",
".",
"binarySearch",
"(",
"mKeys",
",",
"mSize",
",",
"key",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{",
"mValues",
"[",
"i",
"]",... | Adds a mapping from the specified key to the specified value,
replacing the previous mapping from the specified key if there
was one. | [
"Adds",
"a",
"mapping",
"from",
"the",
"specified",
"key",
"to",
"the",
"specified",
"value",
"replacing",
"the",
"previous",
"mapping",
"from",
"the",
"specified",
"key",
"if",
"there",
"was",
"one",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/SparseLongArray.java#L133-L154 |
yidongnan/grpc-spring-boot-starter | grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/serverfactory/AbstractGrpcServerFactory.java | AbstractGrpcServerFactory.toCheckedFile | protected File toCheckedFile(final String context, final String path) {
"""
Converts the given path to a file. This method checks that the file exists and refers to a file.
@param context The context for what the file is used. This value will be used in case of exceptions.
@param path The path of the file to u... | java | protected File toCheckedFile(final String context, final String path) {
if (path == null || path.trim().isEmpty()) {
throw new IllegalArgumentException(context + " path cannot be null or blank");
}
final File file = new File(path);
if (!file.isFile()) {
String mes... | [
"protected",
"File",
"toCheckedFile",
"(",
"final",
"String",
"context",
",",
"final",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
"||",
"path",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumen... | Converts the given path to a file. This method checks that the file exists and refers to a file.
@param context The context for what the file is used. This value will be used in case of exceptions.
@param path The path of the file to use.
@return The file instance created with the given path. | [
"Converts",
"the",
"given",
"path",
"to",
"a",
"file",
".",
"This",
"method",
"checks",
"that",
"the",
"file",
"exists",
"and",
"refers",
"to",
"a",
"file",
"."
] | train | https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/serverfactory/AbstractGrpcServerFactory.java#L151-L165 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java | DeleteHandlerV1.deleteEdgeReference | public boolean deleteEdgeReference(AtlasEdge edge, TypeCategory typeCategory, boolean isOwned,
boolean forceDeleteStructTrait) throws AtlasBaseException {
"""
Force delete is used to remove struct/trait in case of entity updates
@param edge
@param typeCategory
@param isOwn... | java | public boolean deleteEdgeReference(AtlasEdge edge, TypeCategory typeCategory, boolean isOwned,
boolean forceDeleteStructTrait) throws AtlasBaseException {
// default edge direction is outward
return deleteEdgeReference(edge, typeCategory, isOwned, forceDeleteStruc... | [
"public",
"boolean",
"deleteEdgeReference",
"(",
"AtlasEdge",
"edge",
",",
"TypeCategory",
"typeCategory",
",",
"boolean",
"isOwned",
",",
"boolean",
"forceDeleteStructTrait",
")",
"throws",
"AtlasBaseException",
"{",
"// default edge direction is outward",
"return",
"delet... | Force delete is used to remove struct/trait in case of entity updates
@param edge
@param typeCategory
@param isOwned
@param forceDeleteStructTrait
@return returns true if the edge reference is hard deleted
@throws AtlasException | [
"Force",
"delete",
"is",
"used",
"to",
"remove",
"struct",
"/",
"trait",
"in",
"case",
"of",
"entity",
"updates"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java#L221-L226 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java | PoiUtil.searchRowCell | public static Cell searchRowCell(Sheet sheet, int rowIndex, String searchKey) {
"""
查找单元格。
@param sheet 表单
@param rowIndex 行索引
@param searchKey 单元格中包含的关键字
@return 单元格,没有找到时返回null
"""
if (StringUtils.isEmpty(searchKey)) return null;
return searchRow(sheet.getRow(rowIndex), searchKey)... | java | public static Cell searchRowCell(Sheet sheet, int rowIndex, String searchKey) {
if (StringUtils.isEmpty(searchKey)) return null;
return searchRow(sheet.getRow(rowIndex), searchKey);
} | [
"public",
"static",
"Cell",
"searchRowCell",
"(",
"Sheet",
"sheet",
",",
"int",
"rowIndex",
",",
"String",
"searchKey",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"searchKey",
")",
")",
"return",
"null",
";",
"return",
"searchRow",
"(",
"shee... | 查找单元格。
@param sheet 表单
@param rowIndex 行索引
@param searchKey 单元格中包含的关键字
@return 单元格,没有找到时返回null | [
"查找单元格。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java#L348-L352 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java | DateFormatUtils.formatUTC | public static String formatUTC(final long millis, final String pattern, final Locale locale) {
"""
<p>Formats a date/time into a specific pattern using the UTC time zone.</p>
@param millis the date to format expressed in milliseconds
@param pattern the pattern to use to format the date, not null
@param loca... | java | public static String formatUTC(final long millis, final String pattern, final Locale locale) {
return format(new Date(millis), pattern, UTC_TIME_ZONE, locale);
} | [
"public",
"static",
"String",
"formatUTC",
"(",
"final",
"long",
"millis",
",",
"final",
"String",
"pattern",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"format",
"(",
"new",
"Date",
"(",
"millis",
")",
",",
"pattern",
",",
"UTC_TIME_ZONE",
",",... | <p>Formats a date/time into a specific pattern using the UTC time zone.</p>
@param millis the date to format expressed in milliseconds
@param pattern the pattern to use to format the date, not null
@param locale the locale to use, may be <code>null</code>
@return the formatted date | [
"<p",
">",
"Formats",
"a",
"date",
"/",
"time",
"into",
"a",
"specific",
"pattern",
"using",
"the",
"UTC",
"time",
"zone",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java#L240-L242 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/property/PropertyAccessorHelper.java | PropertyAccessorHelper.getObject | public static Object getObject(Object from, Field field) {
"""
Gets object from field.
@param from
the from
@param field
the field
@return the object
@throws PropertyAccessException
the property access exception
"""
if (!field.isAccessible())
{
field.setAccessible(tr... | java | public static Object getObject(Object from, Field field)
{
if (!field.isAccessible())
{
field.setAccessible(true);
}
try
{
return field.get(from);
}
catch (IllegalArgumentException iarg)
{
throw new Prope... | [
"public",
"static",
"Object",
"getObject",
"(",
"Object",
"from",
",",
"Field",
"field",
")",
"{",
"if",
"(",
"!",
"field",
".",
"isAccessible",
"(",
")",
")",
"{",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"}",
"try",
"{",
"return",
"fie... | Gets object from field.
@param from
the from
@param field
the field
@return the object
@throws PropertyAccessException
the property access exception | [
"Gets",
"object",
"from",
"field",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/property/PropertyAccessorHelper.java#L132-L150 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertFrom | public static <T extends GrayI16<T>>T convertFrom(BufferedImage src, T dst , Class<T> type ) {
"""
Converts the buffered image into an {@link GrayI16}. If the buffered image
has multiple channels the intensities of each channel are averaged together.
@param src Input image.
@param dst Where the converted ima... | java | public static <T extends GrayI16<T>>T convertFrom(BufferedImage src, T dst , Class<T> type ) {
if (dst != null) {
dst.reshape(src.getWidth(), src.getHeight());
} else {
dst = GeneralizedImageOps.createSingleBand(type, src.getWidth(), src.getHeight());
}
DataBuffer buffer = src.getRaster().getDataBuffer()... | [
"public",
"static",
"<",
"T",
"extends",
"GrayI16",
"<",
"T",
">",
">",
"T",
"convertFrom",
"(",
"BufferedImage",
"src",
",",
"T",
"dst",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"dst",
"!=",
"null",
")",
"{",
"dst",
".",
"reshap... | Converts the buffered image into an {@link GrayI16}. If the buffered image
has multiple channels the intensities of each channel are averaged together.
@param src Input image.
@param dst Where the converted image is written to. If null a new unsigned image is created.
@return Converted image. | [
"Converts",
"the",
"buffered",
"image",
"into",
"an",
"{",
"@link",
"GrayI16",
"}",
".",
"If",
"the",
"buffered",
"image",
"has",
"multiple",
"channels",
"the",
"intensities",
"of",
"each",
"channel",
"are",
"averaged",
"together",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L399-L415 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java | Worker.mk_worker | @SuppressWarnings("rawtypes")
public static WorkerShutdown mk_worker(Map conf, IContext context, String topologyId, String supervisorId,
int port, String workerId, String jarPath) throws Exception {
"""
create worker instance and run it
@param conf storm co... | java | @SuppressWarnings("rawtypes")
public static WorkerShutdown mk_worker(Map conf, IContext context, String topologyId, String supervisorId,
int port, String workerId, String jarPath) throws Exception {
StringBuilder sb = new StringBuilder();
sb.append("topolog... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"WorkerShutdown",
"mk_worker",
"(",
"Map",
"conf",
",",
"IContext",
"context",
",",
"String",
"topologyId",
",",
"String",
"supervisorId",
",",
"int",
"port",
",",
"String",
"workerId",
",",
... | create worker instance and run it
@param conf storm conf
@param topologyId topology id
@param supervisorId supervisor iid
@param port worker port
@param workerId worker id
@return WorkerShutDown
@throws Exception | [
"create",
"worker",
"instance",
"and",
"run",
"it"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/Worker.java#L227-L241 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/Equation.java | Equation.alias | public void alias( double value , String name ) {
"""
Adds a new floating point variable. If one already has the same name it is written over.
@param value Value of the number
@param name Name in code
"""
if( isReserved(name))
throw new RuntimeException("Reserved word or contains a reserv... | java | public void alias( double value , String name ) {
if( isReserved(name))
throw new RuntimeException("Reserved word or contains a reserved character. '"+name+"'");
VariableDouble old = (VariableDouble)variables.get(name);
if( old == null ) {
variables.put(name, new Variabl... | [
"public",
"void",
"alias",
"(",
"double",
"value",
",",
"String",
"name",
")",
"{",
"if",
"(",
"isReserved",
"(",
"name",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Reserved word or contains a reserved character. '\"",
"+",
"name",
"+",
"\"'\"",
")",
... | Adds a new floating point variable. If one already has the same name it is written over.
@param value Value of the number
@param name Name in code | [
"Adds",
"a",
"new",
"floating",
"point",
"variable",
".",
"If",
"one",
"already",
"has",
"the",
"same",
"name",
"it",
"is",
"written",
"over",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Equation.java#L320-L330 |
tvesalainen/util | util/src/main/java/org/vesalainen/lang/Primitives.java | Primitives.parseBoolean | public static final boolean parseBoolean(CharSequence cs, int beginIndex, int endIndex) {
"""
Parses the char sequence argument as a boolean. The boolean returned represents
the value true if the char sequence argument is not null and is equal, ignoring
case, to the string "true".
@param cs
@param beginIndex t... | java | public static final boolean parseBoolean(CharSequence cs, int beginIndex, int endIndex)
{
return
endIndex - beginIndex == 4 &&
Character.codePointCount(cs, beginIndex, endIndex) == 4 &&
Character.toUpperCase(Character.codePointAt(cs, beginIndex)) == 'T' ... | [
"public",
"static",
"final",
"boolean",
"parseBoolean",
"(",
"CharSequence",
"cs",
",",
"int",
"beginIndex",
",",
"int",
"endIndex",
")",
"{",
"return",
"endIndex",
"-",
"beginIndex",
"==",
"4",
"&&",
"Character",
".",
"codePointCount",
"(",
"cs",
",",
"begi... | Parses the char sequence argument as a boolean. The boolean returned represents
the value true if the char sequence argument is not null and is equal, ignoring
case, to the string "true".
@param cs
@param beginIndex the index to the first char of the text range.
@param endIndex the index after the last char of the text... | [
"Parses",
"the",
"char",
"sequence",
"argument",
"as",
"a",
"boolean",
".",
"The",
"boolean",
"returned",
"represents",
"the",
"value",
"true",
"if",
"the",
"char",
"sequence",
"argument",
"is",
"not",
"null",
"and",
"is",
"equal",
"ignoring",
"case",
"to",
... | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L503-L512 |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/JsonUtils.java | JsonUtils.convertObject | public static <T> T convertObject(String json, Class<T> clazz) throws IOException {
"""
Converts an object in JSON format to the given class. Throws an IOException if the conversion could not be
performed.
"""
try {
if (clazz.isAnnotationPresent(Model.class)) {
return MODEL... | java | public static <T> T convertObject(String json, Class<T> clazz) throws IOException {
try {
if (clazz.isAnnotationPresent(Model.class)) {
return MODEL_MAPPER.readValue(json, clazz);
}
return MAPPER.readValue(json, clazz);
} catch (IOException e) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"convertObject",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"clazz",
".",
"isAnnotationPresent",
"(",
"Model",
".",
"class",
")",
")",
... | Converts an object in JSON format to the given class. Throws an IOException if the conversion could not be
performed. | [
"Converts",
"an",
"object",
"in",
"JSON",
"format",
"to",
"the",
"given",
"class",
".",
"Throws",
"an",
"IOException",
"if",
"the",
"conversion",
"could",
"not",
"be",
"performed",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/JsonUtils.java#L65-L76 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java | BuildWithDetails.streamConsoleOutput | public void streamConsoleOutput(final BuildConsoleStreamListener listener, final int poolingInterval, final int poolingTimeout, boolean crumbFlag) throws InterruptedException, IOException {
"""
Stream build console output log as text using BuildConsoleStreamListener
Method can be used to asynchronously obtain log... | java | public void streamConsoleOutput(final BuildConsoleStreamListener listener, final int poolingInterval, final int poolingTimeout, boolean crumbFlag) throws InterruptedException, IOException {
// Calculate start and timeout
final long startTime = System.currentTimeMillis();
final long timeoutTime =... | [
"public",
"void",
"streamConsoleOutput",
"(",
"final",
"BuildConsoleStreamListener",
"listener",
",",
"final",
"int",
"poolingInterval",
",",
"final",
"int",
"poolingTimeout",
",",
"boolean",
"crumbFlag",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
... | Stream build console output log as text using BuildConsoleStreamListener
Method can be used to asynchronously obtain logs for running build.
@param listener interface used to asynchronously obtain logs
@param poolingInterval interval (seconds) used to pool jenkins for logs
@param poolingTimeout pooling timeout (second... | [
"Stream",
"build",
"console",
"output",
"log",
"as",
"text",
"using",
"BuildConsoleStreamListener",
"Method",
"can",
"be",
"used",
"to",
"asynchronously",
"obtain",
"logs",
"for",
"running",
"build",
"."
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java#L395-L424 |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateBeanMonthlyWeeks.java | CmsSerialDateBeanMonthlyWeeks.toNextDate | private void toNextDate(Calendar date, int interval) {
"""
Calculates the next date, starting from the provided date.
@param date the current date.
@param interval the number of month to add when moving to the next month.
"""
long previousDate = date.getTimeInMillis();
if (!m_weekOfMonthIt... | java | private void toNextDate(Calendar date, int interval) {
long previousDate = date.getTimeInMillis();
if (!m_weekOfMonthIterator.hasNext()) {
date.add(Calendar.MONTH, interval);
m_weekOfMonthIterator = m_weeksOfMonth.iterator();
}
toCorrectDateWithDay(date, m_weekOf... | [
"private",
"void",
"toNextDate",
"(",
"Calendar",
"date",
",",
"int",
"interval",
")",
"{",
"long",
"previousDate",
"=",
"date",
".",
"getTimeInMillis",
"(",
")",
";",
"if",
"(",
"!",
"m_weekOfMonthIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"date",
"... | Calculates the next date, starting from the provided date.
@param date the current date.
@param interval the number of month to add when moving to the next month. | [
"Calculates",
"the",
"next",
"date",
"starting",
"from",
"the",
"provided",
"date",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateBeanMonthlyWeeks.java#L150-L162 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/totp/TOTPValidator.java | TOTPValidator.isValid | public boolean isValid(byte[] key, long timeStep, int digits, HmacShaAlgorithm hmacShaAlgorithm, String value, long validationTime) {
"""
Returns {@code true} if the specified TOTP {@code value} matches the
value of the TOTP generated at validation, otherwise {@code false}.
@param key
the encoded shared secre... | java | public boolean isValid(byte[] key, long timeStep, int digits, HmacShaAlgorithm hmacShaAlgorithm, String value, long validationTime) {
boolean result = false;
TOTPBuilder builder = TOTP.key(key).timeStep(timeStep).digits(digits).hmacSha(hmacShaAlgorithm);
for (int i = -window; i <= window; i++) {... | [
"public",
"boolean",
"isValid",
"(",
"byte",
"[",
"]",
"key",
",",
"long",
"timeStep",
",",
"int",
"digits",
",",
"HmacShaAlgorithm",
"hmacShaAlgorithm",
",",
"String",
"value",
",",
"long",
"validationTime",
")",
"{",
"boolean",
"result",
"=",
"false",
";",... | Returns {@code true} if the specified TOTP {@code value} matches the
value of the TOTP generated at validation, otherwise {@code false}.
@param key
the encoded shared secret key
@param timeStep
the time step size in milliseconds
@param digits
the number of digits a TOTP should contain
@param hmacShaAlgorithm
{@link Hm... | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"specified",
"TOTP",
"{",
"@code",
"value",
"}",
"matches",
"the",
"value",
"of",
"the",
"TOTP",
"generated",
"at",
"validation",
"otherwise",
"{",
"@code",
"false",
"}",
"."
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/totp/TOTPValidator.java#L144-L156 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.getCharset | public static Charset getCharset(HttpMessage message, Charset defaultCharset) {
"""
Fetch charset from message's Content-Type header.
@param message entity to fetch Content-Type header from
@param defaultCharset result to use in case of empty, incorrect or doesn't contain required part header value
@re... | java | public static Charset getCharset(HttpMessage message, Charset defaultCharset) {
CharSequence contentTypeValue = message.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (contentTypeValue != null) {
return getCharset(contentTypeValue, defaultCharset);
} else {
return defaul... | [
"public",
"static",
"Charset",
"getCharset",
"(",
"HttpMessage",
"message",
",",
"Charset",
"defaultCharset",
")",
"{",
"CharSequence",
"contentTypeValue",
"=",
"message",
".",
"headers",
"(",
")",
".",
"get",
"(",
"HttpHeaderNames",
".",
"CONTENT_TYPE",
")",
";... | Fetch charset from message's Content-Type header.
@param message entity to fetch Content-Type header from
@param defaultCharset result to use in case of empty, incorrect or doesn't contain required part header value
@return the charset from message's Content-Type header or {@code defaultCharset}
if charset is n... | [
"Fetch",
"charset",
"from",
"message",
"s",
"Content",
"-",
"Type",
"header",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L371-L378 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/util/MirrorTable.java | MirrorTable.copyRecord | public void copyRecord(Record recAlt, Record recMain) {
"""
Copy the fields from the (main) source to the (mirrored) destination record.
This is done before any write or set.
@param recAlt Destination record
@param recMain Source record
"""
recAlt.moveFields(recMain, null, true, DBConstants.READ_MOV... | java | public void copyRecord(Record recAlt, Record recMain)
{
recAlt.moveFields(recMain, null, true, DBConstants.READ_MOVE, false, false, true, false);
} | [
"public",
"void",
"copyRecord",
"(",
"Record",
"recAlt",
",",
"Record",
"recMain",
")",
"{",
"recAlt",
".",
"moveFields",
"(",
"recMain",
",",
"null",
",",
"true",
",",
"DBConstants",
".",
"READ_MOVE",
",",
"false",
",",
"false",
",",
"true",
",",
"false... | Copy the fields from the (main) source to the (mirrored) destination record.
This is done before any write or set.
@param recAlt Destination record
@param recMain Source record | [
"Copy",
"the",
"fields",
"from",
"the",
"(",
"main",
")",
"source",
"to",
"the",
"(",
"mirrored",
")",
"destination",
"record",
".",
"This",
"is",
"done",
"before",
"any",
"write",
"or",
"set",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/util/MirrorTable.java#L362-L365 |
liferay/com-liferay-commerce | commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountOrganizationRelPersistenceImpl.java | CommerceAccountOrganizationRelPersistenceImpl.findByOrganizationId | @Override
public List<CommerceAccountOrganizationRel> findByOrganizationId(
long organizationId, int start, int end) {
"""
Returns a range of all the commerce account organization rels where organizationId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. ... | java | @Override
public List<CommerceAccountOrganizationRel> findByOrganizationId(
long organizationId, int start, int end) {
return findByOrganizationId(organizationId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceAccountOrganizationRel",
">",
"findByOrganizationId",
"(",
"long",
"organizationId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByOrganizationId",
"(",
"organizationId",
",",
"start",
",",
"end... | Returns a range of all the commerce account organization rels where organizationId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the f... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"account",
"organization",
"rels",
"where",
"organizationId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountOrganizationRelPersistenceImpl.java#L673-L677 |
gwtbootstrap3/gwtbootstrap3 | gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/form/validator/AbstractValidator.java | AbstractValidator.createErrorList | public List<EditorError> createErrorList(Editor<T> editor, T value, String messageKey) {
"""
Creates the error list.
@param editor the editor
@param value the value
@param messageKey the message key
@return the list
"""
List<EditorError> result = new ArrayList<EditorError>();
result.add(n... | java | public List<EditorError> createErrorList(Editor<T> editor, T value, String messageKey) {
List<EditorError> result = new ArrayList<EditorError>();
result.add(new BasicEditorError(editor, value, getInvalidMessage(messageKey)));
return result;
} | [
"public",
"List",
"<",
"EditorError",
">",
"createErrorList",
"(",
"Editor",
"<",
"T",
">",
"editor",
",",
"T",
"value",
",",
"String",
"messageKey",
")",
"{",
"List",
"<",
"EditorError",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"EditorError",
">",
"... | Creates the error list.
@param editor the editor
@param value the value
@param messageKey the message key
@return the list | [
"Creates",
"the",
"error",
"list",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3/blob/54bdbd0b12ba7a436b278c007df960d1adf2e641/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/form/validator/AbstractValidator.java#L80-L84 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.multAddTransAB | public static void multAddTransAB( double alpha , DMatrix3x3 a , DMatrix3x3 b , DMatrix3x3 c) {
"""
<p>
Performs the following operation:<br>
<br>
c += α*a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> += α*∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param alpha Scaling fact... | java | public static void multAddTransAB( double alpha , DMatrix3x3 a , DMatrix3x3 b , DMatrix3x3 c) {
c.a11 += alpha*(a.a11*b.a11 + a.a21*b.a12 + a.a31*b.a13);
c.a12 += alpha*(a.a11*b.a21 + a.a21*b.a22 + a.a31*b.a23);
c.a13 += alpha*(a.a11*b.a31 + a.a21*b.a32 + a.a31*b.a33);
c.a21 += alpha*(a.... | [
"public",
"static",
"void",
"multAddTransAB",
"(",
"double",
"alpha",
",",
"DMatrix3x3",
"a",
",",
"DMatrix3x3",
"b",
",",
"DMatrix3x3",
"c",
")",
"{",
"c",
".",
"a11",
"+=",
"alpha",
"*",
"(",
"a",
".",
"a11",
"*",
"b",
".",
"a11",
"+",
"a",
".",
... | <p>
Performs the following operation:<br>
<br>
c += α*a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> += α*∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param alpha Scaling factor.
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the mul... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"+",
"=",
"&alpha",
";",
"*",
"a<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"b<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L577-L587 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_ips_ipAddress_DELETE | public void serviceName_ips_ipAddress_DELETE(String serviceName, String ipAddress) throws IOException {
"""
Release a given Ip (Additional Ip)
REST: DELETE /vps/{serviceName}/ips/{ipAddress}
@param serviceName [required] The internal name of your VPS offer
@param ipAddress [required] The effective ip address ... | java | public void serviceName_ips_ipAddress_DELETE(String serviceName, String ipAddress) throws IOException {
String qPath = "/vps/{serviceName}/ips/{ipAddress}";
StringBuilder sb = path(qPath, serviceName, ipAddress);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_ips_ipAddress_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"ipAddress",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vps/{serviceName}/ips/{ipAddress}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Release a given Ip (Additional Ip)
REST: DELETE /vps/{serviceName}/ips/{ipAddress}
@param serviceName [required] The internal name of your VPS offer
@param ipAddress [required] The effective ip address of the Ip object | [
"Release",
"a",
"given",
"Ip",
"(",
"Additional",
"Ip",
")"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L575-L579 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Stoichiometry.java | Stoichiometry.setCustomStringGenerator | public void setCustomStringGenerator(Function<List<SubunitCluster>,String> customStringGenerator) {
"""
Let a user-defined function handle the entire string representation of a stoichiometry.
@param customStringGenerator
A function which accepts a list of subunit clusters and returns a string.
"""
this.str... | java | public void setCustomStringGenerator(Function<List<SubunitCluster>,String> customStringGenerator) {
this.strategy = StringOverflowStrategy.CUSTOM;
this.customStringGenerator = customStringGenerator;
} | [
"public",
"void",
"setCustomStringGenerator",
"(",
"Function",
"<",
"List",
"<",
"SubunitCluster",
">",
",",
"String",
">",
"customStringGenerator",
")",
"{",
"this",
".",
"strategy",
"=",
"StringOverflowStrategy",
".",
"CUSTOM",
";",
"this",
".",
"customStringGen... | Let a user-defined function handle the entire string representation of a stoichiometry.
@param customStringGenerator
A function which accepts a list of subunit clusters and returns a string. | [
"Let",
"a",
"user",
"-",
"defined",
"function",
"handle",
"the",
"entire",
"string",
"representation",
"of",
"a",
"stoichiometry",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Stoichiometry.java#L303-L306 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsWidgetDialogParameter.java | CmsWidgetDialogParameter.createId | public static String createId(String name, int index) {
"""
Returns a from id representation for the given widget name and id.<p>
@param name the widget parameter name
@param index the widget parameter index
@return a from id representation for the given widget name and id
"""
StringBuffer resu... | java | public static String createId(String name, int index) {
StringBuffer result = new StringBuffer();
result.append(name);
result.append('.');
result.append(index);
return result.toString();
} | [
"public",
"static",
"String",
"createId",
"(",
"String",
"name",
",",
"int",
"index",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"result",
".",
"append",
"(",
"name",
")",
";",
"result",
".",
"append",
"(",
"'",
"'",... | Returns a from id representation for the given widget name and id.<p>
@param name the widget parameter name
@param index the widget parameter index
@return a from id representation for the given widget name and id | [
"Returns",
"a",
"from",
"id",
"representation",
"for",
"the",
"given",
"widget",
"name",
"and",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsWidgetDialogParameter.java#L393-L401 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MHtmlEncoder.java | MHtmlEncoder.encodeString | public static void encodeString(final StringBuilder sb, final String s) {
"""
Append une chaine à un StringBuilder apres l'avoir encodée. Plus la chaine à encoder est longue, plus les gains de perfs sont sensibles.
@param sb
String StringBuilder à appender.
@param s
String Chaine à encoder et à ajouter à <CO... | java | public static void encodeString(final StringBuilder sb, final String s) {
if (s == null) {
return;
}
final int len = s.length();
// réserve un peu plus de place dans le StringBuilder
sb.ensureCapacity(sb.length() + len + len / 4);
int i;
int index;
char c;
for (i = 0; i < len; i++) {
... | [
"public",
"static",
"void",
"encodeString",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
";",
"}",
"final",
"int",
"len",
"=",
"s",
".",
"length",
"(",
")",
";",
"// r... | Append une chaine à un StringBuilder apres l'avoir encodée. Plus la chaine à encoder est longue, plus les gains de perfs sont sensibles.
@param sb
String StringBuilder à appender.
@param s
String Chaine à encoder et à ajouter à <CODE>sb</CODE> | [
"Append",
"une",
"chaine",
"à",
"un",
"StringBuilder",
"apres",
"l",
"avoir",
"encodée",
".",
"Plus",
"la",
"chaine",
"à",
"encoder",
"est",
"longue",
"plus",
"les",
"gains",
"de",
"perfs",
"sont",
"sensibles",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MHtmlEncoder.java#L118-L148 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_users_login_outgoing_GET | public ArrayList<Long> serviceName_users_login_outgoing_GET(String serviceName, String login, Long deliveryReceipt, Long differedDelivery, Long ptt, String receiver, String sender, String tag) throws IOException {
"""
Sms sent associated to the sms user
REST: GET /sms/{serviceName}/users/{login}/outgoing
@para... | java | public ArrayList<Long> serviceName_users_login_outgoing_GET(String serviceName, String login, Long deliveryReceipt, Long differedDelivery, Long ptt, String receiver, String sender, String tag) throws IOException {
String qPath = "/sms/{serviceName}/users/{login}/outgoing";
StringBuilder sb = path(qPath, serviceName... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_users_login_outgoing_GET",
"(",
"String",
"serviceName",
",",
"String",
"login",
",",
"Long",
"deliveryReceipt",
",",
"Long",
"differedDelivery",
",",
"Long",
"ptt",
",",
"String",
"receiver",
",",
"String",
"s... | Sms sent associated to the sms user
REST: GET /sms/{serviceName}/users/{login}/outgoing
@param differedDelivery [required] Filter the value of differedDelivery property (=)
@param tag [required] Filter the value of tag property (=)
@param ptt [required] Filter the value of ptt property (=)
@param receiver [required] F... | [
"Sms",
"sent",
"associated",
"to",
"the",
"sms",
"user"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L840-L851 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java | InjectionBinding.setObjects | public final void setObjects(Object injectionObject, Object bindingObject) {
"""
Sets the objects to use for injection and binding. Usually, these
objects are the same; otherwise, {@link #setObjects(Object, Reference)} should be used instead.
@param injectionObject the object to inject
@param bindingObject th... | java | public final void setObjects(Object injectionObject, Object bindingObject)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "setObjects", injectionObject, bindingObject);
this.ivInjectedObject = injectionObject;... | [
"public",
"final",
"void",
"setObjects",
"(",
"Object",
"injectionObject",
",",
"Object",
"bindingObject",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"is... | Sets the objects to use for injection and binding. Usually, these
objects are the same; otherwise, {@link #setObjects(Object, Reference)} should be used instead.
@param injectionObject the object to inject
@param bindingObject the object to bind, or null if injectionObject
should be bound directly | [
"Sets",
"the",
"objects",
"to",
"use",
"for",
"injection",
"and",
"binding",
".",
"Usually",
"these",
"objects",
"are",
"the",
"same",
";",
"otherwise",
"{",
"@link",
"#setObjects",
"(",
"Object",
"Reference",
")",
"}",
"should",
"be",
"used",
"instead",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java#L1257-L1270 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobSchedulesInner.java | JobSchedulesInner.get | public JobScheduleInner get(String resourceGroupName, String automationAccountName, UUID jobScheduleId) {
"""
Retrieve the job schedule identified by job schedule name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobSchedule... | java | public JobScheduleInner get(String resourceGroupName, String automationAccountName, UUID jobScheduleId) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, jobScheduleId).toBlocking().single().body();
} | [
"public",
"JobScheduleInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"UUID",
"jobScheduleId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
",",
"jobScheduleId",
... | Retrieve the job schedule identified by job schedule name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobScheduleId The job schedule name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorRespon... | [
"Retrieve",
"the",
"job",
"schedule",
"identified",
"by",
"job",
"schedule",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobSchedulesInner.java#L189-L191 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java | DeleteManager.applyDelete | private static boolean applyDelete(Element delete, Document ilf) {
"""
Attempt to apply a single delete command and return true if it succeeds or false otherwise.
If the delete is disallowed or the target element no longer exists in the document the delete
command fails and returns false.
"""
String ... | java | private static boolean applyDelete(Element delete, Document ilf) {
String nodeID = delete.getAttribute(Constants.ATT_NAME);
Element e = ilf.getElementById(nodeID);
if (e == null) return false;
String deleteAllowed = e.getAttribute(Constants.ATT_DELETE_ALLOWED);
if (deleteAllow... | [
"private",
"static",
"boolean",
"applyDelete",
"(",
"Element",
"delete",
",",
"Document",
"ilf",
")",
"{",
"String",
"nodeID",
"=",
"delete",
".",
"getAttribute",
"(",
"Constants",
".",
"ATT_NAME",
")",
";",
"Element",
"e",
"=",
"ilf",
".",
"getElementById",... | Attempt to apply a single delete command and return true if it succeeds or false otherwise.
If the delete is disallowed or the target element no longer exists in the document the delete
command fails and returns false. | [
"Attempt",
"to",
"apply",
"a",
"single",
"delete",
"command",
"and",
"return",
"true",
"if",
"it",
"succeeds",
"or",
"false",
"otherwise",
".",
"If",
"the",
"delete",
"is",
"disallowed",
"or",
"the",
"target",
"element",
"no",
"longer",
"exists",
"in",
"th... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DeleteManager.java#L88-L102 |
berkesa/datatree | src/main/java/io/datatree/Tree.java | Tree.getObject | @SuppressWarnings("unchecked")
public <TO> TO getObject(String path, TO defaultValue) {
"""
Returns the Object to which the specified path is mapped. The method
returns the default value argument if the path is not valid. This method
performs automatic type conversion if needed (eg. IP String to
InetAddress, ... | java | @SuppressWarnings("unchecked")
public <TO> TO getObject(String path, TO defaultValue) {
Tree child = getChild(path, false);
if (child != null && defaultValue != null) {
TO converted = DataConverterRegistry.convert((Class<TO>) defaultValue.getClass(), child.value);
if (converted == null && (defaultValue ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"TO",
">",
"TO",
"getObject",
"(",
"String",
"path",
",",
"TO",
"defaultValue",
")",
"{",
"Tree",
"child",
"=",
"getChild",
"(",
"path",
",",
"false",
")",
";",
"if",
"(",
"child",
"!="... | Returns the Object to which the specified path is mapped. The method
returns the default value argument if the path is not valid. This method
performs automatic type conversion if needed (eg. IP String to
InetAddress, etc.). Sample code:<br>
@param <TO>
output's type of this method
@param path
path (e.g. "path.to.node... | [
"Returns",
"the",
"Object",
"to",
"which",
"the",
"specified",
"path",
"is",
"mapped",
".",
"The",
"method",
"returns",
"the",
"default",
"value",
"argument",
"if",
"the",
"path",
"is",
"not",
"valid",
".",
"This",
"method",
"performs",
"automatic",
"type",
... | train | https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/Tree.java#L2965-L2976 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java | CommonUtils.getPrivateField | @SuppressWarnings("unchecked")
public static <T> T getPrivateField(Object obj, String fieldName) {
"""
Get the value of private field {@code fieldName} of given object {@code obj}.
@throws IllegalArgumentException
if given field was not found
"""
try {
return (T) FieldUtils.readField(obj, fieldName, ... | java | @SuppressWarnings("unchecked")
public static <T> T getPrivateField(Object obj, String fieldName) {
try {
return (T) FieldUtils.readField(obj, fieldName, true);
}
catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getPrivateField",
"(",
"Object",
"obj",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"(",
"T",
")",
"FieldUtils",
".",
"readField",
"(",
"obj",
",... | Get the value of private field {@code fieldName} of given object {@code obj}.
@throws IllegalArgumentException
if given field was not found | [
"Get",
"the",
"value",
"of",
"private",
"field",
"{",
"@code",
"fieldName",
"}",
"of",
"given",
"object",
"{",
"@code",
"obj",
"}",
"."
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L195-L203 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/CursorLoader.java | CursorLoader.getCursor | public Cursor getCursor(String ref,int x,int y) throws IOException, LWJGLException {
"""
Get a cursor based on a image reference on the classpath
@param ref The reference to the image to be loaded
@param x The x-coordinate of the cursor hotspot (left -> right)
@param y The y-coordinate of the cursor hotspot (... | java | public Cursor getCursor(String ref,int x,int y) throws IOException, LWJGLException {
LoadableImageData imageData = null;
imageData = ImageDataFactory.getImageDataFor(ref);
imageData.configureEdging(false);
ByteBuffer buf = imageData.loadImage(ResourceLoader.getResourceAsStream(ref), true, true, null... | [
"public",
"Cursor",
"getCursor",
"(",
"String",
"ref",
",",
"int",
"x",
",",
"int",
"y",
")",
"throws",
"IOException",
",",
"LWJGLException",
"{",
"LoadableImageData",
"imageData",
"=",
"null",
";",
"imageData",
"=",
"ImageDataFactory",
".",
"getImageDataFor",
... | Get a cursor based on a image reference on the classpath
@param ref The reference to the image to be loaded
@param x The x-coordinate of the cursor hotspot (left -> right)
@param y The y-coordinate of the cursor hotspot (bottom -> top)
@return The create cursor
@throws IOException Indicates a failure to load the image... | [
"Get",
"a",
"cursor",
"based",
"on",
"a",
"image",
"reference",
"on",
"the",
"classpath"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/CursorLoader.java#L49-L79 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.completeLocalOutput | public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
"""
Called when we're all done writing to the target. A local FS will
do nothing, because we've written to exactly the right place. A remote
FS will copy the contents of tmpLocalFile to the correct target at
fsOutpu... | java | public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
fs.completeLocalOutput(fsOutputFile, tmpLocalFile);
} | [
"public",
"void",
"completeLocalOutput",
"(",
"Path",
"fsOutputFile",
",",
"Path",
"tmpLocalFile",
")",
"throws",
"IOException",
"{",
"fs",
".",
"completeLocalOutput",
"(",
"fsOutputFile",
",",
"tmpLocalFile",
")",
";",
"}"
] | Called when we're all done writing to the target. A local FS will
do nothing, because we've written to exactly the right place. A remote
FS will copy the contents of tmpLocalFile to the correct target at
fsOutputFile. | [
"Called",
"when",
"we",
"re",
"all",
"done",
"writing",
"to",
"the",
"target",
".",
"A",
"local",
"FS",
"will",
"do",
"nothing",
"because",
"we",
"ve",
"written",
"to",
"exactly",
"the",
"right",
"place",
".",
"A",
"remote",
"FS",
"will",
"copy",
"the"... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L365-L368 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet.containsAll | public boolean containsAll(String s) {
"""
Returns true if there is a partition of the string such that this set contains each of the partitioned strings.
For example, for the Unicode set [a{bc}{cd}]<br>
containsAll is true for each of: "a", "bc", ""cdbca"<br>
containsAll is false for each of: "acb", "bcda", "b... | java | public boolean containsAll(String s) {
int cp;
for (int i = 0; i < s.length(); i += UTF16.getCharCount(cp)) {
cp = UTF16.charAt(s, i);
if (!contains(cp)) {
if (strings.size() == 0) {
return false;
}
return conta... | [
"public",
"boolean",
"containsAll",
"(",
"String",
"s",
")",
"{",
"int",
"cp",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"+=",
"UTF16",
".",
"getCharCount",
"(",
"cp",
")",
")",
"{",
"cp",
"... | Returns true if there is a partition of the string such that this set contains each of the partitioned strings.
For example, for the Unicode set [a{bc}{cd}]<br>
containsAll is true for each of: "a", "bc", ""cdbca"<br>
containsAll is false for each of: "acb", "bcda", "bcx"<br>
@param s string containing characters to be... | [
"Returns",
"true",
"if",
"there",
"is",
"a",
"partition",
"of",
"the",
"string",
"such",
"that",
"this",
"set",
"contains",
"each",
"of",
"the",
"partitioned",
"strings",
".",
"For",
"example",
"for",
"the",
"Unicode",
"set",
"[",
"a",
"{",
"bc",
"}",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L1928-L1940 |
alexholmes/htuple | core/src/main/java/org/htuple/Tuple.java | Tuple.setBytes | public Tuple setBytes(Enum<?> eval, BytesWritable val) {
"""
Sets a value at a specific position in the tuple.
@param eval the enum which is used to determine the index for the set operation
@param val the value to set
@return a handle to this object to enable builder operations
@see #set(Enum, Object) for ... | java | public Tuple setBytes(Enum<?> eval, BytesWritable val) {
set(eval, (Object) val);
return this;
} | [
"public",
"Tuple",
"setBytes",
"(",
"Enum",
"<",
"?",
">",
"eval",
",",
"BytesWritable",
"val",
")",
"{",
"set",
"(",
"eval",
",",
"(",
"Object",
")",
"val",
")",
";",
"return",
"this",
";",
"}"
] | Sets a value at a specific position in the tuple.
@param eval the enum which is used to determine the index for the set operation
@param val the value to set
@return a handle to this object to enable builder operations
@see #set(Enum, Object) for more info | [
"Sets",
"a",
"value",
"at",
"a",
"specific",
"position",
"in",
"the",
"tuple",
"."
] | train | https://github.com/alexholmes/htuple/blob/5aba63f78a4a9bb505ad3de0a5b0b392724644c4/core/src/main/java/org/htuple/Tuple.java#L498-L501 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSTypeRegistry.java | JSTypeRegistry.unregisterPropertyOnType | public void unregisterPropertyOnType(String propertyName, JSType type) {
"""
Removes the index's reference to a property on the given type (if it is
currently registered). If the property is not registered on the type yet,
this method will not change internal state.
@param propertyName the name of the propert... | java | public void unregisterPropertyOnType(String propertyName, JSType type) {
// TODO(bashir): typesIndexedByProperty should also be updated!
Map<String, ObjectType> typeSet =
eachRefTypeIndexedByProperty.get(propertyName);
if (typeSet != null) {
typeSet.remove(type.toObjectType().getReferenceName(... | [
"public",
"void",
"unregisterPropertyOnType",
"(",
"String",
"propertyName",
",",
"JSType",
"type",
")",
"{",
"// TODO(bashir): typesIndexedByProperty should also be updated!",
"Map",
"<",
"String",
",",
"ObjectType",
">",
"typeSet",
"=",
"eachRefTypeIndexedByProperty",
"."... | Removes the index's reference to a property on the given type (if it is
currently registered). If the property is not registered on the type yet,
this method will not change internal state.
@param propertyName the name of the property to unregister
@param type the type to unregister the property on. | [
"Removes",
"the",
"index",
"s",
"reference",
"to",
"a",
"property",
"on",
"the",
"given",
"type",
"(",
"if",
"it",
"is",
"currently",
"registered",
")",
".",
"If",
"the",
"property",
"is",
"not",
"registered",
"on",
"the",
"type",
"yet",
"this",
"method"... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L953-L960 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/common/Similarity.java | Similarity.kendallsTau | public static double kendallsTau(Vector a, Vector b) {
"""
Computes <a href="http://en.wikipedia.org/wiki/Kendall%27s_tau">Kendall's
tau</a> of the values in the two vectors. This method uses tau-b, which
is suitable for vectors with duplicate values.
@throws IllegalArgumentException when the length of the t... | java | public static double kendallsTau(Vector a, Vector b) {
return kendallsTau(Vectors.asDouble(a), Vectors.asDouble(b));
} | [
"public",
"static",
"double",
"kendallsTau",
"(",
"Vector",
"a",
",",
"Vector",
"b",
")",
"{",
"return",
"kendallsTau",
"(",
"Vectors",
".",
"asDouble",
"(",
"a",
")",
",",
"Vectors",
".",
"asDouble",
"(",
"b",
")",
")",
";",
"}"
] | Computes <a href="http://en.wikipedia.org/wiki/Kendall%27s_tau">Kendall's
tau</a> of the values in the two vectors. This method uses tau-b, which
is suitable for vectors with duplicate values.
@throws IllegalArgumentException when the length of the two vectors are
not the same. | [
"Computes",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Kendall%27s_tau",
">",
"Kendall",
"s",
"tau<",
"/",
"a",
">",
"of",
"the",
"values",
"in",
"the",
"two",
"vectors",
".",
"This",
"method",
"uses"... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L2055-L2057 |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CachingHttpServletRequestWrapper.java | CachingHttpServletRequestWrapper.fillParams | private void fillParams(final Map<String, String[]> params, final String queryString, Charset charset) {
"""
Adds parameter name value paris extracted from given query string.
@param params The parameter map to alter
@param queryString The query string to extract the values from
@param charset
"""
i... | java | private void fillParams(final Map<String, String[]> params, final String queryString, Charset charset) {
if (StringUtils.hasText(queryString)) {
final StringTokenizer tokenizer = new StringTokenizer(queryString, "&");
while (tokenizer.hasMoreTokens()) {
final String[] nam... | [
"private",
"void",
"fillParams",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"params",
",",
"final",
"String",
"queryString",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"queryString",
")",
")... | Adds parameter name value paris extracted from given query string.
@param params The parameter map to alter
@param queryString The query string to extract the values from
@param charset | [
"Adds",
"parameter",
"name",
"value",
"paris",
"extracted",
"from",
"given",
"query",
"string",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CachingHttpServletRequestWrapper.java#L111-L128 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/FirewallRulesInner.java | FirewallRulesInner.listByServerAsync | public Observable<List<FirewallRuleInner>> listByServerAsync(String resourceGroupName, String serverName) {
"""
Returns a list of firewall rules.
@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.
@par... | java | public Observable<List<FirewallRuleInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<FirewallRuleInner>>, List<FirewallRuleInner>>() {
@Override
public Lis... | [
"public",
"Observable",
"<",
"List",
"<",
"FirewallRuleInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
... | Returns a list of firewall rules.
@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.
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Returns",
"a",
"list",
"of",
"firewall",
"rules",
"."
] | 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/FirewallRulesInner.java#L400-L407 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/IOUtils.java | IOUtils.saveAsFile | public static void saveAsFile(String data, String charset, String addr) throws IOException {
"""
将文本保存到本地文件
@param data 文本
@param charset 文本的字符集,不填默认为UTF8
@param addr 保存本地的路径,包含文件名,例如D://a.txt
@throws IOException IO异常
"""
charset = StringUtils.isEmpty(charset) ? "UTF8" : charset;
sa... | java | public static void saveAsFile(String data, String charset, String addr) throws IOException {
charset = StringUtils.isEmpty(charset) ? "UTF8" : charset;
saveAsFile(data.getBytes(charset), addr);
} | [
"public",
"static",
"void",
"saveAsFile",
"(",
"String",
"data",
",",
"String",
"charset",
",",
"String",
"addr",
")",
"throws",
"IOException",
"{",
"charset",
"=",
"StringUtils",
".",
"isEmpty",
"(",
"charset",
")",
"?",
"\"UTF8\"",
":",
"charset",
";",
"... | 将文本保存到本地文件
@param data 文本
@param charset 文本的字符集,不填默认为UTF8
@param addr 保存本地的路径,包含文件名,例如D://a.txt
@throws IOException IO异常 | [
"将文本保存到本地文件"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/IOUtils.java#L51-L54 |
virgo47/javasimon | spring/src/main/java/org/javasimon/spring/BasicMonitoringInterceptor.java | BasicMonitoringInterceptor.processInvoke | protected Object processInvoke(MethodInvocation invocation, @SuppressWarnings("UnusedParameters") Split split) throws Throwable {
"""
Method with default invoke (just calls proceed). It can be overridden and overriding method can stop
the provided split. If split is not stopped it will be stopped right after this... | java | protected Object processInvoke(MethodInvocation invocation, @SuppressWarnings("UnusedParameters") Split split) throws Throwable {
return invocation.proceed();
} | [
"protected",
"Object",
"processInvoke",
"(",
"MethodInvocation",
"invocation",
",",
"@",
"SuppressWarnings",
"(",
"\"UnusedParameters\"",
")",
"Split",
"split",
")",
"throws",
"Throwable",
"{",
"return",
"invocation",
".",
"proceed",
"(",
")",
";",
"}"
] | Method with default invoke (just calls proceed). It can be overridden and overriding method can stop
the provided split. If split is not stopped it will be stopped right after this method finishes.
Any caught throwable should be rethrown again. Method should call {@code invocation.proceed()}.
@param invocation method ... | [
"Method",
"with",
"default",
"invoke",
"(",
"just",
"calls",
"proceed",
")",
".",
"It",
"can",
"be",
"overridden",
"and",
"overriding",
"method",
"can",
"stop",
"the",
"provided",
"split",
".",
"If",
"split",
"is",
"not",
"stopped",
"it",
"will",
"be",
"... | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/spring/src/main/java/org/javasimon/spring/BasicMonitoringInterceptor.java#L66-L68 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/GetUtils.java | GetUtils.ensureNonNull | @Nonnull
public static <T> T ensureNonNull(@Nullable final T value, @Nonnull final T defaultValue) {
"""
Get value and ensure that the value is not null
@param <T> type of value
@param value the value
@param defaultValue the default value to be returned if the value is null
@return not null... | java | @Nonnull
public static <T> T ensureNonNull(@Nullable final T value, @Nonnull final T defaultValue) {
return value == null ? Assertions.assertNotNull(defaultValue) : value;
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"T",
"ensureNonNull",
"(",
"@",
"Nullable",
"final",
"T",
"value",
",",
"@",
"Nonnull",
"final",
"T",
"defaultValue",
")",
"{",
"return",
"value",
"==",
"null",
"?",
"Assertions",
".",
"assertNotNull",
"... | Get value and ensure that the value is not null
@param <T> type of value
@param value the value
@param defaultValue the default value to be returned if the value is null
@return not null value
@throws AssertionError if both the value and the default value are null
@since 1.0 | [
"Get",
"value",
"and",
"ensure",
"that",
"the",
"value",
"is",
"not",
"null"
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/GetUtils.java#L56-L59 |
johnkil/Android-RobotoTextView | robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java | RobotoTypefaces.setUpTypeface | public static void setUpTypeface(@NonNull TextView textView, @NonNull Typeface typeface) {
"""
Set up typeface for TextView. Wrapper over {@link TextView#setTypeface(Typeface)}
for making the font anti-aliased.
@param textView The text view
@param typeface The specify typeface
"""
textView.setPain... | java | public static void setUpTypeface(@NonNull TextView textView, @NonNull Typeface typeface) {
textView.setPaintFlags(textView.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG);
textView.setTypeface(typeface);
} | [
"public",
"static",
"void",
"setUpTypeface",
"(",
"@",
"NonNull",
"TextView",
"textView",
",",
"@",
"NonNull",
"Typeface",
"typeface",
")",
"{",
"textView",
".",
"setPaintFlags",
"(",
"textView",
".",
"getPaintFlags",
"(",
")",
"|",
"Paint",
".",
"ANTI_ALIAS_F... | Set up typeface for TextView. Wrapper over {@link TextView#setTypeface(Typeface)}
for making the font anti-aliased.
@param textView The text view
@param typeface The specify typeface | [
"Set",
"up",
"typeface",
"for",
"TextView",
".",
"Wrapper",
"over",
"{",
"@link",
"TextView#setTypeface",
"(",
"Typeface",
")",
"}",
"for",
"making",
"the",
"font",
"anti",
"-",
"aliased",
"."
] | train | https://github.com/johnkil/Android-RobotoTextView/blob/1341602f16c08057dddd193411e7dab96f963b77/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java#L549-L552 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.