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 |
|---|---|---|---|---|---|---|---|---|---|---|
oboehm/jfachwert | src/main/java/de/jfachwert/bank/Geldbetrag.java | Geldbetrag.validate | public static String validate(String zahl) {
"""
Validiert die uebergebene Zahl, ob sie sich als Geldbetrag eignet.
@param zahl als String
@return die Zahl zur Weitervarabeitung
"""
try {
return Geldbetrag.valueOf(zahl).toString();
} catch (IllegalArgumentException ex) {
... | java | public static String validate(String zahl) {
try {
return Geldbetrag.valueOf(zahl).toString();
} catch (IllegalArgumentException ex) {
throw new InvalidValueException(zahl, "money_amount", ex);
}
} | [
"public",
"static",
"String",
"validate",
"(",
"String",
"zahl",
")",
"{",
"try",
"{",
"return",
"Geldbetrag",
".",
"valueOf",
"(",
"zahl",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"ex",
")",
"{",
"throw",
"new"... | Validiert die uebergebene Zahl, ob sie sich als Geldbetrag eignet.
@param zahl als String
@return die Zahl zur Weitervarabeitung | [
"Validiert",
"die",
"uebergebene",
"Zahl",
"ob",
"sie",
"sich",
"als",
"Geldbetrag",
"eignet",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/bank/Geldbetrag.java#L553-L559 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java | DocumentHelpers.getColumnSharedPrefix | public static String getColumnSharedPrefix(String[] associationKeyColumns) {
"""
Returns the shared prefix of these columns. Null otherwise.
@param associationKeyColumns the columns sharing a prefix
@return the shared prefix of these columns. {@code null} otherwise.
"""
String prefix = null;
for ( Stri... | java | public static String getColumnSharedPrefix(String[] associationKeyColumns) {
String prefix = null;
for ( String column : associationKeyColumns ) {
String newPrefix = getPrefix( column );
if ( prefix == null ) { // first iteration
prefix = newPrefix;
if ( prefix == null ) { // no prefix, quit
brea... | [
"public",
"static",
"String",
"getColumnSharedPrefix",
"(",
"String",
"[",
"]",
"associationKeyColumns",
")",
"{",
"String",
"prefix",
"=",
"null",
";",
"for",
"(",
"String",
"column",
":",
"associationKeyColumns",
")",
"{",
"String",
"newPrefix",
"=",
"getPrefi... | Returns the shared prefix of these columns. Null otherwise.
@param associationKeyColumns the columns sharing a prefix
@return the shared prefix of these columns. {@code null} otherwise. | [
"Returns",
"the",
"shared",
"prefix",
"of",
"these",
"columns",
".",
"Null",
"otherwise",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java#L36-L54 |
apache/flink | flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java | DateTimeUtils.parseFraction | private static int parseFraction(String v, int multiplier) {
"""
Parses a fraction, multiplying the first character by {@code multiplier},
the second character by {@code multiplier / 10},
the third character by {@code multiplier / 100}, and so forth.
<p>For example, {@code parseFraction("1234", 100)} yields {... | java | private static int parseFraction(String v, int multiplier) {
int r = 0;
for (int i = 0; i < v.length(); i++) {
char c = v.charAt(i);
int x = c < '0' || c > '9' ? 0 : (c - '0');
r += multiplier * x;
if (multiplier < 10) {
// We're at the last digit. Check for rounding.
if (i + 1 < v.length()
... | [
"private",
"static",
"int",
"parseFraction",
"(",
"String",
"v",
",",
"int",
"multiplier",
")",
"{",
"int",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"v",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"char",
"... | Parses a fraction, multiplying the first character by {@code multiplier},
the second character by {@code multiplier / 10},
the third character by {@code multiplier / 100}, and so forth.
<p>For example, {@code parseFraction("1234", 100)} yields {@code 123}. | [
"Parses",
"a",
"fraction",
"multiplying",
"the",
"first",
"character",
"by",
"{",
"@code",
"multiplier",
"}",
"the",
"second",
"character",
"by",
"{",
"@code",
"multiplier",
"/",
"10",
"}",
"the",
"third",
"character",
"by",
"{",
"@code",
"multiplier",
"/",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java#L838-L855 |
zeromq/jeromq | src/main/java/org/zeromq/ZProxy.java | ZProxy.newZProxy | @Deprecated
public static ZProxy newZProxy(ZContext ctx, String name, SelectorCreator selector, Proxy sockets,
String motdelafin, Object... args) {
"""
Creates a new proxy in a ZeroMQ way.
This proxy will be less efficient than the
{@link #newZProxy(ZContext, String, org.ze... | java | @Deprecated
public static ZProxy newZProxy(ZContext ctx, String name, SelectorCreator selector, Proxy sockets,
String motdelafin, Object... args)
{
return newZProxy(ctx, name, sockets, motdelafin, args);
} | [
"@",
"Deprecated",
"public",
"static",
"ZProxy",
"newZProxy",
"(",
"ZContext",
"ctx",
",",
"String",
"name",
",",
"SelectorCreator",
"selector",
",",
"Proxy",
"sockets",
",",
"String",
"motdelafin",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newZProxy"... | Creates a new proxy in a ZeroMQ way.
This proxy will be less efficient than the
{@link #newZProxy(ZContext, String, org.zeromq.ZProxy.Proxy, String, Object...) low-level one}.
@param ctx the context used for the proxy.
Possibly null, in this case a new context will be created and automatically destroyed afterwa... | [
"Creates",
"a",
"new",
"proxy",
"in",
"a",
"ZeroMQ",
"way",
".",
"This",
"proxy",
"will",
"be",
"less",
"efficient",
"than",
"the",
"{",
"@link",
"#newZProxy",
"(",
"ZContext",
"String",
"org",
".",
"zeromq",
".",
"ZProxy",
".",
"Proxy",
"String",
"Objec... | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZProxy.java#L239-L244 |
structurizr/java | structurizr-core/src/com/structurizr/view/ViewSet.java | ViewSet.createDeploymentView | public DeploymentView createDeploymentView(SoftwareSystem softwareSystem, String key, String description) {
"""
Creates a deployment view, where the scope of the view is the specified software system.
@param softwareSystem the SoftwareSystem object representing the scope of the view
@param key ... | java | public DeploymentView createDeploymentView(SoftwareSystem softwareSystem, String key, String description) {
assertThatTheSoftwareSystemIsNotNull(softwareSystem);
assertThatTheViewKeyIsSpecifiedAndUnique(key);
DeploymentView view = new DeploymentView(softwareSystem, key, description);
vi... | [
"public",
"DeploymentView",
"createDeploymentView",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"String",
"key",
",",
"String",
"description",
")",
"{",
"assertThatTheSoftwareSystemIsNotNull",
"(",
"softwareSystem",
")",
";",
"assertThatTheViewKeyIsSpecifiedAndUnique",
"(",... | Creates a deployment view, where the scope of the view is the specified software system.
@param softwareSystem the SoftwareSystem object representing the scope of the view
@param key the key for the deployment view (must be unique)
@param description a description of the view
@return ... | [
"Creates",
"a",
"deployment",
"view",
"where",
"the",
"scope",
"of",
"the",
"view",
"is",
"the",
"specified",
"software",
"system",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/view/ViewSet.java#L215-L223 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.equalsIgnoreCaseAccents | @Pure
@Inline(value = "TextUtil.removeAccents($1, $3).equalsIgnoreCase(TextUtil.removeAccents($2, $3))",
imported = {
"""
Compares this <code>String</code> to another <code>String</code>,
ignoring case and accent considerations. Two strings are considered equal
ignoring case and accents if they are of the s... | java | @Pure
@Inline(value = "TextUtil.removeAccents($1, $3).equalsIgnoreCase(TextUtil.removeAccents($2, $3))",
imported = {TextUtil.class})
public static boolean equalsIgnoreCaseAccents(String s1, String s2, Map<Character, String> map) {
return removeAccents(s1, map).equalsIgnoreCase(removeAccents(s2, map));
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"TextUtil.removeAccents($1, $3).equalsIgnoreCase(TextUtil.removeAccents($2, $3))\"",
",",
"imported",
"=",
"{",
"TextUtil",
".",
"class",
"}",
")",
"public",
"static",
"boolean",
"equalsIgnoreCaseAccents",
"(",
"String",
... | Compares this <code>String</code> to another <code>String</code>,
ignoring case and accent considerations. Two strings are considered equal
ignoring case and accents if they are of the same length, and corresponding
characters in the two strings are equal ignoring case and accents.
<p>This method is equivalent to:
<p... | [
"Compares",
"this",
"<code",
">",
"String<",
"/",
"code",
">",
"to",
"another",
"<code",
">",
"String<",
"/",
"code",
">",
"ignoring",
"case",
"and",
"accent",
"considerations",
".",
"Two",
"strings",
"are",
"considered",
"equal",
"ignoring",
"case",
"and",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L1376-L1381 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdSupportingStructure.java | XsdSupportingStructure.textGroupMethod | private static void textGroupMethod(ClassWriter classWriter, String varName, String visitName) {
"""
Creates a method present in the TextGroup interface.
Code:
getVisitor().visitComment(new Text<>(self(), getVisitor(), text));
return this.self();
@param classWriter The TextGroup {@link ClassWriter} object.
@p... | java | private static void textGroupMethod(ClassWriter classWriter, String varName, String visitName){
MethodVisitor mVisitor = classWriter.visitMethod(ACC_PUBLIC, varName, "(" + JAVA_OBJECT_DESC + ")" + elementTypeDesc, "<R:" + JAVA_OBJECT_DESC + ">(TR;)TT;", null);
mVisitor.visitLocalVariable(varName, JAVA_S... | [
"private",
"static",
"void",
"textGroupMethod",
"(",
"ClassWriter",
"classWriter",
",",
"String",
"varName",
",",
"String",
"visitName",
")",
"{",
"MethodVisitor",
"mVisitor",
"=",
"classWriter",
".",
"visitMethod",
"(",
"ACC_PUBLIC",
",",
"varName",
",",
"\"(\"",... | Creates a method present in the TextGroup interface.
Code:
getVisitor().visitComment(new Text<>(self(), getVisitor(), text));
return this.self();
@param classWriter The TextGroup {@link ClassWriter} object.
@param varName The name of the method, i.e. text or comment.
@param visitName The name of the visit method to inv... | [
"Creates",
"a",
"method",
"present",
"in",
"the",
"TextGroup",
"interface",
".",
"Code",
":",
"getVisitor",
"()",
".",
"visitComment",
"(",
"new",
"Text<",
">",
"(",
"self",
"()",
"getVisitor",
"()",
"text",
"))",
";",
"return",
"this",
".",
"self",
"()"... | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdSupportingStructure.java#L181-L201 |
jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java | ObjectAccessor.shallowScramble | public void shallowScramble(PrefabValues prefabValues, TypeTag enclosingType) {
"""
Modifies all fields of the wrapped object that are declared in T, but
not those inherited from superclasses.
This method is consistent: given two equal objects; after scrambling
both objects, they remain equal to each other.
... | java | public void shallowScramble(PrefabValues prefabValues, TypeTag enclosingType) {
for (Field field : FieldIterable.ofIgnoringSuper(type)) {
FieldAccessor accessor = new FieldAccessor(object, field);
accessor.changeField(prefabValues, enclosingType);
}
} | [
"public",
"void",
"shallowScramble",
"(",
"PrefabValues",
"prefabValues",
",",
"TypeTag",
"enclosingType",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"FieldIterable",
".",
"ofIgnoringSuper",
"(",
"type",
")",
")",
"{",
"FieldAccessor",
"accessor",
"=",
"new",
... | Modifies all fields of the wrapped object that are declared in T, but
not those inherited from superclasses.
This method is consistent: given two equal objects; after scrambling
both objects, they remain equal to each other.
It cannot modifiy:
1. static final fields, and
2. final fields that are initialized to a comp... | [
"Modifies",
"all",
"fields",
"of",
"the",
"wrapped",
"object",
"that",
"are",
"declared",
"in",
"T",
"but",
"not",
"those",
"inherited",
"from",
"superclasses",
"."
] | train | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java#L165-L170 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/AbsModule.java | AbsModule.getSpaceIdOrThrow | String getSpaceIdOrThrow(CMAResource resource, String param) {
"""
Extracts the Space ID from the given {@code resource} of name {@code param}.
Throws {@link IllegalArgumentException} if the value is not present.
"""
final String spaceId = resource.getSpaceId();
if (spaceId == null) {
throw new ... | java | String getSpaceIdOrThrow(CMAResource resource, String param) {
final String spaceId = resource.getSpaceId();
if (spaceId == null) {
throw new IllegalArgumentException(String.format(
"%s must have a space associated.", param));
}
return spaceId;
} | [
"String",
"getSpaceIdOrThrow",
"(",
"CMAResource",
"resource",
",",
"String",
"param",
")",
"{",
"final",
"String",
"spaceId",
"=",
"resource",
".",
"getSpaceId",
"(",
")",
";",
"if",
"(",
"spaceId",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentEx... | Extracts the Space ID from the given {@code resource} of name {@code param}.
Throws {@link IllegalArgumentException} if the value is not present. | [
"Extracts",
"the",
"Space",
"ID",
"from",
"the",
"given",
"{"
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/AbsModule.java#L84-L91 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/sort/linearlogarithmic/Quicksort.java | Quicksort.partition | private static int partition(float[] floatArray, int start, int end) {
"""
Routine that arranges the elements in ascending order around a pivot. This routine
runs in O(n) time.
@param floatArray array that we want to sort
@param start index of the starting point to sort
@param end index of the end point to s... | java | private static int partition(float[] floatArray, int start, int end) {
float pivot = floatArray[end];
int index = start - 1;
for(int j = start; j < end; j++) {
if(floatArray[j] <= pivot) {
index++;
TrivialSwap.swap(floatArray, index, j);
... | [
"private",
"static",
"int",
"partition",
"(",
"float",
"[",
"]",
"floatArray",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"float",
"pivot",
"=",
"floatArray",
"[",
"end",
"]",
";",
"int",
"index",
"=",
"start",
"-",
"1",
";",
"for",
"(",
"in... | Routine that arranges the elements in ascending order around a pivot. This routine
runs in O(n) time.
@param floatArray array that we want to sort
@param start index of the starting point to sort
@param end index of the end point to sort
@return an integer that represent the index of the pivot | [
"Routine",
"that",
"arranges",
"the",
"elements",
"in",
"ascending",
"order",
"around",
"a",
"pivot",
".",
"This",
"routine",
"runs",
"in",
"O",
"(",
"n",
")",
"time",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/sort/linearlogarithmic/Quicksort.java#L650-L664 |
netty/netty | transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java | AbstractKQueueStreamChannel.writeBytesMultiple | private int writeBytesMultiple(ChannelOutboundBuffer in, IovArray array) throws IOException {
"""
Write multiple bytes via {@link IovArray}.
@param in the collection which contains objects to write.
@param array The array which contains the content to write.
@return The value that should be decremented from the... | java | private int writeBytesMultiple(ChannelOutboundBuffer in, IovArray array) throws IOException {
final long expectedWrittenBytes = array.size();
assert expectedWrittenBytes != 0;
final int cnt = array.count();
assert cnt != 0;
final long localWrittenBytes = socket.writevAddresses(a... | [
"private",
"int",
"writeBytesMultiple",
"(",
"ChannelOutboundBuffer",
"in",
",",
"IovArray",
"array",
")",
"throws",
"IOException",
"{",
"final",
"long",
"expectedWrittenBytes",
"=",
"array",
".",
"size",
"(",
")",
";",
"assert",
"expectedWrittenBytes",
"!=",
"0",... | Write multiple bytes via {@link IovArray}.
@param in the collection which contains objects to write.
@param array The array which contains the content to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use cases are as fol... | [
"Write",
"multiple",
"bytes",
"via",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java#L147-L160 |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/CachedDAO.java | CachedDAO.read | public Result<List<DATA>> read(final String key, final TRANS trans, final Object ... objs) {
"""
Slight Improved performance available when String and Obj versions are known.
"""
DAOGetter getter = new DAOGetter(trans,dao,objs);
return get(trans, key, getter);
// if(ld!=null) {
// return Result.ok(ld);... | java | public Result<List<DATA>> read(final String key, final TRANS trans, final Object ... objs) {
DAOGetter getter = new DAOGetter(trans,dao,objs);
return get(trans, key, getter);
// if(ld!=null) {
// return Result.ok(ld);//.emptyList(ld.isEmpty());
// }
// // Result Result if exists
// if(getter.result==null) {
... | [
"public",
"Result",
"<",
"List",
"<",
"DATA",
">",
">",
"read",
"(",
"final",
"String",
"key",
",",
"final",
"TRANS",
"trans",
",",
"final",
"Object",
"...",
"objs",
")",
"{",
"DAOGetter",
"getter",
"=",
"new",
"DAOGetter",
"(",
"trans",
",",
"dao",
... | Slight Improved performance available when String and Obj versions are known. | [
"Slight",
"Improved",
"performance",
"available",
"when",
"String",
"and",
"Obj",
"versions",
"are",
"known",
"."
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/CachedDAO.java#L141-L152 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptPropertySet.java | AptPropertySet.initProperties | protected ArrayList<AptProperty> initProperties() {
"""
Initializes the list of ControlProperties associated with this ControlPropertySet
"""
ArrayList<AptProperty> properties = new ArrayList<AptProperty>();
if (_propertySet == null || _propertySet.getMethods() == null )
return pro... | java | protected ArrayList<AptProperty> initProperties()
{
ArrayList<AptProperty> properties = new ArrayList<AptProperty>();
if (_propertySet == null || _propertySet.getMethods() == null )
return properties;
// Add all declared method, but ignore the mystery <clinit> methods
... | [
"protected",
"ArrayList",
"<",
"AptProperty",
">",
"initProperties",
"(",
")",
"{",
"ArrayList",
"<",
"AptProperty",
">",
"properties",
"=",
"new",
"ArrayList",
"<",
"AptProperty",
">",
"(",
")",
";",
"if",
"(",
"_propertySet",
"==",
"null",
"||",
"_property... | Initializes the list of ControlProperties associated with this ControlPropertySet | [
"Initializes",
"the",
"list",
"of",
"ControlProperties",
"associated",
"with",
"this",
"ControlPropertySet"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptPropertySet.java#L67-L81 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.queryColumnSQLKey | public static <T> List<T> queryColumnSQLKey(
String poolName, String sqlKey, String columnName, Class<T> columnType, Object[] params)
throws SQLStatementNotFoundException, YankSQLException {
"""
Return a List of Objects from a single table column given a SQL Key using an SQL statement
matching the sql... | java | public static <T> List<T> queryColumnSQLKey(
String poolName, String sqlKey, String columnName, Class<T> columnType, Object[] params)
throws SQLStatementNotFoundException, YankSQLException {
String sql = YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
if (sql == null || sql.equalsIg... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"queryColumnSQLKey",
"(",
"String",
"poolName",
",",
"String",
"sqlKey",
",",
"String",
"columnName",
",",
"Class",
"<",
"T",
">",
"columnType",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
... | Return a List of Objects from a single table column given a SQL Key using an SQL statement
matching the sqlKey String in a properties file loaded via Yank.addSQLStatements(...).
@param poolName The name of the connection pool to query against
@param sqlKey The SQL Key found in a properties file corresponding to the de... | [
"Return",
"a",
"List",
"of",
"Objects",
"from",
"a",
"single",
"table",
"column",
"given",
"a",
"SQL",
"Key",
"using",
"an",
"SQL",
"statement",
"matching",
"the",
"sqlKey",
"String",
"in",
"a",
"properties",
"file",
"loaded",
"via",
"Yank",
".",
"addSQLSt... | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L543-L553 |
alkacon/opencms-core | src/org/opencms/ui/contextmenu/CmsContextMenu.java | CmsContextMenu.addItem | public ContextMenuItem addItem(String caption, Resource icon) {
"""
Adds new item to context menu root with given caption and icon.<p>
@param caption the caption
@param icon the icon
@return reference to newly added item
"""
ContextMenuItem item = addItem(caption);
item.setIcon(icon);
... | java | public ContextMenuItem addItem(String caption, Resource icon) {
ContextMenuItem item = addItem(caption);
item.setIcon(icon);
return item;
} | [
"public",
"ContextMenuItem",
"addItem",
"(",
"String",
"caption",
",",
"Resource",
"icon",
")",
"{",
"ContextMenuItem",
"item",
"=",
"addItem",
"(",
"caption",
")",
";",
"item",
".",
"setIcon",
"(",
"icon",
")",
";",
"return",
"item",
";",
"}"
] | Adds new item to context menu root with given caption and icon.<p>
@param caption the caption
@param icon the icon
@return reference to newly added item | [
"Adds",
"new",
"item",
"to",
"context",
"menu",
"root",
"with",
"given",
"caption",
"and",
"icon",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/contextmenu/CmsContextMenu.java#L1041-L1046 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/StringUtil.java | StringUtil.endsWithAny | public static boolean endsWithAny(boolean _ignoreCase, String _str, String... _args) {
"""
Checks if given string in _str ends with any of the given strings in _args.
@param _ignoreCase true to ignore case, false to be case sensitive
@param _str string to check
@param _args patterns to find
@return true if giv... | java | public static boolean endsWithAny(boolean _ignoreCase, String _str, String... _args) {
if (_str == null || _args == null || _args.length == 0) {
return false;
}
String heystack = _str;
if (_ignoreCase) {
heystack = _str.toLowerCase();
}
for (Strin... | [
"public",
"static",
"boolean",
"endsWithAny",
"(",
"boolean",
"_ignoreCase",
",",
"String",
"_str",
",",
"String",
"...",
"_args",
")",
"{",
"if",
"(",
"_str",
"==",
"null",
"||",
"_args",
"==",
"null",
"||",
"_args",
".",
"length",
"==",
"0",
")",
"{"... | Checks if given string in _str ends with any of the given strings in _args.
@param _ignoreCase true to ignore case, false to be case sensitive
@param _str string to check
@param _args patterns to find
@return true if given string in _str ends with any of the given strings in _args, false if not or _str/_args is null | [
"Checks",
"if",
"given",
"string",
"in",
"_str",
"ends",
"with",
"any",
"of",
"the",
"given",
"strings",
"in",
"_args",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/StringUtil.java#L521-L538 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java | PermissionUtil.getEffectivePermission | public static long getEffectivePermission(Channel channel, Role role) {
"""
Gets the {@code long} representation of the effective permissions allowed for this {@link net.dv8tion.jda.core.entities.Role Role}
in this {@link net.dv8tion.jda.core.entities.Channel Channel}. This can be used in conjunction with
{@link... | java | public static long getEffectivePermission(Channel channel, Role role)
{
Checks.notNull(channel, "Channel");
Checks.notNull(role, "Role");
Guild guild = channel.getGuild();
if (!guild.equals(role.getGuild()))
throw new IllegalArgumentException("Provided channel and role a... | [
"public",
"static",
"long",
"getEffectivePermission",
"(",
"Channel",
"channel",
",",
"Role",
"role",
")",
"{",
"Checks",
".",
"notNull",
"(",
"channel",
",",
"\"Channel\"",
")",
";",
"Checks",
".",
"notNull",
"(",
"role",
",",
"\"Role\"",
")",
";",
"Guild... | Gets the {@code long} representation of the effective permissions allowed for this {@link net.dv8tion.jda.core.entities.Role Role}
in this {@link net.dv8tion.jda.core.entities.Channel Channel}. This can be used in conjunction with
{@link net.dv8tion.jda.core.Permission#getPermissions(long) Permission.getPermissions(lon... | [
"Gets",
"the",
"{",
"@code",
"long",
"}",
"representation",
"of",
"the",
"effective",
"permissions",
"allowed",
"for",
"this",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"Role",
"Role",
"}",
"in",
"this",
"{",
"... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java#L424-L451 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.getFormatDate | public static String getFormatDate(String format, Date date) {
"""
获取指定日期的指定格式的字符串
@param format 日期格式
@param date 指定日期
@return 指定日期的指定格式的字符串
"""
return getFormatDate(format, date, ZoneId.systemDefault().getId());
} | java | public static String getFormatDate(String format, Date date) {
return getFormatDate(format, date, ZoneId.systemDefault().getId());
} | [
"public",
"static",
"String",
"getFormatDate",
"(",
"String",
"format",
",",
"Date",
"date",
")",
"{",
"return",
"getFormatDate",
"(",
"format",
",",
"date",
",",
"ZoneId",
".",
"systemDefault",
"(",
")",
".",
"getId",
"(",
")",
")",
";",
"}"
] | 获取指定日期的指定格式的字符串
@param format 日期格式
@param date 指定日期
@return 指定日期的指定格式的字符串 | [
"获取指定日期的指定格式的字符串"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L192-L194 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsPopup.java | CmsPopup.addButton | public void addButton(Widget button, int position) {
"""
Adds a button widget to the button panel before the given position.<p>
@param button the button widget
@param position the position to insert the button
"""
m_buttonPanel.insert(button, position);
m_buttonPanel.setStyleName(I_CmsLayo... | java | public void addButton(Widget button, int position) {
m_buttonPanel.insert(button, position);
m_buttonPanel.setStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().popupButtonPanel());
} | [
"public",
"void",
"addButton",
"(",
"Widget",
"button",
",",
"int",
"position",
")",
"{",
"m_buttonPanel",
".",
"insert",
"(",
"button",
",",
"position",
")",
";",
"m_buttonPanel",
".",
"setStyleName",
"(",
"I_CmsLayoutBundle",
".",
"INSTANCE",
".",
"dialogCss... | Adds a button widget to the button panel before the given position.<p>
@param button the button widget
@param position the position to insert the button | [
"Adds",
"a",
"button",
"widget",
"to",
"the",
"button",
"panel",
"before",
"the",
"given",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsPopup.java#L498-L502 |
aws/aws-sdk-java | aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/TreeHashGenerator.java | TreeHashGenerator.calculateTreeHash | public static String calculateTreeHash(InputStream input)
throws AmazonClientException {
"""
Calculates a hex encoded binary hash using a tree hashing algorithm for
the data in the specified input stream. The method will consume all the
inputStream and close it when returned.
@param input
The in... | java | public static String calculateTreeHash(InputStream input)
throws AmazonClientException {
try {
TreeHashInputStream treeHashInputStream =
new TreeHashInputStream(input);
byte[] buffer = new byte[1024];
while (treeHashInputStream.read(buffer, 0... | [
"public",
"static",
"String",
"calculateTreeHash",
"(",
"InputStream",
"input",
")",
"throws",
"AmazonClientException",
"{",
"try",
"{",
"TreeHashInputStream",
"treeHashInputStream",
"=",
"new",
"TreeHashInputStream",
"(",
"input",
")",
";",
"byte",
"[",
"]",
"buffe... | Calculates a hex encoded binary hash using a tree hashing algorithm for
the data in the specified input stream. The method will consume all the
inputStream and close it when returned.
@param input
The input stream containing the data to hash.
@return The hex encoded binary tree hash for the data in the specified
inpu... | [
"Calculates",
"a",
"hex",
"encoded",
"binary",
"hash",
"using",
"a",
"tree",
"hashing",
"algorithm",
"for",
"the",
"data",
"in",
"the",
"specified",
"input",
"stream",
".",
"The",
"method",
"will",
"consume",
"all",
"the",
"inputStream",
"and",
"close",
"it"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/TreeHashGenerator.java#L84-L97 |
mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java | ArrayAdapterCompat.addAll | public void addAll(int index, T... items) {
"""
Inserts the specified objects at the specified index in the array.
@param items The objects to insert into the array.
@param index The index at which the object must be inserted.
"""
List<T> collection = Arrays.asList(items);
synchronized (mLo... | java | public void addAll(int index, T... items) {
List<T> collection = Arrays.asList(items);
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.addAll(index, collection);
} else {
mObjects.addAll(index, collection);
}
... | [
"public",
"void",
"addAll",
"(",
"int",
"index",
",",
"T",
"...",
"items",
")",
"{",
"List",
"<",
"T",
">",
"collection",
"=",
"Arrays",
".",
"asList",
"(",
"items",
")",
";",
"synchronized",
"(",
"mLock",
")",
"{",
"if",
"(",
"mOriginalValues",
"!="... | Inserts the specified objects at the specified index in the array.
@param items The objects to insert into the array.
@param index The index at which the object must be inserted. | [
"Inserts",
"the",
"specified",
"objects",
"at",
"the",
"specified",
"index",
"in",
"the",
"array",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java#L228-L238 |
Clivern/Racter | src/main/java/com/clivern/racter/senders/templates/MessageTemplate.java | MessageTemplate.setQuickReply | public void setQuickReply(String content_type, String title, String payload, String image_url) {
"""
Set Quick Reply
@param content_type the content type
@param title the title
@param payload the payload flag
@param image_url the image URL
"""
HashMap<String, String> quick_reply = new HashMap<Str... | java | public void setQuickReply(String content_type, String title, String payload, String image_url)
{
HashMap<String, String> quick_reply = new HashMap<String, String>();
quick_reply.put("content_type", content_type);
quick_reply.put("title", title);
quick_reply.put("payload", payload);
... | [
"public",
"void",
"setQuickReply",
"(",
"String",
"content_type",
",",
"String",
"title",
",",
"String",
"payload",
",",
"String",
"image_url",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"quick_reply",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Set Quick Reply
@param content_type the content type
@param title the title
@param payload the payload flag
@param image_url the image URL | [
"Set",
"Quick",
"Reply"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/MessageTemplate.java#L117-L125 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.getElementText | public String getElementText(final By by, final boolean normalizeSpace) {
"""
Delegates to {@link #findElement(By)} and then calls {@link WebElement#getText()
getText()} on the returned element. If {@code normalizeSpace} is {@code true}, the
element's text is passed to {@link JFunkUtils#normalizeSpace(String)}.
... | java | public String getElementText(final By by, final boolean normalizeSpace) {
WebElement element = findElement(by);
String text = element.getText();
return normalizeSpace ? JFunkUtils.normalizeSpace(text) : text;
} | [
"public",
"String",
"getElementText",
"(",
"final",
"By",
"by",
",",
"final",
"boolean",
"normalizeSpace",
")",
"{",
"WebElement",
"element",
"=",
"findElement",
"(",
"by",
")",
";",
"String",
"text",
"=",
"element",
".",
"getText",
"(",
")",
";",
"return"... | Delegates to {@link #findElement(By)} and then calls {@link WebElement#getText()
getText()} on the returned element. If {@code normalizeSpace} is {@code true}, the
element's text is passed to {@link JFunkUtils#normalizeSpace(String)}.
@param by
the {@link By} used to locate the element
@param normalizeSpace
specifies ... | [
"Delegates",
"to",
"{",
"@link",
"#findElement",
"(",
"By",
")",
"}",
"and",
"then",
"calls",
"{",
"@link",
"WebElement#getText",
"()",
"getText",
"()",
"}",
"on",
"the",
"returned",
"element",
".",
"If",
"{",
"@code",
"normalizeSpace",
"}",
"is",
"{",
"... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L572-L576 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/internal/query/Helpers.java | Helpers.encloseWithKey | public static String encloseWithKey(String key, Selector selector) {
"""
<P>
Returns the string form of a JSON object with the specified key mapping to a JSON object
enclosing the selector.
</P>
<pre>
{@code
Selector selector = eq("year", 2017);
System.out.println(selector.toString());
// Output: "year": {... | java | public static String encloseWithKey(String key, Selector selector) {
return String.format("{%s}", withKey(key, selector));
} | [
"public",
"static",
"String",
"encloseWithKey",
"(",
"String",
"key",
",",
"Selector",
"selector",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"{%s}\"",
",",
"withKey",
"(",
"key",
",",
"selector",
")",
")",
";",
"}"
] | <P>
Returns the string form of a JSON object with the specified key mapping to a JSON object
enclosing the selector.
</P>
<pre>
{@code
Selector selector = eq("year", 2017);
System.out.println(selector.toString());
// Output: "year": {"$eq" : 2017}
System.out.println(SelectorUtils.encloseWithKey("selector", selector));
... | [
"<P",
">",
"Returns",
"the",
"string",
"form",
"of",
"a",
"JSON",
"object",
"with",
"the",
"specified",
"key",
"mapping",
"to",
"a",
"JSON",
"object",
"enclosing",
"the",
"selector",
".",
"<",
"/",
"P",
">",
"<pre",
">",
"{",
"@code",
"Selector",
"sele... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/internal/query/Helpers.java#L167-L169 |
sarxos/win-registry | src/main/java/com/github/sarxos/winreg/WindowsRegistry.java | WindowsRegistry.readStringSubKeys | public List<String> readStringSubKeys(HKey hk, String key) throws RegistryException {
"""
Read the value name(s) from a given key
@param hk the HKEY
@param key the key
@return the value name(s)
@throws RegistryException when something is not right
"""
return readStringSubKeys(hk, key, null);
} | java | public List<String> readStringSubKeys(HKey hk, String key) throws RegistryException {
return readStringSubKeys(hk, key, null);
} | [
"public",
"List",
"<",
"String",
">",
"readStringSubKeys",
"(",
"HKey",
"hk",
",",
"String",
"key",
")",
"throws",
"RegistryException",
"{",
"return",
"readStringSubKeys",
"(",
"hk",
",",
"key",
",",
"null",
")",
";",
"}"
] | Read the value name(s) from a given key
@param hk the HKEY
@param key the key
@return the value name(s)
@throws RegistryException when something is not right | [
"Read",
"the",
"value",
"name",
"(",
"s",
")",
"from",
"a",
"given",
"key"
] | train | https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L104-L106 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/GrayFilter.java | GrayFilter.filterRGB | public int filterRGB(int pX, int pY, int pARGB) {
"""
Filters one pixel using ITU color-conversion.
@param pX x
@param pY y
@param pARGB pixel value in default color space
@return the filtered pixel value in the default color space
"""
// Get color components
int r = pARGB >> 16 & 0xF... | java | public int filterRGB(int pX, int pY, int pARGB) {
// Get color components
int r = pARGB >> 16 & 0xFF;
int g = pARGB >> 8 & 0xFF;
int b = pARGB & 0xFF;
// ITU standard: Gray scale=(222*Red+707*Green+71*Blue)/1000
int gray = (222 * r + 707 * g + 71 * b) / 10... | [
"public",
"int",
"filterRGB",
"(",
"int",
"pX",
",",
"int",
"pY",
",",
"int",
"pARGB",
")",
"{",
"// Get color components\r",
"int",
"r",
"=",
"pARGB",
">>",
"16",
"&",
"0xFF",
";",
"int",
"g",
"=",
"pARGB",
">>",
"8",
"&",
"0xFF",
";",
"int",
"b",... | Filters one pixel using ITU color-conversion.
@param pX x
@param pY y
@param pARGB pixel value in default color space
@return the filtered pixel value in the default color space | [
"Filters",
"one",
"pixel",
"using",
"ITU",
"color",
"-",
"conversion",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/GrayFilter.java#L112-L130 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.elementDiv | public static void elementDiv(DMatrixD1 a , DMatrixD1 b ) {
"""
<p>Performs the an element by element division operation:<br>
<br>
a<sub>ij</sub> = a<sub>ij</sub> / b<sub>ij</sub> <br>
</p>
@param a The left matrix in the division operation. Modified.
@param b The right matrix in the division operation. Not m... | java | public static void elementDiv(DMatrixD1 a , DMatrixD1 b )
{
if( a.numCols != b.numCols || a.numRows != b.numRows ) {
throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions");
}
int length = a.getNumElements();
for( int i = 0; i < ... | [
"public",
"static",
"void",
"elementDiv",
"(",
"DMatrixD1",
"a",
",",
"DMatrixD1",
"b",
")",
"{",
"if",
"(",
"a",
".",
"numCols",
"!=",
"b",
".",
"numCols",
"||",
"a",
".",
"numRows",
"!=",
"b",
".",
"numRows",
")",
"{",
"throw",
"new",
"MatrixDimens... | <p>Performs the an element by element division operation:<br>
<br>
a<sub>ij</sub> = a<sub>ij</sub> / b<sub>ij</sub> <br>
</p>
@param a The left matrix in the division operation. Modified.
@param b The right matrix in the division operation. Not modified. | [
"<p",
">",
"Performs",
"the",
"an",
"element",
"by",
"element",
"division",
"operation",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"/",
"b<sub",
">",
"ij<",
"/",
"sub",
">",
"<br... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1551-L1562 |
Azure/azure-sdk-for-java | redis/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/redis/v2018_03_01/implementation/LinkedServersInner.java | LinkedServersInner.listAsync | public Observable<Page<RedisLinkedServerWithPropertiesInner>> listAsync(final String resourceGroupName, final String name) {
"""
Gets the list of linked servers associated with this redis cache (requires Premium SKU).
@param resourceGroupName The name of the resource group.
@param name The name of the redis ca... | java | public Observable<Page<RedisLinkedServerWithPropertiesInner>> listAsync(final String resourceGroupName, final String name) {
return listWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<RedisLinkedServerWithPropertiesInner>>, Page<RedisLinkedServerWithPropertiesIn... | [
"public",
"Observable",
"<",
"Page",
"<",
"RedisLinkedServerWithPropertiesInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"na... | Gets the list of linked servers associated with this redis cache (requires Premium SKU).
@param resourceGroupName The name of the resource group.
@param name The name of the redis cache.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<RedisLinkedServ... | [
"Gets",
"the",
"list",
"of",
"linked",
"servers",
"associated",
"with",
"this",
"redis",
"cache",
"(",
"requires",
"Premium",
"SKU",
")",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/redis/v2018_03_01/implementation/LinkedServersInner.java#L511-L519 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java | TldTemplateMatching.addDescriptor | public void addDescriptor( boolean positive , ImageRectangle rect ) {
"""
Creates a new descriptor for the specified region
@param positive if it is a positive or negative example
"""
addDescriptor(positive, rect.x0, rect.y0, rect.x1, rect.y1);
} | java | public void addDescriptor( boolean positive , ImageRectangle rect ) {
addDescriptor(positive, rect.x0, rect.y0, rect.x1, rect.y1);
} | [
"public",
"void",
"addDescriptor",
"(",
"boolean",
"positive",
",",
"ImageRectangle",
"rect",
")",
"{",
"addDescriptor",
"(",
"positive",
",",
"rect",
".",
"x0",
",",
"rect",
".",
"y0",
",",
"rect",
".",
"x1",
",",
"rect",
".",
"y1",
")",
";",
"}"
] | Creates a new descriptor for the specified region
@param positive if it is a positive or negative example | [
"Creates",
"a",
"new",
"descriptor",
"for",
"the",
"specified",
"region"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L84-L87 |
spring-projects/spring-boot | spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java | AstUtils.hasAtLeastOneFieldOrMethod | public static boolean hasAtLeastOneFieldOrMethod(ClassNode node, String... types) {
"""
Determine if a {@link ClassNode} has one or more fields of the specified types or
method returning one or more of the specified types. N.B. the type names are not
normally fully qualified.
@param node the class to examine
@... | java | public static boolean hasAtLeastOneFieldOrMethod(ClassNode node, String... types) {
Set<String> typesSet = new HashSet<>(Arrays.asList(types));
for (FieldNode field : node.getFields()) {
if (typesSet.contains(field.getType().getName())) {
return true;
}
}
for (MethodNode method : node.getMethods()) {
... | [
"public",
"static",
"boolean",
"hasAtLeastOneFieldOrMethod",
"(",
"ClassNode",
"node",
",",
"String",
"...",
"types",
")",
"{",
"Set",
"<",
"String",
">",
"typesSet",
"=",
"new",
"HashSet",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"types",
")",
")",
";",
... | Determine if a {@link ClassNode} has one or more fields of the specified types or
method returning one or more of the specified types. N.B. the type names are not
normally fully qualified.
@param node the class to examine
@param types the types to look for
@return {@code true} if at least one of the types is found, oth... | [
"Determine",
"if",
"a",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java#L100-L113 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.searchCompanies | public ResultList<Company> searchCompanies(String query, Integer page) throws MovieDbException {
"""
Search Companies.
You can use this method to search for production companies that are part
of TMDb. The company IDs will map to those returned on movie calls.
http://help.themoviedb.org/kb/api/search-compani... | java | public ResultList<Company> searchCompanies(String query, Integer page) throws MovieDbException {
return tmdbSearch.searchCompanies(query, page);
} | [
"public",
"ResultList",
"<",
"Company",
">",
"searchCompanies",
"(",
"String",
"query",
",",
"Integer",
"page",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbSearch",
".",
"searchCompanies",
"(",
"query",
",",
"page",
")",
";",
"}"
] | Search Companies.
You can use this method to search for production companies that are part
of TMDb. The company IDs will map to those returned on movie calls.
http://help.themoviedb.org/kb/api/search-companies
@param query query
@param page page
@return
@throws MovieDbException exception | [
"Search",
"Companies",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1317-L1319 |
digipost/signature-api-client-java | src/main/java/no/digipost/signature/client/direct/DirectJobStatusResponse.java | DirectJobStatusResponse.noUpdatedStatus | static DirectJobStatusResponse noUpdatedStatus(Instant nextPermittedPollTime) {
"""
This instance indicates that there has been no status updates since the last poll request for
{@link DirectJobStatusResponse}. Its status is {@link DirectJobStatus#NO_CHANGES NO_CHANGES}.
"""
return new DirectJobStatus... | java | static DirectJobStatusResponse noUpdatedStatus(Instant nextPermittedPollTime) {
return new DirectJobStatusResponse(null, null, NO_CHANGES, null, null, null, null, nextPermittedPollTime) {
@Override public long getSignatureJobId() {
throw new IllegalStateException(
... | [
"static",
"DirectJobStatusResponse",
"noUpdatedStatus",
"(",
"Instant",
"nextPermittedPollTime",
")",
"{",
"return",
"new",
"DirectJobStatusResponse",
"(",
"null",
",",
"null",
",",
"NO_CHANGES",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"nextPermit... | This instance indicates that there has been no status updates since the last poll request for
{@link DirectJobStatusResponse}. Its status is {@link DirectJobStatus#NO_CHANGES NO_CHANGES}. | [
"This",
"instance",
"indicates",
"that",
"there",
"has",
"been",
"no",
"status",
"updates",
"since",
"the",
"last",
"poll",
"request",
"for",
"{"
] | train | https://github.com/digipost/signature-api-client-java/blob/246207571641fbac6beda5ffc585eec188825c45/src/main/java/no/digipost/signature/client/direct/DirectJobStatusResponse.java#L21-L35 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSTypeRegistry.java | JSTypeRegistry.createTemplateTypeMap | public TemplateTypeMap createTemplateTypeMap(
ImmutableList<TemplateType> templateKeys,
ImmutableList<JSType> templateValues) {
"""
Creates a template type map from the specified list of template keys and
template value types.
"""
if (templateKeys == null) {
templateKeys = ImmutableList.... | java | public TemplateTypeMap createTemplateTypeMap(
ImmutableList<TemplateType> templateKeys,
ImmutableList<JSType> templateValues) {
if (templateKeys == null) {
templateKeys = ImmutableList.of();
}
if (templateValues == null) {
templateValues = ImmutableList.of();
}
return (templa... | [
"public",
"TemplateTypeMap",
"createTemplateTypeMap",
"(",
"ImmutableList",
"<",
"TemplateType",
">",
"templateKeys",
",",
"ImmutableList",
"<",
"JSType",
">",
"templateValues",
")",
"{",
"if",
"(",
"templateKeys",
"==",
"null",
")",
"{",
"templateKeys",
"=",
"Imm... | Creates a template type map from the specified list of template keys and
template value types. | [
"Creates",
"a",
"template",
"type",
"map",
"from",
"the",
"specified",
"list",
"of",
"template",
"keys",
"and",
"template",
"value",
"types",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L1855-L1867 |
abel533/EasyXls | src/main/java/com/github/abel533/easyxls/common/XlsUtil.java | XlsUtil.list2Xls | public static boolean list2Xls(List<?> list, String xmlPath, OutputStream outputStream) throws Exception {
"""
导出list对象到excel
@param list 导出的list
@param xmlPath xml完整路径
@param outputStream 输出流
@return 处理结果,true成功,false失败
@throws Exception
"""
try {
ExcelConfig config = getEasyEx... | java | public static boolean list2Xls(List<?> list, String xmlPath, OutputStream outputStream) throws Exception {
try {
ExcelConfig config = getEasyExcel(xmlPath);
return list2Xls(config, list, outputStream);
} catch (Exception e1) {
return false;
}
} | [
"public",
"static",
"boolean",
"list2Xls",
"(",
"List",
"<",
"?",
">",
"list",
",",
"String",
"xmlPath",
",",
"OutputStream",
"outputStream",
")",
"throws",
"Exception",
"{",
"try",
"{",
"ExcelConfig",
"config",
"=",
"getEasyExcel",
"(",
"xmlPath",
")",
";",... | 导出list对象到excel
@param list 导出的list
@param xmlPath xml完整路径
@param outputStream 输出流
@return 处理结果,true成功,false失败
@throws Exception | [
"导出list对象到excel"
] | train | https://github.com/abel533/EasyXls/blob/f73be23745c2180d7c0b8f0a510e72e61cc37d5d/src/main/java/com/github/abel533/easyxls/common/XlsUtil.java#L338-L345 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.dateDiffStr | public static Expression dateDiffStr(String expression1, String expression2, DatePart part) {
"""
Returned expression results in Performs Date arithmetic.
Returns the elapsed time between two date strings in a supported format, as an integer whose unit is part.
"""
return dateDiffStr(x(expression1), x... | java | public static Expression dateDiffStr(String expression1, String expression2, DatePart part) {
return dateDiffStr(x(expression1), x(expression2), part);
} | [
"public",
"static",
"Expression",
"dateDiffStr",
"(",
"String",
"expression1",
",",
"String",
"expression2",
",",
"DatePart",
"part",
")",
"{",
"return",
"dateDiffStr",
"(",
"x",
"(",
"expression1",
")",
",",
"x",
"(",
"expression2",
")",
",",
"part",
")",
... | Returned expression results in Performs Date arithmetic.
Returns the elapsed time between two date strings in a supported format, as an integer whose unit is part. | [
"Returned",
"expression",
"results",
"in",
"Performs",
"Date",
"arithmetic",
".",
"Returns",
"the",
"elapsed",
"time",
"between",
"two",
"date",
"strings",
"in",
"a",
"supported",
"format",
"as",
"an",
"integer",
"whose",
"unit",
"is",
"part",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L132-L134 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaBindSurfaceToArray | public static int cudaBindSurfaceToArray(surfaceReference surfref, cudaArray array, cudaChannelFormatDesc desc) {
"""
[C++ API] Binds an array to a surface
<pre>
template < class T, int dim > cudaError_t cudaBindSurfaceToArray (
const surface < T,
dim > & surf,
cudaArray_const_t array,
const cudaChannelFor... | java | public static int cudaBindSurfaceToArray(surfaceReference surfref, cudaArray array, cudaChannelFormatDesc desc)
{
return checkResult(cudaBindSurfaceToArrayNative(surfref, array, desc));
} | [
"public",
"static",
"int",
"cudaBindSurfaceToArray",
"(",
"surfaceReference",
"surfref",
",",
"cudaArray",
"array",
",",
"cudaChannelFormatDesc",
"desc",
")",
"{",
"return",
"checkResult",
"(",
"cudaBindSurfaceToArrayNative",
"(",
"surfref",
",",
"array",
",",
"desc",... | [C++ API] Binds an array to a surface
<pre>
template < class T, int dim > cudaError_t cudaBindSurfaceToArray (
const surface < T,
dim > & surf,
cudaArray_const_t array,
const cudaChannelFormatDesc& desc ) [inline]
</pre>
<div>
<p>[C++ API] Binds an array to a surface
Binds the CUDA array <tt>array</tt> to the surface ... | [
"[",
"C",
"++",
"API",
"]",
"Binds",
"an",
"array",
"to",
"a",
"surface"
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L9477-L9480 |
bozaro/git-lfs-java | gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java | Client.getObject | @NotNull
public <T> T getObject(@Nullable final Meta meta, @NotNull final Links links, @NotNull final StreamHandler<T> handler) throws IOException {
"""
Download object by metadata.
@param meta Object metadata for stream validation.
@param links Object links.
@param handler Stream handler.
@return Str... | java | @NotNull
public <T> T getObject(@Nullable final Meta meta, @NotNull final Links links, @NotNull final StreamHandler<T> handler) throws IOException {
final Link link = links.getLinks().get(LinkType.Download);
if (link == null) {
throw new FileNotFoundException();
}
return doRequest(link, new Obje... | [
"@",
"NotNull",
"public",
"<",
"T",
">",
"T",
"getObject",
"(",
"@",
"Nullable",
"final",
"Meta",
"meta",
",",
"@",
"NotNull",
"final",
"Links",
"links",
",",
"@",
"NotNull",
"final",
"StreamHandler",
"<",
"T",
">",
"handler",
")",
"throws",
"IOException... | Download object by metadata.
@param meta Object metadata for stream validation.
@param links Object links.
@param handler Stream handler.
@return Stream handler result.
@throws FileNotFoundException File not found exception if object don't exists on LFS server.
@throws IOException On some errors. | [
"Download",
"object",
"by",
"metadata",
"."
] | train | https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java#L151-L158 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.extractPemString | private static String extractPemString(JsonObject json, String fieldName, String msgPrefix) throws NetworkConfigurationException {
"""
Returns the PEM (as a String) from either a path or a pem field
"""
String path = null;
String pemString = null;
JsonObject jsonField = getJsonValueAs... | java | private static String extractPemString(JsonObject json, String fieldName, String msgPrefix) throws NetworkConfigurationException {
String path = null;
String pemString = null;
JsonObject jsonField = getJsonValueAsObject(json.get(fieldName));
if (jsonField != null) {
path = ... | [
"private",
"static",
"String",
"extractPemString",
"(",
"JsonObject",
"json",
",",
"String",
"fieldName",
",",
"String",
"msgPrefix",
")",
"throws",
"NetworkConfigurationException",
"{",
"String",
"path",
"=",
"null",
";",
"String",
"pemString",
"=",
"null",
";",
... | Returns the PEM (as a String) from either a path or a pem field | [
"Returns",
"the",
"PEM",
"(",
"as",
"a",
"String",
")",
"from",
"either",
"a",
"path",
"or",
"a",
"pem",
"field"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L933-L964 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/expression/Uris.java | Uris.escapeFragmentId | public String escapeFragmentId(final String text, final String encoding) {
"""
<p>
Perform am URI fragment identifier <strong>escape</strong> operation
on a {@code String} input.
</p>
<p>
This method simply calls the equivalent method in the {@code UriEscape} class from the
<a href="http://www.unbescape.org"... | java | public String escapeFragmentId(final String text, final String encoding) {
return UriEscape.escapeUriFragmentId(text, encoding);
} | [
"public",
"String",
"escapeFragmentId",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"return",
"UriEscape",
".",
"escapeUriFragmentId",
"(",
"text",
",",
"encoding",
")",
";",
"}"
] | <p>
Perform am URI fragment identifier <strong>escape</strong> operation
on a {@code String} input.
</p>
<p>
This method simply calls the equivalent method in the {@code UriEscape} class from the
<a href="http://www.unbescape.org">Unbescape</a> library.
</p>
<p>
The following are the only allowed chars in an URI fragme... | [
"<p",
">",
"Perform",
"am",
"URI",
"fragment",
"identifier",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"{",
"@code",
"String",
"}",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"simply",
"calls",
"the",
... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/expression/Uris.java#L443-L445 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/Revoker.java | Revoker.attemptRevoke | public static void attemptRevoke(CuratorFramework client, String path) throws Exception {
"""
Utility to mark a lock for revocation. Assuming that the lock has been registered with
a {@link RevocationListener}, it will get called and the lock should be released. Note,
however, that revocation is cooperative.
... | java | public static void attemptRevoke(CuratorFramework client, String path) throws Exception
{
try
{
client.setData().forPath(path, LockInternals.REVOKE_MESSAGE);
}
catch ( KeeperException.NoNodeException ignore )
{
// ignore
}
} | [
"public",
"static",
"void",
"attemptRevoke",
"(",
"CuratorFramework",
"client",
",",
"String",
"path",
")",
"throws",
"Exception",
"{",
"try",
"{",
"client",
".",
"setData",
"(",
")",
".",
"forPath",
"(",
"path",
",",
"LockInternals",
".",
"REVOKE_MESSAGE",
... | Utility to mark a lock for revocation. Assuming that the lock has been registered with
a {@link RevocationListener}, it will get called and the lock should be released. Note,
however, that revocation is cooperative.
@param client the client
@param path the path of the lock - usually from something like
{@link InterPro... | [
"Utility",
"to",
"mark",
"a",
"lock",
"for",
"revocation",
".",
"Assuming",
"that",
"the",
"lock",
"has",
"been",
"registered",
"with",
"a",
"{",
"@link",
"RevocationListener",
"}",
"it",
"will",
"get",
"called",
"and",
"the",
"lock",
"should",
"be",
"rele... | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/Revoker.java#L36-L46 |
google/closure-compiler | src/com/google/javascript/jscomp/ControlFlowAnalysis.java | ControlFlowAnalysis.matchLabel | private static boolean matchLabel(Node target, String label) {
"""
Check if label is actually referencing the target control structure. If
label is null, it always returns true.
"""
if (label == null) {
return true;
}
while (target.isLabel()) {
if (target.getFirstChild().getString().eq... | java | private static boolean matchLabel(Node target, String label) {
if (label == null) {
return true;
}
while (target.isLabel()) {
if (target.getFirstChild().getString().equals(label)) {
return true;
}
target = target.getParent();
}
return false;
} | [
"private",
"static",
"boolean",
"matchLabel",
"(",
"Node",
"target",
",",
"String",
"label",
")",
"{",
"if",
"(",
"label",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"while",
"(",
"target",
".",
"isLabel",
"(",
")",
")",
"{",
"if",
"(",
"t... | Check if label is actually referencing the target control structure. If
label is null, it always returns true. | [
"Check",
"if",
"label",
"is",
"actually",
"referencing",
"the",
"target",
"control",
"structure",
".",
"If",
"label",
"is",
"null",
"it",
"always",
"returns",
"true",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ControlFlowAnalysis.java#L946-L957 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java | CustomVisionPredictionManager.authenticate | public static PredictionEndpoint authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) {
"""
Initializes an instance of Custom Vision Prediction API client.
@param baseUrl the base URL of the service
@param credentials the management credentials for Azure
@param apiKey the Cu... | java | public static PredictionEndpoint authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) {
return new PredictionEndpointImpl(baseUrl, credentials).withApiKey(apiKey);
} | [
"public",
"static",
"PredictionEndpoint",
"authenticate",
"(",
"String",
"baseUrl",
",",
"ServiceClientCredentials",
"credentials",
",",
"final",
"String",
"apiKey",
")",
"{",
"return",
"new",
"PredictionEndpointImpl",
"(",
"baseUrl",
",",
"credentials",
")",
".",
"... | Initializes an instance of Custom Vision Prediction API client.
@param baseUrl the base URL of the service
@param credentials the management credentials for Azure
@param apiKey the Custom Vision Prediction API key
@return the Custom Vision Prediction API client | [
"Initializes",
"an",
"instance",
"of",
"Custom",
"Vision",
"Prediction",
"API",
"client",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java#L63-L65 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.constValue | @Nullable
public static <T> T constValue(Tree tree, Class<? extends T> clazz) {
"""
Returns the compile-time constant value of a tree if it is of type clazz, or {@code null}.
"""
Object value = constValue(tree);
return clazz.isInstance(value) ? clazz.cast(value) : null;
} | java | @Nullable
public static <T> T constValue(Tree tree, Class<? extends T> clazz) {
Object value = constValue(tree);
return clazz.isInstance(value) ? clazz.cast(value) : null;
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
">",
"T",
"constValue",
"(",
"Tree",
"tree",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
")",
"{",
"Object",
"value",
"=",
"constValue",
"(",
"tree",
")",
";",
"return",
"clazz",
".",
"isInstan... | Returns the compile-time constant value of a tree if it is of type clazz, or {@code null}. | [
"Returns",
"the",
"compile",
"-",
"time",
"constant",
"value",
"of",
"a",
"tree",
"if",
"it",
"is",
"of",
"type",
"clazz",
"or",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L931-L935 |
fengwenyi/JavaLib | bak/HttpsClientUtil.java | HttpsClientUtil.doPost | public static String doPost(String url, Map<String, String> header, String param) throws KeyManagementException,
NoSuchAlgorithmException, IOException {
"""
POST方式向Http(s)提交数据并获取返回结果
@param url URL
@param header Header
@param param 参数(String)
@return 服务器数据
@throws KeyManagementException [ell... | java | public static String doPost(String url, Map<String, String> header, String param) throws KeyManagementException,
NoSuchAlgorithmException, IOException {
String result = null;
HttpClient httpClient = new SSLClient();
httpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION... | [
"public",
"static",
"String",
"doPost",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"header",
",",
"String",
"param",
")",
"throws",
"KeyManagementException",
",",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"String",
"result",
... | POST方式向Http(s)提交数据并获取返回结果
@param url URL
@param header Header
@param param 参数(String)
@return 服务器数据
@throws KeyManagementException [ellipsis]
@throws NoSuchAlgorithmException [ellipsis]
@throws IOException [ellipsis] | [
"POST方式向Http",
"(",
"s",
")",
"提交数据并获取返回结果"
] | train | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/bak/HttpsClientUtil.java#L91-L122 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static <T> T[] removeAll(final T[] a, final Object... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)) {
... | java | @SafeVarargs
public static <T> T[] removeAll(final T[] a, final Object... elements) {
if (N.isNullOrEmpty(a)) {
return a;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
return removeAllOccurrences(a, ele... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"removeAll",
"(",
"final",
"T",
"[",
"]",
"a",
",",
"final",
"Object",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"a"... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23535-L23555 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java | MultiLanguageTextProcessor.getBestMatch | public static String getBestMatch(final Locale locale, final MultiLanguageTextOrBuilder multiLanguageText) throws NotAvailableException {
"""
Get the first multiLanguageText for a languageCode from a multiLanguageText type. This is equivalent to calling
{@link #getMultiLanguageTextByLanguage(String, MultiLanguage... | java | public static String getBestMatch(final Locale locale, final MultiLanguageTextOrBuilder multiLanguageText) throws NotAvailableException {
try {
// resolve multiLanguageText via preferred locale.
return getMultiLanguageTextByLanguage(locale.getLanguage(), multiLanguageText);
} cat... | [
"public",
"static",
"String",
"getBestMatch",
"(",
"final",
"Locale",
"locale",
",",
"final",
"MultiLanguageTextOrBuilder",
"multiLanguageText",
")",
"throws",
"NotAvailableException",
"{",
"try",
"{",
"// resolve multiLanguageText via preferred locale.",
"return",
"getMultiL... | Get the first multiLanguageText for a languageCode from a multiLanguageText type. This is equivalent to calling
{@link #getMultiLanguageTextByLanguage(String, MultiLanguageTextOrBuilder)} but the language code is extracted from the locale by calling
{@link Locale#getLanguage()}. If no multiLanguageText matches the lang... | [
"Get",
"the",
"first",
"multiLanguageText",
"for",
"a",
"languageCode",
"from",
"a",
"multiLanguageText",
"type",
".",
"This",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#getMultiLanguageTextByLanguage",
"(",
"String",
"MultiLanguageTextOrBuilder",
")",
"}",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java#L184-L197 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listUsagesWithServiceResponseAsync | public Observable<ServiceResponse<Page<CsmUsageQuotaInner>>> listUsagesWithServiceResponseAsync(final String resourceGroupName, final String name, final String filter) {
"""
Gets server farm usage information.
Gets server farm usage information.
@param resourceGroupName Name of the resource group to which the ... | java | public Observable<ServiceResponse<Page<CsmUsageQuotaInner>>> listUsagesWithServiceResponseAsync(final String resourceGroupName, final String name, final String filter) {
return listUsagesSinglePageAsync(resourceGroupName, name, filter)
.concatMap(new Func1<ServiceResponse<Page<CsmUsageQuotaInner>>, ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"CsmUsageQuotaInner",
">",
">",
">",
"listUsagesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"filter",
")",
"{",
"r... | Gets server farm usage information.
Gets server farm usage information.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of App Service Plan
@param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value... | [
"Gets",
"server",
"farm",
"usage",
"information",
".",
"Gets",
"server",
"farm",
"usage",
"information",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L2915-L2927 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.andNotEqual | public ZealotKhala andNotEqual(String field, Object value) {
"""
生成带" AND "前缀不等查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例
"""
return this.doNormal(ZealotConst.AND_PREFIX, field, value, ZealotConst.NOT_EQUAL_SUFFIX, true);
} | java | public ZealotKhala andNotEqual(String field, Object value) {
return this.doNormal(ZealotConst.AND_PREFIX, field, value, ZealotConst.NOT_EQUAL_SUFFIX, true);
} | [
"public",
"ZealotKhala",
"andNotEqual",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"this",
".",
"doNormal",
"(",
"ZealotConst",
".",
"AND_PREFIX",
",",
"field",
",",
"value",
",",
"ZealotConst",
".",
"NOT_EQUAL_SUFFIX",
",",
"true",
... | 生成带" AND "前缀不等查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例 | [
"生成带",
"AND",
"前缀不等查询的SQL片段",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L606-L608 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java | GuiceUtil.hasInject | public static boolean hasInject(MemberLiteral<?, ?> member) {
"""
Returns {@code true} if the passed member has a inject annotation.
"""
return member.isAnnotationPresent(Inject.class)
|| member.isAnnotationPresent(javax.inject.Inject.class);
} | java | public static boolean hasInject(MemberLiteral<?, ?> member) {
return member.isAnnotationPresent(Inject.class)
|| member.isAnnotationPresent(javax.inject.Inject.class);
} | [
"public",
"static",
"boolean",
"hasInject",
"(",
"MemberLiteral",
"<",
"?",
",",
"?",
">",
"member",
")",
"{",
"return",
"member",
".",
"isAnnotationPresent",
"(",
"Inject",
".",
"class",
")",
"||",
"member",
".",
"isAnnotationPresent",
"(",
"javax",
".",
... | Returns {@code true} if the passed member has a inject annotation. | [
"Returns",
"{"
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/GuiceUtil.java#L177-L180 |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/internal/loader/LoadableResource.java | LoadableResource.loadRemote | public boolean loadRemote() {
"""
Try to load the resource from the remote locations.
@return true, on success.
"""
for (URI itemToLoad : remoteResources) {
try {
return load(itemToLoad, false);
} catch (Exception e) {
LOG.log(Level.INFO, "Fail... | java | public boolean loadRemote() {
for (URI itemToLoad : remoteResources) {
try {
return load(itemToLoad, false);
} catch (Exception e) {
LOG.log(Level.INFO, "Failed to load resource: " + itemToLoad, e);
}
}
return false;
} | [
"public",
"boolean",
"loadRemote",
"(",
")",
"{",
"for",
"(",
"URI",
"itemToLoad",
":",
"remoteResources",
")",
"{",
"try",
"{",
"return",
"load",
"(",
"itemToLoad",
",",
"false",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"LOG",
".",
"... | Try to load the resource from the remote locations.
@return true, on success. | [
"Try",
"to",
"load",
"the",
"resource",
"from",
"the",
"remote",
"locations",
"."
] | train | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/internal/loader/LoadableResource.java#L225-L234 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.onSetReplicateOnWrite | private void onSetReplicateOnWrite(CfDef cfDef, Properties cfProperties, StringBuilder builder) {
"""
On set replicate on write.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder
"""
String replicateOnWrite = cfProperties.getProperty(CassandraConstants.REP... | java | private void onSetReplicateOnWrite(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String replicateOnWrite = cfProperties.getProperty(CassandraConstants.REPLICATE_ON_WRITE);
if (builder != null)
{
String replicateOn_Write = CQLTranslator.getKeyword(CassandraConstan... | [
"private",
"void",
"onSetReplicateOnWrite",
"(",
"CfDef",
"cfDef",
",",
"Properties",
"cfProperties",
",",
"StringBuilder",
"builder",
")",
"{",
"String",
"replicateOnWrite",
"=",
"cfProperties",
".",
"getProperty",
"(",
"CassandraConstants",
".",
"REPLICATE_ON_WRITE",
... | On set replicate on write.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder | [
"On",
"set",
"replicate",
"on",
"write",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2597-L2612 |
apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java | DefaultConfigurableOptionsFactory.setInternal | private void setInternal(String key, String value) {
"""
Sets the configuration with (key, value) if the key is predefined, otherwise throws IllegalArgumentException.
@param key The configuration key, if key is not predefined, throws IllegalArgumentException out.
@param value The configuration value.
"""
... | java | private void setInternal(String key, String value) {
Preconditions.checkArgument(value != null && !value.isEmpty(),
"The configuration value must not be empty.");
configuredOptions.put(key, value);
} | [
"private",
"void",
"setInternal",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isEmpty",
"(",
")",
",",
"\"The configuration value must not be empty.\"",
")",... | Sets the configuration with (key, value) if the key is predefined, otherwise throws IllegalArgumentException.
@param key The configuration key, if key is not predefined, throws IllegalArgumentException out.
@param value The configuration value. | [
"Sets",
"the",
"configuration",
"with",
"(",
"key",
"value",
")",
"if",
"the",
"key",
"is",
"predefined",
"otherwise",
"throws",
"IllegalArgumentException",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java#L407-L412 |
LearnLib/learnlib | oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java | SampleSetEQOracle.addAll | @SafeVarargs
public final SampleSetEQOracle<I, D> addAll(MembershipOracle<I, D> oracle, Word<I>... words) {
"""
Adds several query words to the sample set. The expected output is determined by means of the specified
membership oracle.
@param oracle
the membership oracle used to determine expected outputs
... | java | @SafeVarargs
public final SampleSetEQOracle<I, D> addAll(MembershipOracle<I, D> oracle, Word<I>... words) {
return addAll(oracle, Arrays.asList(words));
} | [
"@",
"SafeVarargs",
"public",
"final",
"SampleSetEQOracle",
"<",
"I",
",",
"D",
">",
"addAll",
"(",
"MembershipOracle",
"<",
"I",
",",
"D",
">",
"oracle",
",",
"Word",
"<",
"I",
">",
"...",
"words",
")",
"{",
"return",
"addAll",
"(",
"oracle",
",",
"... | Adds several query words to the sample set. The expected output is determined by means of the specified
membership oracle.
@param oracle
the membership oracle used to determine expected outputs
@param words
the words to be added to the sample set
@return {@code this}, to enable chained {@code add} or {@code addAll} c... | [
"Adds",
"several",
"query",
"words",
"to",
"the",
"sample",
"set",
".",
"The",
"expected",
"output",
"is",
"determined",
"by",
"means",
"of",
"the",
"specified",
"membership",
"oracle",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java#L100-L103 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getImplementation | public static final <T> T getImplementation(ClassLoader loader,
Class<T> type,
Class<?>[] paramsType,
Collection<?> paramsValue,
... | java | public static final <T> T getImplementation(ClassLoader loader,
Class<T> type,
Class<?>[] paramsType,
Collection<?> paramsValue,
... | [
"public",
"static",
"final",
"<",
"T",
">",
"T",
"getImplementation",
"(",
"ClassLoader",
"loader",
",",
"Class",
"<",
"T",
">",
"type",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramsType",
",",
"Collection",
"<",
"?",
">",
"paramsValue",
",",
"String"... | Get the class implementation from its name by using a custom constructor.
@param <T> The instance type.
@param loader The class loader to use.
@param type The class type.
@param paramsType The parameters type.
@param paramsValue The parameters value.
@param className The class name.
@return The typed class instance.
@... | [
"Get",
"the",
"class",
"implementation",
"from",
"its",
"name",
"by",
"using",
"a",
"custom",
"constructor",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L387-L418 |
Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/utils/ColorUtils.java | ColorUtils.resolveColor | @SuppressWarnings("deprecation")
public static @ColorInt int resolveColor(@ColorRes int color, Context context) {
"""
Resolves a color resource.
@param color the color resource
@param context the current context
@return a color int
"""
if (Build.VERSION.SDK_INT >= 23) {
return co... | java | @SuppressWarnings("deprecation")
public static @ColorInt int resolveColor(@ColorRes int color, Context context) {
if (Build.VERSION.SDK_INT >= 23) {
return context.getResources().getColor(color, context.getTheme());
}
else {
return context.getResources().getColor(colo... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"@",
"ColorInt",
"int",
"resolveColor",
"(",
"@",
"ColorRes",
"int",
"color",
",",
"Context",
"context",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"23",
")"... | Resolves a color resource.
@param color the color resource
@param context the current context
@return a color int | [
"Resolves",
"a",
"color",
"resource",
"."
] | train | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/utils/ColorUtils.java#L26-L34 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_voicemail_serviceName_directories_id_GET | public OvhVoicemailMessages billingAccount_voicemail_serviceName_directories_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}
@param billingAccount [required] The name of... | java | public OvhVoicemailMessages billingAccount_voicemail_serviceName_directories_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
Strin... | [
"public",
"OvhVoicemailMessages",
"billingAccount_voicemail_serviceName_directories_id_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/voicemail/{se... | Get this object properties
REST: GET /telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7942-L7947 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractInputHandler.java | AbstractInputHandler.handleControlMessage | public void handleControlMessage(SIBUuid8 sourceMEUuid, ControlMessage cMsg)
throws SIIncorrectCallException, SIErrorException, SIResourceException {
"""
/* (non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.ControlHandler#handleControlMessage(com.ibm.ws.sib.trm.topology.Cellule, com.ibm.ws.sib.mfp.c... | java | public void handleControlMessage(SIBUuid8 sourceMEUuid, ControlMessage cMsg)
throws SIIncorrectCallException, SIErrorException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleControlMessage", new Object[] { sourceMEUuid, cMsg });
// Nex... | [
"public",
"void",
"handleControlMessage",
"(",
"SIBUuid8",
"sourceMEUuid",
",",
"ControlMessage",
"cMsg",
")",
"throws",
"SIIncorrectCallException",
",",
"SIErrorException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
"... | /* (non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.ControlHandler#handleControlMessage(com.ibm.ws.sib.trm.topology.Cellule, com.ibm.ws.sib.mfp.control.ControlMessage)
Handle all downstream control messages i.e. target control messages | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")",
"@see",
"com",
".",
"ibm",
".",
"ws",
".",
"sib",
".",
"processor",
".",
"impl",
".",
"interfaces",
".",
"ControlHandler#handleControlMessage",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"sib",
".",
"trm",
".",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractInputHandler.java#L674-L710 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/storage/StorageBuilder.java | StorageBuilder.setUserCredentialsRepository | public StorageBuilder setUserCredentialsRepository( UserCredentialsRepository userCredentialsRepo, String userId ) {
"""
Set the user credentials repository. This setter must always be called during the build
@param userCredentialsRepo The repository
@param userId The user identifier (may be null if the identi... | java | public StorageBuilder setUserCredentialsRepository( UserCredentialsRepository userCredentialsRepo, String userId )
{
this.userCredentialsRepo = userCredentialsRepo;
this.userId = userId;
return this;
} | [
"public",
"StorageBuilder",
"setUserCredentialsRepository",
"(",
"UserCredentialsRepository",
"userCredentialsRepo",
",",
"String",
"userId",
")",
"{",
"this",
".",
"userCredentialsRepo",
"=",
"userCredentialsRepo",
";",
"this",
".",
"userId",
"=",
"userId",
";",
"retur... | Set the user credentials repository. This setter must always be called during the build
@param userCredentialsRepo The repository
@param userId The user identifier (may be null if the identifier is unknown)
@return The builder | [
"Set",
"the",
"user",
"credentials",
"repository",
".",
"This",
"setter",
"must",
"always",
"be",
"called",
"during",
"the",
"build"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/storage/StorageBuilder.java#L81-L87 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/ByteArrayContent.java | ByteArrayContent.fromString | public static ByteArrayContent fromString(String type, String contentString) {
"""
Returns a new instance with the UTF-8 encoding (using {@link StringUtils#getBytesUtf8(String)})
of the given content string.
<p>Sample use:
<pre>
<code>
static void setJsonContent(HttpRequest request, String json) {
reques... | java | public static ByteArrayContent fromString(String type, String contentString) {
return new ByteArrayContent(type, StringUtils.getBytesUtf8(contentString));
} | [
"public",
"static",
"ByteArrayContent",
"fromString",
"(",
"String",
"type",
",",
"String",
"contentString",
")",
"{",
"return",
"new",
"ByteArrayContent",
"(",
"type",
",",
"StringUtils",
".",
"getBytesUtf8",
"(",
"contentString",
")",
")",
";",
"}"
] | Returns a new instance with the UTF-8 encoding (using {@link StringUtils#getBytesUtf8(String)})
of the given content string.
<p>Sample use:
<pre>
<code>
static void setJsonContent(HttpRequest request, String json) {
request.setContent(ByteArrayContent.fromString("application/json", json));
}
</code>
</pre>
@param ty... | [
"Returns",
"a",
"new",
"instance",
"with",
"the",
"UTF",
"-",
"8",
"encoding",
"(",
"using",
"{",
"@link",
"StringUtils#getBytesUtf8",
"(",
"String",
")",
"}",
")",
"of",
"the",
"given",
"content",
"string",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/ByteArrayContent.java#L104-L106 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/PropertyHelper.java | PropertyHelper.isPropertyAllowed | public static boolean isPropertyAllowed(Class defClass, String propertyName) {
"""
Checks whether the property of the given name is allowed for the model element.
@param defClass The class of the model element
@param propertyName The name of the property
@return <code>true</code> if the property is allowe... | java | public static boolean isPropertyAllowed(Class defClass, String propertyName)
{
HashMap props = (HashMap)_properties.get(defClass);
return (props == null ? true : props.containsKey(propertyName));
} | [
"public",
"static",
"boolean",
"isPropertyAllowed",
"(",
"Class",
"defClass",
",",
"String",
"propertyName",
")",
"{",
"HashMap",
"props",
"=",
"(",
"HashMap",
")",
"_properties",
".",
"get",
"(",
"defClass",
")",
";",
"return",
"(",
"props",
"==",
"null",
... | Checks whether the property of the given name is allowed for the model element.
@param defClass The class of the model element
@param propertyName The name of the property
@return <code>true</code> if the property is allowed for this type of model elements | [
"Checks",
"whether",
"the",
"property",
"of",
"the",
"given",
"name",
"is",
"allowed",
"for",
"the",
"model",
"element",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/PropertyHelper.java#L242-L247 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/ByteArrayUtil.java | ByteArrayUtil.putLongLE | public static void putLongLE(final byte[] array, final int offset, final long value) {
"""
Put the source <i>long</i> into the destination byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array destination byte array
@param offset destination offset
@param va... | java | public static void putLongLE(final byte[] array, final int offset, final long value) {
array[offset ] = (byte) (value );
array[offset + 1] = (byte) (value >>> 8);
array[offset + 2] = (byte) (value >>> 16);
array[offset + 3] = (byte) (value >>> 24);
array[offset + 4] = (byte) (value >>> 32)... | [
"public",
"static",
"void",
"putLongLE",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"long",
"value",
")",
"{",
"array",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
")",
";",
"array",
"[",
"off... | Put the source <i>long</i> into the destination byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array destination byte array
@param offset destination offset
@param value source <i>long</i> | [
"Put",
"the",
"source",
"<i",
">",
"long<",
"/",
"i",
">",
"into",
"the",
"destination",
"byte",
"array",
"starting",
"at",
"the",
"given",
"offset",
"in",
"little",
"endian",
"order",
".",
"There",
"is",
"no",
"bounds",
"checking",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/ByteArrayUtil.java#L144-L153 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java | UnsignedUtils.digit | public static int digit(char c, int radix) {
"""
Returns the numeric value of the character {@code c} in the specified
radix.
@param c
@param radix
@return
@see #MAX_RADIX
"""
for (int i = 0; i < MAX_RADIX && i < radix; i++) {
if (digits[i] == c) {
return i;
... | java | public static int digit(char c, int radix) {
for (int i = 0; i < MAX_RADIX && i < radix; i++) {
if (digits[i] == c) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"digit",
"(",
"char",
"c",
",",
"int",
"radix",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"MAX_RADIX",
"&&",
"i",
"<",
"radix",
";",
"i",
"++",
")",
"{",
"if",
"(",
"digits",
"[",
"i",
"]",
"==",
... | Returns the numeric value of the character {@code c} in the specified
radix.
@param c
@param radix
@return
@see #MAX_RADIX | [
"Returns",
"the",
"numeric",
"value",
"of",
"the",
"character",
"{",
"@code",
"c",
"}",
"in",
"the",
"specified",
"radix",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java#L55-L62 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java | TimestampUtils.appendTime | private static void appendTime(StringBuilder sb, int hours, int minutes, int seconds, int nanos) {
"""
Appends time part to the {@code StringBuilder} in PostgreSQL-compatible format.
The function truncates {@param nanos} to microseconds. The value is expected to be rounded
beforehand.
@param sb destination
@pa... | java | private static void appendTime(StringBuilder sb, int hours, int minutes, int seconds, int nanos) {
sb.append(NUMBERS[hours]);
sb.append(':');
sb.append(NUMBERS[minutes]);
sb.append(':');
sb.append(NUMBERS[seconds]);
// Add nanoseconds.
// This won't work for server versions < 7.2 which on... | [
"private",
"static",
"void",
"appendTime",
"(",
"StringBuilder",
"sb",
",",
"int",
"hours",
",",
"int",
"minutes",
",",
"int",
"seconds",
",",
"int",
"nanos",
")",
"{",
"sb",
".",
"append",
"(",
"NUMBERS",
"[",
"hours",
"]",
")",
";",
"sb",
".",
"app... | Appends time part to the {@code StringBuilder} in PostgreSQL-compatible format.
The function truncates {@param nanos} to microseconds. The value is expected to be rounded
beforehand.
@param sb destination
@param hours hours
@param minutes minutes
@param seconds seconds
@param nanos nanoseconds | [
"Appends",
"time",
"part",
"to",
"the",
"{"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L690-L720 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/util/V1Util.java | V1Util.copyStream | public static void copyStream(Reader input, Writer output, int buffersize)
throws IOException, IllegalArgumentException {
"""
Coping data(character type) from {@code input} reader to {@code output} writer.
@param input input source of data.
@param output destination of data.
@param buffersize size... | java | public static void copyStream(Reader input, Writer output, int buffersize)
throws IOException, IllegalArgumentException {
if (buffersize < 1) {
throw new IllegalArgumentException(
"buffersize must be greater than 0");
}
char[] buffer = new char[buffers... | [
"public",
"static",
"void",
"copyStream",
"(",
"Reader",
"input",
",",
"Writer",
"output",
",",
"int",
"buffersize",
")",
"throws",
"IOException",
",",
"IllegalArgumentException",
"{",
"if",
"(",
"buffersize",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgume... | Coping data(character type) from {@code input} reader to {@code output} writer.
@param input input source of data.
@param output destination of data.
@param buffersize size of buffer with is using for data copy.
@throws IOException if any errors occur during copying process.
@throws IllegalArgumentException if {@code ... | [
"Coping",
"data",
"(",
"character",
"type",
")",
"from",
"{",
"@code",
"input",
"}",
"reader",
"to",
"{",
"@code",
"output",
"}",
"writer",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/util/V1Util.java#L65-L76 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getFirstParentConstructor | public static Constructor<?> getFirstParentConstructor(Class<?> klass) {
"""
Get the first parent constructor defined in a super class of
{@code klass}.
@param klass The class where the constructor is located. {@code null}
).
@return A .
"""
try {
return getOriginalUnmockedType(klass)... | java | public static Constructor<?> getFirstParentConstructor(Class<?> klass) {
try {
return getOriginalUnmockedType(klass).getSuperclass().getDeclaredConstructors()[0];
} catch (Exception e) {
throw new ConstructorNotFoundException("Failed to lookup constructor.", e);
}
} | [
"public",
"static",
"Constructor",
"<",
"?",
">",
"getFirstParentConstructor",
"(",
"Class",
"<",
"?",
">",
"klass",
")",
"{",
"try",
"{",
"return",
"getOriginalUnmockedType",
"(",
"klass",
")",
".",
"getSuperclass",
"(",
")",
".",
"getDeclaredConstructors",
"... | Get the first parent constructor defined in a super class of
{@code klass}.
@param klass The class where the constructor is located. {@code null}
).
@return A . | [
"Get",
"the",
"first",
"parent",
"constructor",
"defined",
"in",
"a",
"super",
"class",
"of",
"{",
"@code",
"klass",
"}",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L1563-L1569 |
alipay/sofa-rpc | extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperProviderObserver.java | ZookeeperProviderObserver.addProviderListener | public void addProviderListener(ConsumerConfig consumerConfig, ProviderInfoListener listener) {
"""
Add provider listener.
@param consumerConfig the consumer config
@param listener the listener
"""
if (listener != null) {
RegistryUtils.initOrAddList(providerListenerMap, consumerCo... | java | public void addProviderListener(ConsumerConfig consumerConfig, ProviderInfoListener listener) {
if (listener != null) {
RegistryUtils.initOrAddList(providerListenerMap, consumerConfig, listener);
}
} | [
"public",
"void",
"addProviderListener",
"(",
"ConsumerConfig",
"consumerConfig",
",",
"ProviderInfoListener",
"listener",
")",
"{",
"if",
"(",
"listener",
"!=",
"null",
")",
"{",
"RegistryUtils",
".",
"initOrAddList",
"(",
"providerListenerMap",
",",
"consumerConfig"... | Add provider listener.
@param consumerConfig the consumer config
@param listener the listener | [
"Add",
"provider",
"listener",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperProviderObserver.java#L59-L63 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.sort | public static <K, V> TreeMap<K, V> sort(Map<K, V> map) {
"""
排序已有Map,Key有序的Map,使用默认Key排序方式(字母顺序)
@param map Map
@return TreeMap
@since 4.0.1
@see #newTreeMap(Map, Comparator)
"""
return sort(map, null);
} | java | public static <K, V> TreeMap<K, V> sort(Map<K, V> map) {
return sort(map, null);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"TreeMap",
"<",
"K",
",",
"V",
">",
"sort",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
")",
"{",
"return",
"sort",
"(",
"map",
",",
"null",
")",
";",
"}"
] | 排序已有Map,Key有序的Map,使用默认Key排序方式(字母顺序)
@param map Map
@return TreeMap
@since 4.0.1
@see #newTreeMap(Map, Comparator) | [
"排序已有Map,Key有序的Map,使用默认Key排序方式(字母顺序)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L638-L640 |
knowm/XChange | xchange-ccex/src/main/java/org/knowm/xchange/ccex/CCEXAdapters.java | CCEXAdapters.adaptOrderBook | public static OrderBook adaptOrderBook(
CCEXGetorderbook ccexOrderBook, CurrencyPair currencyPair) {
"""
Adapts a org.knowm.xchange.ccex.api.model.OrderBook to a OrderBook Object
@param currencyPair (e.g. BTC/USD)
@return The C-Cex OrderBook
"""
List<LimitOrder> asks =
createOrders(curre... | java | public static OrderBook adaptOrderBook(
CCEXGetorderbook ccexOrderBook, CurrencyPair currencyPair) {
List<LimitOrder> asks =
createOrders(currencyPair, Order.OrderType.ASK, ccexOrderBook.getAsks());
List<LimitOrder> bids =
createOrders(currencyPair, Order.OrderType.BID, ccexOrderBook.getB... | [
"public",
"static",
"OrderBook",
"adaptOrderBook",
"(",
"CCEXGetorderbook",
"ccexOrderBook",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"List",
"<",
"LimitOrder",
">",
"asks",
"=",
"createOrders",
"(",
"currencyPair",
",",
"Order",
".",
"OrderType",
".",
"ASK"... | Adapts a org.knowm.xchange.ccex.api.model.OrderBook to a OrderBook Object
@param currencyPair (e.g. BTC/USD)
@return The C-Cex OrderBook | [
"Adapts",
"a",
"org",
".",
"knowm",
".",
"xchange",
".",
"ccex",
".",
"api",
".",
"model",
".",
"OrderBook",
"to",
"a",
"OrderBook",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-ccex/src/main/java/org/knowm/xchange/ccex/CCEXAdapters.java#L78-L87 |
WiQuery/wiquery | wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java | Options.putFloat | public Options putFloat(String key, IModel<Float> value) {
"""
<p>
Puts an IModel <Double> value for the given option name.
</p>
@param key
the option name.
@param value
the float double.
"""
putOption(key, new FloatOption(value));
return this;
} | java | public Options putFloat(String key, IModel<Float> value)
{
putOption(key, new FloatOption(value));
return this;
} | [
"public",
"Options",
"putFloat",
"(",
"String",
"key",
",",
"IModel",
"<",
"Float",
">",
"value",
")",
"{",
"putOption",
"(",
"key",
",",
"new",
"FloatOption",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Puts an IModel <Double> value for the given option name.
</p>
@param key
the option name.
@param value
the float double. | [
"<p",
">",
"Puts",
"an",
"IModel",
"<",
";",
"Double>",
";",
"value",
"for",
"the",
"given",
"option",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java#L420-L424 |
JoeKerouac/utils | src/main/java/com/joe/utils/secure/impl/SignatureUtilImpl.java | SignatureUtilImpl.checkSign | @Override
public boolean checkSign(byte[] content, byte[] data) {
"""
使用公钥校验签名
@param content 原文
@param data 签名数据(BASE64 encode过的)
@return 返回true表示校验成功
"""
try (PooledObject<SignatureHolder> holder = CACHE.get(id).get()) {
Signature signature = holder.get().getVerify();
... | java | @Override
public boolean checkSign(byte[] content, byte[] data) {
try (PooledObject<SignatureHolder> holder = CACHE.get(id).get()) {
Signature signature = holder.get().getVerify();
signature.update(content);
return signature.verify(BASE_64.decrypt(data));
} catch ... | [
"@",
"Override",
"public",
"boolean",
"checkSign",
"(",
"byte",
"[",
"]",
"content",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"try",
"(",
"PooledObject",
"<",
"SignatureHolder",
">",
"holder",
"=",
"CACHE",
".",
"get",
"(",
"id",
")",
".",
"get",
"("... | 使用公钥校验签名
@param content 原文
@param data 签名数据(BASE64 encode过的)
@return 返回true表示校验成功 | [
"使用公钥校验签名"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/impl/SignatureUtilImpl.java#L119-L128 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java | TopicsInner.beginUpdate | public TopicInner beginUpdate(String resourceGroupName, String topicName, Map<String, String> tags) {
"""
Update a topic.
Asynchronously updates a topic with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@p... | java | public TopicInner beginUpdate(String resourceGroupName, String topicName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags).toBlocking().single().body();
} | [
"public",
"TopicInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"topicName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"topicName",
",",
... | Update a topic.
Asynchronously updates a topic with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@param tags Tags of the resource
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Clo... | [
"Update",
"a",
"topic",
".",
"Asynchronously",
"updates",
"a",
"topic",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L803-L805 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.extractLinkValue | public boolean extractLinkValue(String colName, Map<String, Set<String>> mvLinkValueMap) {
"""
Examine the given column name and, if it represents an MV link value, add it to the
given MV link value map. If a link value is successfully extracted, true is returned.
If the column name is not in the format used for... | java | public boolean extractLinkValue(String colName, Map<String, Set<String>> mvLinkValueMap) {
// Link column names always begin with '~'.
if (colName.length() == 0 || colName.charAt(0) != '~') {
return false;
}
// A '/' should separate the field name and object va... | [
"public",
"boolean",
"extractLinkValue",
"(",
"String",
"colName",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"mvLinkValueMap",
")",
"{",
"// Link column names always begin with '~'.\r",
"if",
"(",
"colName",
".",
"length",
"(",
")",
"==",
... | Examine the given column name and, if it represents an MV link value, add it to the
given MV link value map. If a link value is successfully extracted, true is returned.
If the column name is not in the format used for MV link values, false is returned.
@param colName Column name from an object record belonging... | [
"Examine",
"the",
"given",
"column",
"name",
"and",
"if",
"it",
"represents",
"an",
"MV",
"link",
"value",
"add",
"it",
"to",
"the",
"given",
"MV",
"link",
"value",
"map",
".",
"If",
"a",
"link",
"value",
"is",
"successfully",
"extracted",
"true",
"is",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L672-L697 |
micronaut-projects/micronaut-core | http-client/src/main/java/io/micronaut/http/client/interceptor/HttpClientIntroductionAdvice.java | HttpClientIntroductionAdvice.resolveTemplate | private String resolveTemplate(AnnotationValue<Client> clientAnnotation, String templateString) {
"""
Resolve the template for the client annotation.
@param clientAnnotation client annotation reference
@param templateString template to be applied
@return resolved template contents
"""
String pat... | java | private String resolveTemplate(AnnotationValue<Client> clientAnnotation, String templateString) {
String path = clientAnnotation.get("path", String.class).orElse(null);
if (StringUtils.isNotEmpty(path)) {
return path + templateString;
} else {
String value = clientAnnotat... | [
"private",
"String",
"resolveTemplate",
"(",
"AnnotationValue",
"<",
"Client",
">",
"clientAnnotation",
",",
"String",
"templateString",
")",
"{",
"String",
"path",
"=",
"clientAnnotation",
".",
"get",
"(",
"\"path\"",
",",
"String",
".",
"class",
")",
".",
"o... | Resolve the template for the client annotation.
@param clientAnnotation client annotation reference
@param templateString template to be applied
@return resolved template contents | [
"Resolve",
"the",
"template",
"for",
"the",
"client",
"annotation",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-client/src/main/java/io/micronaut/http/client/interceptor/HttpClientIntroductionAdvice.java#L580-L593 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.readUnsignedShort | public static int readUnsignedShort(byte[] array, int offset) {
"""
Read an unsigned short from the byte array at the given offset.
@param array Array to read from
@param offset Offset to read at
@return short
"""
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset ... | java | public static int readUnsignedShort(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset + 0] & 0xFF;
int b1 = array[offset + 1] & 0xFF;
return ((b0 << 8) + (b1 << 0));
} | [
"public",
"static",
"int",
"readUnsignedShort",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"// First make integers to resolve signed vs. unsigned issues.",
"int",
"b0",
"=",
"array",
"[",
"offset",
"+",
"0",
"]",
"&",
"0xFF",
";",
"int",
"... | Read an unsigned short from the byte array at the given offset.
@param array Array to read from
@param offset Offset to read at
@return short | [
"Read",
"an",
"unsigned",
"short",
"from",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L193-L198 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLArgumentsTab.java | SARLArgumentsTab.createSREArgsBlock | protected void createSREArgsBlock(Composite parent, Font font) {
"""
Create the block for the SRE arguments.
@param parent the parent composite.
@param font the font for the block.
"""
// Create the block for the SRE
final Group group = new Group(parent, SWT.NONE);
group.setFont(font);
final GridLa... | java | protected void createSREArgsBlock(Composite parent, Font font) {
// Create the block for the SRE
final Group group = new Group(parent, SWT.NONE);
group.setFont(font);
final GridLayout layout = new GridLayout();
group.setLayout(layout);
group.setLayoutData(new GridData(GridData.FILL_BOTH));
// Move the SRE... | [
"protected",
"void",
"createSREArgsBlock",
"(",
"Composite",
"parent",
",",
"Font",
"font",
")",
"{",
"// Create the block for the SRE",
"final",
"Group",
"group",
"=",
"new",
"Group",
"(",
"parent",
",",
"SWT",
".",
"NONE",
")",
";",
"group",
".",
"setFont",
... | Create the block for the SRE arguments.
@param parent the parent composite.
@param font the font for the block. | [
"Create",
"the",
"block",
"for",
"the",
"SRE",
"arguments",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLArgumentsTab.java#L103-L117 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java | JacksonUtils.fromJson | public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
"""
Deserialize a {@link JsonNode}, with custom class loader.
@param json
@param clazz
@return
"""
return SerializationUtils.fromJson(json, clazz, classLoader);
} | java | public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
return SerializationUtils.fromJson(json, clazz, classLoader);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJson",
"(",
"JsonNode",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"SerializationUtils",
".",
"fromJson",
"(",
"json",
",",
"clazz",
",",
"classLoader",
... | Deserialize a {@link JsonNode}, with custom class loader.
@param json
@param clazz
@return | [
"Deserialize",
"a",
"{",
"@link",
"JsonNode",
"}",
"with",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java#L96-L98 |
finmath/finmath-lib | src/main/java/net/finmath/modelling/descriptor/xmlparser/FIPXMLParser.java | FIPXMLParser.getSwapLegProductDescriptor | private static InterestRateSwapLegProductDescriptor getSwapLegProductDescriptor(Element leg, String forwardCurveName, String discountCurveName,
DayCountConvention daycountConvention) {
"""
Construct an InterestRateSwapLegProductDescriptor from a node in a FIPXML file.
@param leg The node containing the leg.... | java | private static InterestRateSwapLegProductDescriptor getSwapLegProductDescriptor(Element leg, String forwardCurveName, String discountCurveName,
DayCountConvention daycountConvention) {
boolean isFixed = leg.getElementsByTagName("interestType").item(0).getTextContent().equalsIgnoreCase("FIX");
ArrayList<Pe... | [
"private",
"static",
"InterestRateSwapLegProductDescriptor",
"getSwapLegProductDescriptor",
"(",
"Element",
"leg",
",",
"String",
"forwardCurveName",
",",
"String",
"discountCurveName",
",",
"DayCountConvention",
"daycountConvention",
")",
"{",
"boolean",
"isFixed",
"=",
"l... | Construct an InterestRateSwapLegProductDescriptor from a node in a FIPXML file.
@param leg The node containing the leg.
@param forwardCurveName Forward curve name form outside the node.
@param discountCurveName Discount curve name form outside the node.
@param daycountConvention Daycount convention from outside the no... | [
"Construct",
"an",
"InterestRateSwapLegProductDescriptor",
"from",
"a",
"node",
"in",
"a",
"FIPXML",
"file",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/modelling/descriptor/xmlparser/FIPXMLParser.java#L152-L196 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/MultiInstanceActivityBehavior.java | MultiInstanceActivityBehavior.trigger | public void trigger(DelegateExecution execution, String signalName, Object signalData) {
"""
Intercepts signals, and delegates it to the wrapped {@link ActivityBehavior}.
"""
innerActivityBehavior.trigger(execution, signalName, signalData);
} | java | public void trigger(DelegateExecution execution, String signalName, Object signalData) {
innerActivityBehavior.trigger(execution, signalName, signalData);
} | [
"public",
"void",
"trigger",
"(",
"DelegateExecution",
"execution",
",",
"String",
"signalName",
",",
"Object",
"signalData",
")",
"{",
"innerActivityBehavior",
".",
"trigger",
"(",
"execution",
",",
"signalName",
",",
"signalData",
")",
";",
"}"
] | Intercepts signals, and delegates it to the wrapped {@link ActivityBehavior}. | [
"Intercepts",
"signals",
"and",
"delegates",
"it",
"to",
"the",
"wrapped",
"{"
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/MultiInstanceActivityBehavior.java#L156-L158 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/AttributeFormFieldRegistry.java | AttributeFormFieldRegistry.createFormItem | public static FormItem createFormItem(AbstractReadOnlyAttributeInfo info, VectorLayer layer) {
"""
Create a new {@link FormItem} instance for the given attribute info (top level attribute).<br/>
If the attribute info object has the <code>formInputType</code> set, than that will be used to search for the
correct ... | java | public static FormItem createFormItem(AbstractReadOnlyAttributeInfo info, VectorLayer layer) {
return createFormItem(info, new DefaultAttributeProvider(layer, info.getName()));
} | [
"public",
"static",
"FormItem",
"createFormItem",
"(",
"AbstractReadOnlyAttributeInfo",
"info",
",",
"VectorLayer",
"layer",
")",
"{",
"return",
"createFormItem",
"(",
"info",
",",
"new",
"DefaultAttributeProvider",
"(",
"layer",
",",
"info",
".",
"getName",
"(",
... | Create a new {@link FormItem} instance for the given attribute info (top level attribute).<br/>
If the attribute info object has the <code>formInputType</code> set, than that will be used to search for the
correct field type, otherwise the attribute TYPE name is used (i.e. PrimitiveType.INTEGER.name()).
@param info Th... | [
"Create",
"a",
"new",
"{",
"@link",
"FormItem",
"}",
"instance",
"for",
"the",
"given",
"attribute",
"info",
"(",
"top",
"level",
"attribute",
")",
".",
"<br",
"/",
">",
"If",
"the",
"attribute",
"info",
"object",
"has",
"the",
"<code",
">",
"formInputTy... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/AttributeFormFieldRegistry.java#L403-L405 |
unbescape/unbescape | src/main/java/org/unbescape/css/CssEscape.java | CssEscape.unescapeCss | public static void unescapeCss(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform a CSS <strong>unescape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
No additional configuration arguments are required. Unes... | java | public static void unescapeCss(final char[] text, final int offset, final int len, final Writer writer)
throws IOException{
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
final int textLen = (text =... | [
"public",
"static",
"void",
"unescapeCss",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"... | <p>
Perform a CSS <strong>unescape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
No additional configuration arguments are required. Unescape operations
will always perform <em>complete</em> CSS unescape of backslash and hexadecimal escape
sequences.
</p>
<p>
This method is <strong>thread-safe</strong>.
</p>
... | [
"<p",
">",
"Perform",
"a",
"CSS",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"No",
"additional",
"configuration",
"arguments",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/css/CssEscape.java#L1840-L1861 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceApiWrapper.java | ServiceApiWrapper.doQueryEvents | Observable<ComapiResult<EventsQueryResponse>> doQueryEvents(@NonNull final String token, @NonNull final String conversationId, @NonNull final Long from, @NonNull final Integer limit) {
"""
Query events. Use {@link #doQueryConversationEvents(String, String, Long, Integer)} for better visibility of possible events.... | java | Observable<ComapiResult<EventsQueryResponse>> doQueryEvents(@NonNull final String token, @NonNull final String conversationId, @NonNull final Long from, @NonNull final Integer limit) {
return addLogging(service.queryEvents(AuthManager.addAuthPrefix(token), apiSpaceId, conversationId, from, limit).map(mapToComap... | [
"Observable",
"<",
"ComapiResult",
"<",
"EventsQueryResponse",
">",
">",
"doQueryEvents",
"(",
"@",
"NonNull",
"final",
"String",
"token",
",",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"@",
"NonNull",
"final",
"Long",
"from",
",",
"@",
"NonNul... | Query events. Use {@link #doQueryConversationEvents(String, String, Long, Integer)} for better visibility of possible events.
@param token Comapi access token.
@param conversationId ID of a conversation to query events in it.
@param from ID of the event to start from.
@param limit Limit of... | [
"Query",
"events",
".",
"Use",
"{",
"@link",
"#doQueryConversationEvents",
"(",
"String",
"String",
"Long",
"Integer",
")",
"}",
"for",
"better",
"visibility",
"of",
"possible",
"events",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceApiWrapper.java#L273-L279 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/Noun.java | Noun.addSingular | public static void addSingular(String match, String rule, boolean insensitive) {
"""
<p>Add a match pattern and replacement rule for converting addSingular
forms to addPlural forms.</p>
@param match Match pattern regular expression
@param rule Replacement rule
@param insensitive Flag indicating this match sh... | java | public static void addSingular(String match, String rule, boolean insensitive){
singulars.add(0, new Replacer(match, rule, insensitive));
} | [
"public",
"static",
"void",
"addSingular",
"(",
"String",
"match",
",",
"String",
"rule",
",",
"boolean",
"insensitive",
")",
"{",
"singulars",
".",
"add",
"(",
"0",
",",
"new",
"Replacer",
"(",
"match",
",",
"rule",
",",
"insensitive",
")",
")",
";",
... | <p>Add a match pattern and replacement rule for converting addSingular
forms to addPlural forms.</p>
@param match Match pattern regular expression
@param rule Replacement rule
@param insensitive Flag indicating this match should be case insensitive | [
"<p",
">",
"Add",
"a",
"match",
"pattern",
"and",
"replacement",
"rule",
"for",
"converting",
"addSingular",
"forms",
"to",
"addPlural",
"forms",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/Noun.java#L106-L108 |
dnsjava/dnsjava | org/xbill/DNS/TSIG.java | TSIG.verify | public int
verify(Message m, byte [] b, TSIGRecord old) {
"""
Verifies a TSIG record on an incoming message. Since this is only called
in the context where a TSIG is expected to be present, it is an error
if one is not present. After calling this routine, Message.isVerified() may
be called on this message.
@... | java | public int
verify(Message m, byte [] b, TSIGRecord old) {
return verify(m, b, b.length, old);
} | [
"public",
"int",
"verify",
"(",
"Message",
"m",
",",
"byte",
"[",
"]",
"b",
",",
"TSIGRecord",
"old",
")",
"{",
"return",
"verify",
"(",
"m",
",",
"b",
",",
"b",
".",
"length",
",",
"old",
")",
";",
"}"
] | Verifies a TSIG record on an incoming message. Since this is only called
in the context where a TSIG is expected to be present, it is an error
if one is not present. After calling this routine, Message.isVerified() may
be called on this message.
@param m The message
@param b The message in unparsed form. This is nec... | [
"Verifies",
"a",
"TSIG",
"record",
"on",
"an",
"incoming",
"message",
".",
"Since",
"this",
"is",
"only",
"called",
"in",
"the",
"context",
"where",
"a",
"TSIG",
"is",
"expected",
"to",
"be",
"present",
"it",
"is",
"an",
"error",
"if",
"one",
"is",
"no... | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/TSIG.java#L526-L529 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/userdata/UserDataHelpers.java | UserDataHelpers.readUserData | public static Properties readUserData( String rawProperties, File outputDirectory ) throws IOException {
"""
Reads user data from a string and processes with with #{@link UserDataHelpers#processUserData(Properties, File)}.
@param rawProperties the user data as a string
@param outputDirectory a directory into whi... | java | public static Properties readUserData( String rawProperties, File outputDirectory ) throws IOException {
Properties result = new Properties();
StringReader reader = new StringReader( rawProperties );
result.load( reader );
return processUserData( result, outputDirectory );
} | [
"public",
"static",
"Properties",
"readUserData",
"(",
"String",
"rawProperties",
",",
"File",
"outputDirectory",
")",
"throws",
"IOException",
"{",
"Properties",
"result",
"=",
"new",
"Properties",
"(",
")",
";",
"StringReader",
"reader",
"=",
"new",
"StringReade... | Reads user data from a string and processes with with #{@link UserDataHelpers#processUserData(Properties, File)}.
@param rawProperties the user data as a string
@param outputDirectory a directory into which files should be written
<p>
If null, files sent with {@link #ENCODE_FILE_CONTENT_PREFIX} will not be written.
</p... | [
"Reads",
"user",
"data",
"from",
"a",
"string",
"and",
"processes",
"with",
"with",
"#",
"{",
"@link",
"UserDataHelpers#processUserData",
"(",
"Properties",
"File",
")",
"}",
".",
"@param",
"rawProperties",
"the",
"user",
"data",
"as",
"a",
"string",
"@param",... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/userdata/UserDataHelpers.java#L166-L173 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/products/BermudanSwaption.java | BermudanSwaption.getConditionalExpectationEstimator | public ConditionalExpectationEstimatorInterface getConditionalExpectationEstimator(double fixingDate, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
"""
Return the conditional expectation estimator suitable for this product.
@param fixingDate The condition time.
@param model The m... | java | public ConditionalExpectationEstimatorInterface getConditionalExpectationEstimator(double fixingDate, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
MonteCarloConditionalExpectationRegression condExpEstimator = new MonteCarloConditionalExpectationRegression(
getRegressionBasisFunctio... | [
"public",
"ConditionalExpectationEstimatorInterface",
"getConditionalExpectationEstimator",
"(",
"double",
"fixingDate",
",",
"LIBORModelMonteCarloSimulationInterface",
"model",
")",
"throws",
"CalculationException",
"{",
"MonteCarloConditionalExpectationRegression",
"condExpEstimator",
... | Return the conditional expectation estimator suitable for this product.
@param fixingDate The condition time.
@param model The model
@return The conditional expectation estimator suitable for this product
@throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available ... | [
"Return",
"the",
"conditional",
"expectation",
"estimator",
"suitable",
"for",
"this",
"product",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/BermudanSwaption.java#L160-L165 |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonReceiver.java | PythonReceiver.collectBuffer | @SuppressWarnings( {
"""
Reads a buffer of the given size from the memory-mapped file, and collects all records contained. This method
assumes that all values in the buffer are of the same type. This method does NOT take care of synchronization.
The user must guarantee that the buffer was completely written befo... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public void collectBuffer(Collector<OUT> c, int bufferSize) throws IOException {
fileBuffer.position(0);
while (fileBuffer.position() < bufferSize) {
c.collect(deserializer.deserialize());
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"void",
"collectBuffer",
"(",
"Collector",
"<",
"OUT",
">",
"c",
",",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"fileBuffer",
".",
"position",
"(",
"0"... | Reads a buffer of the given size from the memory-mapped file, and collects all records contained. This method
assumes that all values in the buffer are of the same type. This method does NOT take care of synchronization.
The user must guarantee that the buffer was completely written before calling this method.
@param ... | [
"Reads",
"a",
"buffer",
"of",
"the",
"given",
"size",
"from",
"the",
"memory",
"-",
"mapped",
"file",
"and",
"collects",
"all",
"records",
"contained",
".",
"This",
"method",
"assumes",
"that",
"all",
"values",
"in",
"the",
"buffer",
"are",
"of",
"the",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonReceiver.java#L91-L98 |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/TcpServer.java | TcpServer.bindUntilJavaShutdown | public final void bindUntilJavaShutdown(Duration timeout, @Nullable Consumer<DisposableServer> onStart) {
"""
Start the server in a fully blocking fashion, not only waiting for it to initialize
but also blocking during the full lifecycle of the server. Since most
servers will be long-lived, this is more adapted ... | java | public final void bindUntilJavaShutdown(Duration timeout, @Nullable Consumer<DisposableServer> onStart) {
Objects.requireNonNull(timeout, "timeout");
DisposableServer facade = bindNow();
Objects.requireNonNull(facade, "facade");
if (onStart != null) {
onStart.accept(facade);
}
Runtime.getRuntime()
... | [
"public",
"final",
"void",
"bindUntilJavaShutdown",
"(",
"Duration",
"timeout",
",",
"@",
"Nullable",
"Consumer",
"<",
"DisposableServer",
">",
"onStart",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"timeout",
",",
"\"timeout\"",
")",
";",
"DisposableServer",... | Start the server in a fully blocking fashion, not only waiting for it to initialize
but also blocking during the full lifecycle of the server. Since most
servers will be long-lived, this is more adapted to running a server out of a main
method, only allowing shutdown of the servers through {@code sigkill}.
<p>
Note: {@... | [
"Start",
"the",
"server",
"in",
"a",
"fully",
"blocking",
"fashion",
"not",
"only",
"waiting",
"for",
"it",
"to",
"initialize",
"but",
"also",
"blocking",
"during",
"the",
"full",
"lifecycle",
"of",
"the",
"server",
".",
"Since",
"most",
"servers",
"will",
... | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpServer.java#L211-L227 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/Response.java | Response.send | public void send(String format, Object... args) {
"""
Replaces '{}' in the format string with the supplied arguments and
writes the string content directly to the response.
<p>This method commits the response.</p>
@param format
@param args
"""
checkCommitted();
commit(StringUtils.format(... | java | public void send(String format, Object... args) {
checkCommitted();
commit(StringUtils.format(format, args));
} | [
"public",
"void",
"send",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"checkCommitted",
"(",
")",
";",
"commit",
"(",
"StringUtils",
".",
"format",
"(",
"format",
",",
"args",
")",
")",
";",
"}"
] | Replaces '{}' in the format string with the supplied arguments and
writes the string content directly to the response.
<p>This method commits the response.</p>
@param format
@param args | [
"Replaces",
"{}",
"in",
"the",
"format",
"string",
"with",
"the",
"supplied",
"arguments",
"and",
"writes",
"the",
"string",
"content",
"directly",
"to",
"the",
"response",
".",
"<p",
">",
"This",
"method",
"commits",
"the",
"response",
".",
"<",
"/",
"p",... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/Response.java#L848-L852 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/registry/AtomicMapFieldUpdater.java | AtomicMapFieldUpdater.putAtomic | public boolean putAtomic(C instance, K key, V value, Map<K, V> snapshot) {
"""
Put a value if and only if the map has not changed since the given snapshot was taken. If the put fails,
it is the caller's responsibility to retry.
@param instance the instance with the map field
@param key the key
@param value t... | java | public boolean putAtomic(C instance, K key, V value, Map<K, V> snapshot) {
Assert.checkNotNullParam("key", key);
final Map<K, V> newMap;
final int oldSize = snapshot.size();
if (oldSize == 0) {
newMap = Collections.singletonMap(key, value);
} else if (oldSize == 1) {
... | [
"public",
"boolean",
"putAtomic",
"(",
"C",
"instance",
",",
"K",
"key",
",",
"V",
"value",
",",
"Map",
"<",
"K",
",",
"V",
">",
"snapshot",
")",
"{",
"Assert",
".",
"checkNotNullParam",
"(",
"\"key\"",
",",
"key",
")",
";",
"final",
"Map",
"<",
"K... | Put a value if and only if the map has not changed since the given snapshot was taken. If the put fails,
it is the caller's responsibility to retry.
@param instance the instance with the map field
@param key the key
@param value the value
@param snapshot the map snapshot
@return {@code false} if the snapshot is out of... | [
"Put",
"a",
"value",
"if",
"and",
"only",
"if",
"the",
"map",
"has",
"not",
"changed",
"since",
"the",
"given",
"snapshot",
"was",
"taken",
".",
"If",
"the",
"put",
"fails",
"it",
"is",
"the",
"caller",
"s",
"responsibility",
"to",
"retry",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/AtomicMapFieldUpdater.java#L97-L117 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/TimeUnitUtility.java | TimeUnitUtility.getInstance | @SuppressWarnings("unchecked") public static TimeUnit getInstance(String units, Locale locale) throws MPXJException {
"""
This method is used to parse a string representation of a time
unit, and return the appropriate constant value.
@param units string representation of a time unit
@param locale target local... | java | @SuppressWarnings("unchecked") public static TimeUnit getInstance(String units, Locale locale) throws MPXJException
{
Map<String, Integer> map = LocaleData.getMap(locale, LocaleData.TIME_UNITS_MAP);
Integer result = map.get(units.toLowerCase());
if (result == null)
{
throw new MPXJEx... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"TimeUnit",
"getInstance",
"(",
"String",
"units",
",",
"Locale",
"locale",
")",
"throws",
"MPXJException",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"map",
"=",
"LocaleData",
".",
... | This method is used to parse a string representation of a time
unit, and return the appropriate constant value.
@param units string representation of a time unit
@param locale target locale
@return numeric constant
@throws MPXJException normally thrown when parsing fails | [
"This",
"method",
"is",
"used",
"to",
"parse",
"a",
"string",
"representation",
"of",
"a",
"time",
"unit",
"and",
"return",
"the",
"appropriate",
"constant",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/TimeUnitUtility.java#L55-L64 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/InputsInner.java | InputsInner.createOrReplaceAsync | public Observable<InputInner> createOrReplaceAsync(String resourceGroupName, String jobName, String inputName, InputInner input, String ifMatch, String ifNoneMatch) {
"""
Creates an input or replaces an already existing input under an existing streaming job.
@param resourceGroupName The name of the resource gro... | java | public Observable<InputInner> createOrReplaceAsync(String resourceGroupName, String jobName, String inputName, InputInner input, String ifMatch, String ifNoneMatch) {
return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, inputName, input, ifMatch, ifNoneMatch).map(new Func1<ServiceResponseW... | [
"public",
"Observable",
"<",
"InputInner",
">",
"createOrReplaceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"inputName",
",",
"InputInner",
"input",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
"return"... | Creates an input or replaces an already existing input under an existing streaming job.
@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 jobName The name of the streaming job.
@param inputName The nam... | [
"Creates",
"an",
"input",
"or",
"replaces",
"an",
"already",
"existing",
"input",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/InputsInner.java#L247-L254 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java | PoissonDistribution.rawProbability | public static double rawProbability(double x, double lambda) {
"""
Poisson distribution probability, but also for non-integer arguments.
<p>
lb^x exp(-lb) / x!
@param x X
@param lambda lambda
@return Poisson distribution probability
"""
// Extreme lambda
if(lambda == 0) {
return ((x == 0) ... | java | public static double rawProbability(double x, double lambda) {
// Extreme lambda
if(lambda == 0) {
return ((x == 0) ? 1. : 0.);
}
// Extreme values
if(Double.isInfinite(lambda) || x < 0) {
return 0.;
}
if(x <= lambda * Double.MIN_NORMAL) {
return FastMath.exp(-lambda);
... | [
"public",
"static",
"double",
"rawProbability",
"(",
"double",
"x",
",",
"double",
"lambda",
")",
"{",
"// Extreme lambda",
"if",
"(",
"lambda",
"==",
"0",
")",
"{",
"return",
"(",
"(",
"x",
"==",
"0",
")",
"?",
"1.",
":",
"0.",
")",
";",
"}",
"// ... | Poisson distribution probability, but also for non-integer arguments.
<p>
lb^x exp(-lb) / x!
@param x X
@param lambda lambda
@return Poisson distribution probability | [
"Poisson",
"distribution",
"probability",
"but",
"also",
"for",
"non",
"-",
"integer",
"arguments",
".",
"<p",
">",
"lb^x",
"exp",
"(",
"-",
"lb",
")",
"/",
"x!"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java#L434-L453 |
aws/aws-sdk-java | aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/model/DescribeSigningJobResult.java | DescribeSigningJobResult.withSigningParameters | public DescribeSigningJobResult withSigningParameters(java.util.Map<String, String> signingParameters) {
"""
<p>
Map of user-assigned key-value pairs used during signing. These values contain any information that you specified
for use in your signing job.
</p>
@param signingParameters
Map of user-assigned k... | java | public DescribeSigningJobResult withSigningParameters(java.util.Map<String, String> signingParameters) {
setSigningParameters(signingParameters);
return this;
} | [
"public",
"DescribeSigningJobResult",
"withSigningParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"signingParameters",
")",
"{",
"setSigningParameters",
"(",
"signingParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Map of user-assigned key-value pairs used during signing. These values contain any information that you specified
for use in your signing job.
</p>
@param signingParameters
Map of user-assigned key-value pairs used during signing. These values contain any information that you
specified for use in your signing job.... | [
"<p",
">",
"Map",
"of",
"user",
"-",
"assigned",
"key",
"-",
"value",
"pairs",
"used",
"during",
"signing",
".",
"These",
"values",
"contain",
"any",
"information",
"that",
"you",
"specified",
"for",
"use",
"in",
"your",
"signing",
"job",
".",
"<",
"/",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/model/DescribeSigningJobResult.java#L387-L390 |
r0adkll/Slidr | library/src/main/java/com/r0adkll/slidr/util/ViewDragHelper.java | ViewDragHelper.smoothSlideViewTo | public boolean smoothSlideViewTo(View child, int finalLeft, int finalTop) {
"""
Animate the view <code>child</code> to the given (left, top) position.
If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
on each subsequent frame to continue the motion until it returns false. I... | java | public boolean smoothSlideViewTo(View child, int finalLeft, int finalTop) {
mCapturedView = child;
mActivePointerId = INVALID_POINTER;
boolean continueSliding = forceSettleCapturedViewAt(finalLeft, finalTop, 0, 0);
if (!continueSliding && mDragState == STATE_IDLE && mCapturedView != null... | [
"public",
"boolean",
"smoothSlideViewTo",
"(",
"View",
"child",
",",
"int",
"finalLeft",
",",
"int",
"finalTop",
")",
"{",
"mCapturedView",
"=",
"child",
";",
"mActivePointerId",
"=",
"INVALID_POINTER",
";",
"boolean",
"continueSliding",
"=",
"forceSettleCapturedVie... | Animate the view <code>child</code> to the given (left, top) position.
If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
on each subsequent frame to continue the motion until it returns false. If this method
returns false there is no further work to do to complete the movement.
<p... | [
"Animate",
"the",
"view",
"<code",
">",
"child<",
"/",
"code",
">",
"to",
"the",
"given",
"(",
"left",
"top",
")",
"position",
".",
"If",
"this",
"method",
"returns",
"true",
"the",
"caller",
"should",
"invoke",
"{",
"@link",
"#continueSettling",
"(",
"b... | train | https://github.com/r0adkll/Slidr/blob/737db115eb68435764648fbd905b1dea4b52f039/library/src/main/java/com/r0adkll/slidr/util/ViewDragHelper.java#L501-L511 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java | AbstractIndexWriter.addMemberDesc | protected void addMemberDesc(Element member, Content contentTree) {
"""
Add description about the Static Variable/Method/Constructor for a
member.
@param member MemberDoc for the member within the Class Kind
@param contentTree the content tree to which the member description will be added
"""
Type... | java | protected void addMemberDesc(Element member, Content contentTree) {
TypeElement containing = utils.getEnclosingTypeElement(member);
String classdesc = utils.getTypeElementName(containing, true) + " ";
if (utils.isField(member)) {
Content resource = contents.getContent(utils.isStatic(... | [
"protected",
"void",
"addMemberDesc",
"(",
"Element",
"member",
",",
"Content",
"contentTree",
")",
"{",
"TypeElement",
"containing",
"=",
"utils",
".",
"getEnclosingTypeElement",
"(",
"member",
")",
";",
"String",
"classdesc",
"=",
"utils",
".",
"getTypeElementNa... | Add description about the Static Variable/Method/Constructor for a
member.
@param member MemberDoc for the member within the Class Kind
@param contentTree the content tree to which the member description will be added | [
"Add",
"description",
"about",
"the",
"Static",
"Variable",
"/",
"Method",
"/",
"Constructor",
"for",
"a",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java#L395-L414 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isSubtype | public static boolean isSubtype(ReferenceType t, ReferenceType possibleSupertype) throws ClassNotFoundException {
"""
Determine if one reference type is a subtype of another.
@param t
a reference type
@param possibleSupertype
the possible supertype
@return true if t is a subtype of possibleSupertype, false ... | java | public static boolean isSubtype(ReferenceType t, ReferenceType possibleSupertype) throws ClassNotFoundException {
return Global.getAnalysisCache().getDatabase(Subtypes2.class).isSubtype(t, possibleSupertype);
} | [
"public",
"static",
"boolean",
"isSubtype",
"(",
"ReferenceType",
"t",
",",
"ReferenceType",
"possibleSupertype",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"Global",
".",
"getAnalysisCache",
"(",
")",
".",
"getDatabase",
"(",
"Subtypes2",
".",
"class",... | Determine if one reference type is a subtype of another.
@param t
a reference type
@param possibleSupertype
the possible supertype
@return true if t is a subtype of possibleSupertype, false if not | [
"Determine",
"if",
"one",
"reference",
"type",
"is",
"a",
"subtype",
"of",
"another",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L109-L111 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java | LogMetadata.removeEmptyLedgers | LogMetadata removeEmptyLedgers(int skipCountFromEnd) {
"""
Removes LedgerMetadata instances for those Ledgers that are known to be empty.
@param skipCountFromEnd The number of Ledgers to spare, counting from the end of the LedgerMetadata list.
@return A new instance of LogMetadata with the updated ledger list.... | java | LogMetadata removeEmptyLedgers(int skipCountFromEnd) {
val newLedgers = new ArrayList<LedgerMetadata>();
int cutoffIndex = this.ledgers.size() - skipCountFromEnd;
for (int i = 0; i < cutoffIndex; i++) {
LedgerMetadata lm = this.ledgers.get(i);
if (lm.getStatus() != Ledger... | [
"LogMetadata",
"removeEmptyLedgers",
"(",
"int",
"skipCountFromEnd",
")",
"{",
"val",
"newLedgers",
"=",
"new",
"ArrayList",
"<",
"LedgerMetadata",
">",
"(",
")",
";",
"int",
"cutoffIndex",
"=",
"this",
".",
"ledgers",
".",
"size",
"(",
")",
"-",
"skipCountF... | Removes LedgerMetadata instances for those Ledgers that are known to be empty.
@param skipCountFromEnd The number of Ledgers to spare, counting from the end of the LedgerMetadata list.
@return A new instance of LogMetadata with the updated ledger list. | [
"Removes",
"LedgerMetadata",
"instances",
"for",
"those",
"Ledgers",
"that",
"are",
"known",
"to",
"be",
"empty",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L165-L182 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBScanExpression.java | DynamoDBScanExpression.addFilterCondition | public void addFilterCondition(String attributeName, Condition condition) {
"""
Adds a new filter condition to the current scan filter.
@param attributeName
The name of the attribute on which the specified condition
operates.
@param condition
The condition which describes how the specified attribute is
com... | java | public void addFilterCondition(String attributeName, Condition condition) {
if ( scanFilter == null )
scanFilter = new HashMap<String, Condition>();
scanFilter.put(attributeName, condition);
} | [
"public",
"void",
"addFilterCondition",
"(",
"String",
"attributeName",
",",
"Condition",
"condition",
")",
"{",
"if",
"(",
"scanFilter",
"==",
"null",
")",
"scanFilter",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Condition",
">",
"(",
")",
";",
"scanFilter... | Adds a new filter condition to the current scan filter.
@param attributeName
The name of the attribute on which the specified condition
operates.
@param condition
The condition which describes how the specified attribute is
compared and if a row of data is included in the results
returned by the scan operation. | [
"Adds",
"a",
"new",
"filter",
"condition",
"to",
"the",
"current",
"scan",
"filter",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBScanExpression.java#L253-L258 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/KeyAreaInfo.java | KeyAreaInfo.setupKeyBuffer | public void setupKeyBuffer(BaseBuffer destBuffer, int iAreaDesc) {
"""
Set up the key area indicated.
<br />Note: The thin implementation is completely different from the thick implementation
here, the areadesc is ignored and the thin data data area is set up instead.
@param destBuffer (Always ignored for the t... | java | public void setupKeyBuffer(BaseBuffer destBuffer, int iAreaDesc)
{
int iKeyFields = this.getKeyFields();
m_rgobjTempData = new Object[iKeyFields];
for (int iKeyFieldSeq = Constants.MAIN_KEY_FIELD; iKeyFieldSeq < iKeyFields + Constants.MAIN_KEY_FIELD; iKeyFieldSeq++)
{
m_r... | [
"public",
"void",
"setupKeyBuffer",
"(",
"BaseBuffer",
"destBuffer",
",",
"int",
"iAreaDesc",
")",
"{",
"int",
"iKeyFields",
"=",
"this",
".",
"getKeyFields",
"(",
")",
";",
"m_rgobjTempData",
"=",
"new",
"Object",
"[",
"iKeyFields",
"]",
";",
"for",
"(",
... | Set up the key area indicated.
<br />Note: The thin implementation is completely different from the thick implementation
here, the areadesc is ignored and the thin data data area is set up instead.
@param destBuffer (Always ignored for the thin implementation).
@param iAreaDesc (Always ignored for the thin implementati... | [
"Set",
"up",
"the",
"key",
"area",
"indicated",
".",
"<br",
"/",
">",
"Note",
":",
"The",
"thin",
"implementation",
"is",
"completely",
"different",
"from",
"the",
"thick",
"implementation",
"here",
"the",
"areadesc",
"is",
"ignored",
"and",
"the",
"thin",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/KeyAreaInfo.java#L236-L244 |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/storage/ReportsProvider.java | ReportsProvider.loadReport | protected boolean loadReport(ReportsConfig result, InputStream report, String reportName) {
"""
Loads a report, this does the deserialization, this method can be substituted with another, called by child
classes. Once it has deserialized it, it put it into the map.
@param result
@param report
@param reportName... | java | protected boolean loadReport(ReportsConfig result, InputStream report, String reportName) {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
ReportConfig reportConfig = null;
try {
reportConfig = mapper.readValue(report, ReportConfig.class);
} catch (IOException e) ... | [
"protected",
"boolean",
"loadReport",
"(",
"ReportsConfig",
"result",
",",
"InputStream",
"report",
",",
"String",
"reportName",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
"new",
"YAMLFactory",
"(",
")",
")",
";",
"ReportConfig",
"repor... | Loads a report, this does the deserialization, this method can be substituted with another, called by child
classes. Once it has deserialized it, it put it into the map.
@param result
@param report
@param reportName
@return | [
"Loads",
"a",
"report",
"this",
"does",
"the",
"deserialization",
"this",
"method",
"can",
"be",
"substituted",
"with",
"another",
"called",
"by",
"child",
"classes",
".",
"Once",
"it",
"has",
"deserialized",
"it",
"it",
"put",
"it",
"into",
"the",
"map",
... | train | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/storage/ReportsProvider.java#L64-L77 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.