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-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseDoubleObj | @Nullable
public static Double parseDoubleObj (@Nullable final Object aObject, @Nullable final Double aDefault) {
"""
Parse the given {@link Object} as {@link Double}. Note: both the locale
independent form of a double can be parsed here (e.g. 4.523) as well as a
localized form using the comma as the decimal s... | java | @Nullable
public static Double parseDoubleObj (@Nullable final Object aObject, @Nullable final Double aDefault)
{
final double dValue = parseDouble (aObject, Double.NaN);
return Double.isNaN (dValue) ? aDefault : Double.valueOf (dValue);
} | [
"@",
"Nullable",
"public",
"static",
"Double",
"parseDoubleObj",
"(",
"@",
"Nullable",
"final",
"Object",
"aObject",
",",
"@",
"Nullable",
"final",
"Double",
"aDefault",
")",
"{",
"final",
"double",
"dValue",
"=",
"parseDouble",
"(",
"aObject",
",",
"Double",
... | Parse the given {@link Object} as {@link Double}. Note: both the locale
independent form of a double can be parsed here (e.g. 4.523) as well as a
localized form using the comma as the decimal separator (e.g. the German
4,523).
@param aObject
The object to parse. May be <code>null</code>.
@param aDefault
The default va... | [
"Parse",
"the",
"given",
"{",
"@link",
"Object",
"}",
"as",
"{",
"@link",
"Double",
"}",
".",
"Note",
":",
"both",
"the",
"locale",
"independent",
"form",
"of",
"a",
"double",
"can",
"be",
"parsed",
"here",
"(",
"e",
".",
"g",
".",
"4",
".",
"523",... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L530-L535 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/InternationalFixedChronology.java | InternationalFixedChronology.dateYearDay | @Override
public InternationalFixedDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
"""
Obtains a local date in International Fixed calendar system from the
era, year-of-era and day-of-year fields.
@param era the International Fixed era, not null
@param yearOfEra the year-of-era
@param dayOfYe... | java | @Override
public InternationalFixedDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"@",
"Override",
"public",
"InternationalFixedDate",
"dateYearDay",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"return",
"dateYearDay",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
"dayOfYear",
")",
";",
"... | Obtains a local date in International Fixed calendar system from the
era, year-of-era and day-of-year fields.
@param era the International Fixed era, not null
@param yearOfEra the year-of-era
@param dayOfYear the day-of-year
@return the International Fixed local date, not null
@throws DateTimeException if unable to... | [
"Obtains",
"a",
"local",
"date",
"in",
"International",
"Fixed",
"calendar",
"system",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/InternationalFixedChronology.java#L255-L258 |
Faylixe/googlecodejam-client | src/main/java/fr/faylixe/googlecodejam/client/CodeJamSession.java | CodeJamSession.buildFilename | public String buildFilename(final ProblemInput input, final int attempt) {
"""
<p>Builds and returns a valid file name
for the given problem <tt>input</tt>.</p>
@param input Input to retrieve file name from.
@param attempt Attempt number.
@return Built file name.
"""
final StringBuilder builder = new S... | java | public String buildFilename(final ProblemInput input, final int attempt) {
final StringBuilder builder = new StringBuilder();
final Problem problem = input.getProblem();
final ContestInfo info = problem.getParent();
final int index = info.getProblems().indexOf(problem);
final char letter = (char) ((int) 'A' +... | [
"public",
"String",
"buildFilename",
"(",
"final",
"ProblemInput",
"input",
",",
"final",
"int",
"attempt",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"final",
"Problem",
"problem",
"=",
"input",
".",
"getProblem... | <p>Builds and returns a valid file name
for the given problem <tt>input</tt>.</p>
@param input Input to retrieve file name from.
@param attempt Attempt number.
@return Built file name. | [
"<p",
">",
"Builds",
"and",
"returns",
"a",
"valid",
"file",
"name",
"for",
"the",
"given",
"problem",
"<tt",
">",
"input<",
"/",
"tt",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Faylixe/googlecodejam-client/blob/84a5fed4e049dca48994dc3f70213976aaff4bd3/src/main/java/fr/faylixe/googlecodejam/client/CodeJamSession.java#L233-L251 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java | IntegrationAccountsInner.regenerateAccessKeyAsync | public Observable<IntegrationAccountInner> regenerateAccessKeyAsync(String resourceGroupName, String integrationAccountName, KeyType keyType) {
"""
Regenerates the integration account access key.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@par... | java | public Observable<IntegrationAccountInner> regenerateAccessKeyAsync(String resourceGroupName, String integrationAccountName, KeyType keyType) {
return regenerateAccessKeyWithServiceResponseAsync(resourceGroupName, integrationAccountName, keyType).map(new Func1<ServiceResponse<IntegrationAccountInner>, Integrati... | [
"public",
"Observable",
"<",
"IntegrationAccountInner",
">",
"regenerateAccessKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"regenerateAccessKeyWithServiceResponseAsync",
"(",
"resourceGr... | Regenerates the integration account access key.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param keyType The key type. Possible values include: 'NotSpecified', 'Primary', 'Secondary'
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Regenerates",
"the",
"integration",
"account",
"access",
"key",
"."
] | 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/IntegrationAccountsInner.java#L1333-L1340 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.beginFailoverAsync | public Observable<InstanceFailoverGroupInner> beginFailoverAsync(String resourceGroupName, String locationName, String failoverGroupName) {
"""
Fails over from the current primary managed instance to this managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You c... | java | public Observable<InstanceFailoverGroupInner> beginFailoverAsync(String resourceGroupName, String locationName, String failoverGroupName) {
return beginFailoverWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).map(new Func1<ServiceResponse<InstanceFailoverGroupInner>, InstanceFailover... | [
"public",
"Observable",
"<",
"InstanceFailoverGroupInner",
">",
"beginFailoverAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"beginFailoverWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Fails over from the current primary managed instance to this managed instance.
@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 locationName The name of the region where the resource is located.
@para... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"managed",
"instance",
"to",
"this",
"managed",
"instance",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L797-L804 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/RandomUtils.java | RandomUtils.nextInt | public static int nextInt(final int startInclusive, final int endExclusive) {
"""
<p>
Returns a random integer within the specified range.
</p>
@param startInclusive
the smallest value that can be returned, must be non-negative
@param endExclusive
the upper bound (not included)
@throws IllegalArgumentExce... | java | public static int nextInt(final int startInclusive, final int endExclusive) {
Validate.isTrue(endExclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
if (startInclusiv... | [
"public",
"static",
"int",
"nextInt",
"(",
"final",
"int",
"startInclusive",
",",
"final",
"int",
"endExclusive",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"endExclusive",
">=",
"startInclusive",
",",
"\"Start value must be smaller or equal to end value.\"",
")",
";",... | <p>
Returns a random integer within the specified range.
</p>
@param startInclusive
the smallest value that can be returned, must be non-negative
@param endExclusive
the upper bound (not included)
@throws IllegalArgumentException
if {@code startInclusive > endExclusive} or if
{@code startInclusive} is negative
@return... | [
"<p",
">",
"Returns",
"a",
"random",
"integer",
"within",
"the",
"specified",
"range",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/RandomUtils.java#L94-L104 |
shrinkwrap/descriptors | metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/MetadataParser.java | MetadataParser.generateCode | public void generateCode(final MetadataParserPath path, final boolean verbose) throws TransformerException {
"""
Generates source code by applying the <code>ddJavaAll.xsl</code> XSLT extracted from the resource stream.
@throws TransformerException
"""
/** initialize the map which will overwrite glob... | java | public void generateCode(final MetadataParserPath path, final boolean verbose) throws TransformerException {
/** initialize the map which will overwrite global parameters as defined in metadata.xsl/ddJava.xsl */
final Map<String, String> xsltParameters = new HashMap<String, String>();
xsltParame... | [
"public",
"void",
"generateCode",
"(",
"final",
"MetadataParserPath",
"path",
",",
"final",
"boolean",
"verbose",
")",
"throws",
"TransformerException",
"{",
"/** initialize the map which will overwrite global parameters as defined in metadata.xsl/ddJava.xsl */",
"final",
"Map",
... | Generates source code by applying the <code>ddJavaAll.xsl</code> XSLT extracted from the resource stream.
@throws TransformerException | [
"Generates",
"source",
"code",
"by",
"applying",
"the",
"<code",
">",
"ddJavaAll",
".",
"xsl<",
"/",
"code",
">",
"XSLT",
"extracted",
"from",
"the",
"resource",
"stream",
"."
] | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/MetadataParser.java#L175-L190 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java | MediaDescriptorField.setDescriptor | protected void setDescriptor(Text line) throws ParseException {
"""
Reads values from specified text line
@param line the text description of the media.
@throws ParseException
"""
line.trim();
try {
//split using equal sign
Iterator<Text> it = line.split('=').iterato... | java | protected void setDescriptor(Text line) throws ParseException {
line.trim();
try {
//split using equal sign
Iterator<Text> it = line.split('=').iterator();
//skip first token (m)
Text t = it.next();
//select second token (media_type port prof... | [
"protected",
"void",
"setDescriptor",
"(",
"Text",
"line",
")",
"throws",
"ParseException",
"{",
"line",
".",
"trim",
"(",
")",
";",
"try",
"{",
"//split using equal sign",
"Iterator",
"<",
"Text",
">",
"it",
"=",
"line",
".",
"split",
"(",
"'",
"'",
")"... | Reads values from specified text line
@param line the text description of the media.
@throws ParseException | [
"Reads",
"values",
"from",
"specified",
"text",
"line"
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L79-L120 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java | WriterUtils.getDefaultWriterFilePath | public static Path getDefaultWriterFilePath(State state, int numBranches, int branchId) {
"""
Creates the default {@link Path} for the {@link ConfigurationKeys#WRITER_FILE_PATH} key.
@param numBranches is the total number of branches for the given {@link State}.
@param branchId is the id for the specific branch ... | java | public static Path getDefaultWriterFilePath(State state, int numBranches, int branchId) {
if (state instanceof WorkUnitState) {
WorkUnitState workUnitState = (WorkUnitState) state;
return new Path(ForkOperatorUtils.getPathForBranch(workUnitState, workUnitState.getOutputFilePath(),
numBranches,... | [
"public",
"static",
"Path",
"getDefaultWriterFilePath",
"(",
"State",
"state",
",",
"int",
"numBranches",
",",
"int",
"branchId",
")",
"{",
"if",
"(",
"state",
"instanceof",
"WorkUnitState",
")",
"{",
"WorkUnitState",
"workUnitState",
"=",
"(",
"WorkUnitState",
... | Creates the default {@link Path} for the {@link ConfigurationKeys#WRITER_FILE_PATH} key.
@param numBranches is the total number of branches for the given {@link State}.
@param branchId is the id for the specific branch that the {@link org.apache.gobblin.writer.DataWriter} will write to.
@return a {@link Path} specifyin... | [
"Creates",
"the",
"default",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java#L209-L222 |
alkacon/opencms-core | src/org/opencms/jsp/decorator/CmsDecoratorConfiguration.java | CmsDecoratorConfiguration.getDecorationDefinition | public CmsDecorationDefintion getDecorationDefinition(CmsXmlContent configuration, int i) {
"""
Builds a CmsDecorationDefintion from a given configuration file.<p>
@param configuration the configuration file
@param i the number of the decoration definition to create
@return CmsDecorationDefintion created form... | java | public CmsDecorationDefintion getDecorationDefinition(CmsXmlContent configuration, int i) {
CmsDecorationDefintion decDef = new CmsDecorationDefintion();
String name = configuration.getValue(XPATH_DECORATION + "[" + i + "]/" + XPATH_NAME, m_configurationLocale).getStringValue(
m_cms);
... | [
"public",
"CmsDecorationDefintion",
"getDecorationDefinition",
"(",
"CmsXmlContent",
"configuration",
",",
"int",
"i",
")",
"{",
"CmsDecorationDefintion",
"decDef",
"=",
"new",
"CmsDecorationDefintion",
"(",
")",
";",
"String",
"name",
"=",
"configuration",
".",
"getV... | Builds a CmsDecorationDefintion from a given configuration file.<p>
@param configuration the configuration file
@param i the number of the decoration definition to create
@return CmsDecorationDefintion created form configuration file | [
"Builds",
"a",
"CmsDecorationDefintion",
"from",
"a",
"given",
"configuration",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/decorator/CmsDecoratorConfiguration.java#L242-L275 |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java | MapViewPosition.moveCenterAndZoom | @Override
public void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff) {
"""
Animates the center position of the map by the given amount of pixels.
@param moveHorizontal the amount of pixels to move this MapViewPosition horizontally.
@param moveVertical the amount of pixe... | java | @Override
public void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff) {
moveCenterAndZoom(moveHorizontal, moveVertical, zoomLevelDiff, true);
} | [
"@",
"Override",
"public",
"void",
"moveCenterAndZoom",
"(",
"double",
"moveHorizontal",
",",
"double",
"moveVertical",
",",
"byte",
"zoomLevelDiff",
")",
"{",
"moveCenterAndZoom",
"(",
"moveHorizontal",
",",
"moveVertical",
",",
"zoomLevelDiff",
",",
"true",
")",
... | Animates the center position of the map by the given amount of pixels.
@param moveHorizontal the amount of pixels to move this MapViewPosition horizontally.
@param moveVertical the amount of pixels to move this MapViewPosition vertically.
@param zoomLevelDiff the difference in desired zoom level. | [
"Animates",
"the",
"center",
"position",
"of",
"the",
"map",
"by",
"the",
"given",
"amount",
"of",
"pixels",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java#L304-L307 |
intellimate/Izou | src/main/java/org/intellimate/izou/system/file/FileManager.java | FileManager.createDefaultFile | public void createDefaultFile(String defaultFilePath, String initMessage) throws IOException {
"""
Creates a default File in case it does not exist yet. Default files can be used to load other files that are
created at runtime (like properties file)
@param defaultFilePath path to default file.txt (or where it ... | java | public void createDefaultFile(String defaultFilePath, String initMessage) throws IOException {
File file = new File(defaultFilePath);
BufferedWriter bufferedWriterInit = null;
try {
if (!file.exists()) {
file.createNewFile();
bufferedWriterInit = new B... | [
"public",
"void",
"createDefaultFile",
"(",
"String",
"defaultFilePath",
",",
"String",
"initMessage",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"defaultFilePath",
")",
";",
"BufferedWriter",
"bufferedWriterInit",
"=",
"null",
";"... | Creates a default File in case it does not exist yet. Default files can be used to load other files that are
created at runtime (like properties file)
@param defaultFilePath path to default file.txt (or where it should be created)
@param initMessage the string to write in default file
@throws IOException is thrown by ... | [
"Creates",
"a",
"default",
"File",
"in",
"case",
"it",
"does",
"not",
"exist",
"yet",
".",
"Default",
"files",
"can",
"be",
"used",
"to",
"load",
"other",
"files",
"that",
"are",
"created",
"at",
"runtime",
"(",
"like",
"properties",
"file",
")"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/system/file/FileManager.java#L113-L133 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedStatsCalculator.java | VariantAggregatedStatsCalculator.parseStats | protected void parseStats(Variant variant, StudyEntry file, int numAllele, String reference, String[] alternateAlleles, Map<String, String> info) {
"""
Looks for tags contained in statsTags and calculates stats parsing them.
@param variant
@param file
@param numAllele
@param reference
@param alternateAlleles
... | java | protected void parseStats(Variant variant, StudyEntry file, int numAllele, String reference, String[] alternateAlleles, Map<String, String> info) {
VariantStats vs = new VariantStats();
Map<String, String> stats = new LinkedHashMap<>();
for (Map.Entry<String, String> entry : info.entrySet()) {
... | [
"protected",
"void",
"parseStats",
"(",
"Variant",
"variant",
",",
"StudyEntry",
"file",
",",
"int",
"numAllele",
",",
"String",
"reference",
",",
"String",
"[",
"]",
"alternateAlleles",
",",
"Map",
"<",
"String",
",",
"String",
">",
"info",
")",
"{",
"Var... | Looks for tags contained in statsTags and calculates stats parsing them.
@param variant
@param file
@param numAllele
@param reference
@param alternateAlleles
@param info | [
"Looks",
"for",
"tags",
"contained",
"in",
"statsTags",
"and",
"calculates",
"stats",
"parsing",
"them",
"."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedStatsCalculator.java#L132-L148 |
wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/reflection/util/ClassUtils.java | ClassUtils.loadClass | @SuppressWarnings("unchecked")
public static <T> Class<? extends T> loadClass(String className, Class<T> ofType) {
"""
Loads and returns the class named className of type superClass.
@param <T> Type of the class
@param className Name of the class to load
@param superClass Type of the class to load
@retu... | java | @SuppressWarnings("unchecked")
public static <T> Class<? extends T> loadClass(String className, Class<T> ofType) {
try {
Class<?> clazz = Class.forName(className);
if(ofType == null || ! ofType.isAssignableFrom(clazz)) {
throw new IllegalArgumentException("... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"?",
"extends",
"T",
">",
"loadClass",
"(",
"String",
"className",
",",
"Class",
"<",
"T",
">",
"ofType",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">... | Loads and returns the class named className of type superClass.
@param <T> Type of the class
@param className Name of the class to load
@param superClass Type of the class to load
@return The loaded class of type superClass.
@throws IllegalArgumentException if the class with className could not be loaded or
if the th... | [
"Loads",
"and",
"returns",
"the",
"class",
"named",
"className",
"of",
"type",
"superClass",
"."
] | train | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/reflection/util/ClassUtils.java#L123-L135 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java | DynamicReportBuilder.addAutoText | public DynamicReportBuilder addAutoText(String message, byte position, byte alignment) {
"""
Adds a custom fixed message (literal) in header or footer. The message
width will be the page witdth<br>
The parameters are all constants from the
<code>ar.com.fdvs.dj.domain.AutoText</code> class
<br>
<br>
@param ... | java | public DynamicReportBuilder addAutoText(String message, byte position, byte alignment) {
HorizontalBandAlignment alignment_ = HorizontalBandAlignment.buildAligment(alignment);
AutoText text = new AutoText(message, position, alignment_);
text.setWidth(AutoText.WIDTH_NOT_SET);
addAutoText(... | [
"public",
"DynamicReportBuilder",
"addAutoText",
"(",
"String",
"message",
",",
"byte",
"position",
",",
"byte",
"alignment",
")",
"{",
"HorizontalBandAlignment",
"alignment_",
"=",
"HorizontalBandAlignment",
".",
"buildAligment",
"(",
"alignment",
")",
";",
"AutoText... | Adds a custom fixed message (literal) in header or footer. The message
width will be the page witdth<br>
The parameters are all constants from the
<code>ar.com.fdvs.dj.domain.AutoText</code> class
<br>
<br>
@param message The text to show
@param position POSITION_HEADER or POSITION_FOOTER
@param alignment <br>ALIGM... | [
"Adds",
"a",
"custom",
"fixed",
"message",
"(",
"literal",
")",
"in",
"header",
"or",
"footer",
".",
"The",
"message",
"width",
"will",
"be",
"the",
"page",
"witdth<br",
">",
"The",
"parameters",
"are",
"all",
"constants",
"from",
"the",
"<code",
">",
"a... | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L200-L206 |
VoltDB/voltdb | src/frontend/org/voltdb/messaging/FragmentTaskMessage.java | FragmentTaskMessage.addFragment | public void addFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet) {
"""
Add a pre-planned fragment.
@param fragmentId
@param outputDepId
@param parameterSet
"""
addFragment(planHash, null, outputDepId, parameterSet);
} | java | public void addFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet) {
addFragment(planHash, null, outputDepId, parameterSet);
} | [
"public",
"void",
"addFragment",
"(",
"byte",
"[",
"]",
"planHash",
",",
"int",
"outputDepId",
",",
"ByteBuffer",
"parameterSet",
")",
"{",
"addFragment",
"(",
"planHash",
",",
"null",
",",
"outputDepId",
",",
"parameterSet",
")",
";",
"}"
] | Add a pre-planned fragment.
@param fragmentId
@param outputDepId
@param parameterSet | [
"Add",
"a",
"pre",
"-",
"planned",
"fragment",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FragmentTaskMessage.java#L289-L291 |
kite-sdk/kite | kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/shaded/com/googlecode/jcsv/fastreader/SimpleCSVTokenizer.java | SimpleCSVTokenizer.tokenizeLine | @Override
public boolean tokenizeLine(String line, BufferedReader reader, Record record) throws IOException {
"""
Splits the given input line into parts, using the given delimiter.
"""
char separator = separatorChar;
int len = line.length();
int start = 0;
int j = 0;
for (int i = 0; i < ... | java | @Override
public boolean tokenizeLine(String line, BufferedReader reader, Record record) throws IOException {
char separator = separatorChar;
int len = line.length();
int start = 0;
int j = 0;
for (int i = 0; i < len; i++) {
if (line.charAt(i) == separator) {
put(line, start, i, j, ... | [
"@",
"Override",
"public",
"boolean",
"tokenizeLine",
"(",
"String",
"line",
",",
"BufferedReader",
"reader",
",",
"Record",
"record",
")",
"throws",
"IOException",
"{",
"char",
"separator",
"=",
"separatorChar",
";",
"int",
"len",
"=",
"line",
".",
"length",
... | Splits the given input line into parts, using the given delimiter. | [
"Splits",
"the",
"given",
"input",
"line",
"into",
"parts",
"using",
"the",
"given",
"delimiter",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/shaded/com/googlecode/jcsv/fastreader/SimpleCSVTokenizer.java#L44-L59 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedCollection.java | FileBasedCollection.loadAtomEntry | private Entry loadAtomEntry(final InputStream in) {
"""
Create a Rome Atom entry based on a Roller entry. Content is escaped. Link is stored as
rel=alternate link.
"""
try {
return Atom10Parser.parseEntry(new BufferedReader(new InputStreamReader(in, "UTF-8")), null, Locale.US);
} c... | java | private Entry loadAtomEntry(final InputStream in) {
try {
return Atom10Parser.parseEntry(new BufferedReader(new InputStreamReader(in, "UTF-8")), null, Locale.US);
} catch (final Exception e) {
e.printStackTrace();
return null;
}
} | [
"private",
"Entry",
"loadAtomEntry",
"(",
"final",
"InputStream",
"in",
")",
"{",
"try",
"{",
"return",
"Atom10Parser",
".",
"parseEntry",
"(",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"in",
",",
"\"UTF-8\"",
")",
")",
",",
"null",
",",... | Create a Rome Atom entry based on a Roller entry. Content is escaped. Link is stored as
rel=alternate link. | [
"Create",
"a",
"Rome",
"Atom",
"entry",
"based",
"on",
"a",
"Roller",
"entry",
".",
"Content",
"is",
"escaped",
".",
"Link",
"is",
"stored",
"as",
"rel",
"=",
"alternate",
"link",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedCollection.java#L616-L623 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java | SyntheticStorableReferenceBuilder.copyToMasterPrimaryKey | @Deprecated
public void copyToMasterPrimaryKey(Storable indexEntry, S master) throws FetchException {
"""
Sets all the primary key properties of the given master, using the
applicable properties of the given index entry.
@param indexEntry source of property values
@param master master whose primary key p... | java | @Deprecated
public void copyToMasterPrimaryKey(Storable indexEntry, S master) throws FetchException {
getReferenceAccess().copyToMasterPrimaryKey(indexEntry, master);
} | [
"@",
"Deprecated",
"public",
"void",
"copyToMasterPrimaryKey",
"(",
"Storable",
"indexEntry",
",",
"S",
"master",
")",
"throws",
"FetchException",
"{",
"getReferenceAccess",
"(",
")",
".",
"copyToMasterPrimaryKey",
"(",
"indexEntry",
",",
"master",
")",
";",
"}"
] | Sets all the primary key properties of the given master, using the
applicable properties of the given index entry.
@param indexEntry source of property values
@param master master whose primary key properties will be set
@deprecated call getReferenceAccess | [
"Sets",
"all",
"the",
"primary",
"key",
"properties",
"of",
"the",
"given",
"master",
"using",
"the",
"applicable",
"properties",
"of",
"the",
"given",
"index",
"entry",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java#L353-L356 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java | CacheOnDisk.delCacheEntry | public void delCacheEntry(ValueSet removeList, int cause, int source, boolean fromDepIdTemplateInvalidation, boolean fireEvent) {
"""
Call this method to remove multiple of cache ids from the disk.
@param removeList
- a collection of cache ids.
"""
htod.delCacheEntry(removeList, cause, source, from... | java | public void delCacheEntry(ValueSet removeList, int cause, int source, boolean fromDepIdTemplateInvalidation, boolean fireEvent) {
htod.delCacheEntry(removeList, cause, source, fromDepIdTemplateInvalidation, fireEvent);
} | [
"public",
"void",
"delCacheEntry",
"(",
"ValueSet",
"removeList",
",",
"int",
"cause",
",",
"int",
"source",
",",
"boolean",
"fromDepIdTemplateInvalidation",
",",
"boolean",
"fireEvent",
")",
"{",
"htod",
".",
"delCacheEntry",
"(",
"removeList",
",",
"cause",
",... | Call this method to remove multiple of cache ids from the disk.
@param removeList
- a collection of cache ids. | [
"Call",
"this",
"method",
"to",
"remove",
"multiple",
"of",
"cache",
"ids",
"from",
"the",
"disk",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java#L1297-L1299 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract.java | Tesseract.getOCRText | protected String getOCRText(String filename, int pageNum) {
"""
Gets recognized text.
@param filename input file name. Needed only for reading a UNLV zone
file.
@param pageNum page number; needed for hocr paging.
@return the recognized text
"""
if (filename != null && !filename.isEmpty()) {
... | java | protected String getOCRText(String filename, int pageNum) {
if (filename != null && !filename.isEmpty()) {
api.TessBaseAPISetInputName(handle, filename);
}
Pointer utf8Text = renderedFormat == RenderedFormat.HOCR ? api.TessBaseAPIGetHOCRText(handle, pageNum - 1) : api.TessBaseA... | [
"protected",
"String",
"getOCRText",
"(",
"String",
"filename",
",",
"int",
"pageNum",
")",
"{",
"if",
"(",
"filename",
"!=",
"null",
"&&",
"!",
"filename",
".",
"isEmpty",
"(",
")",
")",
"{",
"api",
".",
"TessBaseAPISetInputName",
"(",
"handle",
",",
"f... | Gets recognized text.
@param filename input file name. Needed only for reading a UNLV zone
file.
@param pageNum page number; needed for hocr paging.
@return the recognized text | [
"Gets",
"recognized",
"text",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L497-L506 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java | ParameterFormatter.handleLiteralChar | private static void handleLiteralChar(final StringBuilder buffer, final int escapeCounter, final char curChar) {
"""
16 bytes (allows immediate JVM inlining: < 35 bytes) LOG4J2-1096
"""
// any other char beside ESCAPE or DELIM_START/STOP-combo
// write unescaped escape chars
writeUnesca... | java | private static void handleLiteralChar(final StringBuilder buffer, final int escapeCounter, final char curChar) {
// any other char beside ESCAPE or DELIM_START/STOP-combo
// write unescaped escape chars
writeUnescapedEscapeChars(escapeCounter, buffer);
buffer.append(curChar);
} | [
"private",
"static",
"void",
"handleLiteralChar",
"(",
"final",
"StringBuilder",
"buffer",
",",
"final",
"int",
"escapeCounter",
",",
"final",
"char",
"curChar",
")",
"{",
"// any other char beside ESCAPE or DELIM_START/STOP-combo",
"// write unescaped escape chars",
"writeUn... | 16 bytes (allows immediate JVM inlining: < 35 bytes) LOG4J2-1096 | [
"16",
"bytes",
"(",
"allows",
"immediate",
"JVM",
"inlining",
":",
"<",
"35",
"bytes",
")",
"LOG4J2",
"-",
"1096"
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java#L307-L312 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/selectiveaccess/SelectiveAccessHandler.java | SelectiveAccessHandler.setSectionHandling | public void setSectionHandling( Map<String, EnumMap<SIT, EnumMap<CIT, Boolean>>> sectionHandling ) {
"""
Be sure to set the Default Section Handling to avoid errors...
"""
this.sectionHandling = sectionHandling;
} | java | public void setSectionHandling( Map<String, EnumMap<SIT, EnumMap<CIT, Boolean>>> sectionHandling ) {
this.sectionHandling = sectionHandling;
} | [
"public",
"void",
"setSectionHandling",
"(",
"Map",
"<",
"String",
",",
"EnumMap",
"<",
"SIT",
",",
"EnumMap",
"<",
"CIT",
",",
"Boolean",
">",
">",
">",
"sectionHandling",
")",
"{",
"this",
".",
"sectionHandling",
"=",
"sectionHandling",
";",
"}"
] | Be sure to set the Default Section Handling to avoid errors... | [
"Be",
"sure",
"to",
"set",
"the",
"Default",
"Section",
"Handling",
"to",
"avoid",
"errors",
"..."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/selectiveaccess/SelectiveAccessHandler.java#L120-L122 |
finnyb/javampd | src/main/java/org/bff/javampd/admin/MPDAdmin.java | MPDAdmin.fireMPDChangeEvent | protected synchronized void fireMPDChangeEvent(MPDChangeEvent.Event event) {
"""
Sends the appropriate {@link MPDChangeEvent} to all registered
{@link MPDChangeListener}s.
@param event the {@link MPDChangeEvent.Event} to send
"""
MPDChangeEvent mce = new MPDChangeEvent(this, event);
for (M... | java | protected synchronized void fireMPDChangeEvent(MPDChangeEvent.Event event) {
MPDChangeEvent mce = new MPDChangeEvent(this, event);
for (MPDChangeListener mcl : listeners) {
mcl.mpdChanged(mce);
}
} | [
"protected",
"synchronized",
"void",
"fireMPDChangeEvent",
"(",
"MPDChangeEvent",
".",
"Event",
"event",
")",
"{",
"MPDChangeEvent",
"mce",
"=",
"new",
"MPDChangeEvent",
"(",
"this",
",",
"event",
")",
";",
"for",
"(",
"MPDChangeListener",
"mcl",
":",
"listeners... | Sends the appropriate {@link MPDChangeEvent} to all registered
{@link MPDChangeListener}s.
@param event the {@link MPDChangeEvent.Event} to send | [
"Sends",
"the",
"appropriate",
"{",
"@link",
"MPDChangeEvent",
"}",
"to",
"all",
"registered",
"{",
"@link",
"MPDChangeListener",
"}",
"s",
"."
] | train | https://github.com/finnyb/javampd/blob/186736e85fc238b4208cc9ee23373f9249376b4c/src/main/java/org/bff/javampd/admin/MPDAdmin.java#L120-L126 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java | LevenshteinDistanceFunction.postfixLen | private static int postfixLen(String o1, String o2, int prefix) {
"""
Compute the postfix length.
@param o1 First object
@param o2 Second object
@param prefix Known prefix length
@return Postfix length
"""
int postfix = 0;
int p1 = o1.length(), p2 = o2.length();
while(p1 > prefix && p2 > pref... | java | private static int postfixLen(String o1, String o2, int prefix) {
int postfix = 0;
int p1 = o1.length(), p2 = o2.length();
while(p1 > prefix && p2 > prefix && (o1.charAt(--p1) == o2.charAt(--p2))) {
++postfix;
}
return postfix;
} | [
"private",
"static",
"int",
"postfixLen",
"(",
"String",
"o1",
",",
"String",
"o2",
",",
"int",
"prefix",
")",
"{",
"int",
"postfix",
"=",
"0",
";",
"int",
"p1",
"=",
"o1",
".",
"length",
"(",
")",
",",
"p2",
"=",
"o2",
".",
"length",
"(",
")",
... | Compute the postfix length.
@param o1 First object
@param o2 Second object
@param prefix Known prefix length
@return Postfix length | [
"Compute",
"the",
"postfix",
"length",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L132-L139 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multifile/MultiFileJournalHelper.java | MultiFileJournalHelper.parseParametersForPollingInterval | static long parseParametersForPollingInterval(Map<String, String> parameters)
throws JournalException {
"""
Find the polling interval that we will choose when checking for new
journal files to appear.
"""
String intervalString =
parameters.get(PARAMETER_FOLLOW_POLLING_INTER... | java | static long parseParametersForPollingInterval(Map<String, String> parameters)
throws JournalException {
String intervalString =
parameters.get(PARAMETER_FOLLOW_POLLING_INTERVAL);
if (intervalString == null) {
intervalString = DEFAULT_FOLLOW_POLLING_INTERVAL;
... | [
"static",
"long",
"parseParametersForPollingInterval",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"throws",
"JournalException",
"{",
"String",
"intervalString",
"=",
"parameters",
".",
"get",
"(",
"PARAMETER_FOLLOW_POLLING_INTERVAL",
")",
";",
... | Find the polling interval that we will choose when checking for new
journal files to appear. | [
"Find",
"the",
"polling",
"interval",
"that",
"we",
"will",
"choose",
"when",
"checking",
"for",
"new",
"journal",
"files",
"to",
"appear",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multifile/MultiFileJournalHelper.java#L50-L73 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java | ScopedServletUtils.setScopedSessionAttr | public static void setScopedSessionAttr( String attrName, Object val, HttpServletRequest request ) {
"""
If the request is a ScopedRequest, this sets an attribute whose name is scoped to that request's scope-ID;
otherwise, it is a straight passthrough to {@link HttpSession#setAttribute}.
@exclude
"""
... | java | public static void setScopedSessionAttr( String attrName, Object val, HttpServletRequest request )
{
request.getSession().setAttribute( getScopedSessionAttrName( attrName, request ), val );
} | [
"public",
"static",
"void",
"setScopedSessionAttr",
"(",
"String",
"attrName",
",",
"Object",
"val",
",",
"HttpServletRequest",
"request",
")",
"{",
"request",
".",
"getSession",
"(",
")",
".",
"setAttribute",
"(",
"getScopedSessionAttrName",
"(",
"attrName",
",",... | If the request is a ScopedRequest, this sets an attribute whose name is scoped to that request's scope-ID;
otherwise, it is a straight passthrough to {@link HttpSession#setAttribute}.
@exclude | [
"If",
"the",
"request",
"is",
"a",
"ScopedRequest",
"this",
"sets",
"an",
"attribute",
"whose",
"name",
"is",
"scoped",
"to",
"that",
"request",
"s",
"scope",
"-",
"ID",
";",
"otherwise",
"it",
"is",
"a",
"straight",
"passthrough",
"to",
"{",
"@link",
"H... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L330-L333 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.isAnnotationArray | private boolean isAnnotationArray(Map<? extends ExecutableElement, ? extends AnnotationValue> pairs) {
"""
Check if the annotation contains an array of annotation as a value. This
check is to verify if a repeatable type annotation is present or not.
@param pairs annotation type element and value pairs
@retu... | java | private boolean isAnnotationArray(Map<? extends ExecutableElement, ? extends AnnotationValue> pairs) {
AnnotationValue annotationValue;
for (ExecutableElement ee : pairs.keySet()) {
annotationValue = pairs.get(ee);
boolean rvalue = new SimpleAnnotationValueVisitor9<Boolean, Void>... | [
"private",
"boolean",
"isAnnotationArray",
"(",
"Map",
"<",
"?",
"extends",
"ExecutableElement",
",",
"?",
"extends",
"AnnotationValue",
">",
"pairs",
")",
"{",
"AnnotationValue",
"annotationValue",
";",
"for",
"(",
"ExecutableElement",
"ee",
":",
"pairs",
".",
... | Check if the annotation contains an array of annotation as a value. This
check is to verify if a repeatable type annotation is present or not.
@param pairs annotation type element and value pairs
@return true if the annotation contains an array of annotation as a value. | [
"Check",
"if",
"the",
"annotation",
"contains",
"an",
"array",
"of",
"annotation",
"as",
"a",
"value",
".",
"This",
"check",
"is",
"to",
"verify",
"if",
"a",
"repeatable",
"type",
"annotation",
"is",
"present",
"or",
"not",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L2502-L2542 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/message/ReceiveQueueSession.java | ReceiveQueueSession.addRemoteMessageFilter | public BaseMessageFilter addRemoteMessageFilter(BaseMessageFilter messageFilter, RemoteSession remoteSession) throws RemoteException {
"""
Given a copy of the client's message filter, set up a remote filter.
@param messageFilter The message filter.
@param remoteSession The remote session.
@return The message fi... | java | public BaseMessageFilter addRemoteMessageFilter(BaseMessageFilter messageFilter, RemoteSession remoteSession) throws RemoteException
{
BaseMessageFilter remoteFilter = messageFilter; // The actual remote filter.
messageFilter.setRegistryID(null); // The needs to be null to add this filter to the re... | [
"public",
"BaseMessageFilter",
"addRemoteMessageFilter",
"(",
"BaseMessageFilter",
"messageFilter",
",",
"RemoteSession",
"remoteSession",
")",
"throws",
"RemoteException",
"{",
"BaseMessageFilter",
"remoteFilter",
"=",
"messageFilter",
";",
"// The actual remote filter.",
"mes... | Given a copy of the client's message filter, set up a remote filter.
@param messageFilter The message filter.
@param remoteSession The remote session.
@return The message filter. | [
"Given",
"a",
"copy",
"of",
"the",
"client",
"s",
"message",
"filter",
"set",
"up",
"a",
"remote",
"filter",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/message/ReceiveQueueSession.java#L154-L179 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram3/support/async/CardLoadSupport.java | CardLoadSupport.loadMore | public void loadMore(final Card card) {
"""
start load data with paging for a card, usually called by {@link TangramEngine}
@param card the card need async loading data
"""
if (mAsyncPageLoader == null) {
return;
}
if (!card.loading && card.loadMore && card.hasMore) {
... | java | public void loadMore(final Card card) {
if (mAsyncPageLoader == null) {
return;
}
if (!card.loading && card.loadMore && card.hasMore) {
card.loading = true;
if (!card.loaded) {
card.page = sInitialPage;
}
mAsyncPageLoa... | [
"public",
"void",
"loadMore",
"(",
"final",
"Card",
"card",
")",
"{",
"if",
"(",
"mAsyncPageLoader",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"card",
".",
"loading",
"&&",
"card",
".",
"loadMore",
"&&",
"card",
".",
"hasMore",
")",... | start load data with paging for a card, usually called by {@link TangramEngine}
@param card the card need async loading data | [
"start",
"load",
"data",
"with",
"paging",
"for",
"a",
"card",
"usually",
"called",
"by",
"{"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram3/support/async/CardLoadSupport.java#L134-L174 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/topology/RefreshFutures.java | RefreshFutures.awaitAll | static long awaitAll(long timeout, TimeUnit timeUnit, Collection<? extends Future<?>> futures) throws InterruptedException {
"""
Await for either future completion or to reach the timeout. Successful/exceptional future completion is not substantial.
@param timeout the timeout value.
@param timeUnit timeout uni... | java | static long awaitAll(long timeout, TimeUnit timeUnit, Collection<? extends Future<?>> futures) throws InterruptedException {
long waitTime = 0;
for (Future<?> future : futures) {
long timeoutLeft = timeUnit.toNanos(timeout) - waitTime;
if (timeoutLeft <= 0) {
... | [
"static",
"long",
"awaitAll",
"(",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
",",
"Collection",
"<",
"?",
"extends",
"Future",
"<",
"?",
">",
">",
"futures",
")",
"throws",
"InterruptedException",
"{",
"long",
"waitTime",
"=",
"0",
";",
"for",
"(",
... | Await for either future completion or to reach the timeout. Successful/exceptional future completion is not substantial.
@param timeout the timeout value.
@param timeUnit timeout unit.
@param futures {@link Collection} of {@literal Future}s.
@return time awaited in {@link TimeUnit#NANOSECONDS}.
@throws InterruptedExce... | [
"Await",
"for",
"either",
"future",
"completion",
"or",
"to",
"reach",
"the",
"timeout",
".",
"Successful",
"/",
"exceptional",
"future",
"completion",
"is",
"not",
"substantial",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/topology/RefreshFutures.java#L36-L63 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.data_smd_smdId_PUT | public OvhSmd data_smd_smdId_PUT(Long smdId, String data) throws IOException {
"""
Modify an existing SMD file
REST: PUT /domain/data/smd/{smdId}
@param smdId [required] SMD ID
@param data [required] SMD content file
"""
String qPath = "/domain/data/smd/{smdId}";
StringBuilder sb = path(qPath, smdId);... | java | public OvhSmd data_smd_smdId_PUT(Long smdId, String data) throws IOException {
String qPath = "/domain/data/smd/{smdId}";
StringBuilder sb = path(qPath, smdId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "data", data);
String resp = exec(qPath, "PUT", sb.toString(), o);
return conv... | [
"public",
"OvhSmd",
"data_smd_smdId_PUT",
"(",
"Long",
"smdId",
",",
"String",
"data",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/data/smd/{smdId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"smdId",
")",
";",
"Ha... | Modify an existing SMD file
REST: PUT /domain/data/smd/{smdId}
@param smdId [required] SMD ID
@param data [required] SMD content file | [
"Modify",
"an",
"existing",
"SMD",
"file"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L155-L162 |
lucee/Lucee | core/src/main/java/lucee/transformer/util/Hash.java | Hash.getHashText | public static String getHashText(String plainText, String algorithm) throws NoSuchAlgorithmException {
"""
Method getHashText.
@param plainText
@param algorithm The algorithm to use like MD2, MD5, SHA-1, etc.
@return String
@throws NoSuchAlgorithmException
"""
MessageDigest mdAlgorithm = MessageDigest.g... | java | public static String getHashText(String plainText, String algorithm) throws NoSuchAlgorithmException {
MessageDigest mdAlgorithm = MessageDigest.getInstance(algorithm);
mdAlgorithm.update(plainText.getBytes());
byte[] digest = mdAlgorithm.digest();
StringBuffer hexString = new StringBuffer();
for (int i = 0; i ... | [
"public",
"static",
"String",
"getHashText",
"(",
"String",
"plainText",
",",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"MessageDigest",
"mdAlgorithm",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"algorithm",
")",
";",
"mdAlgorithm",
... | Method getHashText.
@param plainText
@param algorithm The algorithm to use like MD2, MD5, SHA-1, etc.
@return String
@throws NoSuchAlgorithmException | [
"Method",
"getHashText",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/Hash.java#L68-L87 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java | I18N.getFormattedString | public static String getFormattedString(String key, Object... arguments) {
"""
Retourne une traduction dans la locale courante et insère les arguments aux positions {i}.
@param key clé d'un libellé dans les fichiers de traduction
@param arguments Valeur à inclure dans le résultat
@return String
"""
// éc... | java | public static String getFormattedString(String key, Object... arguments) {
// échappement des quotes qui sont des caractères spéciaux pour MessageFormat
final String string = getString(key).replace("'", "''");
return new MessageFormat(string, getCurrentLocale()).format(arguments);
} | [
"public",
"static",
"String",
"getFormattedString",
"(",
"String",
"key",
",",
"Object",
"...",
"arguments",
")",
"{",
"// échappement des quotes qui sont des caractères spéciaux pour MessageFormat\r",
"final",
"String",
"string",
"=",
"getString",
"(",
"key",
")",
".",
... | Retourne une traduction dans la locale courante et insère les arguments aux positions {i}.
@param key clé d'un libellé dans les fichiers de traduction
@param arguments Valeur à inclure dans le résultat
@return String | [
"Retourne",
"une",
"traduction",
"dans",
"la",
"locale",
"courante",
"et",
"insère",
"les",
"arguments",
"aux",
"positions",
"{",
"i",
"}",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java#L130-L134 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.equalsAny | public static boolean equalsAny(final CharSequence string, final CharSequence... searchStrings) {
"""
<p>Compares given <code>string</code> to a CharSequences vararg of <code>searchStrings</code>,
returning {@code true} if the <code>string</code> is equal to any of the <code>searchStrings</code>.</p>
<pre>
St... | java | public static boolean equalsAny(final CharSequence string, final CharSequence... searchStrings) {
if (ArrayUtils.isNotEmpty(searchStrings)) {
for (final CharSequence next : searchStrings) {
if (equals(string, next)) {
return true;
}
}
... | [
"public",
"static",
"boolean",
"equalsAny",
"(",
"final",
"CharSequence",
"string",
",",
"final",
"CharSequence",
"...",
"searchStrings",
")",
"{",
"if",
"(",
"ArrayUtils",
".",
"isNotEmpty",
"(",
"searchStrings",
")",
")",
"{",
"for",
"(",
"final",
"CharSeque... | <p>Compares given <code>string</code> to a CharSequences vararg of <code>searchStrings</code>,
returning {@code true} if the <code>string</code> is equal to any of the <code>searchStrings</code>.</p>
<pre>
StringUtils.equalsAny(null, (CharSequence[]) null) = false
StringUtils.equalsAny(null, null, null) = true
Stri... | [
"<p",
">",
"Compares",
"given",
"<code",
">",
"string<",
"/",
"code",
">",
"to",
"a",
"CharSequences",
"vararg",
"of",
"<code",
">",
"searchStrings<",
"/",
"code",
">",
"returning",
"{",
"@code",
"true",
"}",
"if",
"the",
"<code",
">",
"string<",
"/",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L1243-L1252 |
Erudika/para | para-core/src/main/java/com/erudika/para/validation/Constraint.java | Constraint.matches | public static boolean matches(Class<? extends Annotation> anno, String consName) {
"""
Verifies that the given annotation type corresponds to a known constraint.
@param anno annotation type
@param consName constraint name
@return true if known
"""
return VALIDATORS.get(anno).equals(consName);
} | java | public static boolean matches(Class<? extends Annotation> anno, String consName) {
return VALIDATORS.get(anno).equals(consName);
} | [
"public",
"static",
"boolean",
"matches",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"anno",
",",
"String",
"consName",
")",
"{",
"return",
"VALIDATORS",
".",
"get",
"(",
"anno",
")",
".",
"equals",
"(",
"consName",
")",
";",
"}"
] | Verifies that the given annotation type corresponds to a known constraint.
@param anno annotation type
@param consName constraint name
@return true if known | [
"Verifies",
"that",
"the",
"given",
"annotation",
"type",
"corresponds",
"to",
"a",
"known",
"constraint",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/validation/Constraint.java#L144-L146 |
trellis-ldp-archive/trellis-http | src/main/java/org/trellisldp/http/impl/BaseLdpHandler.java | BaseLdpHandler.checkCache | protected static void checkCache(final Request request, final Instant modified, final EntityTag etag) {
"""
Check the request for a cache-related response
@param request the request
@param modified the modified time
@param etag the etag
@throws WebApplicationException either a 412 Precondition Failed or a 304 ... | java | protected static void checkCache(final Request request, final Instant modified, final EntityTag etag) {
final ResponseBuilder builder = request.evaluatePreconditions(from(modified), etag);
if (nonNull(builder)) {
throw new WebApplicationException(builder.build());
}
} | [
"protected",
"static",
"void",
"checkCache",
"(",
"final",
"Request",
"request",
",",
"final",
"Instant",
"modified",
",",
"final",
"EntityTag",
"etag",
")",
"{",
"final",
"ResponseBuilder",
"builder",
"=",
"request",
".",
"evaluatePreconditions",
"(",
"from",
"... | Check the request for a cache-related response
@param request the request
@param modified the modified time
@param etag the etag
@throws WebApplicationException either a 412 Precondition Failed or a 304 Not Modified, depending on the context. | [
"Check",
"the",
"request",
"for",
"a",
"cache",
"-",
"related",
"response"
] | train | https://github.com/trellis-ldp-archive/trellis-http/blob/bc762f88602c49c2b137a7adf68d576666e55fff/src/main/java/org/trellisldp/http/impl/BaseLdpHandler.java#L112-L117 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/msv/GenericMsvValidator.java | GenericMsvValidator.validateElementStart | @Override
public void validateElementStart(String localName, String uri, String prefix)
throws XMLStreamException {
"""
Method called to update information about the newly encountered (start)
element. At this point namespace information has been resolved, but
no DTD validation has been done. Validato... | java | @Override
public void validateElementStart(String localName, String uri, String prefix)
throws XMLStreamException
{
/* [WSTX-200]: If sub-tree we were to validate has ended, we
* have no current acceptor, and must quite. Ideally we would
* really handle this more cleanly bu... | [
"@",
"Override",
"public",
"void",
"validateElementStart",
"(",
"String",
"localName",
",",
"String",
"uri",
",",
"String",
"prefix",
")",
"throws",
"XMLStreamException",
"{",
"/* [WSTX-200]: If sub-tree we were to validate has ended, we\n * have no current acceptor, an... | Method called to update information about the newly encountered (start)
element. At this point namespace information has been resolved, but
no DTD validation has been done. Validator is to do these validations,
including checking for attribute value (and existence) compatibility. | [
"Method",
"called",
"to",
"update",
"information",
"about",
"the",
"newly",
"encountered",
"(",
"start",
")",
"element",
".",
"At",
"this",
"point",
"namespace",
"information",
"has",
"been",
"resolved",
"but",
"no",
"DTD",
"validation",
"has",
"been",
"done",... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/msv/GenericMsvValidator.java#L240-L287 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/io/CharStreams.java | CharStreams.readLines | @CanIgnoreReturnValue // some processors won't return a useful result
public static <T> T readLines(Readable readable, LineProcessor<T> processor) throws IOException {
"""
Streams lines from a {@link Readable} object, stopping when the processor returns {@code false}
or all lines have been read and returning th... | java | @CanIgnoreReturnValue // some processors won't return a useful result
public static <T> T readLines(Readable readable, LineProcessor<T> processor) throws IOException {
checkNotNull(readable);
checkNotNull(processor);
LineReader lineReader = new LineReader(readable);
String line;
while ((line = li... | [
"@",
"CanIgnoreReturnValue",
"// some processors won't return a useful result",
"public",
"static",
"<",
"T",
">",
"T",
"readLines",
"(",
"Readable",
"readable",
",",
"LineProcessor",
"<",
"T",
">",
"processor",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
... | Streams lines from a {@link Readable} object, stopping when the processor returns {@code false}
or all lines have been read and returning the result produced by the processor. Does not close
{@code readable}. Note that this method may not fully consume the contents of {@code readable}
if the processor stops processing ... | [
"Streams",
"lines",
"from",
"a",
"{",
"@link",
"Readable",
"}",
"object",
"stopping",
"when",
"the",
"processor",
"returns",
"{",
"@code",
"false",
"}",
"or",
"all",
"lines",
"have",
"been",
"read",
"and",
"returning",
"the",
"result",
"produced",
"by",
"t... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/io/CharStreams.java#L139-L152 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/generic/Generic.java | Generic.getUploadedMojo | private final ByteVec getUploadedMojo(final Key<Frame> key) throws IllegalArgumentException {
"""
Retrieves pre-uploaded MOJO archive and performs basic verifications, if present.
@param key Key to MOJO bytes in DKV
@return An instance of {@link ByteVec} containing the bytes of an uploaded MOJO, if present. Or... | java | private final ByteVec getUploadedMojo(final Key<Frame> key) throws IllegalArgumentException {
Objects.requireNonNull(key); // Nicer null pointer exception in case null key is accidentally provided
Frame mojoFrame = key.get();
if (mojoFrame.numCols() > 1)
throw new IllegalArgumentExc... | [
"private",
"final",
"ByteVec",
"getUploadedMojo",
"(",
"final",
"Key",
"<",
"Frame",
">",
"key",
")",
"throws",
"IllegalArgumentException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
")",
";",
"// Nicer null pointer exception in case null key is accidentally provi... | Retrieves pre-uploaded MOJO archive and performs basic verifications, if present.
@param key Key to MOJO bytes in DKV
@return An instance of {@link ByteVec} containing the bytes of an uploaded MOJO, if present. Or exception. Never returns null.
@throws IllegalArgumentException In case the supplied key is invalid (MOJO... | [
"Retrieves",
"pre",
"-",
"uploaded",
"MOJO",
"archive",
"and",
"performs",
"basic",
"verifications",
"if",
"present",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/generic/Generic.java#L89-L101 |
netty/netty | codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheEncoder.java | AbstractBinaryMemcacheEncoder.encodeExtras | private static void encodeExtras(ByteBuf buf, ByteBuf extras) {
"""
Encode the extras.
@param buf the {@link ByteBuf} to write into.
@param extras the extras to encode.
"""
if (extras == null || !extras.isReadable()) {
return;
}
buf.writeBytes(extras);
} | java | private static void encodeExtras(ByteBuf buf, ByteBuf extras) {
if (extras == null || !extras.isReadable()) {
return;
}
buf.writeBytes(extras);
} | [
"private",
"static",
"void",
"encodeExtras",
"(",
"ByteBuf",
"buf",
",",
"ByteBuf",
"extras",
")",
"{",
"if",
"(",
"extras",
"==",
"null",
"||",
"!",
"extras",
".",
"isReadable",
"(",
")",
")",
"{",
"return",
";",
"}",
"buf",
".",
"writeBytes",
"(",
... | Encode the extras.
@param buf the {@link ByteBuf} to write into.
@param extras the extras to encode. | [
"Encode",
"the",
"extras",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheEncoder.java#L54-L60 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwt/src/com/ibm/websphere/security/jwt/JwtBuilder.java | JwtBuilder.signWith | public JwtBuilder signWith(String algorithm, Key key) throws KeyException {
"""
Signing key and algorithm information.
@param algorithm
This String value represents the signing algorithm. This information will be used
to sign the {@code JwtToken}
@param key
The private key {@code Key} to use for signing JWT... | java | public JwtBuilder signWith(String algorithm, Key key) throws KeyException {
builder = builder.signWith(algorithm, key);
return this;
} | [
"public",
"JwtBuilder",
"signWith",
"(",
"String",
"algorithm",
",",
"Key",
"key",
")",
"throws",
"KeyException",
"{",
"builder",
"=",
"builder",
".",
"signWith",
"(",
"algorithm",
",",
"key",
")",
";",
"return",
"this",
";",
"}"
] | Signing key and algorithm information.
@param algorithm
This String value represents the signing algorithm. This information will be used
to sign the {@code JwtToken}
@param key
The private key {@code Key} to use for signing JWTs.
@return {@code JwtBuilder} object
@throws KeyException
Thrown if the key is {@code null}... | [
"Signing",
"key",
"and",
"algorithm",
"information",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/websphere/security/jwt/JwtBuilder.java#L327-L330 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSessionFactory.java | CmsUgcSessionFactory.createSession | private CmsUgcSession createSession(CmsObject cms, CmsUgcConfiguration config) throws CmsUgcException {
"""
Creates a new editing session.<p>
@param cms the cms context
@param config the configuration
@return the form session
@throws CmsUgcException if the session creation fails
"""
if (getQ... | java | private CmsUgcSession createSession(CmsObject cms, CmsUgcConfiguration config) throws CmsUgcException {
if (getQueue(config).waitForSlot()) {
try {
return new CmsUgcSession(m_adminCms, cms, config);
} catch (CmsException e) {
LOG.error(e.getLocalizedMessa... | [
"private",
"CmsUgcSession",
"createSession",
"(",
"CmsObject",
"cms",
",",
"CmsUgcConfiguration",
"config",
")",
"throws",
"CmsUgcException",
"{",
"if",
"(",
"getQueue",
"(",
"config",
")",
".",
"waitForSlot",
"(",
")",
")",
"{",
"try",
"{",
"return",
"new",
... | Creates a new editing session.<p>
@param cms the cms context
@param config the configuration
@return the form session
@throws CmsUgcException if the session creation fails | [
"Creates",
"a",
"new",
"editing",
"session",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSessionFactory.java#L187-L201 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/StatementManager.java | StatementManager.getGenericStatement | public Statement getGenericStatement(ClassDescriptor cds, boolean scrollable) throws PersistenceBrokerException {
"""
return a generic Statement for the given ClassDescriptor.
Never use this method for UPDATE/INSERT/DELETE if you want to use the batch mode.
"""
try
{
return cds.... | java | public Statement getGenericStatement(ClassDescriptor cds, boolean scrollable) throws PersistenceBrokerException
{
try
{
return cds.getStatementsForClass(m_conMan).getGenericStmt(m_conMan.getConnection(), scrollable);
}
catch (LookupException e)
{
... | [
"public",
"Statement",
"getGenericStatement",
"(",
"ClassDescriptor",
"cds",
",",
"boolean",
"scrollable",
")",
"throws",
"PersistenceBrokerException",
"{",
"try",
"{",
"return",
"cds",
".",
"getStatementsForClass",
"(",
"m_conMan",
")",
".",
"getGenericStmt",
"(",
... | return a generic Statement for the given ClassDescriptor.
Never use this method for UPDATE/INSERT/DELETE if you want to use the batch mode. | [
"return",
"a",
"generic",
"Statement",
"for",
"the",
"given",
"ClassDescriptor",
".",
"Never",
"use",
"this",
"method",
"for",
"UPDATE",
"/",
"INSERT",
"/",
"DELETE",
"if",
"you",
"want",
"to",
"use",
"the",
"batch",
"mode",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java#L569-L579 |
google/error-prone | check_api/src/main/java/com/google/errorprone/apply/SourceFile.java | SourceFile.replaceChars | public void replaceChars(int startPosition, int endPosition, String replacement) {
"""
Replace the source code between the start and end character positions with a new string.
<p>This method uses the same conventions as {@link String#substring(int, int)} for its start
and end parameters.
"""
try {
... | java | public void replaceChars(int startPosition, int endPosition, String replacement) {
try {
sourceBuilder.replace(startPosition, endPosition, replacement);
} catch (StringIndexOutOfBoundsException e) {
throw new IndexOutOfBoundsException(
String.format(
"Replacement cannot be ma... | [
"public",
"void",
"replaceChars",
"(",
"int",
"startPosition",
",",
"int",
"endPosition",
",",
"String",
"replacement",
")",
"{",
"try",
"{",
"sourceBuilder",
".",
"replace",
"(",
"startPosition",
",",
"endPosition",
",",
"replacement",
")",
";",
"}",
"catch",... | Replace the source code between the start and end character positions with a new string.
<p>This method uses the same conventions as {@link String#substring(int, int)} for its start
and end parameters. | [
"Replace",
"the",
"source",
"code",
"between",
"the",
"start",
"and",
"end",
"character",
"positions",
"with",
"a",
"new",
"string",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/apply/SourceFile.java#L150-L160 |
sundrio/sundrio | annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java | ToPojo.readObjectValue | private static String readObjectValue(String ref, TypeDef source, Property property) {
"""
Returns the string representation of the code that reads an object property from a reference using a getter.
@param ref The reference.
@param source The type of the reference.
@param property The pro... | java | private static String readObjectValue(String ref, TypeDef source, Property property) {
return indent(ref) + "("+property.getTypeRef().toString()+")(" + ref + " instanceof Map ? ((Map)" + ref + ").getOrDefault(\"" + getterOf(source, property).getName() + "\", " + getDefaultValue(property)+") : "+ getDefaultValue... | [
"private",
"static",
"String",
"readObjectValue",
"(",
"String",
"ref",
",",
"TypeDef",
"source",
",",
"Property",
"property",
")",
"{",
"return",
"indent",
"(",
"ref",
")",
"+",
"\"(\"",
"+",
"property",
".",
"getTypeRef",
"(",
")",
".",
"toString",
"(",
... | Returns the string representation of the code that reads an object property from a reference using a getter.
@param ref The reference.
@param source The type of the reference.
@param property The property to read.
@return The code. | [
"Returns",
"the",
"string",
"representation",
"of",
"the",
"code",
"that",
"reads",
"an",
"object",
"property",
"from",
"a",
"reference",
"using",
"a",
"getter",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java#L756-L758 |
NessComputing/components-ness-httpclient | client/src/main/java/com/nesscomputing/httpclient/HttpClientDefaultAuthProvider.java | HttpClientDefaultAuthProvider.forUser | public static final HttpClientAuthProvider forUser(final String login, final String password) {
"""
Returns an {@link HttpClientAuthProvider} that will accept any remote host and presents
the login and password as authentication credential.
@param login Login to use.
@param password Password to use.
"""
... | java | public static final HttpClientAuthProvider forUser(final String login, final String password)
{
return new HttpClientDefaultAuthProvider(null, null, -1, null, login, password);
} | [
"public",
"static",
"final",
"HttpClientAuthProvider",
"forUser",
"(",
"final",
"String",
"login",
",",
"final",
"String",
"password",
")",
"{",
"return",
"new",
"HttpClientDefaultAuthProvider",
"(",
"null",
",",
"null",
",",
"-",
"1",
",",
"null",
",",
"login... | Returns an {@link HttpClientAuthProvider} that will accept any remote host and presents
the login and password as authentication credential.
@param login Login to use.
@param password Password to use. | [
"Returns",
"an",
"{"
] | train | https://github.com/NessComputing/components-ness-httpclient/blob/8e97e8576e470449672c81fa7890c60f9986966d/client/src/main/java/com/nesscomputing/httpclient/HttpClientDefaultAuthProvider.java#L44-L47 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/util/ManhattanDistance.java | ManhattanDistance.getDistance | public double getDistance(double[] sample1, double[] sample2) throws IllegalArgumentException {
"""
Get the distance between two data samples.
@param sample1
the first sample of <code>double</code> values
@param sample2
the second sample of <code>double</code> values
@return the distance between <code>sampl... | java | public double getDistance(double[] sample1, double[] sample2) throws IllegalArgumentException {
int n = sample1.length;
if (n != sample2.length || n < 1)
throw new IllegalArgumentException("Input arrays must have the same length.");
double sumOfDifferences = 0;
for (int i = 0; i < n; i++) {
if (Double.i... | [
"public",
"double",
"getDistance",
"(",
"double",
"[",
"]",
"sample1",
",",
"double",
"[",
"]",
"sample2",
")",
"throws",
"IllegalArgumentException",
"{",
"int",
"n",
"=",
"sample1",
".",
"length",
";",
"if",
"(",
"n",
"!=",
"sample2",
".",
"length",
"||... | Get the distance between two data samples.
@param sample1
the first sample of <code>double</code> values
@param sample2
the second sample of <code>double</code> values
@return the distance between <code>sample1</code> and
<code>sample2</code>
@throws IllegalArgumentException
if the two samples contain different amount... | [
"Get",
"the",
"distance",
"between",
"two",
"data",
"samples",
"."
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/util/ManhattanDistance.java#L43-L58 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/BeanUtils.java | BeanUtils.getAllProperties | public static List<PropertyNode> getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters) {
"""
Get all properties including JavaBean pseudo properties matching getter conventions.
@param type the ClassNode
@param includeSuperProperties whether to in... | java | public static List<PropertyNode> getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters) {
return getAllProperties(type, includeSuperProperties, includeStatic, includePseudoGetters, false, false);
} | [
"public",
"static",
"List",
"<",
"PropertyNode",
">",
"getAllProperties",
"(",
"ClassNode",
"type",
",",
"boolean",
"includeSuperProperties",
",",
"boolean",
"includeStatic",
",",
"boolean",
"includePseudoGetters",
")",
"{",
"return",
"getAllProperties",
"(",
"type",
... | Get all properties including JavaBean pseudo properties matching getter conventions.
@param type the ClassNode
@param includeSuperProperties whether to include super properties
@param includeStatic whether to include static properties
@param includePseudoGetters whether to include JavaBean pseudo (getXXX/isYYY) proper... | [
"Get",
"all",
"properties",
"including",
"JavaBean",
"pseudo",
"properties",
"matching",
"getter",
"conventions",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/BeanUtils.java#L51-L53 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/SerIteratorFactory.java | SerIteratorFactory.createChild | public SerIterator createChild(Object value, SerIterator parent) {
"""
Creates an iterator wrapper for a value retrieved from a parent iterator.
<p>
Allows the parent iterator to define the child iterator using generic type information.
This handles cases such as a {@code List} as the value in a {@code Map}.
... | java | public SerIterator createChild(Object value, SerIterator parent) {
Class<?> declaredType = parent.valueType();
List<Class<?>> childGenericTypes = parent.valueTypeTypes();
if (value instanceof Collection) {
if (childGenericTypes.size() == 1) {
return collection((Collec... | [
"public",
"SerIterator",
"createChild",
"(",
"Object",
"value",
",",
"SerIterator",
"parent",
")",
"{",
"Class",
"<",
"?",
">",
"declaredType",
"=",
"parent",
".",
"valueType",
"(",
")",
";",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"childGenericTypes",
... | Creates an iterator wrapper for a value retrieved from a parent iterator.
<p>
Allows the parent iterator to define the child iterator using generic type information.
This handles cases such as a {@code List} as the value in a {@code Map}.
@param value the possible collection-like object, not null
@param parent the p... | [
"Creates",
"an",
"iterator",
"wrapper",
"for",
"a",
"value",
"retrieved",
"from",
"a",
"parent",
"iterator",
".",
"<p",
">",
"Allows",
"the",
"parent",
"iterator",
"to",
"define",
"the",
"child",
"iterator",
"using",
"generic",
"type",
"information",
".",
"T... | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerIteratorFactory.java#L150-L170 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java | ResourceHealthMetadatasInner.listBySiteAsync | public Observable<Page<ResourceHealthMetadataInner>> listBySiteAsync(final String resourceGroupName, final String name) {
"""
Gets the category of ResourceHealthMetadata to use for the given site as a collection.
Gets the category of ResourceHealthMetadata to use for the given site as a collection.
@param reso... | java | public Observable<Page<ResourceHealthMetadataInner>> listBySiteAsync(final String resourceGroupName, final String name) {
return listBySiteWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<ResourceHealthMetadataInner>>, Page<ResourceHealthMetadataInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"ResourceHealthMetadataInner",
">",
">",
"listBySiteAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listBySiteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets the category of ResourceHealthMetadata to use for the given site as a collection.
Gets the category of ResourceHealthMetadata to use for the given site as a collection.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of web app.
@throws IllegalArgumentException ... | [
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"as",
"a",
"collection",
".",
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"as",
"a",
"collection",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java#L387-L395 |
realexpayments/rxp-hpp-java | src/main/java/com/realexpayments/hpp/sdk/RealexHpp.java | RealexHpp.requestToJson | public String requestToJson(HppRequest hppRequest, boolean encoded ) {
"""
<p>
Method produces JSON from <code>HppRequest</code> object.
Carries out the following actions:
<ul>
<li>Validates inputs</li>
<li>Generates defaults for security hash, order ID and time stamp (if required)</li>
<li>Optional to Base6... | java | public String requestToJson(HppRequest hppRequest, boolean encoded ) {
LOGGER.info("Converting HppRequest to JSON.");
String json = null;
//generate defaults
LOGGER.debug("Generating defaults.");
hppRequest.generateDefaults(secret);
//validate request
LOGGER.debug("Validating request.");
ValidationU... | [
"public",
"String",
"requestToJson",
"(",
"HppRequest",
"hppRequest",
",",
"boolean",
"encoded",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Converting HppRequest to JSON.\"",
")",
";",
"String",
"json",
"=",
"null",
";",
"//generate defaults",
"LOGGER",
".",
"debug"... | <p>
Method produces JSON from <code>HppRequest</code> object.
Carries out the following actions:
<ul>
<li>Validates inputs</li>
<li>Generates defaults for security hash, order ID and time stamp (if required)</li>
<li>Optional to Base64 encode inputs</li>
<li>Serialises request object to JSON</li>
</ul>
</p>
@param hpp... | [
"<p",
">",
"Method",
"produces",
"JSON",
"from",
"<code",
">",
"HppRequest<",
"/",
"code",
">",
"object",
".",
"Carries",
"out",
"the",
"following",
"actions",
":",
"<ul",
">",
"<li",
">",
"Validates",
"inputs<",
"/",
"li",
">",
"<li",
">",
"Generates",
... | train | https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/RealexHpp.java#L79-L110 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java | ImagePipeline.fetchDecodedImage | public DataSource<CloseableReference<CloseableImage>> fetchDecodedImage(
ImageRequest imageRequest,
Object callerContext) {
"""
Submits a request for execution and returns a DataSource representing the pending decoded
image(s).
<p>The returned DataSource must be closed once the client has finished wi... | java | public DataSource<CloseableReference<CloseableImage>> fetchDecodedImage(
ImageRequest imageRequest,
Object callerContext) {
return fetchDecodedImage(imageRequest, callerContext, ImageRequest.RequestLevel.FULL_FETCH);
} | [
"public",
"DataSource",
"<",
"CloseableReference",
"<",
"CloseableImage",
">",
">",
"fetchDecodedImage",
"(",
"ImageRequest",
"imageRequest",
",",
"Object",
"callerContext",
")",
"{",
"return",
"fetchDecodedImage",
"(",
"imageRequest",
",",
"callerContext",
",",
"Imag... | Submits a request for execution and returns a DataSource representing the pending decoded
image(s).
<p>The returned DataSource must be closed once the client has finished with it.
@param imageRequest the request to submit
@param callerContext the caller context for image request
@return a DataSource representing the p... | [
"Submits",
"a",
"request",
"for",
"execution",
"and",
"returns",
"a",
"DataSource",
"representing",
"the",
"pending",
"decoded",
"image",
"(",
"s",
")",
".",
"<p",
">",
"The",
"returned",
"DataSource",
"must",
"be",
"closed",
"once",
"the",
"client",
"has",
... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java#L213-L217 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/AbstractJPAProviderIntegration.java | AbstractJPAProviderIntegration.logProviderInfo | @FFDCIgnore(Exception.class)
private void logProviderInfo(String providerName, ClassLoader loader) {
"""
Log version information about the specified persistence provider, if it can be determined.
@param providerName fully qualified class name of JPA persistence provider
@param loader class loader with acce... | java | @FFDCIgnore(Exception.class)
private void logProviderInfo(String providerName, ClassLoader loader) {
try {
if (PROVIDER_ECLIPSELINK.equals(providerName)) {
// org.eclipse.persistence.Version.getVersion(): 2.6.4.v20160829-44060b6
Class<?> Version = loadClass(loader... | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"private",
"void",
"logProviderInfo",
"(",
"String",
"providerName",
",",
"ClassLoader",
"loader",
")",
"{",
"try",
"{",
"if",
"(",
"PROVIDER_ECLIPSELINK",
".",
"equals",
"(",
"providerName",
")",
")",
... | Log version information about the specified persistence provider, if it can be determined.
@param providerName fully qualified class name of JPA persistence provider
@param loader class loader with access to the JPA provider classes | [
"Log",
"version",
"information",
"about",
"the",
"specified",
"persistence",
"provider",
"if",
"it",
"can",
"be",
"determined",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/AbstractJPAProviderIntegration.java#L68-L95 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newComponentFeedbackPanel | public static ComponentFeedbackPanel newComponentFeedbackPanel(final String id,
final Component filter) {
"""
Factory method for create a new {@link ComponentFeedbackPanel}.
@param id
the id
@param filter
the filter
@return the {@link ComponentFeedbackPanel}
"""
final ComponentFeedbackPanel feedback... | java | public static ComponentFeedbackPanel newComponentFeedbackPanel(final String id,
final Component filter)
{
final ComponentFeedbackPanel feedbackPanel = new ComponentFeedbackPanel(id, filter);
feedbackPanel.setOutputMarkupId(true);
return feedbackPanel;
} | [
"public",
"static",
"ComponentFeedbackPanel",
"newComponentFeedbackPanel",
"(",
"final",
"String",
"id",
",",
"final",
"Component",
"filter",
")",
"{",
"final",
"ComponentFeedbackPanel",
"feedbackPanel",
"=",
"new",
"ComponentFeedbackPanel",
"(",
"id",
",",
"filter",
... | Factory method for create a new {@link ComponentFeedbackPanel}.
@param id
the id
@param filter
the filter
@return the {@link ComponentFeedbackPanel} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"ComponentFeedbackPanel",
"}",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L142-L148 |
tommyettinger/RegExodus | src/main/java/regexodus/ds/CharCharMap.java | CharCharMap.arraySize | public static int arraySize(final int expected, final float f) {
"""
Returns the least power of two smaller than or equal to 2<sup>30</sup> and larger than or equal to <code>Math.ceil( expected / f )</code>.
@param expected the expected number of elements in a hash table.
@param f the load factor.
@ret... | java | public static int arraySize(final int expected, final float f) {
final long s = Math.max(2, HashCommon.nextPowerOfTwo((long) Math.ceil(expected / f)));
if (s > (1 << 30))
throw new IllegalArgumentException("Too large (" + expected + " expected elements with load factor " + f + ")");
... | [
"public",
"static",
"int",
"arraySize",
"(",
"final",
"int",
"expected",
",",
"final",
"float",
"f",
")",
"{",
"final",
"long",
"s",
"=",
"Math",
".",
"max",
"(",
"2",
",",
"HashCommon",
".",
"nextPowerOfTwo",
"(",
"(",
"long",
")",
"Math",
".",
"cei... | Returns the least power of two smaller than or equal to 2<sup>30</sup> and larger than or equal to <code>Math.ceil( expected / f )</code>.
@param expected the expected number of elements in a hash table.
@param f the load factor.
@return the minimum possible size for a backing array.
@throws IllegalArgumentExce... | [
"Returns",
"the",
"least",
"power",
"of",
"two",
"smaller",
"than",
"or",
"equal",
"to",
"2<sup",
">",
"30<",
"/",
"sup",
">",
"and",
"larger",
"than",
"or",
"equal",
"to",
"<code",
">",
"Math",
".",
"ceil",
"(",
"expected",
"/",
"f",
")",
"<",
"/"... | train | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/ds/CharCharMap.java#L465-L470 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ejs/ras/TraceNLS.java | TraceNLS.getResourceBundle | public static ResourceBundle getResourceBundle(Class<?> caller, String bundleName, Locale locale) {
"""
Looks up the specified ResourceBundle
This method first uses the current classLoader to find the
ResourceBundle. If that fails, it uses the context classLoader.
@param caller
Class object calling this me... | java | public static ResourceBundle getResourceBundle(Class<?> caller, String bundleName, Locale locale) {
return TraceNLSResolver.getInstance().getResourceBundle(caller, bundleName, locale);
} | [
"public",
"static",
"ResourceBundle",
"getResourceBundle",
"(",
"Class",
"<",
"?",
">",
"caller",
",",
"String",
"bundleName",
",",
"Locale",
"locale",
")",
"{",
"return",
"TraceNLSResolver",
".",
"getInstance",
"(",
")",
".",
"getResourceBundle",
"(",
"caller",... | Looks up the specified ResourceBundle
This method first uses the current classLoader to find the
ResourceBundle. If that fails, it uses the context classLoader.
@param caller
Class object calling this method
@param bundleName
the fully qualified name of the ResourceBundle. Must not be
null.
@param locale
the Locale o... | [
"Looks",
"up",
"the",
"specified",
"ResourceBundle"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ejs/ras/TraceNLS.java#L804-L806 |
f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, Serializable value) {
"""
Inserts a Serializable value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a Serializable object, or null
@return this bundler insta... | java | public Bundler put(String key, Serializable value) {
delegate.putSerializable(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"Serializable",
"value",
")",
"{",
"delegate",
".",
"putSerializable",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a Serializable value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a Serializable object, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"Serializable",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L426-L429 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextChildSupport.java | ControlBeanContextChildSupport.firePropertyChange | protected void firePropertyChange(String name, Object oldValue, Object newValue) {
"""
Fire a property change event.
@param name
@param oldValue
@param newValue
"""
_propertyChangeSupport.firePropertyChange(name, oldValue, newValue);
} | java | protected void firePropertyChange(String name, Object oldValue, Object newValue) {
_propertyChangeSupport.firePropertyChange(name, oldValue, newValue);
} | [
"protected",
"void",
"firePropertyChange",
"(",
"String",
"name",
",",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"_propertyChangeSupport",
".",
"firePropertyChange",
"(",
"name",
",",
"oldValue",
",",
"newValue",
")",
";",
"}"
] | Fire a property change event.
@param name
@param oldValue
@param newValue | [
"Fire",
"a",
"property",
"change",
"event",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextChildSupport.java#L216-L218 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/query/QueryBuilder.java | QueryBuilder.useIndex | public QueryBuilder useIndex(String designDocument, String indexName) {
"""
Instruct a query to use a specific index.
@param designDocument Design document to use.
@param indexName Index name to use.
@return {@code QueryBuilder} object for method chaining.
"""
useIndex = new String[]{designDocument,... | java | public QueryBuilder useIndex(String designDocument, String indexName) {
useIndex = new String[]{designDocument, indexName};
return this;
} | [
"public",
"QueryBuilder",
"useIndex",
"(",
"String",
"designDocument",
",",
"String",
"indexName",
")",
"{",
"useIndex",
"=",
"new",
"String",
"[",
"]",
"{",
"designDocument",
",",
"indexName",
"}",
";",
"return",
"this",
";",
"}"
] | Instruct a query to use a specific index.
@param designDocument Design document to use.
@param indexName Index name to use.
@return {@code QueryBuilder} object for method chaining. | [
"Instruct",
"a",
"query",
"to",
"use",
"a",
"specific",
"index",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/query/QueryBuilder.java#L183-L186 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsInner.java | RoleDefinitionsInner.listAsync | public Observable<Page<RoleDefinitionInner>> listAsync(final String scope, final String filter) {
"""
Get all role definitions that are applicable at scope and above.
@param scope The scope of the role definition.
@param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below th... | java | public Observable<Page<RoleDefinitionInner>> listAsync(final String scope, final String filter) {
return listWithServiceResponseAsync(scope, filter)
.map(new Func1<ServiceResponse<Page<RoleDefinitionInner>>, Page<RoleDefinitionInner>>() {
@Override
public Page<RoleDef... | [
"public",
"Observable",
"<",
"Page",
"<",
"RoleDefinitionInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"filter",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"scope",
",",
"filter",
")",
".",
"map",
"(",
... | Get all role definitions that are applicable at scope and above.
@param scope The scope of the role definition.
@param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the o... | [
"Get",
"all",
"role",
"definitions",
"that",
"are",
"applicable",
"at",
"scope",
"and",
"above",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleDefinitionsInner.java#L495-L503 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.veeamCloudConnect_serviceName_upgrade_GET | public ArrayList<String> veeamCloudConnect_serviceName_upgrade_GET(String serviceName, OvhOffer offer) throws IOException {
"""
Get allowed durations for 'upgrade' option
REST: GET /order/veeamCloudConnect/{serviceName}/upgrade
@param offer [required] The offer on which you want to be upgraded
@param serviceN... | java | public ArrayList<String> veeamCloudConnect_serviceName_upgrade_GET(String serviceName, OvhOffer offer) throws IOException {
String qPath = "/order/veeamCloudConnect/{serviceName}/upgrade";
StringBuilder sb = path(qPath, serviceName);
query(sb, "offer", offer);
String resp = exec(qPath, "GET", sb.toString(), nul... | [
"public",
"ArrayList",
"<",
"String",
">",
"veeamCloudConnect_serviceName_upgrade_GET",
"(",
"String",
"serviceName",
",",
"OvhOffer",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/veeamCloudConnect/{serviceName}/upgrade\"",
";",
"StringBuild... | Get allowed durations for 'upgrade' option
REST: GET /order/veeamCloudConnect/{serviceName}/upgrade
@param offer [required] The offer on which you want to be upgraded
@param serviceName [required] | [
"Get",
"allowed",
"durations",
"for",
"upgrade",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2040-L2046 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/AbstractDatabase.java | AbstractDatabase.addDocumentChangeListener | @NonNull
public ListenerToken addDocumentChangeListener(
@NonNull String id,
@NonNull DocumentChangeListener listener) {
"""
Add the given DocumentChangeListener to the specified document.
"""
return addDocumentChangeListener(id, null, listener);
} | java | @NonNull
public ListenerToken addDocumentChangeListener(
@NonNull String id,
@NonNull DocumentChangeListener listener) {
return addDocumentChangeListener(id, null, listener);
} | [
"@",
"NonNull",
"public",
"ListenerToken",
"addDocumentChangeListener",
"(",
"@",
"NonNull",
"String",
"id",
",",
"@",
"NonNull",
"DocumentChangeListener",
"listener",
")",
"{",
"return",
"addDocumentChangeListener",
"(",
"id",
",",
"null",
",",
"listener",
")",
"... | Add the given DocumentChangeListener to the specified document. | [
"Add",
"the",
"given",
"DocumentChangeListener",
"to",
"the",
"specified",
"document",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L654-L659 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/listener/ExternalEventHandlerBase.java | ExternalEventHandlerBase.createResponseMessage | protected String createResponseMessage(Exception e, String request, Object msgdoc, Map<String,String> metaInfo) {
"""
This method is used to create an MDW default response message. Such
a message is only used when an exception occurred before customizable
code is reached (e.g. the external message is malformed s... | java | protected String createResponseMessage(Exception e, String request, Object msgdoc, Map<String,String> metaInfo) {
ListenerHelper helper = new ListenerHelper();
if (e instanceof ServiceException)
return helper.createErrorResponse(request, metaInfo, (ServiceException)e).getContent();
e... | [
"protected",
"String",
"createResponseMessage",
"(",
"Exception",
"e",
",",
"String",
"request",
",",
"Object",
"msgdoc",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metaInfo",
")",
"{",
"ListenerHelper",
"helper",
"=",
"new",
"ListenerHelper",
"(",
")",
... | This method is used to create an MDW default response message. Such
a message is only used when an exception occurred before customizable
code is reached (e.g. the external message is malformed so we cannot
determine which handler to call), or a simple acknowledgment is sufficient.
@param e The exception that triggers... | [
"This",
"method",
"is",
"used",
"to",
"create",
"an",
"MDW",
"default",
"response",
"message",
".",
"Such",
"a",
"message",
"is",
"only",
"used",
"when",
"an",
"exception",
"occurred",
"before",
"customizable",
"code",
"is",
"reached",
"(",
"e",
".",
"g",
... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/listener/ExternalEventHandlerBase.java#L223-L231 |
emilsjolander/sprinkles | library/src/main/java/se/emilsjolander/sprinkles/Query.java | Query.all | public static <T extends Model> ManyQuery<T> all(Class<T> clazz) {
"""
Start a query for the entire list of instance of type T
@param clazz
The class representing the type of the list you want returned
@param <T>
The type of the list you want returned
@return the query to execute
"""
return ... | java | public static <T extends Model> ManyQuery<T> all(Class<T> clazz) {
return many(clazz, "SELECT * FROM " + Utils.getTableName(clazz));
} | [
"public",
"static",
"<",
"T",
"extends",
"Model",
">",
"ManyQuery",
"<",
"T",
">",
"all",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"many",
"(",
"clazz",
",",
"\"SELECT * FROM \"",
"+",
"Utils",
".",
"getTableName",
"(",
"clazz",
")",
... | Start a query for the entire list of instance of type T
@param clazz
The class representing the type of the list you want returned
@param <T>
The type of the list you want returned
@return the query to execute | [
"Start",
"a",
"query",
"for",
"the",
"entire",
"list",
"of",
"instance",
"of",
"type",
"T"
] | train | https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Query.java#L124-L126 |
fedups/com.obdobion.algebrain | src/main/java/com/obdobion/algebrain/operator/OpChain.java | OpChain.resolve | @Override
public void resolve(final ValueStack values) throws Exception {
"""
{@inheritDoc}
This is an intermediate result. Its result is not directly returned.
Assign the value to a variable if you need access to it later.
"""
if (values.size() < 2)
throw new ParseException("missin... | java | @Override
public void resolve(final ValueStack values) throws Exception
{
if (values.size() < 2)
throw new ParseException("missing operand", 0);
try
{
final Object rightSideResult = values.popWhatever();
values.popWhatever();
values.push(... | [
"@",
"Override",
"public",
"void",
"resolve",
"(",
"final",
"ValueStack",
"values",
")",
"throws",
"Exception",
"{",
"if",
"(",
"values",
".",
"size",
"(",
")",
"<",
"2",
")",
"throw",
"new",
"ParseException",
"(",
"\"missing operand\"",
",",
"0",
")",
"... | {@inheritDoc}
This is an intermediate result. Its result is not directly returned.
Assign the value to a variable if you need access to it later. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/fedups/com.obdobion.algebrain/blob/d0adaa9fbbba907bdcf820961e9058b0d2b15a8a/src/main/java/com/obdobion/algebrain/operator/OpChain.java#L71-L88 |
twilliamson/mogwee-logging | src/main/java/com/mogwee/logging/Logger.java | Logger.warnf | public final void warnf(Throwable cause, String message, Object... args) {
"""
Logs a formatted message and stack trace if WARN logging is enabled.
@param cause an exception to print stack trace of
@param message a <a href="http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax">format ... | java | public final void warnf(Throwable cause, String message, Object... args)
{
logf(Level.WARN, cause, message, args);
} | [
"public",
"final",
"void",
"warnf",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"logf",
"(",
"Level",
".",
"WARN",
",",
"cause",
",",
"message",
",",
"args",
")",
";",
"}"
] | Logs a formatted message and stack trace if WARN logging is enabled.
@param cause an exception to print stack trace of
@param message a <a href="http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax">format string</a>
@param args arguments referenced by the format specifiers in the format s... | [
"Logs",
"a",
"formatted",
"message",
"and",
"stack",
"trace",
"if",
"WARN",
"logging",
"is",
"enabled",
"."
] | train | https://github.com/twilliamson/mogwee-logging/blob/30b99c2649de455432d956a8f6a74316de4cd62c/src/main/java/com/mogwee/logging/Logger.java#L202-L205 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java | Calendar.handleGetDateFormat | protected DateFormat handleGetDateFormat(String pattern, Locale locale) {
"""
Creates a <code>DateFormat</code> appropriate to this calendar.
This is a framework method for subclasses to override. This method
is responsible for creating the calendar-specific DateFormat and
DateFormatSymbols objects as needed.
... | java | protected DateFormat handleGetDateFormat(String pattern, Locale locale) {
return handleGetDateFormat(pattern, null, ULocale.forLocale(locale));
} | [
"protected",
"DateFormat",
"handleGetDateFormat",
"(",
"String",
"pattern",
",",
"Locale",
"locale",
")",
"{",
"return",
"handleGetDateFormat",
"(",
"pattern",
",",
"null",
",",
"ULocale",
".",
"forLocale",
"(",
"locale",
")",
")",
";",
"}"
] | Creates a <code>DateFormat</code> appropriate to this calendar.
This is a framework method for subclasses to override. This method
is responsible for creating the calendar-specific DateFormat and
DateFormatSymbols objects as needed.
@param pattern the pattern, specific to the <code>DateFormat</code>
subclass
@param lo... | [
"Creates",
"a",
"<code",
">",
"DateFormat<",
"/",
"code",
">",
"appropriate",
"to",
"this",
"calendar",
".",
"This",
"is",
"a",
"framework",
"method",
"for",
"subclasses",
"to",
"override",
".",
"This",
"method",
"is",
"responsible",
"for",
"creating",
"the"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L3355-L3357 |
census-instrumentation/opencensus-java | exporters/metrics/ocagent/src/main/java/io/opencensus/exporter/metrics/ocagent/OcAgentNodeUtils.java | OcAgentNodeUtils.getProcessIdentifier | @VisibleForTesting
static ProcessIdentifier getProcessIdentifier(String jvmName, Timestamp censusTimestamp) {
"""
Creates process identifier with the given JVM name and start time.
"""
String hostname;
int pid;
// jvmName should be something like '<pid>@<hostname>', at least in Oracle and OpenJdk... | java | @VisibleForTesting
static ProcessIdentifier getProcessIdentifier(String jvmName, Timestamp censusTimestamp) {
String hostname;
int pid;
// jvmName should be something like '<pid>@<hostname>', at least in Oracle and OpenJdk JVMs
int delimiterIndex = jvmName.indexOf('@');
if (delimiterIndex < 1) {
... | [
"@",
"VisibleForTesting",
"static",
"ProcessIdentifier",
"getProcessIdentifier",
"(",
"String",
"jvmName",
",",
"Timestamp",
"censusTimestamp",
")",
"{",
"String",
"hostname",
";",
"int",
"pid",
";",
"// jvmName should be something like '<pid>@<hostname>', at least in Oracle an... | Creates process identifier with the given JVM name and start time. | [
"Creates",
"process",
"identifier",
"with",
"the",
"given",
"JVM",
"name",
"and",
"start",
"time",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/exporters/metrics/ocagent/src/main/java/io/opencensus/exporter/metrics/ocagent/OcAgentNodeUtils.java#L60-L90 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator._generate | protected void _generate(SarlBehaviorUnit handler, PyAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param handler the behavior unit.
@param it the target for the generated content.
@param context the context.
"""
final JvmTypeReference event = handler.getName();... | java | protected void _generate(SarlBehaviorUnit handler, PyAppendable it, IExtraLanguageGeneratorContext context) {
final JvmTypeReference event = handler.getName();
final String handleName = it.declareUniqueNameVariable(handler, "__on_" + event.getSimpleName() + "__"); //$NON-NLS-1$ //$NON-NLS-2$
it.append("def ").app... | [
"protected",
"void",
"_generate",
"(",
"SarlBehaviorUnit",
"handler",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"final",
"JvmTypeReference",
"event",
"=",
"handler",
".",
"getName",
"(",
")",
";",
"final",
"String",
"ha... | Generate the given object.
@param handler the behavior unit.
@param it the target for the generated content.
@param context the context. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L988-L1014 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/DocumentRevs.java | DocumentRevs.setOthers | @JsonAnySetter
public void setOthers(String name, Object value) {
"""
Jackson will automatically put any field it can not find match to this @JsonAnySetter bucket. This is
effectively all the document content.
"""
if(name.startsWith("_")) {
// Just be defensive
throw new Ru... | java | @JsonAnySetter
public void setOthers(String name, Object value) {
if(name.startsWith("_")) {
// Just be defensive
throw new RuntimeException("This is a reserved field, and should not be treated as document content.");
}
this.others.put(name, value);
} | [
"@",
"JsonAnySetter",
"public",
"void",
"setOthers",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"name",
".",
"startsWith",
"(",
"\"_\"",
")",
")",
"{",
"// Just be defensive",
"throw",
"new",
"RuntimeException",
"(",
"\"This is a reser... | Jackson will automatically put any field it can not find match to this @JsonAnySetter bucket. This is
effectively all the document content. | [
"Jackson",
"will",
"automatically",
"put",
"any",
"field",
"it",
"can",
"not",
"find",
"match",
"to",
"this"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/DocumentRevs.java#L79-L86 |
contentful/contentful.java | src/main/java/com/contentful/java/cda/TransformQuery.java | TransformQuery.one | public Flowable<Transformed> one(String id) {
"""
Retrieve the transformed entry from Contentful.
@param id the id of the entry of type Transformed.
@return the Transformed entry.
@throws CDAResourceNotFoundException if no such resource was found.
@throws IllegalStateException if the transformed class... | java | public Flowable<Transformed> one(String id) {
try {
return baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.contentType().id()
.equals(contentTypeId);
}
... | [
"public",
"Flowable",
"<",
"Transformed",
">",
"one",
"(",
"String",
"id",
")",
"{",
"try",
"{",
"return",
"baseQuery",
"(",
")",
".",
"one",
"(",
"id",
")",
".",
"filter",
"(",
"new",
"Predicate",
"<",
"CDAEntry",
">",
"(",
")",
"{",
"@",
"Overrid... | Retrieve the transformed entry from Contentful.
@param id the id of the entry of type Transformed.
@return the Transformed entry.
@throws CDAResourceNotFoundException if no such resource was found.
@throws IllegalStateException if the transformed class could not be created.
@throws IllegalStateException ... | [
"Retrieve",
"the",
"transformed",
"entry",
"from",
"Contentful",
"."
] | train | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/TransformQuery.java#L148-L168 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newReadOnlyException | public static ReadOnlyException newReadOnlyException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link ReadOnlyException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throw... | java | public static ReadOnlyException newReadOnlyException(Throwable cause, String message, Object... args) {
return new ReadOnlyException(format(message, args), cause);
} | [
"public",
"static",
"ReadOnlyException",
"newReadOnlyException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ReadOnlyException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"cause",
"... | Constructs and initializes a new {@link ReadOnlyException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link ReadOnlyException} was thrown.
@param message {@link String} describing t... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ReadOnlyException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L859-L861 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java | AbstractPlainSocketImpl.doConnect | synchronized void doConnect(InetAddress address, int port, int timeout) throws IOException {
"""
The workhorse of the connection operation. Tries several times to
establish a connection to the given <host, port>. If unsuccessful,
throws an IOException indicating what went wrong.
"""
synchronized (f... | java | synchronized void doConnect(InetAddress address, int port, int timeout) throws IOException {
synchronized (fdLock) {
if (!closePending && (socket == null || !socket.isBound())) {
NetHooks.beforeTcpConnect(fd, address, port);
}
}
try {
BlockGuar... | [
"synchronized",
"void",
"doConnect",
"(",
"InetAddress",
"address",
",",
"int",
"port",
",",
"int",
"timeout",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"fdLock",
")",
"{",
"if",
"(",
"!",
"closePending",
"&&",
"(",
"socket",
"==",
"null",
"|... | The workhorse of the connection operation. Tries several times to
establish a connection to the given <host, port>. If unsuccessful,
throws an IOException indicating what went wrong. | [
"The",
"workhorse",
"of",
"the",
"connection",
"operation",
".",
"Tries",
"several",
"times",
"to",
"establish",
"a",
"connection",
"to",
"the",
"given",
"<host",
"port",
">",
".",
"If",
"unsuccessful",
"throws",
"an",
"IOException",
"indicating",
"what",
"wen... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java#L329-L356 |
knightliao/disconf | disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/mapper/QueryGenerator.java | QueryGenerator.getCreateQuery | public Query getCreateQuery(boolean generateKey, boolean quick, ENTITY... entities) {
"""
構造一個create語句的query
@param generateKey 由數據庫autoincrement生成key,還是應用端指定key
@param quick 時候用快速方式,快速方式無法將自動生成key填充到對象中。一般此參數為false,只有當批量創建,且由數據庫生成key時該處可選。
@param entities
@return 下午1:26:37 created by Darwin(Tianxin)... | java | public Query getCreateQuery(boolean generateKey, boolean quick, ENTITY... entities) {
return getCreateQuery(Arrays.asList(entities), generateKey, quick, null);
} | [
"public",
"Query",
"getCreateQuery",
"(",
"boolean",
"generateKey",
",",
"boolean",
"quick",
",",
"ENTITY",
"...",
"entities",
")",
"{",
"return",
"getCreateQuery",
"(",
"Arrays",
".",
"asList",
"(",
"entities",
")",
",",
"generateKey",
",",
"quick",
",",
"n... | 構造一個create語句的query
@param generateKey 由數據庫autoincrement生成key,還是應用端指定key
@param quick 時候用快速方式,快速方式無法將自動生成key填充到對象中。一般此參數為false,只有當批量創建,且由數據庫生成key時該處可選。
@param entities
@return 下午1:26:37 created by Darwin(Tianxin) | [
"構造一個create語句的query"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/mapper/QueryGenerator.java#L230-L232 |
openskynetwork/java-adsb | src/main/java/org/opensky/libadsb/Position.java | Position.fromECEF | public static Position fromECEF (double x, double y, double z) {
"""
Converts a cartesian earth-centered earth-fixed coordinate into an WGS84 LLA position
@param x coordinate in meters
@param y coordinate in meters
@param z coordinate in meters
@return a position object representing the WGS84 position
"""
... | java | public static Position fromECEF (double x, double y, double z) {
double p = sqrt(x*x + y*y);
double th = atan2(a * z, b * p);
double lon = atan2(y, x);
double lat = atan2(
(z + (a*a - b*b) / (b*b) * b * pow(sin(th), 3)),
p - e2 * a * pow(cos(th), 3));
double N = a / sqrt(1 - pow(sqrt(e2) * sin(lat), ... | [
"public",
"static",
"Position",
"fromECEF",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"double",
"p",
"=",
"sqrt",
"(",
"x",
"*",
"x",
"+",
"y",
"*",
"y",
")",
";",
"double",
"th",
"=",
"atan2",
"(",
"a",
"*",
"z",
... | Converts a cartesian earth-centered earth-fixed coordinate into an WGS84 LLA position
@param x coordinate in meters
@param y coordinate in meters
@param z coordinate in meters
@return a position object representing the WGS84 position | [
"Converts",
"a",
"cartesian",
"earth",
"-",
"centered",
"earth",
"-",
"fixed",
"coordinate",
"into",
"an",
"WGS84",
"LLA",
"position"
] | train | https://github.com/openskynetwork/java-adsb/blob/01d497d3e74ad10063ab443ab583e9c8653a8b8d/src/main/java/org/opensky/libadsb/Position.java#L146-L164 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/HeaderCell.java | HeaderCell.setAttribute | public void setAttribute(String name, String value, String facet) throws JspException {
"""
<p>
Implementation of the {@link org.apache.beehive.netui.tags.IAttributeConsumer} interface. This
allows users of the anchorCell tag to extend the attribute set that is rendered by the HTML
anchor. This method accepts... | java | public void setAttribute(String name, String value, String facet) throws JspException {
if(facet == null || facet.equals(ATTRIBUTE_HEADER_NAME)) {
super.addStateAttribute(_cellState, name, value);
}
else {
String s = Bundle.getString("Tags_AttributeFacetNotSupported", new... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"facet",
"==",
"null",
"||",
"facet",
".",
"equals",
"(",
"ATTRIBUTE_HEADER_NAME",
")",
")",
"{",
"super... | <p>
Implementation of the {@link org.apache.beehive.netui.tags.IAttributeConsumer} interface. This
allows users of the anchorCell tag to extend the attribute set that is rendered by the HTML
anchor. This method accepts the following facets:
<table>
<tr><td>Facet Name</td><td>Operation</td></tr>
<tr><td><code>header</... | [
"<p",
">",
"Implementation",
"of",
"the",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/HeaderCell.java#L706-L714 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.removeByG_C | @Override
public void removeByG_C(long groupId, long commerceAccountId) {
"""
Removes all the commerce orders where groupId = ? and commerceAccountId = ? from the database.
@param groupId the group ID
@param commerceAccountId the commerce account ID
"""
for (CommerceOrder commerceOrder : findByG... | java | @Override
public void removeByG_C(long groupId, long commerceAccountId) {
for (CommerceOrder commerceOrder : findByG_C(groupId,
commerceAccountId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceOrder);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_C",
"(",
"long",
"groupId",
",",
"long",
"commerceAccountId",
")",
"{",
"for",
"(",
"CommerceOrder",
"commerceOrder",
":",
"findByG_C",
"(",
"groupId",
",",
"commerceAccountId",
",",
"QueryUtil",
".",
"ALL_POS",
",",... | Removes all the commerce orders where groupId = ? and commerceAccountId = ? from the database.
@param groupId the group ID
@param commerceAccountId the commerce account ID | [
"Removes",
"all",
"the",
"commerce",
"orders",
"where",
"groupId",
"=",
"?",
";",
"and",
"commerceAccountId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L4001-L4007 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java | GlobToRegex.toRegex | public static String toRegex(String glob, String separators) {
"""
Converts the given glob to a regular expression pattern. The given separators determine what
characters the resulting expression breaks on for glob expressions such as * which should not
cross directory boundaries.
<p>Basic conversions (assumi... | java | public static String toRegex(String glob, String separators) {
return new GlobToRegex(glob, separators).convert();
} | [
"public",
"static",
"String",
"toRegex",
"(",
"String",
"glob",
",",
"String",
"separators",
")",
"{",
"return",
"new",
"GlobToRegex",
"(",
"glob",
",",
"separators",
")",
".",
"convert",
"(",
")",
";",
"}"
] | Converts the given glob to a regular expression pattern. The given separators determine what
characters the resulting expression breaks on for glob expressions such as * which should not
cross directory boundaries.
<p>Basic conversions (assuming / as only separator):
<pre>{@code
? = [^/]
* = [^/]*
** ... | [
"Converts",
"the",
"given",
"glob",
"to",
"a",
"regular",
"expression",
"pattern",
".",
"The",
"given",
"separators",
"determine",
"what",
"characters",
"the",
"resulting",
"expression",
"breaks",
"on",
"for",
"glob",
"expressions",
"such",
"as",
"*",
"which",
... | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java#L48-L50 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/PerplexityAffinityMatrixBuilder.java | PerplexityAffinityMatrixBuilder.computePi | protected static double computePi(int i, double[] dist_i, double[] pij_i, double perplexity, double logPerp) {
"""
Compute row pij[i], using binary search on the kernel bandwidth sigma to
obtain the desired perplexity.
@param i Current point
@param dist_i Distance matrix row pij[i]
@param pij_i Output row
@... | java | protected static double computePi(int i, double[] dist_i, double[] pij_i, double perplexity, double logPerp) {
// Relation to paper: beta == 1. / (2*sigma*sigma)
double beta = estimateInitialBeta(dist_i, perplexity);
double diff = computeH(i, dist_i, pij_i, -beta) - logPerp;
double betaMin = 0.;
dou... | [
"protected",
"static",
"double",
"computePi",
"(",
"int",
"i",
",",
"double",
"[",
"]",
"dist_i",
",",
"double",
"[",
"]",
"pij_i",
",",
"double",
"perplexity",
",",
"double",
"logPerp",
")",
"{",
"// Relation to paper: beta == 1. / (2*sigma*sigma)",
"double",
"... | Compute row pij[i], using binary search on the kernel bandwidth sigma to
obtain the desired perplexity.
@param i Current point
@param dist_i Distance matrix row pij[i]
@param pij_i Output row
@param perplexity Desired perplexity
@param logPerp Log of desired perplexity
@return Beta | [
"Compute",
"row",
"pij",
"[",
"i",
"]",
"using",
"binary",
"search",
"on",
"the",
"kernel",
"bandwidth",
"sigma",
"to",
"obtain",
"the",
"desired",
"perplexity",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/PerplexityAffinityMatrixBuilder.java#L175-L193 |
google/identity-toolkit-java-client | src/main/java/com/google/identitytoolkit/GitkitClient.java | GitkitClient.createFromJson | public static GitkitClient createFromJson(String configPath)
throws GitkitClientException, JSONException, IOException {
"""
Constructs a Gitkit client from a JSON config file
@param configPath Path to JSON configuration file
@return Gitkit client
"""
return createFromJson(configPath, null);
} | java | public static GitkitClient createFromJson(String configPath)
throws GitkitClientException, JSONException, IOException {
return createFromJson(configPath, null);
} | [
"public",
"static",
"GitkitClient",
"createFromJson",
"(",
"String",
"configPath",
")",
"throws",
"GitkitClientException",
",",
"JSONException",
",",
"IOException",
"{",
"return",
"createFromJson",
"(",
"configPath",
",",
"null",
")",
";",
"}"
] | Constructs a Gitkit client from a JSON config file
@param configPath Path to JSON configuration file
@return Gitkit client | [
"Constructs",
"a",
"Gitkit",
"client",
"from",
"a",
"JSON",
"config",
"file"
] | train | https://github.com/google/identity-toolkit-java-client/blob/61dda1aabbd541ad5e431e840fd266bfca5f8a4a/src/main/java/com/google/identitytoolkit/GitkitClient.java#L119-L122 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java | Histogram.setStrategy | public void setStrategy( T minimum,
T maximum ) {
"""
Set the histogram to use the supplied minimum and maximum values to determine the bucket size.
@param minimum
@param maximum
"""
this.bucketingStrategy = new ExplicitBucketingStrategy(minimum, maximum);
this.... | java | public void setStrategy( T minimum,
T maximum ) {
this.bucketingStrategy = new ExplicitBucketingStrategy(minimum, maximum);
this.bucketWidth = null;
} | [
"public",
"void",
"setStrategy",
"(",
"T",
"minimum",
",",
"T",
"maximum",
")",
"{",
"this",
".",
"bucketingStrategy",
"=",
"new",
"ExplicitBucketingStrategy",
"(",
"minimum",
",",
"maximum",
")",
";",
"this",
".",
"bucketWidth",
"=",
"null",
";",
"}"
] | Set the histogram to use the supplied minimum and maximum values to determine the bucket size.
@param minimum
@param maximum | [
"Set",
"the",
"histogram",
"to",
"use",
"the",
"supplied",
"minimum",
"and",
"maximum",
"values",
"to",
"determine",
"the",
"bucket",
"size",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L94-L98 |
apache/groovy | subprojects/groovy-dateutil/src/main/java/org/apache/groovy/dateutil/extensions/DateUtilExtensions.java | DateUtilExtensions.upto | public static void upto(Date self, Date to, Closure closure) {
"""
Iterates from this date up to the given date, inclusive,
incrementing by one day each time.
@param self a Date
@param to another Date to go up to
@param closure the closure to call
@since 2.2
"""
if (self.compareTo(to) <=... | java | public static void upto(Date self, Date to, Closure closure) {
if (self.compareTo(to) <= 0) {
for (Date i = (Date) self.clone(); i.compareTo(to) <= 0; i = next(i)) {
closure.call(i);
}
} else
throw new GroovyRuntimeException("The argument (" + to +
... | [
"public",
"static",
"void",
"upto",
"(",
"Date",
"self",
",",
"Date",
"to",
",",
"Closure",
"closure",
")",
"{",
"if",
"(",
"self",
".",
"compareTo",
"(",
"to",
")",
"<=",
"0",
")",
"{",
"for",
"(",
"Date",
"i",
"=",
"(",
"Date",
")",
"self",
"... | Iterates from this date up to the given date, inclusive,
incrementing by one day each time.
@param self a Date
@param to another Date to go up to
@param closure the closure to call
@since 2.2 | [
"Iterates",
"from",
"this",
"date",
"up",
"to",
"the",
"given",
"date",
"inclusive",
"incrementing",
"by",
"one",
"day",
"each",
"time",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-dateutil/src/main/java/org/apache/groovy/dateutil/extensions/DateUtilExtensions.java#L709-L717 |
allengeorge/libraft | libraft-agent/src/main/java/io/libraft/agent/rpc/Handshakers.java | Handshakers.createHandshakeMessage | static ChannelBuffer createHandshakeMessage(String serverId, ObjectMapper mapper) throws JsonProcessingException {
"""
Create a {@code RaftNetworkClient} handshake message.
@param serverId unique id of the Raft server (sent in the handshake message)
@param mapper instance of {@code ObjectMapper} used to map ha... | java | static ChannelBuffer createHandshakeMessage(String serverId, ObjectMapper mapper) throws JsonProcessingException {
return ChannelBuffers.wrappedBuffer(mapper.writeValueAsBytes(new Handshake(serverId)));
} | [
"static",
"ChannelBuffer",
"createHandshakeMessage",
"(",
"String",
"serverId",
",",
"ObjectMapper",
"mapper",
")",
"throws",
"JsonProcessingException",
"{",
"return",
"ChannelBuffers",
".",
"wrappedBuffer",
"(",
"mapper",
".",
"writeValueAsBytes",
"(",
"new",
"Handshak... | Create a {@code RaftNetworkClient} handshake message.
@param serverId unique id of the Raft server (sent in the handshake message)
@param mapper instance of {@code ObjectMapper} used to map handshake properties to
their corresponding fields in the encoded handshake message
@return {@code ChannelBuffer} instance that c... | [
"Create",
"a",
"{",
"@code",
"RaftNetworkClient",
"}",
"handshake",
"message",
"."
] | train | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/rpc/Handshakers.java#L106-L108 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/VerboseFormatter.java | VerboseFormatter.appendLevel | private static void appendLevel(StringBuilder message, LogRecord event) {
"""
Append log level.
@param message The message builder.
@param event The log record.
"""
final String logLevel = event.getLevel().getName();
for (int i = logLevel.length(); i < LOG_LEVEL_LENGTH; i++)
{
... | java | private static void appendLevel(StringBuilder message, LogRecord event)
{
final String logLevel = event.getLevel().getName();
for (int i = logLevel.length(); i < LOG_LEVEL_LENGTH; i++)
{
message.append(Constant.SPACE);
}
message.append(logLevel).append(Cons... | [
"private",
"static",
"void",
"appendLevel",
"(",
"StringBuilder",
"message",
",",
"LogRecord",
"event",
")",
"{",
"final",
"String",
"logLevel",
"=",
"event",
".",
"getLevel",
"(",
")",
".",
"getName",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"logLeve... | Append log level.
@param message The message builder.
@param event The log record. | [
"Append",
"log",
"level",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/VerboseFormatter.java#L58-L66 |
alkacon/opencms-core | src/org/opencms/util/CmsFileUtil.java | CmsFileUtil.formatFilesize | public static String formatFilesize(long filesize, Locale locale) {
"""
Returns the formatted filesize to Bytes, KB, MB or GB depending on the given value.<p>
@param filesize in bytes
@param locale the locale of the current OpenCms user or the System's default locale if the first choice
is not at hand.
@re... | java | public static String formatFilesize(long filesize, Locale locale) {
String result;
filesize = Math.abs(filesize);
if (Math.abs(filesize) < 1024) {
result = Messages.get().getBundle(locale).key(Messages.GUI_FILEUTIL_FILESIZE_BYTES_1, new Long(filesize));
} else if (Math.abs(... | [
"public",
"static",
"String",
"formatFilesize",
"(",
"long",
"filesize",
",",
"Locale",
"locale",
")",
"{",
"String",
"result",
";",
"filesize",
"=",
"Math",
".",
"abs",
"(",
"filesize",
")",
";",
"if",
"(",
"Math",
".",
"abs",
"(",
"filesize",
")",
"<... | Returns the formatted filesize to Bytes, KB, MB or GB depending on the given value.<p>
@param filesize in bytes
@param locale the locale of the current OpenCms user or the System's default locale if the first choice
is not at hand.
@return the formatted filesize to Bytes, KB, MB or GB depending on the given value | [
"Returns",
"the",
"formatted",
"filesize",
"to",
"Bytes",
"KB",
"MB",
"or",
"GB",
"depending",
"on",
"the",
"given",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsFileUtil.java#L229-L252 |
networknt/light-4j | http-url/src/main/java/com/networknt/url/QueryString.java | QueryString.addString | public final void addString(String key, String... values) {
"""
Adds one or multiple string values.
Adding a single <code>null</code> value has no effect.
When adding multiple values, <code>null</code> values are converted
to blank strings.
@param key the key of the value to set
@param values the values to se... | java | public final void addString(String key, String... values) {
if (values == null || Array.getLength(values) == 0) {
return;
}
List<String> list = parameters.get(key);
if (list == null) {
list = new ArrayList<>();
}
list.addAll(Arrays.asList(values));... | [
"public",
"final",
"void",
"addString",
"(",
"String",
"key",
",",
"String",
"...",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"Array",
".",
"getLength",
"(",
"values",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"List",
"<",
"S... | Adds one or multiple string values.
Adding a single <code>null</code> value has no effect.
When adding multiple values, <code>null</code> values are converted
to blank strings.
@param key the key of the value to set
@param values the values to set | [
"Adds",
"one",
"or",
"multiple",
"string",
"values",
".",
"Adding",
"a",
"single",
"<code",
">",
"null<",
"/",
"code",
">",
"value",
"has",
"no",
"effect",
".",
"When",
"adding",
"multiple",
"values",
"<code",
">",
"null<",
"/",
"code",
">",
"values",
... | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/http-url/src/main/java/com/networknt/url/QueryString.java#L201-L211 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/AverageDownSampleOps.java | AverageDownSampleOps.reshapeDown | public static void reshapeDown(ImageBase image, int inputWidth, int inputHeight, int squareWidth) {
"""
Reshapes an image so that it is the correct size to store the down sampled image
"""
int w = downSampleSize(inputWidth,squareWidth);
int h = downSampleSize(inputHeight,squareWidth);
image.reshape(w,h)... | java | public static void reshapeDown(ImageBase image, int inputWidth, int inputHeight, int squareWidth) {
int w = downSampleSize(inputWidth,squareWidth);
int h = downSampleSize(inputHeight,squareWidth);
image.reshape(w,h);
} | [
"public",
"static",
"void",
"reshapeDown",
"(",
"ImageBase",
"image",
",",
"int",
"inputWidth",
",",
"int",
"inputHeight",
",",
"int",
"squareWidth",
")",
"{",
"int",
"w",
"=",
"downSampleSize",
"(",
"inputWidth",
",",
"squareWidth",
")",
";",
"int",
"h",
... | Reshapes an image so that it is the correct size to store the down sampled image | [
"Reshapes",
"an",
"image",
"so",
"that",
"it",
"is",
"the",
"correct",
"size",
"to",
"store",
"the",
"down",
"sampled",
"image"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/misc/AverageDownSampleOps.java#L59-L64 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/DataSet.java | DataSet.writeAsCsv | public DataSink<T> writeAsCsv(String filePath) {
"""
Writes a {@link Tuple} DataSet as CSV file(s) to the specified location.
<p><b>Note: Only a Tuple DataSet can written as a CSV file.</b>
<p>For each Tuple field the result of {@link Object#toString()} is written.
Tuple fields are separated by the default ... | java | public DataSink<T> writeAsCsv(String filePath) {
return writeAsCsv(filePath, CsvOutputFormat.DEFAULT_LINE_DELIMITER, CsvOutputFormat.DEFAULT_FIELD_DELIMITER);
} | [
"public",
"DataSink",
"<",
"T",
">",
"writeAsCsv",
"(",
"String",
"filePath",
")",
"{",
"return",
"writeAsCsv",
"(",
"filePath",
",",
"CsvOutputFormat",
".",
"DEFAULT_LINE_DELIMITER",
",",
"CsvOutputFormat",
".",
"DEFAULT_FIELD_DELIMITER",
")",
";",
"}"
] | Writes a {@link Tuple} DataSet as CSV file(s) to the specified location.
<p><b>Note: Only a Tuple DataSet can written as a CSV file.</b>
<p>For each Tuple field the result of {@link Object#toString()} is written.
Tuple fields are separated by the default field delimiter {@code "comma" (,)}.
<p>Tuples are are separat... | [
"Writes",
"a",
"{",
"@link",
"Tuple",
"}",
"DataSet",
"as",
"CSV",
"file",
"(",
"s",
")",
"to",
"the",
"specified",
"location",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L1564-L1566 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/client/http2/SimpleHTTPClient.java | SimpleHTTPClient.removeConnectionPool | public void removeConnectionPool(String host, int port) {
"""
Remove the HTTP connection pool.
@param host The host URL.
@param port The target port.
"""
RequestBuilder req = new RequestBuilder();
req.host = host;
req.port = port;
removePool(req);
} | java | public void removeConnectionPool(String host, int port) {
RequestBuilder req = new RequestBuilder();
req.host = host;
req.port = port;
removePool(req);
} | [
"public",
"void",
"removeConnectionPool",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"RequestBuilder",
"req",
"=",
"new",
"RequestBuilder",
"(",
")",
";",
"req",
".",
"host",
"=",
"host",
";",
"req",
".",
"port",
"=",
"port",
";",
"removePool",... | Remove the HTTP connection pool.
@param host The host URL.
@param port The target port. | [
"Remove",
"the",
"HTTP",
"connection",
"pool",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/client/http2/SimpleHTTPClient.java#L725-L730 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-bpm/src/main/java/org/switchyard/component/bpm/runtime/BPMTaskServiceRegistry.java | BPMTaskServiceRegistry.getTaskService | public static final synchronized BPMTaskService getTaskService(QName serviceDomainName, QName serviceName) {
"""
Gets a task service.
@param serviceDomainName the service domain name
@param serviceName the service name
@return the task service
"""
KnowledgeRuntimeManager runtimeManager = Knowledge... | java | public static final synchronized BPMTaskService getTaskService(QName serviceDomainName, QName serviceName) {
KnowledgeRuntimeManager runtimeManager = KnowledgeRuntimeManagerRegistry.getRuntimeManager(serviceDomainName, serviceName);
if (runtimeManager != null) {
RuntimeEngine runtimeEngine =... | [
"public",
"static",
"final",
"synchronized",
"BPMTaskService",
"getTaskService",
"(",
"QName",
"serviceDomainName",
",",
"QName",
"serviceName",
")",
"{",
"KnowledgeRuntimeManager",
"runtimeManager",
"=",
"KnowledgeRuntimeManagerRegistry",
".",
"getRuntimeManager",
"(",
"se... | Gets a task service.
@param serviceDomainName the service domain name
@param serviceName the service name
@return the task service | [
"Gets",
"a",
"task",
"service",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-bpm/src/main/java/org/switchyard/component/bpm/runtime/BPMTaskServiceRegistry.java#L38-L56 |
lecho/hellocharts-android | hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java | Axis.generateAxisFromCollection | public static Axis generateAxisFromCollection(List<Float> axisValues, List<String> axisValuesLabels) {
"""
Generates Axis with values and labels from given lists, both lists must have the same size.
"""
if (axisValues.size() != axisValuesLabels.size()) {
throw new IllegalArgumentException("... | java | public static Axis generateAxisFromCollection(List<Float> axisValues, List<String> axisValuesLabels) {
if (axisValues.size() != axisValuesLabels.size()) {
throw new IllegalArgumentException("Values and labels lists must have the same size!");
}
List<AxisValue> values = new ArrayList... | [
"public",
"static",
"Axis",
"generateAxisFromCollection",
"(",
"List",
"<",
"Float",
">",
"axisValues",
",",
"List",
"<",
"String",
">",
"axisValuesLabels",
")",
"{",
"if",
"(",
"axisValues",
".",
"size",
"(",
")",
"!=",
"axisValuesLabels",
".",
"size",
"(",... | Generates Axis with values and labels from given lists, both lists must have the same size. | [
"Generates",
"Axis",
"with",
"values",
"and",
"labels",
"from",
"given",
"lists",
"both",
"lists",
"must",
"have",
"the",
"same",
"size",
"."
] | train | https://github.com/lecho/hellocharts-android/blob/c41419c9afa097452dee823c7eba0e5136aa96bd/hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java#L143-L158 |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java | AccountsInner.updateAsync | public Observable<CognitiveServicesAccountInner> updateAsync(String resourceGroupName, String accountName) {
"""
Updates a Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive Services account.
@throws Ille... | java | public Observable<CognitiveServicesAccountInner> updateAsync(String resourceGroupName, String accountName) {
return updateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<CognitiveServicesAccountInner>, CognitiveServicesAccountInner>() {
@Override
pu... | [
"public",
"Observable",
"<",
"CognitiveServicesAccountInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"map",
"(",
... | Updates a Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive Services account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the CognitiveServicesAccountInner ... | [
"Updates",
"a",
"Cognitive",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java#L255-L262 |
groundupworks/wings | wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookSettingsActivity.java | FacebookSettingsActivity.replaceFragment | void replaceFragment(Fragment fragment, boolean addToBackStack, boolean popPreviousState) {
"""
Replaces a {@link android.support.v4.app.Fragment} in the container.
@param fragment the new {@link android.support.v4.app.Fragment} used to replace the current.
@param addToBackStack true to add transacti... | java | void replaceFragment(Fragment fragment, boolean addToBackStack, boolean popPreviousState) {
final FragmentManager fragmentManager = getSupportFragmentManager();
if (popPreviousState) {
fragmentManager.popBackStack();
}
final FragmentTransaction ft = fragmentManager.beginTran... | [
"void",
"replaceFragment",
"(",
"Fragment",
"fragment",
",",
"boolean",
"addToBackStack",
",",
"boolean",
"popPreviousState",
")",
"{",
"final",
"FragmentManager",
"fragmentManager",
"=",
"getSupportFragmentManager",
"(",
")",
";",
"if",
"(",
"popPreviousState",
")",
... | Replaces a {@link android.support.v4.app.Fragment} in the container.
@param fragment the new {@link android.support.v4.app.Fragment} used to replace the current.
@param addToBackStack true to add transaction to back stack; false otherwise.
@param popPreviousState true to pop the previous state from the back ... | [
"Replaces",
"a",
"{",
"@link",
"android",
".",
"support",
".",
"v4",
".",
"app",
".",
"Fragment",
"}",
"in",
"the",
"container",
"."
] | train | https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookSettingsActivity.java#L76-L88 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/convert/StringConverter.java | StringConverter.toStringWithDefault | public static String toStringWithDefault(Object value, String defaultValue) {
"""
Converts value into string or returns default when value is null.
@param value the value to convert.
@param defaultValue the default value.
@return string value or default when value is null.
@see StringConverter#toNul... | java | public static String toStringWithDefault(Object value, String defaultValue) {
String result = toNullableString(value);
return result != null ? result : defaultValue;
} | [
"public",
"static",
"String",
"toStringWithDefault",
"(",
"Object",
"value",
",",
"String",
"defaultValue",
")",
"{",
"String",
"result",
"=",
"toNullableString",
"(",
"value",
")",
";",
"return",
"result",
"!=",
"null",
"?",
"result",
":",
"defaultValue",
";"... | Converts value into string or returns default when value is null.
@param value the value to convert.
@param defaultValue the default value.
@return string value or default when value is null.
@see StringConverter#toNullableString(Object) | [
"Converts",
"value",
"into",
"string",
"or",
"returns",
"default",
"when",
"value",
"is",
"null",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/convert/StringConverter.java#L111-L114 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java | HttpInboundServiceContextImpl.finishRawResponseMessage | @Override
public VirtualConnection finishRawResponseMessage(WsByteBuffer[] body, InterChannelCallback cb, boolean bForce) throws MessageSentException {
"""
Finish sending the response message asynchronously. The body buffers can
be null if there is no more actual body. This method will avoid any
body modific... | java | @Override
public VirtualConnection finishRawResponseMessage(WsByteBuffer[] body, InterChannelCallback cb, boolean bForce) throws MessageSentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "finishRawResponseMessage(async)");
}
setRawBody... | [
"@",
"Override",
"public",
"VirtualConnection",
"finishRawResponseMessage",
"(",
"WsByteBuffer",
"[",
"]",
"body",
",",
"InterChannelCallback",
"cb",
",",
"boolean",
"bForce",
")",
"throws",
"MessageSentException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingE... | Finish sending the response message asynchronously. The body buffers can
be null if there is no more actual body. This method will avoid any
body modifications, such as compression or chunked-encoding. If the
headers have not been sent yet, then they will be prepended to the input
data.
<p>
If the asynchronous write ca... | [
"Finish",
"sending",
"the",
"response",
"message",
"asynchronously",
".",
"The",
"body",
"buffers",
"can",
"be",
"null",
"if",
"there",
"is",
"no",
"more",
"actual",
"body",
".",
"This",
"method",
"will",
"avoid",
"any",
"body",
"modifications",
"such",
"as"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java#L1184-L1195 |
netty/netty | handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java | TrafficCounter.readTimeToWait | @Deprecated
public long readTimeToWait(final long size, final long limitTraffic, final long maxTime) {
"""
Returns the time to wait (if any) for the given length message, using the given limitTraffic and the max wait
time.
@param size
the recv size
@param limitTraffic
the traffic limit in bytes per seco... | java | @Deprecated
public long readTimeToWait(final long size, final long limitTraffic, final long maxTime) {
return readTimeToWait(size, limitTraffic, maxTime, milliSecondFromNano());
} | [
"@",
"Deprecated",
"public",
"long",
"readTimeToWait",
"(",
"final",
"long",
"size",
",",
"final",
"long",
"limitTraffic",
",",
"final",
"long",
"maxTime",
")",
"{",
"return",
"readTimeToWait",
"(",
"size",
",",
"limitTraffic",
",",
"maxTime",
",",
"milliSecon... | Returns the time to wait (if any) for the given length message, using the given limitTraffic and the max wait
time.
@param size
the recv size
@param limitTraffic
the traffic limit in bytes per second.
@param maxTime
the max time in ms to wait in case of excess of traffic.
@return the current time to wait (in ms) if ne... | [
"Returns",
"the",
"time",
"to",
"wait",
"(",
"if",
"any",
")",
"for",
"the",
"given",
"length",
"message",
"using",
"the",
"given",
"limitTraffic",
"and",
"the",
"max",
"wait",
"time",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java#L480-L483 |
samskivert/pythagoras | src/main/java/pythagoras/f/Frustum.java | Frustum.boundsUnderRotation | public Box boundsUnderRotation (Matrix3 matrix, Box result) {
"""
Computes the bounds of the frustum under the supplied rotation and places the results in
the box provided.
@return a reference to the result box, for chaining.
"""
result.setToEmpty();
for (Vector3 vertex : _vertices) {
... | java | public Box boundsUnderRotation (Matrix3 matrix, Box result) {
result.setToEmpty();
for (Vector3 vertex : _vertices) {
result.addLocal(matrix.transform(vertex, _vertex));
}
return result;
} | [
"public",
"Box",
"boundsUnderRotation",
"(",
"Matrix3",
"matrix",
",",
"Box",
"result",
")",
"{",
"result",
".",
"setToEmpty",
"(",
")",
";",
"for",
"(",
"Vector3",
"vertex",
":",
"_vertices",
")",
"{",
"result",
".",
"addLocal",
"(",
"matrix",
".",
"tra... | Computes the bounds of the frustum under the supplied rotation and places the results in
the box provided.
@return a reference to the result box, for chaining. | [
"Computes",
"the",
"bounds",
"of",
"the",
"frustum",
"under",
"the",
"supplied",
"rotation",
"and",
"places",
"the",
"results",
"in",
"the",
"box",
"provided",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Frustum.java#L219-L225 |
wildfly/wildfly-core | controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java | Operations.createReadAttributeOperation | public static ModelNode createReadAttributeOperation(final ModelNode address, final String attributeName) {
"""
Creates an operation to read the attribute represented by the {@code attributeName} parameter.
@param address the address to create the read attribute for
@param attributeName the name of the p... | java | public static ModelNode createReadAttributeOperation(final ModelNode address, final String attributeName) {
final ModelNode op = createOperation(READ_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
return op;
} | [
"public",
"static",
"ModelNode",
"createReadAttributeOperation",
"(",
"final",
"ModelNode",
"address",
",",
"final",
"String",
"attributeName",
")",
"{",
"final",
"ModelNode",
"op",
"=",
"createOperation",
"(",
"READ_ATTRIBUTE_OPERATION",
",",
"address",
")",
";",
"... | Creates an operation to read the attribute represented by the {@code attributeName} parameter.
@param address the address to create the read attribute for
@param attributeName the name of the parameter to read
@return the operation | [
"Creates",
"an",
"operation",
"to",
"read",
"the",
"attribute",
"represented",
"by",
"the",
"{",
"@code",
"attributeName",
"}",
"parameter",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java#L220-L224 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cachecontentgroup.java | cachecontentgroup.get | public static cachecontentgroup get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch cachecontentgroup resource of given name .
"""
cachecontentgroup obj = new cachecontentgroup();
obj.set_name(name);
cachecontentgroup response = (cachecontentgroup) obj.get_resource(servic... | java | public static cachecontentgroup get(nitro_service service, String name) throws Exception{
cachecontentgroup obj = new cachecontentgroup();
obj.set_name(name);
cachecontentgroup response = (cachecontentgroup) obj.get_resource(service);
return response;
} | [
"public",
"static",
"cachecontentgroup",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"cachecontentgroup",
"obj",
"=",
"new",
"cachecontentgroup",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch cachecontentgroup resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"cachecontentgroup",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cachecontentgroup.java#L1536-L1541 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.