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 |
|---|---|---|---|---|---|---|---|---|---|---|
michael-rapp/AndroidUtil | example/src/main/java/de/mrapp/android/util/example/MainActivity.java | MainActivity.adaptElevation | private void adaptElevation(final int elevation, final boolean parallelLight) {
"""
Adapts the elevation.
@param elevation
The elevation, which should be set, in dp as an {@link Integer} value
@param parallelLight
True, if parallel light should be emulated, false otherwise
"""
elevationTextView.s... | java | private void adaptElevation(final int elevation, final boolean parallelLight) {
elevationTextView.setText(String.format(getString(R.string.elevation), elevation));
elevationLeft.setShadowElevation(elevation);
elevationLeft.emulateParallelLight(parallelLight);
elevationTopLeft.setShadowEl... | [
"private",
"void",
"adaptElevation",
"(",
"final",
"int",
"elevation",
",",
"final",
"boolean",
"parallelLight",
")",
"{",
"elevationTextView",
".",
"setText",
"(",
"String",
".",
"format",
"(",
"getString",
"(",
"R",
".",
"string",
".",
"elevation",
")",
",... | Adapts the elevation.
@param elevation
The elevation, which should be set, in dp as an {@link Integer} value
@param parallelLight
True, if parallel light should be emulated, false otherwise | [
"Adapts",
"the",
"elevation",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/example/src/main/java/de/mrapp/android/util/example/MainActivity.java#L163-L181 |
google/closure-compiler | src/com/google/javascript/jscomp/CollapseProperties.java | CollapseProperties.addStubsForUndeclaredProperties | private void addStubsForUndeclaredProperties(Name n, String alias, Node parent, Node addAfter) {
"""
Adds global variable "stubs" for any properties of a global name that are only set in a local
scope or read but never set.
@param n An object representing a global name (e.g. "a", "a.b.c")
@param alias The fla... | java | private void addStubsForUndeclaredProperties(Name n, String alias, Node parent, Node addAfter) {
checkState(n.canCollapseUnannotatedChildNames(), n);
checkArgument(NodeUtil.isStatementBlock(parent), parent);
checkNotNull(addAfter);
if (n.props == null) {
return;
}
for (Name p : n.props) {
... | [
"private",
"void",
"addStubsForUndeclaredProperties",
"(",
"Name",
"n",
",",
"String",
"alias",
",",
"Node",
"parent",
",",
"Node",
"addAfter",
")",
"{",
"checkState",
"(",
"n",
".",
"canCollapseUnannotatedChildNames",
"(",
")",
",",
"n",
")",
";",
"checkArgum... | Adds global variable "stubs" for any properties of a global name that are only set in a local
scope or read but never set.
@param n An object representing a global name (e.g. "a", "a.b.c")
@param alias The flattened name of the object whose properties we are adding stubs for (e.g.
"a$b$c")
@param parent The node to wh... | [
"Adds",
"global",
"variable",
"stubs",
"for",
"any",
"properties",
"of",
"a",
"global",
"name",
"that",
"are",
"only",
"set",
"in",
"a",
"local",
"scope",
"or",
"read",
"but",
"never",
"set",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CollapseProperties.java#L890-L913 |
actframework/actframework | src/main/java/act/data/ApacheMultipartParser.java | ApacheMultipartParser.getFieldName | private String getFieldName(Map /* String, String */ headers) {
"""
Retrieves the field name from the <code>Content-disposition</code>
header.
@param headers A <code>Map</code> containing the HTTP request headers.
@return The field name for the current <code>encapsulation</code>.
"""
String fieldN... | java | private String getFieldName(Map /* String, String */ headers) {
String fieldName = null;
String cd = getHeader(headers, CONTENT_DISPOSITION);
if (cd != null && cd.toLowerCase().startsWith(FORM_DATA)) {
ParameterParser parser = new ParameterParser();
parser.setLowerCaseNa... | [
"private",
"String",
"getFieldName",
"(",
"Map",
"/* String, String */",
"headers",
")",
"{",
"String",
"fieldName",
"=",
"null",
";",
"String",
"cd",
"=",
"getHeader",
"(",
"headers",
",",
"CONTENT_DISPOSITION",
")",
";",
"if",
"(",
"cd",
"!=",
"null",
"&&"... | Retrieves the field name from the <code>Content-disposition</code>
header.
@param headers A <code>Map</code> containing the HTTP request headers.
@return The field name for the current <code>encapsulation</code>. | [
"Retrieves",
"the",
"field",
"name",
"from",
"the",
"<code",
">",
"Content",
"-",
"disposition<",
"/",
"code",
">",
"header",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/data/ApacheMultipartParser.java#L207-L222 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java | ScriptContext.chooseRandom | @Cmd
public String chooseRandom(final String propertyKey, final List<String> randomValues) {
"""
Randomly selects an item from a list of Strings. List items may contain placeholder tokens.
The result is stored in the configuration under the specified key and also returned by this
method.
@param propertyKey
... | java | @Cmd
public String chooseRandom(final String propertyKey, final List<String> randomValues) {
Randomizable<String> choice = new RandomCollection<>(random, randomValues);
String currentValue = choice.get();
if (log.isDebugEnabled()) {
log.debug("Chosen value: " + currentValue);
}
currentValue = resolvePrope... | [
"@",
"Cmd",
"public",
"String",
"chooseRandom",
"(",
"final",
"String",
"propertyKey",
",",
"final",
"List",
"<",
"String",
">",
"randomValues",
")",
"{",
"Randomizable",
"<",
"String",
">",
"choice",
"=",
"new",
"RandomCollection",
"<>",
"(",
"random",
",",... | Randomly selects an item from a list of Strings. List items may contain placeholder tokens.
The result is stored in the configuration under the specified key and also returned by this
method.
@param propertyKey
the property key under which to store the result
@param randomValues
the list of strings
@return a randomly ... | [
"Randomly",
"selects",
"an",
"item",
"from",
"a",
"list",
"of",
"Strings",
".",
"List",
"items",
"may",
"contain",
"placeholder",
"tokens",
".",
"The",
"result",
"is",
"stored",
"in",
"the",
"configuration",
"under",
"the",
"specified",
"key",
"and",
"also",... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java#L227-L240 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUserSegmentRelPersistenceImpl.java | CommerceDiscountUserSegmentRelPersistenceImpl.findAll | @Override
public List<CommerceDiscountUserSegmentRel> findAll() {
"""
Returns all the commerce discount user segment rels.
@return the commerce discount user segment rels
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceDiscountUserSegmentRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountUserSegmentRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce discount user segment rels.
@return the commerce discount user segment rels | [
"Returns",
"all",
"the",
"commerce",
"discount",
"user",
"segment",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUserSegmentRelPersistenceImpl.java#L1729-L1732 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.setFooter | public EmbedBuilder setFooter(String text, File icon) {
"""
Sets the footer of the embed.
@param text The text of the footer.
@param icon The footer's icon.
@return The current instance in order to chain call methods.
"""
delegate.setFooter(text, icon);
return this;
} | java | public EmbedBuilder setFooter(String text, File icon) {
delegate.setFooter(text, icon);
return this;
} | [
"public",
"EmbedBuilder",
"setFooter",
"(",
"String",
"text",
",",
"File",
"icon",
")",
"{",
"delegate",
".",
"setFooter",
"(",
"text",
",",
"icon",
")",
";",
"return",
"this",
";",
"}"
] | Sets the footer of the embed.
@param text The text of the footer.
@param icon The footer's icon.
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"footer",
"of",
"the",
"embed",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L143-L146 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java | GroupService.getEntity | private static IEntity getEntity(String key, Class<?> type, String service)
throws GroupsException {
"""
Returns an <code>IEntity</code> representing a portal entity. This does not guarantee that
the entity actually exists.
@param key String - the group key.
@param type Class - the Class of the un... | java | private static IEntity getEntity(String key, Class<?> type, String service)
throws GroupsException {
return instance().igetEntity(key, type, service);
} | [
"private",
"static",
"IEntity",
"getEntity",
"(",
"String",
"key",
",",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"service",
")",
"throws",
"GroupsException",
"{",
"return",
"instance",
"(",
")",
".",
"igetEntity",
"(",
"key",
",",
"type",
",",
"ser... | Returns an <code>IEntity</code> representing a portal entity. This does not guarantee that
the entity actually exists.
@param key String - the group key.
@param type Class - the Class of the underlying IGroupMember.
@param service String - the name of the component service.
@return org.apereo.portal.groups.IEntity | [
"Returns",
"an",
"<code",
">",
"IEntity<",
"/",
"code",
">",
"representing",
"a",
"portal",
"entity",
".",
"This",
"does",
"not",
"guarantee",
"that",
"the",
"entity",
"actually",
"exists",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java#L161-L164 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/datebox/CmsDateConverter.java | CmsDateConverter.getDateWithTime | @SuppressWarnings("deprecation")
public static Date getDateWithTime(Date date, String time) {
"""
Merges a given Date object with a given time String.<p>
Returns a <code>null</code> if the given time format coudn't be parsed.<p>
The expected time String should include the am pm information if the time fo... | java | @SuppressWarnings("deprecation")
public static Date getDateWithTime(Date date, String time) {
Date result;
try {
Date timeAsDate = Z_TIME_FORMAT.parse(time);
result = new Date(date.getYear(), date.getMonth(), date.getDate());
result.setHours(timeAsDate.getHours()... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"Date",
"getDateWithTime",
"(",
"Date",
"date",
",",
"String",
"time",
")",
"{",
"Date",
"result",
";",
"try",
"{",
"Date",
"timeAsDate",
"=",
"Z_TIME_FORMAT",
".",
"parse",
"(",
"time... | Merges a given Date object with a given time String.<p>
Returns a <code>null</code> if the given time format coudn't be parsed.<p>
The expected time String should include the am pm information if the time format is in 12 hour presentation.<p>
@param date the given Date object which time has to be set
@param time the... | [
"Merges",
"a",
"given",
"Date",
"object",
"with",
"a",
"given",
"time",
"String",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/datebox/CmsDateConverter.java#L130-L144 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/ClientBase.java | ClientBase.uploadToExternalPayloadStorage | protected String uploadToExternalPayloadStorage(ExternalPayloadStorage.PayloadType payloadType, byte[] payloadBytes, long payloadSize) {
"""
Uses the {@link PayloadStorage} for storing large payloads.
Gets the uri for storing the payload from the server and then uploads to this location.
@param payloadType th... | java | protected String uploadToExternalPayloadStorage(ExternalPayloadStorage.PayloadType payloadType, byte[] payloadBytes, long payloadSize) {
Preconditions.checkArgument(payloadType.equals(ExternalPayloadStorage.PayloadType.WORKFLOW_INPUT) || payloadType.equals(ExternalPayloadStorage.PayloadType.TASK_OUTPUT),
... | [
"protected",
"String",
"uploadToExternalPayloadStorage",
"(",
"ExternalPayloadStorage",
".",
"PayloadType",
"payloadType",
",",
"byte",
"[",
"]",
"payloadBytes",
",",
"long",
"payloadSize",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"payloadType",
".",
"equ... | Uses the {@link PayloadStorage} for storing large payloads.
Gets the uri for storing the payload from the server and then uploads to this location.
@param payloadType the {@link com.netflix.conductor.common.utils.ExternalPayloadStorage.PayloadType} to be uploaded
@param payloadBytes the byte array containing the payl... | [
"Uses",
"the",
"{",
"@link",
"PayloadStorage",
"}",
"for",
"storing",
"large",
"payloads",
".",
"Gets",
"the",
"uri",
"for",
"storing",
"the",
"payload",
"from",
"the",
"server",
"and",
"then",
"uploads",
"to",
"this",
"location",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/ClientBase.java#L203-L209 |
infinispan/infinispan | lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java | FileListOperations.removeAndAdd | public void removeAndAdd(final String toRemove, final String toAdd) {
"""
Optimized implementation to perform both a remove and an add
@param toRemove
@param toAdd
"""
writeLock.lock();
try {
FileListCacheValue fileList = getFileList();
boolean done = fileList.addAndRemove(toAdd... | java | public void removeAndAdd(final String toRemove, final String toAdd) {
writeLock.lock();
try {
FileListCacheValue fileList = getFileList();
boolean done = fileList.addAndRemove(toAdd, toRemove);
if (done) {
updateFileList(fileList);
if (trace) {
... | [
"public",
"void",
"removeAndAdd",
"(",
"final",
"String",
"toRemove",
",",
"final",
"String",
"toAdd",
")",
"{",
"writeLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"FileListCacheValue",
"fileList",
"=",
"getFileList",
"(",
")",
";",
"boolean",
"done",
"=... | Optimized implementation to perform both a remove and an add
@param toRemove
@param toAdd | [
"Optimized",
"implementation",
"to",
"perform",
"both",
"a",
"remove",
"and",
"an",
"add"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java#L86-L100 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.setUserDataAt | public void setUserDataAt(int index, Object data) {
"""
Set the user data at the given index.
@param index is the index of the data.
@param data is the data
"""
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
this.userData.set(index, data);
} | java | public void setUserDataAt(int index, Object data) {
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
this.userData.set(index, data);
} | [
"public",
"void",
"setUserDataAt",
"(",
"int",
"index",
",",
"Object",
"data",
")",
"{",
"if",
"(",
"this",
".",
"userData",
"==",
"null",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"this",
".",
"userData",
".",
"set",
"... | Set the user data at the given index.
@param index is the index of the data.
@param data is the data | [
"Set",
"the",
"user",
"data",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L288-L293 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.nextAfter | public static float nextAfter(final float f, final double direction) {
"""
Get the next machine representable number after a number, moving
in the direction of another number.
<p>
The ordering is as follows (increasing):
<ul>
<li>-INFINITY</li>
<li>-MAX_VALUE</li>
<li>-MIN_VALUE</li>
<li>-0.0</li>
<li>+0.... | java | public static float nextAfter(final float f, final double direction) {
// handling of some important special cases
if (Double.isNaN(f) || Double.isNaN(direction)) {
return Float.NaN;
} else if (f == direction) {
return (float) direction;
} else if (Float.isInfini... | [
"public",
"static",
"float",
"nextAfter",
"(",
"final",
"float",
"f",
",",
"final",
"double",
"direction",
")",
"{",
"// handling of some important special cases",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"f",
")",
"||",
"Double",
".",
"isNaN",
"(",
"direction"... | Get the next machine representable number after a number, moving
in the direction of another number.
<p>
The ordering is as follows (increasing):
<ul>
<li>-INFINITY</li>
<li>-MAX_VALUE</li>
<li>-MIN_VALUE</li>
<li>-0.0</li>
<li>+0.0</li>
<li>+MIN_VALUE</li>
<li>+MAX_VALUE</li>
<li>+INFINITY</li>
<li></li>
<p>
If argume... | [
"Get",
"the",
"next",
"machine",
"representable",
"number",
"after",
"a",
"number",
"moving",
"in",
"the",
"direction",
"of",
"another",
"number",
".",
"<p",
">",
"The",
"ordering",
"is",
"as",
"follows",
"(",
"increasing",
")",
":",
"<ul",
">",
"<li",
"... | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L3339-L3362 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java | Whitebox.invokeMethod | public static synchronized <T> T invokeMethod(Class<?> clazz, String methodToExecute, Object... arguments)
throws Exception {
"""
Invoke a static private or inner class method. This may be useful to test
private methods.
"""
return WhiteboxImpl.invokeMethod(clazz, methodToExecute, arguments);
} | java | public static synchronized <T> T invokeMethod(Class<?> clazz, String methodToExecute, Object... arguments)
throws Exception {
return WhiteboxImpl.invokeMethod(clazz, methodToExecute, arguments);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"invokeMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodToExecute",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"WhiteboxImpl",
".",
"invokeMethod",
... | Invoke a static private or inner class method. This may be useful to test
private methods. | [
"Invoke",
"a",
"static",
"private",
"or",
"inner",
"class",
"method",
".",
"This",
"may",
"be",
"useful",
"to",
"test",
"private",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L464-L467 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/WarUtils.java | WarUtils.addContextParam | public static void addContextParam(Document doc, Element root) {
"""
Adds a context parameter to a web.xml file to override where the shiro config location is to be loaded from.
The location loaded from will be represented by the "com.meltmedia.cadmium.contentRoot" system property.
@param doc The xml DOM documen... | java | public static void addContextParam(Document doc, Element root) {
Element ctxParam = doc.createElement("context-param");
Element paramName = doc.createElement("param-name");
paramName.appendChild(doc.createTextNode("shiroConfigLocations"));
ctxParam.appendChild(paramName);
Element paramValue = doc.cr... | [
"public",
"static",
"void",
"addContextParam",
"(",
"Document",
"doc",
",",
"Element",
"root",
")",
"{",
"Element",
"ctxParam",
"=",
"doc",
".",
"createElement",
"(",
"\"context-param\"",
")",
";",
"Element",
"paramName",
"=",
"doc",
".",
"createElement",
"(",... | Adds a context parameter to a web.xml file to override where the shiro config location is to be loaded from.
The location loaded from will be represented by the "com.meltmedia.cadmium.contentRoot" system property.
@param doc The xml DOM document to create the new xml elements with.
@param root The xml Element node to a... | [
"Adds",
"a",
"context",
"parameter",
"to",
"a",
"web",
".",
"xml",
"file",
"to",
"override",
"where",
"the",
"shiro",
"config",
"location",
"is",
"to",
"be",
"loaded",
"from",
".",
"The",
"location",
"loaded",
"from",
"will",
"be",
"represented",
"by",
"... | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/WarUtils.java#L277-L289 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/reflect/MethodReflector.java | MethodReflector.invokeMethod | public static Object invokeMethod(Object obj, String name, Object... args) {
"""
Invokes an object method by its name with specified parameters.
@param obj an object to invoke.
@param name a name of the method to invoke.
@param args a list of method arguments.
@return the result of the method invocation or ... | java | public static Object invokeMethod(Object obj, String name, Object... args) {
if (obj == null)
throw new NullPointerException("Object cannot be null");
if (name == null)
throw new NullPointerException("Method name cannot be null");
Class<?> objClass = obj.getClass();
for (Method method : objClass.getMeth... | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"Object",
"obj",
",",
"String",
"name",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Object cannot be null\"",
")",
";",
"if",
... | Invokes an object method by its name with specified parameters.
@param obj an object to invoke.
@param name a name of the method to invoke.
@param args a list of method arguments.
@return the result of the method invocation or null if method returns void. | [
"Invokes",
"an",
"object",
"method",
"by",
"its",
"name",
"with",
"specified",
"parameters",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/reflect/MethodReflector.java#L65-L83 |
apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java | KinesisDataFetcher.advanceLastDiscoveredShardOfStream | public void advanceLastDiscoveredShardOfStream(String stream, String shardId) {
"""
Updates the last discovered shard of a subscribed stream; only updates if the update is valid.
"""
String lastSeenShardIdOfStream = this.subscribedStreamsToLastDiscoveredShardIds.get(stream);
// the update is valid only if... | java | public void advanceLastDiscoveredShardOfStream(String stream, String shardId) {
String lastSeenShardIdOfStream = this.subscribedStreamsToLastDiscoveredShardIds.get(stream);
// the update is valid only if the given shard id is greater
// than the previous last seen shard id of the stream
if (lastSeenShardIdOfSt... | [
"public",
"void",
"advanceLastDiscoveredShardOfStream",
"(",
"String",
"stream",
",",
"String",
"shardId",
")",
"{",
"String",
"lastSeenShardIdOfStream",
"=",
"this",
".",
"subscribedStreamsToLastDiscoveredShardIds",
".",
"get",
"(",
"stream",
")",
";",
"// the update i... | Updates the last discovered shard of a subscribed stream; only updates if the update is valid. | [
"Updates",
"the",
"last",
"discovered",
"shard",
"of",
"a",
"subscribed",
"stream",
";",
"only",
"updates",
"if",
"the",
"update",
"is",
"valid",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L519-L530 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONAssert.java | JSONAssert.assertNotEquals | public static void assertNotEquals(String expectedStr, JSONObject actual, JSONCompareMode compareMode)
throws JSONException {
"""
Asserts that the JSONObject provided does not match the expected string. If it is it throws an
{@link AssertionError}.
@see #assertEquals(String, JSONObject, JSONCompar... | java | public static void assertNotEquals(String expectedStr, JSONObject actual, JSONCompareMode compareMode)
throws JSONException {
assertNotEquals("", expectedStr, actual, compareMode);
} | [
"public",
"static",
"void",
"assertNotEquals",
"(",
"String",
"expectedStr",
",",
"JSONObject",
"actual",
",",
"JSONCompareMode",
"compareMode",
")",
"throws",
"JSONException",
"{",
"assertNotEquals",
"(",
"\"\"",
",",
"expectedStr",
",",
"actual",
",",
"compareMode... | Asserts that the JSONObject provided does not match the expected string. If it is it throws an
{@link AssertionError}.
@see #assertEquals(String, JSONObject, JSONCompareMode)
@param expectedStr Expected JSON string
@param actual JSONObject to compare
@param compareMode Specifies which comparison mode to use
@throws ... | [
"Asserts",
"that",
"the",
"JSONObject",
"provided",
"does",
"not",
"match",
"the",
"expected",
"string",
".",
"If",
"it",
"is",
"it",
"throws",
"an",
"{",
"@link",
"AssertionError",
"}",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java#L163-L166 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.setFormat | public void setFormat(int formatElementIndex, Format newFormat) {
"""
Sets the Format object to use for the format element with the given
format element index within the previously set pattern string.
The format element index is the zero-based number of the format
element counting from the start of the pattern ... | java | public void setFormat(int formatElementIndex, Format newFormat) {
int formatNumber = 0;
for (int partIndex = 0; (partIndex = nextTopLevelArgStart(partIndex)) >= 0;) {
if (formatNumber == formatElementIndex) {
setCustomArgStartFormat(partIndex, newFormat);
retu... | [
"public",
"void",
"setFormat",
"(",
"int",
"formatElementIndex",
",",
"Format",
"newFormat",
")",
"{",
"int",
"formatNumber",
"=",
"0",
";",
"for",
"(",
"int",
"partIndex",
"=",
"0",
";",
"(",
"partIndex",
"=",
"nextTopLevelArgStart",
"(",
"partIndex",
")",
... | Sets the Format object to use for the format element with the given
format element index within the previously set pattern string.
The format element index is the zero-based number of the format
element counting from the start of the pattern string.
<p>
Since the order of format elements in a pattern string often
chang... | [
"Sets",
"the",
"Format",
"object",
"to",
"use",
"for",
"the",
"format",
"element",
"with",
"the",
"given",
"format",
"element",
"index",
"within",
"the",
"previously",
"set",
"pattern",
"string",
".",
"The",
"format",
"element",
"index",
"is",
"the",
"zero",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L736-L746 |
Bedework/bw-util | bw-util-struts/src/main/java/org/bedework/util/struts/UtilActionForm.java | UtilActionForm.intVal | public int intVal(String newVal, int curVal, String name) {
"""
Convert a string parameter so we can add an
error message for incorrect formats (instead of relying on Struts).
<p>Struts tends to return 0 or null for illegal values, e.g., alpha
characters for a number.
@param newVal
@param curVal
@param n... | java | public int intVal(String newVal, int curVal, String name) {
int newInt;
try {
newInt = Integer.parseInt(newVal);
} catch (Exception e) {
valErrors.add(new IntValError(name, newVal));
newInt = curVal;
}
return newInt;
} | [
"public",
"int",
"intVal",
"(",
"String",
"newVal",
",",
"int",
"curVal",
",",
"String",
"name",
")",
"{",
"int",
"newInt",
";",
"try",
"{",
"newInt",
"=",
"Integer",
".",
"parseInt",
"(",
"newVal",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",... | Convert a string parameter so we can add an
error message for incorrect formats (instead of relying on Struts).
<p>Struts tends to return 0 or null for illegal values, e.g., alpha
characters for a number.
@param newVal
@param curVal
@param name
@return String | [
"Convert",
"a",
"string",
"parameter",
"so",
"we",
"can",
"add",
"an",
"error",
"message",
"for",
"incorrect",
"formats",
"(",
"instead",
"of",
"relying",
"on",
"Struts",
")",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/UtilActionForm.java#L595-L606 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/condition/GraphCondition.java | GraphCondition.setResults | protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results) {
"""
This sets the variable with the given name to the given value. If there is already a variable with the same name in the top-most stack frame,
we will combine them here.
This helps in the case of ... | java | protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results)
{
Variables variables = Variables.instance(event);
Iterable<? extends WindupVertexFrame> existingVariables = variables.findVariable(variable, 1);
if (existingVariables != null)
... | [
"protected",
"void",
"setResults",
"(",
"GraphRewrite",
"event",
",",
"String",
"variable",
",",
"Iterable",
"<",
"?",
"extends",
"WindupVertexFrame",
">",
"results",
")",
"{",
"Variables",
"variables",
"=",
"Variables",
".",
"instance",
"(",
"event",
")",
";"... | This sets the variable with the given name to the given value. If there is already a variable with the same name in the top-most stack frame,
we will combine them here.
This helps in the case of multiple conditions tied together with "or" or "and". | [
"This",
"sets",
"the",
"variable",
"with",
"the",
"given",
"name",
"to",
"the",
"given",
"value",
".",
"If",
"there",
"is",
"already",
"a",
"variable",
"with",
"the",
"same",
"name",
"in",
"the",
"top",
"-",
"most",
"stack",
"frame",
"we",
"will",
"com... | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/condition/GraphCondition.java#L76-L88 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMRandom.java | JMRandom.buildRandomIntStream | public static IntStream buildRandomIntStream(int streamSize,
int inclusiveLowerBound, int exclusiveUpperBound) {
"""
Build random int stream int stream.
@param streamSize the stream size
@param inclusiveLowerBound the inclusive lower bound
@param exclusiveUpperBound the exclusive upper bo... | java | public static IntStream buildRandomIntStream(int streamSize,
int inclusiveLowerBound, int exclusiveUpperBound) {
return buildRandomIntStream(streamSize, new Random(),
inclusiveLowerBound, exclusiveUpperBound);
} | [
"public",
"static",
"IntStream",
"buildRandomIntStream",
"(",
"int",
"streamSize",
",",
"int",
"inclusiveLowerBound",
",",
"int",
"exclusiveUpperBound",
")",
"{",
"return",
"buildRandomIntStream",
"(",
"streamSize",
",",
"new",
"Random",
"(",
")",
",",
"inclusiveLow... | Build random int stream int stream.
@param streamSize the stream size
@param inclusiveLowerBound the inclusive lower bound
@param exclusiveUpperBound the exclusive upper bound
@return the int stream | [
"Build",
"random",
"int",
"stream",
"int",
"stream",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMRandom.java#L62-L66 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java | Arc42DocumentationTemplate.addDeploymentViewSection | public Section addDeploymentViewSection(SoftwareSystem softwareSystem, File... files) throws IOException {
"""
Adds a "Deployment View" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files ... | java | public Section addDeploymentViewSection(SoftwareSystem softwareSystem, File... files) throws IOException {
return addSection(softwareSystem, "Deployment View", files);
} | [
"public",
"Section",
"addDeploymentViewSection",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"Deployment View\"",
",",
"files",
")",
";",
"}"
] | Adds a "Deployment View" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation {@lin... | [
"Adds",
"a",
"Deployment",
"View",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java#L193-L195 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Chunk.java | Chunk.setSkew | public Chunk setSkew(float alpha, float beta) {
"""
Skews the text to simulate italic and other effects. Try <CODE>alpha=0
</CODE> and <CODE>beta=12</CODE>.
@param alpha
the first angle in degrees
@param beta
the second angle in degrees
@return this <CODE>Chunk</CODE>
"""
alpha = (float) Math.tan(alp... | java | public Chunk setSkew(float alpha, float beta) {
alpha = (float) Math.tan(alpha * Math.PI / 180);
beta = (float) Math.tan(beta * Math.PI / 180);
return setAttribute(SKEW, new float[] { alpha, beta });
} | [
"public",
"Chunk",
"setSkew",
"(",
"float",
"alpha",
",",
"float",
"beta",
")",
"{",
"alpha",
"=",
"(",
"float",
")",
"Math",
".",
"tan",
"(",
"alpha",
"*",
"Math",
".",
"PI",
"/",
"180",
")",
";",
"beta",
"=",
"(",
"float",
")",
"Math",
".",
"... | Skews the text to simulate italic and other effects. Try <CODE>alpha=0
</CODE> and <CODE>beta=12</CODE>.
@param alpha
the first angle in degrees
@param beta
the second angle in degrees
@return this <CODE>Chunk</CODE> | [
"Skews",
"the",
"text",
"to",
"simulate",
"italic",
"and",
"other",
"effects",
".",
"Try",
"<CODE",
">",
"alpha",
"=",
"0",
"<",
"/",
"CODE",
">",
"and",
"<CODE",
">",
"beta",
"=",
"12<",
"/",
"CODE",
">",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Chunk.java#L581-L585 |
jboss/jboss-el-api_spec | src/main/java/javax/el/ELProcessor.java | ELProcessor.setValue | public void setValue(String expression, Object value) {
"""
Sets an expression with a new value.
The target expression is evaluated, up to the last property resolution,
and the resultant (base, property) pair is set to the provided value.
@param expression The target expression
@param value The new value to ... | java | public void setValue(String expression, Object value) {
ValueExpression exp = factory.createValueExpression(
elManager.getELContext(),
bracket(expression), Object.class);
exp.setValue(elManager.getELContext(), value);
} | [
"public",
"void",
"setValue",
"(",
"String",
"expression",
",",
"Object",
"value",
")",
"{",
"ValueExpression",
"exp",
"=",
"factory",
".",
"createValueExpression",
"(",
"elManager",
".",
"getELContext",
"(",
")",
",",
"bracket",
"(",
"expression",
")",
",",
... | Sets an expression with a new value.
The target expression is evaluated, up to the last property resolution,
and the resultant (base, property) pair is set to the provided value.
@param expression The target expression
@param value The new value to set.
@throws PropertyNotFoundException if one of the property
resoluti... | [
"Sets",
"an",
"expression",
"with",
"a",
"new",
"value",
".",
"The",
"target",
"expression",
"is",
"evaluated",
"up",
"to",
"the",
"last",
"property",
"resolution",
"and",
"the",
"resultant",
"(",
"base",
"property",
")",
"pair",
"is",
"set",
"to",
"the",
... | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELProcessor.java#L150-L155 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.setClientInfo | public void setClientInfo(final Properties properties) throws SQLClientInfoException {
"""
<p>Sets the value of the connection's client info properties. The <code>Properties</code>
object contains the names and values of the client info properties to be set. The set of
client info properties contained in the p... | java | public void setClientInfo(final Properties properties) throws SQLClientInfoException {
Map<String, ClientInfoStatus> propertiesExceptions = new HashMap<>();
for (String name : new String[]{"ApplicationName", "ClientUser", "ClientHostname"}) {
try {
setClientInfo(name, properties.getProperty(name))... | [
"public",
"void",
"setClientInfo",
"(",
"final",
"Properties",
"properties",
")",
"throws",
"SQLClientInfoException",
"{",
"Map",
"<",
"String",
",",
"ClientInfoStatus",
">",
"propertiesExceptions",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"String... | <p>Sets the value of the connection's client info properties. The <code>Properties</code>
object contains the names and values of the client info properties to be set. The set of
client info properties contained in the properties list replaces the current set of client info
properties on the connection. If a propert... | [
"<p",
">",
"Sets",
"the",
"value",
"of",
"the",
"connection",
"s",
"client",
"info",
"properties",
".",
"The",
"<code",
">",
"Properties<",
"/",
"code",
">",
"object",
"contains",
"the",
"names",
"and",
"values",
"of",
"the",
"client",
"info",
"properties"... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L1404-L1420 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.unsubscribeAllResourcesFor | public void unsubscribeAllResourcesFor(CmsRequestContext context, String poolName, CmsPrincipal principal)
throws CmsException {
"""
Unsubscribes the user or group from all resources.<p>
@param context the request context
@param poolName the name of the database pool to use
@param principal the principal ... | java | public void unsubscribeAllResourcesFor(CmsRequestContext context, String poolName, CmsPrincipal principal)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.unsubscribeAllResourcesFor(dbc, poolName, principal);
} catch (Exce... | [
"public",
"void",
"unsubscribeAllResourcesFor",
"(",
"CmsRequestContext",
"context",
",",
"String",
"poolName",
",",
"CmsPrincipal",
"principal",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
... | Unsubscribes the user or group from all resources.<p>
@param context the request context
@param poolName the name of the database pool to use
@param principal the principal that unsubscribes from all resources
@throws CmsException if something goes wrong | [
"Unsubscribes",
"the",
"user",
"or",
"group",
"from",
"all",
"resources",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6355-L6376 |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java | ExcelReport.generateReport | public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String sOpDirectory) {
"""
The first method that gets called when generating the report. Generates data in way the Excel should appear.
Creates the Excel Report and writes it to a file.
"""
logger.entering(new Object[] { xmlSuit... | java | public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String sOpDirectory) {
logger.entering(new Object[] { xmlSuites, suites, sOpDirectory });
if (ListenerManager.isCurrentMethodSkipped(this)) {
logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
return;
... | [
"public",
"void",
"generateReport",
"(",
"List",
"<",
"XmlSuite",
">",
"xmlSuites",
",",
"List",
"<",
"ISuite",
">",
"suites",
",",
"String",
"sOpDirectory",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"xmlSuites",
",",
"sui... | The first method that gets called when generating the report. Generates data in way the Excel should appear.
Creates the Excel Report and writes it to a file. | [
"The",
"first",
"method",
"that",
"gets",
"called",
"when",
"generating",
"the",
"report",
".",
"Generates",
"data",
"in",
"way",
"the",
"Excel",
"should",
"appear",
".",
"Creates",
"the",
"Excel",
"Report",
"and",
"writes",
"it",
"to",
"a",
"file",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java#L98-L137 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java | BoundingBox.increaseByScale | public BoundingBox increaseByScale(final float pBoundingboxPaddingRelativeScale) {
"""
Scale this bounding box by a given factor.
@param pBoundingboxPaddingRelativeScale
scale factor
@return scaled bounding box
"""
if (pBoundingboxPaddingRelativeScale <= 0)
throw new IllegalArgumentExc... | java | public BoundingBox increaseByScale(final float pBoundingboxPaddingRelativeScale) {
if (pBoundingboxPaddingRelativeScale <= 0)
throw new IllegalArgumentException("pBoundingboxPaddingRelativeScale must be positive");
final TileSystem tileSystem = org.osmdroid.views.MapView.getTileSystem();
... | [
"public",
"BoundingBox",
"increaseByScale",
"(",
"final",
"float",
"pBoundingboxPaddingRelativeScale",
")",
"{",
"if",
"(",
"pBoundingboxPaddingRelativeScale",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"pBoundingboxPaddingRelativeScale must be positive\... | Scale this bounding box by a given factor.
@param pBoundingboxPaddingRelativeScale
scale factor
@return scaled bounding box | [
"Scale",
"this",
"bounding",
"box",
"by",
"a",
"given",
"factor",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java#L251-L266 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java | OrientedBox3f.setSecondAxis | @Override
public void setSecondAxis(Vector3D axis, double extent) {
"""
Set the second axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param axis - the new values for the first axis.
@param extent - the extent of the axis.
"""
setSecondAxis(axis.getX(), axis.getY(... | java | @Override
public void setSecondAxis(Vector3D axis, double extent) {
setSecondAxis(axis.getX(), axis.getY(), axis.getZ(), extent);
} | [
"@",
"Override",
"public",
"void",
"setSecondAxis",
"(",
"Vector3D",
"axis",
",",
"double",
"extent",
")",
"{",
"setSecondAxis",
"(",
"axis",
".",
"getX",
"(",
")",
",",
"axis",
".",
"getY",
"(",
")",
",",
"axis",
".",
"getZ",
"(",
")",
",",
"extent"... | Set the second axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param axis - the new values for the first axis.
@param extent - the extent of the axis. | [
"Set",
"the",
"second",
"axis",
"of",
"the",
"box",
".",
"The",
"third",
"axis",
"is",
"updated",
"to",
"be",
"perpendicular",
"to",
"the",
"two",
"other",
"axis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java#L481-L484 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/document/RtfPageSetting.java | RtfPageSetting.rectEquals | private boolean rectEquals(Rectangle rect1, Rectangle rect2) {
"""
This method compares to Rectangles. They are considered equal if width and height are the same
@param rect1 The first Rectangle to compare
@param rect2 The second Rectangle to compare
@return <code>True</code> if the Rectangles equal, <code>fa... | java | private boolean rectEquals(Rectangle rect1, Rectangle rect2) {
return (rect1.getWidth() == rect2.getWidth()) && (rect1.getHeight() == rect2.getHeight());
} | [
"private",
"boolean",
"rectEquals",
"(",
"Rectangle",
"rect1",
",",
"Rectangle",
"rect2",
")",
"{",
"return",
"(",
"rect1",
".",
"getWidth",
"(",
")",
"==",
"rect2",
".",
"getWidth",
"(",
")",
")",
"&&",
"(",
"rect1",
".",
"getHeight",
"(",
")",
"==",
... | This method compares to Rectangles. They are considered equal if width and height are the same
@param rect1 The first Rectangle to compare
@param rect2 The second Rectangle to compare
@return <code>True</code> if the Rectangles equal, <code>false</code> otherwise | [
"This",
"method",
"compares",
"to",
"Rectangles",
".",
"They",
"are",
"considered",
"equal",
"if",
"width",
"and",
"height",
"are",
"the",
"same"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/document/RtfPageSetting.java#L426-L428 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/ThriftDataResultHelper.java | ThriftDataResultHelper.transformThriftResult | public static <T> T transformThriftResult(ColumnOrSuperColumn cosc, ColumnFamilyType columnFamilyType, ThriftRow row) {
"""
Transform thrift result.
@param <T> the generic type
@param cosc the cosc
@param columnFamilyType the column family type
@param row the row
@return the t
"""
Object output ... | java | public static <T> T transformThriftResult(ColumnOrSuperColumn cosc, ColumnFamilyType columnFamilyType, ThriftRow row)
{
Object output = null;
if (cosc != null)
{
switch (columnFamilyType)
{
case COLUMN:
output = cosc.column;
... | [
"public",
"static",
"<",
"T",
">",
"T",
"transformThriftResult",
"(",
"ColumnOrSuperColumn",
"cosc",
",",
"ColumnFamilyType",
"columnFamilyType",
",",
"ThriftRow",
"row",
")",
"{",
"Object",
"output",
"=",
"null",
";",
"if",
"(",
"cosc",
"!=",
"null",
")",
"... | Transform thrift result.
@param <T> the generic type
@param cosc the cosc
@param columnFamilyType the column family type
@param row the row
@return the t | [
"Transform",
"thrift",
"result",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/ThriftDataResultHelper.java#L90-L131 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/ObjectSchema.java | ObjectSchema.withRequiredProperty | public ObjectSchema withRequiredProperty(String name, Object type, IValidationRule... rules) {
"""
Adds a validation schema for a required object property.
@param name a property name.
@param type (optional) a property schema or type.
@param rules (optional) a list of property validation rules.
@return the... | java | public ObjectSchema withRequiredProperty(String name, Object type, IValidationRule... rules) {
_properties = _properties != null ? _properties : new ArrayList<PropertySchema>();
PropertySchema schema = new PropertySchema(name, type);
schema.setRules(Arrays.asList(rules));
schema.makeRequired();
return withPro... | [
"public",
"ObjectSchema",
"withRequiredProperty",
"(",
"String",
"name",
",",
"Object",
"type",
",",
"IValidationRule",
"...",
"rules",
")",
"{",
"_properties",
"=",
"_properties",
"!=",
"null",
"?",
"_properties",
":",
"new",
"ArrayList",
"<",
"PropertySchema",
... | Adds a validation schema for a required object property.
@param name a property name.
@param type (optional) a property schema or type.
@param rules (optional) a list of property validation rules.
@return the validation schema | [
"Adds",
"a",
"validation",
"schema",
"for",
"a",
"required",
"object",
"property",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/ObjectSchema.java#L114-L120 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java | SocketBindingJBossASClient.setSocketBindingPort | public void setSocketBindingPort(String socketBindingGroupName, String socketBindingName, int port)
throws Exception {
"""
Sets the port number for the named socket binding found in the named socket binding group.
@param socketBindingGroupName the name of the socket binding group that has the named sock... | java | public void setSocketBindingPort(String socketBindingGroupName, String socketBindingName, int port)
throws Exception {
setSocketBindingPortExpression(socketBindingGroupName, socketBindingName, null, port);
} | [
"public",
"void",
"setSocketBindingPort",
"(",
"String",
"socketBindingGroupName",
",",
"String",
"socketBindingName",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"setSocketBindingPortExpression",
"(",
"socketBindingGroupName",
",",
"socketBindingName",
",",
"nul... | Sets the port number for the named socket binding found in the named socket binding group.
@param socketBindingGroupName the name of the socket binding group that has the named socket binding
@param socketBindingName the name of the socket binding whose port is to be set
@param port the new port number
@throws Excepti... | [
"Sets",
"the",
"port",
"number",
"for",
"the",
"named",
"socket",
"binding",
"found",
"in",
"the",
"named",
"socket",
"binding",
"group",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java#L236-L239 |
Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.getChunks | private DBCursor getChunks(DBCollection collection) {
"""
Gets chunks.
@param collection the collection
@return the chunks
"""
DB config = collection.getDB().getSisterDB("config");
DBCollection configChunks = config.getCollection("chunks");
return configChunks.find(new BasicDBObject... | java | private DBCursor getChunks(DBCollection collection) {
DB config = collection.getDB().getSisterDB("config");
DBCollection configChunks = config.getCollection("chunks");
return configChunks.find(new BasicDBObject("ns", collection.getFullName()));
} | [
"private",
"DBCursor",
"getChunks",
"(",
"DBCollection",
"collection",
")",
"{",
"DB",
"config",
"=",
"collection",
".",
"getDB",
"(",
")",
".",
"getSisterDB",
"(",
"\"config\"",
")",
";",
"DBCollection",
"configChunks",
"=",
"config",
".",
"getCollection",
"(... | Gets chunks.
@param collection the collection
@return the chunks | [
"Gets",
"chunks",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L177-L181 |
chen0040/java-genetic-programming | src/main/java/com/github/chen0040/gp/lgp/gp/PopulationInitialization.java | PopulationInitialization.initializeWithConstantLength | private static void initializeWithConstantLength(List<Program> programs, LGP manager, RandEngine randEngine) {
"""
the program length is distributed uniformly between iMinProgLength and iMaxProgLength
"""
int popSize = manager.getPopulationSize();
for(int i=0; i<popSize; ++i)
{
Prog... | java | private static void initializeWithConstantLength(List<Program> programs, LGP manager, RandEngine randEngine) {
int popSize = manager.getPopulationSize();
for(int i=0; i<popSize; ++i)
{
Program lgp= new Program();
initialize(lgp, manager, randEngine, manager.getPopInitConstantProgram... | [
"private",
"static",
"void",
"initializeWithConstantLength",
"(",
"List",
"<",
"Program",
">",
"programs",
",",
"LGP",
"manager",
",",
"RandEngine",
"randEngine",
")",
"{",
"int",
"popSize",
"=",
"manager",
".",
"getPopulationSize",
"(",
")",
";",
"for",
"(",
... | the program length is distributed uniformly between iMinProgLength and iMaxProgLength | [
"the",
"program",
"length",
"is",
"distributed",
"uniformly",
"between",
"iMinProgLength",
"and",
"iMaxProgLength"
] | train | https://github.com/chen0040/java-genetic-programming/blob/498fc8f4407ea9d45f2e0ac797a8948da337c74f/src/main/java/com/github/chen0040/gp/lgp/gp/PopulationInitialization.java#L51-L60 |
apereo/cas | support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java | AbstractServiceValidateController.getServiceCredentialsFromRequest | protected Credential getServiceCredentialsFromRequest(final WebApplicationService service, final HttpServletRequest request) {
"""
Overrideable method to determine which credentials to use to grant a
proxy granting ticket. Default is to use the pgtUrl.
@param service the webapp service requesting proxy
@param... | java | protected Credential getServiceCredentialsFromRequest(final WebApplicationService service, final HttpServletRequest request) {
val pgtUrl = request.getParameter(CasProtocolConstants.PARAMETER_PROXY_CALLBACK_URL);
if (StringUtils.isNotBlank(pgtUrl)) {
try {
val registeredServi... | [
"protected",
"Credential",
"getServiceCredentialsFromRequest",
"(",
"final",
"WebApplicationService",
"service",
",",
"final",
"HttpServletRequest",
"request",
")",
"{",
"val",
"pgtUrl",
"=",
"request",
".",
"getParameter",
"(",
"CasProtocolConstants",
".",
"PARAMETER_PRO... | Overrideable method to determine which credentials to use to grant a
proxy granting ticket. Default is to use the pgtUrl.
@param service the webapp service requesting proxy
@param request the HttpServletRequest object.
@return the credentials or null if there was an error or no credentials
provided. | [
"Overrideable",
"method",
"to",
"determine",
"which",
"credentials",
"to",
"use",
"to",
"grant",
"a",
"proxy",
"granting",
"ticket",
".",
"Default",
"is",
"to",
"use",
"the",
"pgtUrl",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java#L89-L101 |
twitter/cloudhopper-commons | ch-commons-xbean/src/main/java/com/cloudhopper/commons/xbean/util/PropertiesReplacementUtil.java | PropertiesReplacementUtil.replaceProperties | static public InputStream replaceProperties(File file, Properties props) throws IOException, SubstitutionException {
"""
Creates an InputStream containing the document resulting from replacing template
parameters in the given file.
@param file The template file
@param props The properties
@return An InputStrea... | java | static public InputStream replaceProperties(File file, Properties props) throws IOException, SubstitutionException {
return replaceProperties(new FileInputStream(file), props);
} | [
"static",
"public",
"InputStream",
"replaceProperties",
"(",
"File",
"file",
",",
"Properties",
"props",
")",
"throws",
"IOException",
",",
"SubstitutionException",
"{",
"return",
"replaceProperties",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
",",
"props",
... | Creates an InputStream containing the document resulting from replacing template
parameters in the given file.
@param file The template file
@param props The properties
@return An InputStream containing the resulting document. | [
"Creates",
"an",
"InputStream",
"containing",
"the",
"document",
"resulting",
"from",
"replacing",
"template",
"parameters",
"in",
"the",
"given",
"file",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-xbean/src/main/java/com/cloudhopper/commons/xbean/util/PropertiesReplacementUtil.java#L99-L101 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/AbstractAuditEventMessageImpl.java | AbstractAuditEventMessageImpl.getTypeValuePair | public TypeValuePairType getTypeValuePair(String type, String value) {
"""
Create and set a Type Value Pair instance for a given type and value
@param type The type to set
@param value The value to set
@return The Type Value Pair instance
"""
return getTypeValuePair(type, value.getBytes(StandardCh... | java | public TypeValuePairType getTypeValuePair(String type, String value) {
return getTypeValuePair(type, value.getBytes(StandardCharsets.UTF_8));
} | [
"public",
"TypeValuePairType",
"getTypeValuePair",
"(",
"String",
"type",
",",
"String",
"value",
")",
"{",
"return",
"getTypeValuePair",
"(",
"type",
",",
"value",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
")",
";",
"}"
] | Create and set a Type Value Pair instance for a given type and value
@param type The type to set
@param value The value to set
@return The Type Value Pair instance | [
"Create",
"and",
"set",
"a",
"Type",
"Value",
"Pair",
"instance",
"for",
"a",
"given",
"type",
"and",
"value"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/AbstractAuditEventMessageImpl.java#L439-L441 |
wg/lettuce | src/main/java/com/lambdaworks/redis/RedisClient.java | RedisClient.setDefaultTimeout | public void setDefaultTimeout(long timeout, TimeUnit unit) {
"""
Set the default timeout for {@link RedisConnection connections} created by
this client. The timeout applies to connection attempts and non-blocking
commands.
@param timeout Default connection timeout.
@param unit Unit of time for the tim... | java | public void setDefaultTimeout(long timeout, TimeUnit unit) {
this.timeout = timeout;
this.unit = unit;
bootstrap.setOption("connectTimeoutMillis", unit.toMillis(timeout));
} | [
"public",
"void",
"setDefaultTimeout",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"timeout",
"=",
"timeout",
";",
"this",
".",
"unit",
"=",
"unit",
";",
"bootstrap",
".",
"setOption",
"(",
"\"connectTimeoutMillis\"",
",",
"unit",... | Set the default timeout for {@link RedisConnection connections} created by
this client. The timeout applies to connection attempts and non-blocking
commands.
@param timeout Default connection timeout.
@param unit Unit of time for the timeout. | [
"Set",
"the",
"default",
"timeout",
"for",
"{",
"@link",
"RedisConnection",
"connections",
"}",
"created",
"by",
"this",
"client",
".",
"The",
"timeout",
"applies",
"to",
"connection",
"attempts",
"and",
"non",
"-",
"blocking",
"commands",
"."
] | train | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/RedisClient.java#L77-L81 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/parser/properties/RtfProperty.java | RtfProperty.setProperty | private boolean setProperty(String propertyName, Object propertyValueNew) {
"""
Set the value of the property identified by the parameter.
@param propertyName The property name to set
@param propertyValueNew The object to set the property value to
@return <code>true</code> for handled or <code>false</code> if... | java | private boolean setProperty(String propertyName, Object propertyValueNew) {
if(propertyName == null || propertyValueNew == null) return false;
Object propertyValueOld = getProperty(propertyName);
if(propertyValueOld instanceof Integer && propertyValueNew instanceof Integer) {
int valueOld = ((Integer)p... | [
"private",
"boolean",
"setProperty",
"(",
"String",
"propertyName",
",",
"Object",
"propertyValueNew",
")",
"{",
"if",
"(",
"propertyName",
"==",
"null",
"||",
"propertyValueNew",
"==",
"null",
")",
"return",
"false",
";",
"Object",
"propertyValueOld",
"=",
"get... | Set the value of the property identified by the parameter.
@param propertyName The property name to set
@param propertyValueNew The object to set the property value to
@return <code>true</code> for handled or <code>false</code> if <code>propertyName</code> or <code>propertyValue</code> is <code>null</code> | [
"Set",
"the",
"value",
"of",
"the",
"property",
"identified",
"by",
"the",
"parameter",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/parser/properties/RtfProperty.java#L301-L321 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ejs/ras/TraceNLS.java | TraceNLS.getFormattedMessageFromLocalizedMessage | public static String getFormattedMessageFromLocalizedMessage(String localizedMessage, Object[] args, boolean quiet) {
"""
Return the formatted message obtained by substituting parameters passed
into a message
@param localizedMessage
the message into which parameters will be substituted
@param args
the argum... | java | public static String getFormattedMessageFromLocalizedMessage(String localizedMessage, Object[] args, boolean quiet) {
return TraceNLSResolver.getInstance().getFormattedMessage(localizedMessage, args);
} | [
"public",
"static",
"String",
"getFormattedMessageFromLocalizedMessage",
"(",
"String",
"localizedMessage",
",",
"Object",
"[",
"]",
"args",
",",
"boolean",
"quiet",
")",
"{",
"return",
"TraceNLSResolver",
".",
"getInstance",
"(",
")",
".",
"getFormattedMessage",
"(... | Return the formatted message obtained by substituting parameters passed
into a message
@param localizedMessage
the message into which parameters will be substituted
@param args
the arguments that will be substituted into the message
@param quiet
indicates whether or not errors will be logged when
encountered
@return S... | [
"Return",
"the",
"formatted",
"message",
"obtained",
"by",
"substituting",
"parameters",
"passed",
"into",
"a",
"message"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ejs/ras/TraceNLS.java#L681-L683 |
sdl/Testy | src/main/java/com/sdl/selenium/web/WebLocatorAbstractBuilder.java | WebLocatorAbstractBuilder.setTemplateValue | @SuppressWarnings("unchecked")
public <T extends WebLocatorAbstractBuilder> T setTemplateValue(final String key, final String... value) {
"""
<p><b>Used for finding element process (to generate xpath address)</b></p>
<p>Example:</p>
<pre>
WebLocator child = new WebLocator().setTemplate("custom", "%1$s = %2$... | java | @SuppressWarnings("unchecked")
public <T extends WebLocatorAbstractBuilder> T setTemplateValue(final String key, final String... value) {
pathBuilder.setTemplateValue(key, value);
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"WebLocatorAbstractBuilder",
">",
"T",
"setTemplateValue",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"...",
"value",
")",
"{",
"pathBuilder",
".",
"setTemplateValue",
... | <p><b>Used for finding element process (to generate xpath address)</b></p>
<p>Example:</p>
<pre>
WebLocator child = new WebLocator().setTemplate("custom", "%1$s = %2$s");
child.setTemplateValue("custom", "a", "b");
assertThat(child.getXPath(), equalTo("//*[a = b]"));
</pre>
@param key identify key
@param value value... | [
"<p",
">",
"<b",
">",
"Used",
"for",
"finding",
"element",
"process",
"(",
"to",
"generate",
"xpath",
"address",
")",
"<",
"/",
"b",
">",
"<",
"/",
"p",
">",
"<p",
">",
"Example",
":",
"<",
"/",
"p",
">",
"<pre",
">",
"WebLocator",
"child",
"=",
... | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/WebLocatorAbstractBuilder.java#L310-L314 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java | ContinuousDistributions.dirichletPdf | public static double dirichletPdf(double[] pi, double a) {
"""
Implementation for single alpha value.
@param pi The vector with probabilities.
@param a The alpha parameter for all pseudocounts.
@return The probability
"""
double probability=1.0;
int piLength=pi.length;... | java | public static double dirichletPdf(double[] pi, double a) {
double probability=1.0;
int piLength=pi.length;
for(int i=0;i<piLength;++i) {
probability*=Math.pow(pi[i], a-1);
}
double sumAi=piLength*a;
double productGammaAi=Math.pow(gam... | [
"public",
"static",
"double",
"dirichletPdf",
"(",
"double",
"[",
"]",
"pi",
",",
"double",
"a",
")",
"{",
"double",
"probability",
"=",
"1.0",
";",
"int",
"piLength",
"=",
"pi",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Implementation for single alpha value.
@param pi The vector with probabilities.
@param a The alpha parameter for all pseudocounts.
@return The probability | [
"Implementation",
"for",
"single",
"alpha",
"value",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L619-L633 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Sets.java | Sets.cartesianProduct | public static final <A,B> Set<OrderedPair<A,B>> cartesianProduct(Set<A> a, Set<B> b) {
"""
Cartesian product of A and B, denoted A × B, is the set whose members are
all possible ordered pairs (a, b) where a is a member of A and b is a
member of B.
@param <A>
@param <B>
@param a
@param b
@return
"""
... | java | public static final <A,B> Set<OrderedPair<A,B>> cartesianProduct(Set<A> a, Set<B> b)
{
Set<OrderedPair<A,B>> set = new HashSet<>();
for (A t : a)
{
for (B v : b)
{
set.add(new OrderedPair(t, v));
}
}
return set;
... | [
"public",
"static",
"final",
"<",
"A",
",",
"B",
">",
"Set",
"<",
"OrderedPair",
"<",
"A",
",",
"B",
">",
">",
"cartesianProduct",
"(",
"Set",
"<",
"A",
">",
"a",
",",
"Set",
"<",
"B",
">",
"b",
")",
"{",
"Set",
"<",
"OrderedPair",
"<",
"A",
... | Cartesian product of A and B, denoted A × B, is the set whose members are
all possible ordered pairs (a, b) where a is a member of A and b is a
member of B.
@param <A>
@param <B>
@param a
@param b
@return | [
"Cartesian",
"product",
"of",
"A",
"and",
"B",
"denoted",
"A",
"×",
"B",
"is",
"the",
"set",
"whose",
"members",
"are",
"all",
"possible",
"ordered",
"pairs",
"(",
"a",
"b",
")",
"where",
"a",
"is",
"a",
"member",
"of",
"A",
"and",
"b",
"is",
"a",
... | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Sets.java#L180-L191 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.unionSize | public static int unionSize(long[] x, long[] y) {
"""
Compute the union size of two Bitsets.
@param x First bitset
@param y Second bitset
@return Union size
"""
final int lx = x.length, ly = y.length;
final int min = (lx < ly) ? lx : ly;
int i = 0, res = 0;
for(; i < min; i++) {
res ... | java | public static int unionSize(long[] x, long[] y) {
final int lx = x.length, ly = y.length;
final int min = (lx < ly) ? lx : ly;
int i = 0, res = 0;
for(; i < min; i++) {
res += Long.bitCount(x[i] | y[i]);
}
for(; i < lx; i++) {
res += Long.bitCount(x[i]);
}
for(; i < ly; i++) ... | [
"public",
"static",
"int",
"unionSize",
"(",
"long",
"[",
"]",
"x",
",",
"long",
"[",
"]",
"y",
")",
"{",
"final",
"int",
"lx",
"=",
"x",
".",
"length",
",",
"ly",
"=",
"y",
".",
"length",
";",
"final",
"int",
"min",
"=",
"(",
"lx",
"<",
"ly"... | Compute the union size of two Bitsets.
@param x First bitset
@param y Second bitset
@return Union size | [
"Compute",
"the",
"union",
"size",
"of",
"two",
"Bitsets",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L1490-L1504 |
Harium/keel | src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java | HistogramStatistics.GetRange | public static IntRange GetRange( int[] values, double percent ) {
"""
Get range around median containing specified percentage of values.
@param values Values.
@param percent Values percentage around median.
@return Returns the range which containes specifies percentage of values.
"""
int total = 0, ... | java | public static IntRange GetRange( int[] values, double percent ){
int total = 0, n = values.length;
// for all values
for ( int i = 0; i < n; i++ )
{
// accumalate total
total += values[i];
}
int min, max, hits;
int h = (int) ( total * ( p... | [
"public",
"static",
"IntRange",
"GetRange",
"(",
"int",
"[",
"]",
"values",
",",
"double",
"percent",
")",
"{",
"int",
"total",
"=",
"0",
",",
"n",
"=",
"values",
".",
"length",
";",
"// for all values",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Get range around median containing specified percentage of values.
@param values Values.
@param percent Values percentage around median.
@return Returns the range which containes specifies percentage of values. | [
"Get",
"range",
"around",
"median",
"containing",
"specified",
"percentage",
"of",
"values",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L79-L107 |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/core/xml/spring327/AbstractMarshaller.java | AbstractMarshaller.unmarshalSaxSource | protected Object unmarshalSaxSource(SAXSource saxSource) throws XmlMappingException, IOException {
"""
Template method for handling {@code SAXSource}s.
<p>This implementation delegates to {@code unmarshalSaxReader}.
@param saxSource the {@code SAXSource}
@return the object graph
@throws XmlMappingException if ... | java | protected Object unmarshalSaxSource(SAXSource saxSource) throws XmlMappingException, IOException {
if (saxSource.getXMLReader() == null) {
try {
saxSource.setXMLReader(createXmlReader());
}
catch (SAXException ex) {
throw new UnmarshallingFailureException("Could not create XMLReader for SAXSource", e... | [
"protected",
"Object",
"unmarshalSaxSource",
"(",
"SAXSource",
"saxSource",
")",
"throws",
"XmlMappingException",
",",
"IOException",
"{",
"if",
"(",
"saxSource",
".",
"getXMLReader",
"(",
")",
"==",
"null",
")",
"{",
"try",
"{",
"saxSource",
".",
"setXMLReader"... | Template method for handling {@code SAXSource}s.
<p>This implementation delegates to {@code unmarshalSaxReader}.
@param saxSource the {@code SAXSource}
@return the object graph
@throws XmlMappingException if the given source cannot be mapped to an object
@throws IOException if an I/O Exception occurs
@see #unmarshalSax... | [
"Template",
"method",
"for",
"handling",
"{"
] | train | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/core/xml/spring327/AbstractMarshaller.java#L345-L358 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6ravariables_binding.java | nd6ravariables_binding.get | public static nd6ravariables_binding get(nitro_service service, Long vlan) throws Exception {
"""
Use this API to fetch nd6ravariables_binding resource of given name .
"""
nd6ravariables_binding obj = new nd6ravariables_binding();
obj.set_vlan(vlan);
nd6ravariables_binding response = (nd6ravariables_bind... | java | public static nd6ravariables_binding get(nitro_service service, Long vlan) throws Exception{
nd6ravariables_binding obj = new nd6ravariables_binding();
obj.set_vlan(vlan);
nd6ravariables_binding response = (nd6ravariables_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"nd6ravariables_binding",
"get",
"(",
"nitro_service",
"service",
",",
"Long",
"vlan",
")",
"throws",
"Exception",
"{",
"nd6ravariables_binding",
"obj",
"=",
"new",
"nd6ravariables_binding",
"(",
")",
";",
"obj",
".",
"set_vlan",
"(",
"vlan",
... | Use this API to fetch nd6ravariables_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"nd6ravariables_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6ravariables_binding.java#L115-L120 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java | AiMaterial.getTyped | private <T> T getTyped(PropertyKey key, Class<T> clazz) {
"""
Helper method. Returns typed property data.
@param <T> type
@param key the key
@param clazz type
@return the data
"""
Property p = getProperty(key.m_key);
if (null == p || null == p.getData()) {
return claz... | java | private <T> T getTyped(PropertyKey key, Class<T> clazz) {
Property p = getProperty(key.m_key);
if (null == p || null == p.getData()) {
return clazz.cast(m_defaults.get(key));
}
return clazz.cast(p.getData());
} | [
"private",
"<",
"T",
">",
"T",
"getTyped",
"(",
"PropertyKey",
"key",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"Property",
"p",
"=",
"getProperty",
"(",
"key",
".",
"m_key",
")",
";",
"if",
"(",
"null",
"==",
"p",
"||",
"null",
"==",
"p",
... | Helper method. Returns typed property data.
@param <T> type
@param key the key
@param clazz type
@return the data | [
"Helper",
"method",
".",
"Returns",
"typed",
"property",
"data",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1227-L1235 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java | VpnTunnelClient.insertVpnTunnel | @BetaApi
public final Operation insertVpnTunnel(String region, VpnTunnel vpnTunnelResource) {
"""
Creates a VpnTunnel resource in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
Projec... | java | @BetaApi
public final Operation insertVpnTunnel(String region, VpnTunnel vpnTunnelResource) {
InsertVpnTunnelHttpRequest request =
InsertVpnTunnelHttpRequest.newBuilder()
.setRegion(region)
.setVpnTunnelResource(vpnTunnelResource)
.build();
return insertVpnTunnel(r... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertVpnTunnel",
"(",
"String",
"region",
",",
"VpnTunnel",
"vpnTunnelResource",
")",
"{",
"InsertVpnTunnelHttpRequest",
"request",
"=",
"InsertVpnTunnelHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setRegion",
"(",... | Creates a VpnTunnel resource in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
VpnTunnel vpnTunnelResource = VpnTunnel.newB... | [
"Creates",
"a",
"VpnTunnel",
"resource",
"in",
"the",
"specified",
"project",
"and",
"region",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java#L542-L551 |
yanzhenjie/AndPermission | support/src/main/java/com/yanzhenjie/permission/AndPermission.java | AndPermission.getFileUri | public static Uri getFileUri(Activity activity, File file) {
"""
Get compatible Android 7.0 and lower versions of Uri.
@param activity {@link Activity}.
@param file apk file.
@return uri.
"""
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(acti... | java | public static Uri getFileUri(Activity activity, File file) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(activity, activity.getPackageName() + ".file.path.share", file);
}
return Uri.fromFile(file);
} | [
"public",
"static",
"Uri",
"getFileUri",
"(",
"Activity",
"activity",
",",
"File",
"file",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"N",
")",
"{",
"return",
"FileProvider",
".",
"getUriForFile"... | Get compatible Android 7.0 and lower versions of Uri.
@param activity {@link Activity}.
@param file apk file.
@return uri. | [
"Get",
"compatible",
"Android",
"7",
".",
"0",
"and",
"lower",
"versions",
"of",
"Uri",
"."
] | train | https://github.com/yanzhenjie/AndPermission/blob/bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c/support/src/main/java/com/yanzhenjie/permission/AndPermission.java#L362-L367 |
wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/AssetsSingleton.java | AssetsSingleton.index | @Route(method = HttpMethod.GET, uri = "/assets")
public Result index() {
"""
Serves the asset list page, or a JSON form depending on the {@literal ACCEPT} header.
@return the page, the json form or a bad request. Bad request are returned in "PROD" mode.
"""
if (configuration.isProd()) {
... | java | @Route(method = HttpMethod.GET, uri = "/assets")
public Result index() {
if (configuration.isProd()) {
// Dumping assets is not enabled in PROD mode,
// returning a bad request result
return badRequest("Sorry, no asset dump in PROD mode.");
}
if (cache.is... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"GET",
",",
"uri",
"=",
"\"/assets\"",
")",
"public",
"Result",
"index",
"(",
")",
"{",
"if",
"(",
"configuration",
".",
"isProd",
"(",
")",
")",
"{",
"// Dumping assets is not enabled in PROD mode,",
"// ... | Serves the asset list page, or a JSON form depending on the {@literal ACCEPT} header.
@return the page, the json form or a bad request. Bad request are returned in "PROD" mode. | [
"Serves",
"the",
"asset",
"list",
"page",
"or",
"a",
"JSON",
"form",
"depending",
"on",
"the",
"{"
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/AssetsSingleton.java#L61-L78 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/ancillary/RelatedClassMap.java | RelatedClassMap.getCardinality | public Cardinality getCardinality(Class<? extends ElementBase> sourceClass, Class<? extends ElementBase> targetClass) {
"""
Returns the cardinality between two element classes.
@param sourceClass The primary class.
@param targetClass The class to test.
@return The cardinality in the class relationship (never ... | java | public Cardinality getCardinality(Class<? extends ElementBase> sourceClass, Class<? extends ElementBase> targetClass) {
Cardinalities cardinalities = getCardinalities(sourceClass);
Cardinality cardinality = cardinalities == null ? null : cardinalities.getCardinality(targetClass);
return cardinal... | [
"public",
"Cardinality",
"getCardinality",
"(",
"Class",
"<",
"?",
"extends",
"ElementBase",
">",
"sourceClass",
",",
"Class",
"<",
"?",
"extends",
"ElementBase",
">",
"targetClass",
")",
"{",
"Cardinalities",
"cardinalities",
"=",
"getCardinalities",
"(",
"source... | Returns the cardinality between two element classes.
@param sourceClass The primary class.
@param targetClass The class to test.
@return The cardinality in the class relationship (never null). | [
"Returns",
"the",
"cardinality",
"between",
"two",
"element",
"classes",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/ancillary/RelatedClassMap.java#L197-L201 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java | DataFactory.getFloat | private static Float getFloat(final AnnotationData pAnnotation, final BitUtils pBit) {
"""
Method use to get float
@param pAnnotation
annotation
@param pBit
bit utils
@return
"""
Float ret = null;
if (BCD_FORMAT.equals(pAnnotation.getFormat())) {
ret = Float.parseFloat(pBit.getNextHexaString(pAn... | java | private static Float getFloat(final AnnotationData pAnnotation, final BitUtils pBit) {
Float ret = null;
if (BCD_FORMAT.equals(pAnnotation.getFormat())) {
ret = Float.parseFloat(pBit.getNextHexaString(pAnnotation.getSize()));
} else {
ret = (float) getInteger(pAnnotation, pBit);
}
return ret;
} | [
"private",
"static",
"Float",
"getFloat",
"(",
"final",
"AnnotationData",
"pAnnotation",
",",
"final",
"BitUtils",
"pBit",
")",
"{",
"Float",
"ret",
"=",
"null",
";",
"if",
"(",
"BCD_FORMAT",
".",
"equals",
"(",
"pAnnotation",
".",
"getFormat",
"(",
")",
"... | Method use to get float
@param pAnnotation
annotation
@param pBit
bit utils
@return | [
"Method",
"use",
"to",
"get",
"float"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java#L172-L182 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/MementoResource.java | MementoResource.filterLinkParams | public static Link filterLinkParams(final Link link, final boolean filter) {
"""
Filter link parameters from a provided Link object, if configured to do so.
@param link the link
@param filter whether to filter the memento parameters
@return a Link without Memento parameters, if desired; otherwise, the original ... | java | public static Link filterLinkParams(final Link link, final boolean filter) {
// from and until parameters can cause problems with downstream applications because they contain commas. This
// method makes it possible to filter out those params, if desired. By default, they are not filtered out.
i... | [
"public",
"static",
"Link",
"filterLinkParams",
"(",
"final",
"Link",
"link",
",",
"final",
"boolean",
"filter",
")",
"{",
"// from and until parameters can cause problems with downstream applications because they contain commas. This",
"// method makes it possible to filter out those ... | Filter link parameters from a provided Link object, if configured to do so.
@param link the link
@param filter whether to filter the memento parameters
@return a Link without Memento parameters, if desired; otherwise, the original link | [
"Filter",
"link",
"parameters",
"from",
"a",
"provided",
"Link",
"object",
"if",
"configured",
"to",
"do",
"so",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/MementoResource.java#L184-L195 |
tencentyun/cos-java-sdk | src/main/java/com/qcloud/cos/op/FileOp.java | FileOp.uploadSingleFile | public String uploadSingleFile(UploadFileRequest request) throws AbstractCosException {
"""
上传单文件请求, 不分片
@param request
上传文件请求
@return JSON格式的字符串, 格式为{"code":$code, "message":"$mess"}, code为0表示成功,
其他为失败, message为success或者失败原因
@throws AbstractCosException
SDK定义的COS异常, 通常是输入参数有误或者环境问题(如网络不通)
"""
reques... | java | public String uploadSingleFile(UploadFileRequest request) throws AbstractCosException {
request.check_param();
String localPath = request.getLocalPath();
long fileSize = 0;
try {
fileSize = CommonFileUtils.getFileLength(localPath);
} catch (Exception e) {
throw new UnknownException(e.toString());
}
... | [
"public",
"String",
"uploadSingleFile",
"(",
"UploadFileRequest",
"request",
")",
"throws",
"AbstractCosException",
"{",
"request",
".",
"check_param",
"(",
")",
";",
"String",
"localPath",
"=",
"request",
".",
"getLocalPath",
"(",
")",
";",
"long",
"fileSize",
... | 上传单文件请求, 不分片
@param request
上传文件请求
@return JSON格式的字符串, 格式为{"code":$code, "message":"$mess"}, code为0表示成功,
其他为失败, message为success或者失败原因
@throws AbstractCosException
SDK定义的COS异常, 通常是输入参数有误或者环境问题(如网络不通) | [
"上传单文件请求",
"不分片"
] | train | https://github.com/tencentyun/cos-java-sdk/blob/6709a48f67c1ea7b82a7215f5037d6ccf218b630/src/main/java/com/qcloud/cos/op/FileOp.java#L179-L223 |
networknt/light-4j | dump/src/main/java/com/networknt/dump/QueryParametersDumper.java | QueryParametersDumper.dumpRequest | @Override
public void dumpRequest(Map<String, Object> result) {
"""
impl of dumping request query parameter to result
@param result A map you want to put dump information to
"""
exchange.getQueryParameters().forEach((k, v) -> {
if (config.getRequestFilteredQueryParameters().contains(k)... | java | @Override
public void dumpRequest(Map<String, Object> result) {
exchange.getQueryParameters().forEach((k, v) -> {
if (config.getRequestFilteredQueryParameters().contains(k)) {
//mask query parameter value
String queryParameterValue = config.isMaskEnabled() ? Mask.... | [
"@",
"Override",
"public",
"void",
"dumpRequest",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
")",
"{",
"exchange",
".",
"getQueryParameters",
"(",
")",
".",
"forEach",
"(",
"(",
"k",
",",
"v",
")",
"->",
"{",
"if",
"(",
"config",
".",
... | impl of dumping request query parameter to result
@param result A map you want to put dump information to | [
"impl",
"of",
"dumping",
"request",
"query",
"parameter",
"to",
"result"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/QueryParametersDumper.java#L39-L49 |
js-lib-com/commons | src/main/java/js/lang/Config.java | Config.getAttribute | public String getAttribute(String name, String defaultValue) {
"""
Get attribute value or given default value if there is no attribute with requested name. If given default value is
null and attribute is not found this method still returns null, that is, requested default value.
@param name attribute name.
@p... | java | public String getAttribute(String name, String defaultValue)
{
Params.notNullOrEmpty(name, "Attribute name");
return getAttribute(name, String.class, defaultValue);
} | [
"public",
"String",
"getAttribute",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"Params",
".",
"notNullOrEmpty",
"(",
"name",
",",
"\"Attribute name\"",
")",
";",
"return",
"getAttribute",
"(",
"name",
",",
"String",
".",
"class",
",",
"d... | Get attribute value or given default value if there is no attribute with requested name. If given default value is
null and attribute is not found this method still returns null, that is, requested default value.
@param name attribute name.
@param defaultValue default value, null or empty accepted.
@return attribute v... | [
"Get",
"attribute",
"value",
"or",
"given",
"default",
"value",
"if",
"there",
"is",
"no",
"attribute",
"with",
"requested",
"name",
".",
"If",
"given",
"default",
"value",
"is",
"null",
"and",
"attribute",
"is",
"not",
"found",
"this",
"method",
"still",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/lang/Config.java#L282-L286 |
jenkinsci/jenkins | core/src/main/java/hudson/util/EditDistance.java | EditDistance.findNearest | public static String findNearest( String key, String[] group ) {
"""
Finds the string in the <code>group</code> closest to
<code>key</code> and returns it.
@return null if group.length==0.
"""
return findNearest(key,Arrays.asList(group));
} | java | public static String findNearest( String key, String[] group ) {
return findNearest(key,Arrays.asList(group));
} | [
"public",
"static",
"String",
"findNearest",
"(",
"String",
"key",
",",
"String",
"[",
"]",
"group",
")",
"{",
"return",
"findNearest",
"(",
"key",
",",
"Arrays",
".",
"asList",
"(",
"group",
")",
")",
";",
"}"
] | Finds the string in the <code>group</code> closest to
<code>key</code> and returns it.
@return null if group.length==0. | [
"Finds",
"the",
"string",
"in",
"the",
"<code",
">",
"group<",
"/",
"code",
">",
"closest",
"to",
"<code",
">",
"key<",
"/",
"code",
">",
"and",
"returns",
"it",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/EditDistance.java#L53-L55 |
RallyTools/RallyRestToolkitForJava | src/main/java/com/rallydev/rest/client/HttpClient.java | HttpClient.doPost | public String doPost(String url, String body) throws IOException {
"""
Perform a post against the WSAPI
@param url the request url
@param body the body of the post
@return the JSON encoded string response
@throws IOException if a non-200 response code is returned or if some other
problem occurs while execu... | java | public String doPost(String url, String body) throws IOException {
HttpPost httpPost = new HttpPost(getWsapiUrl() + url);
httpPost.setEntity(new StringEntity(body, "utf-8"));
return doRequest(httpPost);
} | [
"public",
"String",
"doPost",
"(",
"String",
"url",
",",
"String",
"body",
")",
"throws",
"IOException",
"{",
"HttpPost",
"httpPost",
"=",
"new",
"HttpPost",
"(",
"getWsapiUrl",
"(",
")",
"+",
"url",
")",
";",
"httpPost",
".",
"setEntity",
"(",
"new",
"S... | Perform a post against the WSAPI
@param url the request url
@param body the body of the post
@return the JSON encoded string response
@throws IOException if a non-200 response code is returned or if some other
problem occurs while executing the request | [
"Perform",
"a",
"post",
"against",
"the",
"WSAPI"
] | train | https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/HttpClient.java#L176-L180 |
fozziethebeat/S-Space | opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java | LatentRelationalAnalysis.computeSVD | public Matrix computeSVD(Matrix sparse_matrix, int dimensions) {
"""
Does the Singular Value Decomposition using the generated sparse matrix.
The dimensions used cannot exceed the number of columns in the original
matrix.
@param sparse_matrix the sparse {@code Matrix}
@param dimensions the number of singular... | java | public Matrix computeSVD(Matrix sparse_matrix, int dimensions) {
try {
File rawTermDocMatrix =
File.createTempFile("lra-term-document-matrix", ".dat");
MatrixIO.writeMatrix(sparse_matrix, rawTermDocMatrix,
MatrixIO.Format.SVDLIBC_SPARSE_T... | [
"public",
"Matrix",
"computeSVD",
"(",
"Matrix",
"sparse_matrix",
",",
"int",
"dimensions",
")",
"{",
"try",
"{",
"File",
"rawTermDocMatrix",
"=",
"File",
".",
"createTempFile",
"(",
"\"lra-term-document-matrix\"",
",",
"\".dat\"",
")",
";",
"MatrixIO",
".",
"wr... | Does the Singular Value Decomposition using the generated sparse matrix.
The dimensions used cannot exceed the number of columns in the original
matrix.
@param sparse_matrix the sparse {@code Matrix}
@param dimensions the number of singular values to calculate
@return The decomposed word space {@link Matrix} | [
"Does",
"the",
"Singular",
"Value",
"Decomposition",
"using",
"the",
"generated",
"sparse",
"matrix",
".",
"The",
"dimensions",
"used",
"cannot",
"exceed",
"the",
"number",
"of",
"columns",
"in",
"the",
"original",
"matrix",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java#L914-L927 |
SQiShER/java-object-diff | src/main/java/de/danielbechler/util/Assert.java | Assert.hasText | public static void hasText(final String value, final String name) throws IllegalArgumentException {
"""
Ensures that the given <code>value</code> contains characters.
@param value The value to check.
@param name The name of the variable (used for the exception message).
@throws IllegalArgumentException If ... | java | public static void hasText(final String value, final String name) throws IllegalArgumentException
{
if (Strings.isEmpty(name)) // Yo dawg, I heard you like assertions, so I put an assertion in your assertion
{
throw new IllegalArgumentException("'name' must not be null or empty");
}
if (Strings.isEmpty(valu... | [
"public",
"static",
"void",
"hasText",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"Strings",
".",
"isEmpty",
"(",
"name",
")",
")",
"// Yo dawg, I heard you like assertions, so I put an... | Ensures that the given <code>value</code> contains characters.
@param value The value to check.
@param name The name of the variable (used for the exception message).
@throws IllegalArgumentException If the given value is <code>null</code> or doesn't contain any non-whitespace
characters. | [
"Ensures",
"that",
"the",
"given",
"<code",
">",
"value<",
"/",
"code",
">",
"contains",
"characters",
"."
] | train | https://github.com/SQiShER/java-object-diff/blob/6f576669d49087f0e825a417cadc3d4c707a4924/src/main/java/de/danielbechler/util/Assert.java#L77-L87 |
Erudika/para | para-server/src/main/java/com/erudika/para/rest/RestUtils.java | RestUtils.getReadResponse | public static Response getReadResponse(App app, ParaObject content) {
"""
Read response as JSON.
@param app the app object
@param content the object that was read
@return status code 200 or 404
"""
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
RestUtils.class, ... | java | public static Response getReadResponse(App app, ParaObject content) {
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
RestUtils.class, "crud", "read")) {
// app can't modify other apps except itself
if (app != null && content != null &&
checkImplicitAppPermissions... | [
"public",
"static",
"Response",
"getReadResponse",
"(",
"App",
"app",
",",
"ParaObject",
"content",
")",
"{",
"try",
"(",
"final",
"Metrics",
".",
"Context",
"context",
"=",
"Metrics",
".",
"time",
"(",
"app",
"==",
"null",
"?",
"null",
":",
"app",
".",
... | Read response as JSON.
@param app the app object
@param content the object that was read
@return status code 200 or 404 | [
"Read",
"response",
"as",
"JSON",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L296-L306 |
VoltDB/voltdb | src/frontend/org/voltdb/DefaultProcedureManager.java | DefaultProcedureManager.generateCrudExpressionColumns | private static void generateCrudExpressionColumns(Table table, StringBuilder sb) {
"""
Helper to generate a full col1 = ?, col2 = ?... clause.
@param table
@param sb
"""
boolean first = true;
// Sort the catalog table columns by column order.
ArrayList<Column> tableColumns = new Arra... | java | private static void generateCrudExpressionColumns(Table table, StringBuilder sb) {
boolean first = true;
// Sort the catalog table columns by column order.
ArrayList<Column> tableColumns = new ArrayList<Column>(table.getColumns().size());
for (Column c : table.getColumns()) {
... | [
"private",
"static",
"void",
"generateCrudExpressionColumns",
"(",
"Table",
"table",
",",
"StringBuilder",
"sb",
")",
"{",
"boolean",
"first",
"=",
"true",
";",
"// Sort the catalog table columns by column order.",
"ArrayList",
"<",
"Column",
">",
"tableColumns",
"=",
... | Helper to generate a full col1 = ?, col2 = ?... clause.
@param table
@param sb | [
"Helper",
"to",
"generate",
"a",
"full",
"col1",
"=",
"?",
"col2",
"=",
"?",
"...",
"clause",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DefaultProcedureManager.java#L282-L297 |
vdurmont/semver4j | src/main/java/com/vdurmont/semver4j/Requirement.java | Requirement.buildLoose | public static Requirement buildLoose(String requirement) {
"""
Builds a loose requirement (will test that the version is equivalent to the requirement)
@param requirement the version of the requirement
@return the generated requirement
"""
return build(new Semver(requirement, Semver.SemverType.LO... | java | public static Requirement buildLoose(String requirement) {
return build(new Semver(requirement, Semver.SemverType.LOOSE));
} | [
"public",
"static",
"Requirement",
"buildLoose",
"(",
"String",
"requirement",
")",
"{",
"return",
"build",
"(",
"new",
"Semver",
"(",
"requirement",
",",
"Semver",
".",
"SemverType",
".",
"LOOSE",
")",
")",
";",
"}"
] | Builds a loose requirement (will test that the version is equivalent to the requirement)
@param requirement the version of the requirement
@return the generated requirement | [
"Builds",
"a",
"loose",
"requirement",
"(",
"will",
"test",
"that",
"the",
"version",
"is",
"equivalent",
"to",
"the",
"requirement",
")"
] | train | https://github.com/vdurmont/semver4j/blob/3f0266e4985ac29e9da482e04001ed15fad6c3e2/src/main/java/com/vdurmont/semver4j/Requirement.java#L85-L87 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.setCursor | public void setCursor(Object object, String cursor) {
"""
Set a specific cursor on an element of this <code>GraphicsContext</code>.
@param object
the element on which the controller should be set.
@param cursor
The string representation of the cursor to use.
"""
if (isAttached()) {
helper.setCursor(... | java | public void setCursor(Object object, String cursor) {
if (isAttached()) {
helper.setCursor(object, cursor);
}
} | [
"public",
"void",
"setCursor",
"(",
"Object",
"object",
",",
"String",
"cursor",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"helper",
".",
"setCursor",
"(",
"object",
",",
"cursor",
")",
";",
"}",
"}"
] | Set a specific cursor on an element of this <code>GraphicsContext</code>.
@param object
the element on which the controller should be set.
@param cursor
The string representation of the cursor to use. | [
"Set",
"a",
"specific",
"cursor",
"on",
"an",
"element",
"of",
"this",
"<code",
">",
"GraphicsContext<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L679-L683 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java | CacheOnDisk.delCacheEntry | public void delCacheEntry(CacheEntry ce, int cause, int source, boolean fromDepIdTemplateInvalidation) {
"""
Call this method to a cache entry from the disk.
@param ce
- cache entry.
"""
htod.delCacheEntry(ce, cause, source, fromDepIdTemplateInvalidation);
} | java | public void delCacheEntry(CacheEntry ce, int cause, int source, boolean fromDepIdTemplateInvalidation) {
htod.delCacheEntry(ce, cause, source, fromDepIdTemplateInvalidation);
} | [
"public",
"void",
"delCacheEntry",
"(",
"CacheEntry",
"ce",
",",
"int",
"cause",
",",
"int",
"source",
",",
"boolean",
"fromDepIdTemplateInvalidation",
")",
"{",
"htod",
".",
"delCacheEntry",
"(",
"ce",
",",
"cause",
",",
"source",
",",
"fromDepIdTemplateInvalid... | Call this method to a cache entry from the disk.
@param ce
- cache entry. | [
"Call",
"this",
"method",
"to",
"a",
"cache",
"entry",
"from",
"the",
"disk",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java#L1287-L1289 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Bindings.java | Bindings.bindLabel | public static void bindLabel (final Value<String> value, final HasText target) {
"""
Binds the specified string value to the supplied text-having widget. The binding is one-way,
in that only changes to the value will be reflected in the text-having widget. It is
expected that no other changes will be made to the... | java | public static void bindLabel (final Value<String> value, final HasText target)
{
value.addListenerAndTrigger(new Value.Listener<String>() {
public void valueChanged (String value) {
// avoid updating the target if the value is already the same; in the case where
/... | [
"public",
"static",
"void",
"bindLabel",
"(",
"final",
"Value",
"<",
"String",
">",
"value",
",",
"final",
"HasText",
"target",
")",
"{",
"value",
".",
"addListenerAndTrigger",
"(",
"new",
"Value",
".",
"Listener",
"<",
"String",
">",
"(",
")",
"{",
"pub... | Binds the specified string value to the supplied text-having widget. The binding is one-way,
in that only changes to the value will be reflected in the text-having widget. It is
expected that no other changes will be made to the widget. | [
"Binds",
"the",
"specified",
"string",
"value",
"to",
"the",
"supplied",
"text",
"-",
"having",
"widget",
".",
"The",
"binding",
"is",
"one",
"-",
"way",
"in",
"that",
"only",
"changes",
"to",
"the",
"value",
"will",
"be",
"reflected",
"in",
"the",
"text... | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L142-L154 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.changeCustomAttribute | public CustomAttribute changeCustomAttribute(final Object userIdOrUsername, final String key, final String value) throws GitLabApiException {
"""
Changes custom attribute for the given user
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param key for the ... | java | public CustomAttribute changeCustomAttribute(final Object userIdOrUsername, final String key, final String value) throws GitLabApiException {
return createCustomAttribute(userIdOrUsername, key, value);
} | [
"public",
"CustomAttribute",
"changeCustomAttribute",
"(",
"final",
"Object",
"userIdOrUsername",
",",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"throws",
"GitLabApiException",
"{",
"return",
"createCustomAttribute",
"(",
"userIdOrUsername",
",",
... | Changes custom attribute for the given user
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param key for the customAttribute
@param value for the customAttribute
@return changedCustomAttribute
@throws GitLabApiException on failure while changing customAttributes | [
"Changes",
"custom",
"attribute",
"for",
"the",
"given",
"user"
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L954-L956 |
jenkinsci/jenkins | core/src/main/java/hudson/Util.java | Util.replaceMacro | @Nullable
public static String replaceMacro( @CheckForNull String s, @Nonnull Map<String,String> properties) {
"""
Replaces the occurrence of '$key' by {@code properties.get('key')}.
<p>
Unlike shell, undefined variables are left as-is (this behavior is the same as Ant.)
"""
return replaceMacro... | java | @Nullable
public static String replaceMacro( @CheckForNull String s, @Nonnull Map<String,String> properties) {
return replaceMacro(s, new VariableResolver.ByMap<>(properties));
} | [
"@",
"Nullable",
"public",
"static",
"String",
"replaceMacro",
"(",
"@",
"CheckForNull",
"String",
"s",
",",
"@",
"Nonnull",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"return",
"replaceMacro",
"(",
"s",
",",
"new",
"VariableResolver",... | Replaces the occurrence of '$key' by {@code properties.get('key')}.
<p>
Unlike shell, undefined variables are left as-is (this behavior is the same as Ant.) | [
"Replaces",
"the",
"occurrence",
"of",
"$key",
"by",
"{",
"@code",
"properties",
".",
"get",
"(",
"key",
")",
"}",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Util.java#L145-L148 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java | RouterClient.insertRouter | @BetaApi
public final Operation insertRouter(String region, Router routerResource) {
"""
Creates a Router resource in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (RouterClient routerClient = RouterClient.create()) {
ProjectRegionName region = ... | java | @BetaApi
public final Operation insertRouter(String region, Router routerResource) {
InsertRouterHttpRequest request =
InsertRouterHttpRequest.newBuilder()
.setRegion(region)
.setRouterResource(routerResource)
.build();
return insertRouter(request);
} | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertRouter",
"(",
"String",
"region",
",",
"Router",
"routerResource",
")",
"{",
"InsertRouterHttpRequest",
"request",
"=",
"InsertRouterHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setRegion",
"(",
"region",
... | Creates a Router resource in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (RouterClient routerClient = RouterClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
Router routerResource = Router.newBuilder().build();
Ope... | [
"Creates",
"a",
"Router",
"resource",
"in",
"the",
"specified",
"project",
"and",
"region",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java#L777-L786 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_worklight_new_duration_GET | public OvhOrder license_worklight_new_duration_GET(String duration, String ip, Boolean lessThan1000Users, OvhWorkLightVersionEnum version) throws IOException {
"""
Get prices and contracts information
REST: GET /order/license/worklight/new/{duration}
@param version [required] This license version
@param ip [r... | java | public OvhOrder license_worklight_new_duration_GET(String duration, String ip, Boolean lessThan1000Users, OvhWorkLightVersionEnum version) throws IOException {
String qPath = "/order/license/worklight/new/{duration}";
StringBuilder sb = path(qPath, duration);
query(sb, "ip", ip);
query(sb, "lessThan1000Users", ... | [
"public",
"OvhOrder",
"license_worklight_new_duration_GET",
"(",
"String",
"duration",
",",
"String",
"ip",
",",
"Boolean",
"lessThan1000Users",
",",
"OvhWorkLightVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/license/worklig... | Get prices and contracts information
REST: GET /order/license/worklight/new/{duration}
@param version [required] This license version
@param ip [required] Ip on which this license would be installed (for dedicated your main server Ip)
@param lessThan1000Users [required] Does your company have less than 1000 potential ... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1559-L1567 |
rey5137/material | material/src/main/java/com/rey/material/widget/EditText.java | EditText.setTextKeepState | public final void setTextKeepState (CharSequence text, TextView.BufferType type) {
"""
Like {@link #setText(CharSequence, TextView.BufferType)},
except that the cursor position (if any) is retained in the new text.
@see #setText(CharSequence, TextView.BufferType)
"""
mInputView.setTextKeepState(text, typ... | java | public final void setTextKeepState (CharSequence text, TextView.BufferType type){
mInputView.setTextKeepState(text, type);
} | [
"public",
"final",
"void",
"setTextKeepState",
"(",
"CharSequence",
"text",
",",
"TextView",
".",
"BufferType",
"type",
")",
"{",
"mInputView",
".",
"setTextKeepState",
"(",
"text",
",",
"type",
")",
";",
"}"
] | Like {@link #setText(CharSequence, TextView.BufferType)},
except that the cursor position (if any) is retained in the new text.
@see #setText(CharSequence, TextView.BufferType) | [
"Like",
"{",
"@link",
"#setText",
"(",
"CharSequence",
"TextView",
".",
"BufferType",
")",
"}",
"except",
"that",
"the",
"cursor",
"position",
"(",
"if",
"any",
")",
"is",
"retained",
"in",
"the",
"new",
"text",
"."
] | train | https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/EditText.java#L3521-L3523 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getSiblingCount | public int getSiblingCount(Geometry geometry, GeometryIndex index) {
"""
Given a certain index, how many indices of the same type can be found within the given geometry. This count
includes the given index.<br>
For example, if the index points to a vertex on a LinearRing within a polygon, then this will return t... | java | public int getSiblingCount(Geometry geometry, GeometryIndex index) {
if (index.hasChild() && geometry.getGeometries() != null &&
geometry.getGeometries().length > index.getValue()) {
return getSiblingCount(geometry.getGeometries()[index.getValue()], index.getChild());
}
switch (index.getType()) {
case ... | [
"public",
"int",
"getSiblingCount",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
"&&",
"geometry",
".",
"getGeometries",
"(",
")",
"!=",
"null",
"&&",
"geometry",
".",
"getGeometries",
... | Given a certain index, how many indices of the same type can be found within the given geometry. This count
includes the given index.<br>
For example, if the index points to a vertex on a LinearRing within a polygon, then this will return the amount
of vertices on that LinearRing.
@param geometry
The geometry to look ... | [
"Given",
"a",
"certain",
"index",
"how",
"many",
"indices",
"of",
"the",
"same",
"type",
"can",
"be",
"found",
"within",
"the",
"given",
"geometry",
".",
"This",
"count",
"includes",
"the",
"given",
"index",
".",
"<br",
">",
"For",
"example",
"if",
"the"... | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L536-L559 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentItemPersistenceImpl.java | CommerceShipmentItemPersistenceImpl.findByGroupId | @Override
public List<CommerceShipmentItem> findByGroupId(long groupId) {
"""
Returns all the commerce shipment items where groupId = ?.
@param groupId the group ID
@return the matching commerce shipment items
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceShipmentItem> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShipmentItem",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
... | Returns all the commerce shipment items where groupId = ?.
@param groupId the group ID
@return the matching commerce shipment items | [
"Returns",
"all",
"the",
"commerce",
"shipment",
"items",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentItemPersistenceImpl.java#L122-L125 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.handleServerHeaderDecodeSizeError | protected void handleServerHeaderDecodeSizeError(ChannelHandlerContext ctx, Http2Stream stream) {
"""
Notifies client that this server has received headers that are larger than what it is
willing to accept. Override to change behavior.
@param ctx the channel context
@param stream the Http2Stream on which the ... | java | protected void handleServerHeaderDecodeSizeError(ChannelHandlerContext ctx, Http2Stream stream) {
encoder().writeHeaders(ctx, stream.id(), HEADERS_TOO_LARGE_HEADERS, 0, true, ctx.newPromise());
} | [
"protected",
"void",
"handleServerHeaderDecodeSizeError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Http2Stream",
"stream",
")",
"{",
"encoder",
"(",
")",
".",
"writeHeaders",
"(",
"ctx",
",",
"stream",
".",
"id",
"(",
")",
",",
"HEADERS_TOO_LARGE_HEADERS",
",",
... | Notifies client that this server has received headers that are larger than what it is
willing to accept. Override to change behavior.
@param ctx the channel context
@param stream the Http2Stream on which the header was received | [
"Notifies",
"client",
"that",
"this",
"server",
"has",
"received",
"headers",
"that",
"are",
"larger",
"than",
"what",
"it",
"is",
"willing",
"to",
"accept",
".",
"Override",
"to",
"change",
"behavior",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L732-L734 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java | ThreadLocalRandom.longs | public LongStream longs(long streamSize) {
"""
Returns a stream producing the given {@code streamSize} number of
pseudorandom {@code long} values.
@param streamSize the number of values to generate
@return a stream of pseudorandom {@code long} values
@throws IllegalArgumentException if {@code streamSize} is
... | java | public LongStream longs(long streamSize) {
if (streamSize < 0L)
throw new IllegalArgumentException(BAD_SIZE);
return StreamSupport.longStream
(new RandomLongsSpliterator
(0L, streamSize, Long.MAX_VALUE, 0L),
false);
} | [
"public",
"LongStream",
"longs",
"(",
"long",
"streamSize",
")",
"{",
"if",
"(",
"streamSize",
"<",
"0L",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"BAD_SIZE",
")",
";",
"return",
"StreamSupport",
".",
"longStream",
"(",
"new",
"RandomLongsSpliterato... | Returns a stream producing the given {@code streamSize} number of
pseudorandom {@code long} values.
@param streamSize the number of values to generate
@return a stream of pseudorandom {@code long} values
@throws IllegalArgumentException if {@code streamSize} is
less than zero
@since 1.8 | [
"Returns",
"a",
"stream",
"producing",
"the",
"given",
"{",
"@code",
"streamSize",
"}",
"number",
"of",
"pseudorandom",
"{",
"@code",
"long",
"}",
"values",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java#L562-L569 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findIndexOf | public static <T> int findIndexOf(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
"""
Iterates over the elements of an Iterator and returns the index of the first item that satisfies the
condition specified by the closure.
@param self an Iterator
@param condition ... | java | public static <T> int findIndexOf(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
return findIndexOf(self, 0, condition);
} | [
"public",
"static",
"<",
"T",
">",
"int",
"findIndexOf",
"(",
"Iterator",
"<",
"T",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"FirstGenericType",
".",
"class",
")",
"Closure",
"condition",
")",
"{",
"return",
"findIndexOf",
"(",
"self... | Iterates over the elements of an Iterator and returns the index of the first item that satisfies the
condition specified by the closure.
@param self an Iterator
@param condition the matching condition
@return an integer that is the index of the first matched object or -1 if no match was found
@since 2.5.0 | [
"Iterates",
"over",
"the",
"elements",
"of",
"an",
"Iterator",
"and",
"returns",
"the",
"index",
"of",
"the",
"first",
"item",
"that",
"satisfies",
"the",
"condition",
"specified",
"by",
"the",
"closure",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16722-L16724 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.getPasswordlessAuthenticationAccount | public static <T> T getPasswordlessAuthenticationAccount(final RequestContext event, final Class<T> clazz) {
"""
Gets passwordless authentication account.
@param <T> the type parameter
@param event the event
@param clazz the clazz
@return the passwordless authentication account
"""
return getPa... | java | public static <T> T getPasswordlessAuthenticationAccount(final RequestContext event, final Class<T> clazz) {
return getPasswordlessAuthenticationAccount(event.getCurrentEvent(), clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getPasswordlessAuthenticationAccount",
"(",
"final",
"RequestContext",
"event",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"getPasswordlessAuthenticationAccount",
"(",
"event",
".",
"getCurrentEvent",
... | Gets passwordless authentication account.
@param <T> the type parameter
@param event the event
@param clazz the clazz
@return the passwordless authentication account | [
"Gets",
"passwordless",
"authentication",
"account",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L861-L863 |
ykrasik/jaci | jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java | ReflectionUtils.invokeNoArgs | @SuppressWarnings("unchecked")
public static <T> T invokeNoArgs(Object instance, ReflectionMethod method) {
"""
Invokes the method, using the provided instance as 'this'.
Method must be no-args and have a return value of type {@code T}.
If the method is private, it will be made accessible outside of it's cla... | java | @SuppressWarnings("unchecked")
public static <T> T invokeNoArgs(Object instance, ReflectionMethod method) {
method.setAccessible(true);
try {
return (T) method.invoke(instance, NO_ARGS);
} catch (Exception e) {
throw SneakyException.sneakyThrow(e);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"invokeNoArgs",
"(",
"Object",
"instance",
",",
"ReflectionMethod",
"method",
")",
"{",
"method",
".",
"setAccessible",
"(",
"true",
")",
";",
"try",
"{",
"return",
... | Invokes the method, using the provided instance as 'this'.
Method must be no-args and have a return value of type {@code T}.
If the method is private, it will be made accessible outside of it's class.
@param instance Instance to use as 'this' for invocation.
@param method Method to invoke.
@param <T> Return type.
@ret... | [
"Invokes",
"the",
"method",
"using",
"the",
"provided",
"instance",
"as",
"this",
".",
"Method",
"must",
"be",
"no",
"-",
"args",
"and",
"have",
"a",
"return",
"value",
"of",
"type",
"{",
"@code",
"T",
"}",
".",
"If",
"the",
"method",
"is",
"private",
... | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java#L190-L198 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.getOptionallyThrottledFileSystem | public static FileSystem getOptionallyThrottledFileSystem(FileSystem fs, int qpsLimit) throws IOException {
"""
Get a throttled {@link FileSystem} that limits the number of queries per second to a {@link FileSystem}. If
the input qps is <= 0, no such throttling will be performed.
@throws IOException
"""
... | java | public static FileSystem getOptionallyThrottledFileSystem(FileSystem fs, int qpsLimit) throws IOException {
if (fs instanceof Decorator) {
for (Object obj : DecoratorUtils.getDecoratorLineage(fs)) {
if (obj instanceof RateControlledFileSystem) {
// Already rate controlled
return fs... | [
"public",
"static",
"FileSystem",
"getOptionallyThrottledFileSystem",
"(",
"FileSystem",
"fs",
",",
"int",
"qpsLimit",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fs",
"instanceof",
"Decorator",
")",
"{",
"for",
"(",
"Object",
"obj",
":",
"DecoratorUtils",
".... | Get a throttled {@link FileSystem} that limits the number of queries per second to a {@link FileSystem}. If
the input qps is <= 0, no such throttling will be performed.
@throws IOException | [
"Get",
"a",
"throttled",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L558-L578 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/network/MalisisNetwork.java | MalisisNetwork.registerMessage | public <REQ extends IMessage, REPLY extends IMessage> void registerMessage(Class<? extends IMessageHandler<REQ, REPLY>> messageHandler, Class<REQ> requestMessageType, Side side) {
"""
Register a message with the next discriminator available.
@param <REQ> the generic type
@param <REPLY> the generic type
@param... | java | public <REQ extends IMessage, REPLY extends IMessage> void registerMessage(Class<? extends IMessageHandler<REQ, REPLY>> messageHandler, Class<REQ> requestMessageType, Side side)
{
super.registerMessage(messageHandler, requestMessageType, discriminator++, side);
MalisisCore.log.info("Registering " + messageHandler.... | [
"public",
"<",
"REQ",
"extends",
"IMessage",
",",
"REPLY",
"extends",
"IMessage",
">",
"void",
"registerMessage",
"(",
"Class",
"<",
"?",
"extends",
"IMessageHandler",
"<",
"REQ",
",",
"REPLY",
">",
">",
"messageHandler",
",",
"Class",
"<",
"REQ",
">",
"re... | Register a message with the next discriminator available.
@param <REQ> the generic type
@param <REPLY> the generic type
@param messageHandler the message handler
@param requestMessageType the request message type
@param side the side | [
"Register",
"a",
"message",
"with",
"the",
"next",
"discriminator",
"available",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/network/MalisisNetwork.java#L98-L103 |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/OrchestrationMasterSlaveDataSourceFactory.java | OrchestrationMasterSlaveDataSourceFactory.createDataSource | public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig,
final Properties props, final OrchestrationConfiguration orchestrationConfig) throws SQLException {
"""
Create master-slave... | java | public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig,
final Properties props, final OrchestrationConfiguration orchestrationConfig) throws SQLException {
if (null == masterSl... | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"final",
"Map",
"<",
"String",
",",
"DataSource",
">",
"dataSourceMap",
",",
"final",
"MasterSlaveRuleConfiguration",
"masterSlaveRuleConfig",
",",
"final",
"Properties",
"props",
",",
"final",
"OrchestrationCon... | Create master-slave data source.
@param dataSourceMap data source map
@param masterSlaveRuleConfig master-slave rule configuration
@param props properties
@param orchestrationConfig orchestration configuration
@return master-slave data source
@throws SQLException SQL exception | [
"Create",
"master",
"-",
"slave",
"data",
"source",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/OrchestrationMasterSlaveDataSourceFactory.java#L50-L57 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/StartStreamHandler.java | StartStreamHandler.channelActive | @Override
public void channelActive(final ChannelHandlerContext ctx) throws Exception {
"""
Once the channel is active, start to send the HTTP request to begin chunking.
"""
String terseUri = "/pools/default/bs/" + bucket;
FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, Htt... | java | @Override
public void channelActive(final ChannelHandlerContext ctx) throws Exception {
String terseUri = "/pools/default/bs/" + bucket;
FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, terseUri);
request.headers().add(HttpHeaders.Names.ACCEPT, "application/json")... | [
"@",
"Override",
"public",
"void",
"channelActive",
"(",
"final",
"ChannelHandlerContext",
"ctx",
")",
"throws",
"Exception",
"{",
"String",
"terseUri",
"=",
"\"/pools/default/bs/\"",
"+",
"bucket",
";",
"FullHttpRequest",
"request",
"=",
"new",
"DefaultFullHttpReques... | Once the channel is active, start to send the HTTP request to begin chunking. | [
"Once",
"the",
"channel",
"is",
"active",
"start",
"to",
"send",
"the",
"HTTP",
"request",
"to",
"begin",
"chunking",
"."
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/StartStreamHandler.java#L54-L61 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java | UserCredentialsFileRepository.getUserKey | private String getUserKey( AppInfo appInfo, String userId ) {
"""
Builds the key of a credentials according to a given appInfo and userId
@param appInfo The application informations
@param userId The user identifier
@return The user key
"""
if ( userId == null ) {
throw new IllegalArgu... | java | private String getUserKey( AppInfo appInfo, String userId )
{
if ( userId == null ) {
throw new IllegalArgumentException( "userId should not be null" );
}
return String.format( "%s%s", getAppPrefix( appInfo ), userId );
} | [
"private",
"String",
"getUserKey",
"(",
"AppInfo",
"appInfo",
",",
"String",
"userId",
")",
"{",
"if",
"(",
"userId",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"userId should not be null\"",
")",
";",
"}",
"return",
"String",
"... | Builds the key of a credentials according to a given appInfo and userId
@param appInfo The application informations
@param userId The user identifier
@return The user key | [
"Builds",
"the",
"key",
"of",
"a",
"credentials",
"according",
"to",
"a",
"given",
"appInfo",
"and",
"userId"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java#L189-L196 |
joniles/mpxj | src/main/java/net/sf/mpxj/RecurringData.java | RecurringData.getDailyDates | private void getDailyDates(Calendar calendar, int frequency, List<Date> dates) {
"""
Calculate start dates for a daily recurrence.
@param calendar current date
@param frequency frequency
@param dates array of start dates
"""
while (moreDates(calendar, dates))
{
dates.add(calendar.getT... | java | private void getDailyDates(Calendar calendar, int frequency, List<Date> dates)
{
while (moreDates(calendar, dates))
{
dates.add(calendar.getTime());
calendar.add(Calendar.DAY_OF_YEAR, frequency);
}
} | [
"private",
"void",
"getDailyDates",
"(",
"Calendar",
"calendar",
",",
"int",
"frequency",
",",
"List",
"<",
"Date",
">",
"dates",
")",
"{",
"while",
"(",
"moreDates",
"(",
"calendar",
",",
"dates",
")",
")",
"{",
"dates",
".",
"add",
"(",
"calendar",
"... | Calculate start dates for a daily recurrence.
@param calendar current date
@param frequency frequency
@param dates array of start dates | [
"Calculate",
"start",
"dates",
"for",
"a",
"daily",
"recurrence",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L401-L408 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/script/ScriptValidationContext.java | ScriptValidationContext.getValidationScript | public String getValidationScript(TestContext context) {
"""
Constructs the actual validation script either from data or external resource.
@param context the current TestContext.
@return the validationScript
@throws CitrusRuntimeException
"""
try {
if (validationScriptResourcePath != nu... | java | public String getValidationScript(TestContext context) {
try {
if (validationScriptResourcePath != null) {
return context.replaceDynamicContentInString(FileUtils.readToString(FileUtils.getFileResource(validationScriptResourcePath, context),
Charset.forName(con... | [
"public",
"String",
"getValidationScript",
"(",
"TestContext",
"context",
")",
"{",
"try",
"{",
"if",
"(",
"validationScriptResourcePath",
"!=",
"null",
")",
"{",
"return",
"context",
".",
"replaceDynamicContentInString",
"(",
"FileUtils",
".",
"readToString",
"(",
... | Constructs the actual validation script either from data or external resource.
@param context the current TestContext.
@return the validationScript
@throws CitrusRuntimeException | [
"Constructs",
"the",
"actual",
"validation",
"script",
"either",
"from",
"data",
"or",
"external",
"resource",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/script/ScriptValidationContext.java#L75-L88 |
allcolor/YaHP-Converter | YaHPConverter/src/org/allcolor/yahp/converter/CMutex.java | CMutex.acquireMultiple | public static final void acquireMultiple(long timeout, CMutex mutex[])
throws RuntimeException {
"""
Acquires an array of mutex
@param timeout
maximum time to wait
@param mutex
the mutex array to acquire
@throws RuntimeException
if timeout is reached
"""
Arrays.sort(mutex, new CMutexComparator()... | java | public static final void acquireMultiple(long timeout, CMutex mutex[])
throws RuntimeException {
Arrays.sort(mutex, new CMutexComparator());
for (int i = 0; i < mutex.length; i++) {
try {
mutex[i].acquire(timeout);
} catch (RuntimeException re) {
// release successfuly acquired mutex.
for (int ... | [
"public",
"static",
"final",
"void",
"acquireMultiple",
"(",
"long",
"timeout",
",",
"CMutex",
"mutex",
"[",
"]",
")",
"throws",
"RuntimeException",
"{",
"Arrays",
".",
"sort",
"(",
"mutex",
",",
"new",
"CMutexComparator",
"(",
")",
")",
";",
"for",
"(",
... | Acquires an array of mutex
@param timeout
maximum time to wait
@param mutex
the mutex array to acquire
@throws RuntimeException
if timeout is reached | [
"Acquires",
"an",
"array",
"of",
"mutex"
] | train | https://github.com/allcolor/YaHP-Converter/blob/d72745281766a784a6b319f3787aa1d8de7cd0fe/YaHPConverter/src/org/allcolor/yahp/converter/CMutex.java#L94-L110 |
ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/dbschema/DatabaseRelationDefinition.java | DatabaseRelationDefinition.addAttribute | public Attribute addAttribute(QuotedID id, int type, String typeName, boolean canNull) {
"""
creates a new attribute
@param id
@param type
@param typeName
@param canNull
"""
Attribute att = new Attribute(this, new QualifiedAttributeID(getID(), id),
attributes.size() + 1, type, typeName, canNull,
... | java | public Attribute addAttribute(QuotedID id, int type, String typeName, boolean canNull) {
Attribute att = new Attribute(this, new QualifiedAttributeID(getID(), id),
attributes.size() + 1, type, typeName, canNull,
typeMapper.getTermType(type, typeName));
//check for duplicate names (put returns the previou... | [
"public",
"Attribute",
"addAttribute",
"(",
"QuotedID",
"id",
",",
"int",
"type",
",",
"String",
"typeName",
",",
"boolean",
"canNull",
")",
"{",
"Attribute",
"att",
"=",
"new",
"Attribute",
"(",
"this",
",",
"new",
"QualifiedAttributeID",
"(",
"getID",
"(",... | creates a new attribute
@param id
@param type
@param typeName
@param canNull | [
"creates",
"a",
"new",
"attribute"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/dbschema/DatabaseRelationDefinition.java#L66-L78 |
NextFaze/power-adapters | power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java | PowerAdapter.asAdapter | @CheckResult
@NonNull
public static PowerAdapter asAdapter(@NonNull @LayoutRes int... resources) {
"""
Converts the specified fixed array of layout resources to an adapter.
"""
return new ItemAdapter(toItems(checkNotNull(resources, "resources")));
} | java | @CheckResult
@NonNull
public static PowerAdapter asAdapter(@NonNull @LayoutRes int... resources) {
return new ItemAdapter(toItems(checkNotNull(resources, "resources")));
} | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"static",
"PowerAdapter",
"asAdapter",
"(",
"@",
"NonNull",
"@",
"LayoutRes",
"int",
"...",
"resources",
")",
"{",
"return",
"new",
"ItemAdapter",
"(",
"toItems",
"(",
"checkNotNull",
"(",
"resources",
",",
"\"reso... | Converts the specified fixed array of layout resources to an adapter. | [
"Converts",
"the",
"specified",
"fixed",
"array",
"of",
"layout",
"resources",
"to",
"an",
"adapter",
"."
] | train | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java#L619-L623 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/FeatureUtil.java | FeatureUtil.toOutcomeMatrix | public static INDArray toOutcomeMatrix(int[] index, long numOutcomes) {
"""
Creates an out come vector from the specified inputs
@param index the index of the label
@param numOutcomes the number of possible outcomes
@return a binary label matrix used for supervised learning
"""
INDArray ret ... | java | public static INDArray toOutcomeMatrix(int[] index, long numOutcomes) {
INDArray ret = Nd4j.create(index.length, numOutcomes);
for (int i = 0; i < ret.rows(); i++) {
int[] nums = new int[(int) numOutcomes];
nums[index[i]] = 1;
ret.putRow(i, NDArrayUtil.toNDArray(nums)... | [
"public",
"static",
"INDArray",
"toOutcomeMatrix",
"(",
"int",
"[",
"]",
"index",
",",
"long",
"numOutcomes",
")",
"{",
"INDArray",
"ret",
"=",
"Nd4j",
".",
"create",
"(",
"index",
".",
"length",
",",
"numOutcomes",
")",
";",
"for",
"(",
"int",
"i",
"=... | Creates an out come vector from the specified inputs
@param index the index of the label
@param numOutcomes the number of possible outcomes
@return a binary label matrix used for supervised learning | [
"Creates",
"an",
"out",
"come",
"vector",
"from",
"the",
"specified",
"inputs"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/FeatureUtil.java#L51-L60 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/Utils.java | Utils.join | @SuppressWarnings( {
"""
配列の要素を指定した区切り文字で繋げて1つの文字列とする。
@param arrays 結合対象の配列
@param separator 区切り文字
@param elementConverter 要素を変換するクラス。
@return 結合した文字列
""""rawtypes", "unchecked"})
public static String join(final Object[] arrays, final String separator, final ElementConverter elementConverter) {
... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static String join(final Object[] arrays, final String separator, final ElementConverter elementConverter) {
if(arrays == null) {
return "";
}
final int len = arrays.length;
if(len == 0) {
return "... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"String",
"join",
"(",
"final",
"Object",
"[",
"]",
"arrays",
",",
"final",
"String",
"separator",
",",
"final",
"ElementConverter",
"elementConverter",
")",
... | 配列の要素を指定した区切り文字で繋げて1つの文字列とする。
@param arrays 結合対象の配列
@param separator 区切り文字
@param elementConverter 要素を変換するクラス。
@return 結合した文字列 | [
"配列の要素を指定した区切り文字で繋げて1つの文字列とする。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/Utils.java#L119-L143 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.sub | public static <T> List<T> sub(List<T> list, int start, int end) {
"""
截取集合的部分
@param <T> 集合元素类型
@param list 被截取的数组
@param start 开始位置(包含)
@param end 结束位置(不包含)
@return 截取后的数组,当开始位置超过最大时,返回空的List
"""
return sub(list, start, end, 1);
} | java | public static <T> List<T> sub(List<T> list, int start, int end) {
return sub(list, start, end, 1);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"sub",
"(",
"List",
"<",
"T",
">",
"list",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"sub",
"(",
"list",
",",
"start",
",",
"end",
",",
"1",
")",
";",
"}"
] | 截取集合的部分
@param <T> 集合元素类型
@param list 被截取的数组
@param start 开始位置(包含)
@param end 结束位置(不包含)
@return 截取后的数组,当开始位置超过最大时,返回空的List | [
"截取集合的部分"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L814-L816 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ChineseCalendar.java | ChineseCalendar.newMoonNear | private int newMoonNear(int days, boolean after) {
"""
Return the closest new moon to the given date, searching either
forward or backward in time.
@param days days after January 1, 1970 0:00 Asia/Shanghai
@param after if true, search for a new moon on or after the given
date; otherwise, search for a new moon ... | java | private int newMoonNear(int days, boolean after) {
astro.setTime(daysToMillis(days));
long newMoon = astro.getMoonTime(CalendarAstronomer.NEW_MOON, after);
return millisToDays(newMoon);
} | [
"private",
"int",
"newMoonNear",
"(",
"int",
"days",
",",
"boolean",
"after",
")",
"{",
"astro",
".",
"setTime",
"(",
"daysToMillis",
"(",
"days",
")",
")",
";",
"long",
"newMoon",
"=",
"astro",
".",
"getMoonTime",
"(",
"CalendarAstronomer",
".",
"NEW_MOON... | Return the closest new moon to the given date, searching either
forward or backward in time.
@param days days after January 1, 1970 0:00 Asia/Shanghai
@param after if true, search for a new moon on or after the given
date; otherwise, search for a new moon before it
@return days after January 1, 1970 0:00 Asia/Shanghai ... | [
"Return",
"the",
"closest",
"new",
"moon",
"to",
"the",
"given",
"date",
"searching",
"either",
"forward",
"or",
"backward",
"in",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ChineseCalendar.java#L712-L718 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsLightTrace.java | CommsLightTrace.traceTransaction | public static void traceTransaction(TraceComponent callersTrace, String action, Object transaction, int commsId, int commsFlags) {
"""
Trace a transaction associated with an action.
@param callersTrace The trace component of the caller
@param action A string (no spaces) provided by the caller to prefix the keywo... | java | public static void traceTransaction(TraceComponent callersTrace, String action, Object transaction, int commsId, int commsFlags)
{
if (light_tc.isDebugEnabled() || callersTrace.isDebugEnabled()) {
// Build the trace string
String traceText = action + ": " + transaction +
" CommsId:" + co... | [
"public",
"static",
"void",
"traceTransaction",
"(",
"TraceComponent",
"callersTrace",
",",
"String",
"action",
",",
"Object",
"transaction",
",",
"int",
"commsId",
",",
"int",
"commsFlags",
")",
"{",
"if",
"(",
"light_tc",
".",
"isDebugEnabled",
"(",
")",
"||... | Trace a transaction associated with an action.
@param callersTrace The trace component of the caller
@param action A string (no spaces) provided by the caller to prefix the keyword included in the trace line
@param transaction An optional transaction associated with the action being performed on the message
@param comm... | [
"Trace",
"a",
"transaction",
"associated",
"with",
"an",
"action",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsLightTrace.java#L135-L150 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newFormatException | public static FormatException newFormatException(String message, Object... args) {
"""
Constructs and initializes a new {@link FormatException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link FormatException exceptio... | java | public static FormatException newFormatException(String message, Object... args) {
return newFormatException(null, message, args);
} | [
"public",
"static",
"FormatException",
"newFormatException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newFormatException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link FormatException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link FormatException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link St... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"FormatException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L703-L705 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java | MavenProjectScannerPlugin.scanFile | private <F extends FileDescriptor> F scanFile(MavenProjectDirectoryDescriptor projectDescriptor, File file, String path, Scope scope, Scanner scanner) {
"""
Scan a given file.
<p>
The current project is pushed to the context.
</p>
@param projectDescriptor
The maven project descriptor.
@param file
The fi... | java | private <F extends FileDescriptor> F scanFile(MavenProjectDirectoryDescriptor projectDescriptor, File file, String path, Scope scope, Scanner scanner) {
scanner.getContext().push(MavenProjectDirectoryDescriptor.class, projectDescriptor);
try {
return scanner.scan(file, path, scope);
... | [
"private",
"<",
"F",
"extends",
"FileDescriptor",
">",
"F",
"scanFile",
"(",
"MavenProjectDirectoryDescriptor",
"projectDescriptor",
",",
"File",
"file",
",",
"String",
"path",
",",
"Scope",
"scope",
",",
"Scanner",
"scanner",
")",
"{",
"scanner",
".",
"getConte... | Scan a given file.
<p>
The current project is pushed to the context.
</p>
@param projectDescriptor
The maven project descriptor.
@param file
The file.
@param path
The path.
@param scope
The scope.
@param scanner
The scanner. | [
"Scan",
"a",
"given",
"file",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L360-L367 |
spotbugs/spotbugs | eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java | ASTUtil.getFieldDeclaration | public static FieldDeclaration getFieldDeclaration(TypeDeclaration type, FieldAnnotation fieldAnno)
throws FieldDeclarationNotFoundException {
"""
Returns the <CODE>FieldDeclaration</CODE> for the specified
<CODE>FieldAnnotation</CODE>. The field has to be declared in the
specified <CODE>TypeDeclarat... | java | public static FieldDeclaration getFieldDeclaration(TypeDeclaration type, FieldAnnotation fieldAnno)
throws FieldDeclarationNotFoundException {
requireNonNull(fieldAnno, "field annotation");
return getFieldDeclaration(type, fieldAnno.getFieldName());
} | [
"public",
"static",
"FieldDeclaration",
"getFieldDeclaration",
"(",
"TypeDeclaration",
"type",
",",
"FieldAnnotation",
"fieldAnno",
")",
"throws",
"FieldDeclarationNotFoundException",
"{",
"requireNonNull",
"(",
"fieldAnno",
",",
"\"field annotation\"",
")",
";",
"return",
... | Returns the <CODE>FieldDeclaration</CODE> for the specified
<CODE>FieldAnnotation</CODE>. The field has to be declared in the
specified <CODE>TypeDeclaration</CODE>.
@param type
The <CODE>TypeDeclaration</CODE>, where the
<CODE>FieldDeclaration</CODE> is declared in.
@param fieldAnno
The <CODE>FieldAnnotation</CODE>, ... | [
"Returns",
"the",
"<CODE",
">",
"FieldDeclaration<",
"/",
"CODE",
">",
"for",
"the",
"specified",
"<CODE",
">",
"FieldAnnotation<",
"/",
"CODE",
">",
".",
"The",
"field",
"has",
"to",
"be",
"declared",
"in",
"the",
"specified",
"<CODE",
">",
"TypeDeclaration... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java#L283-L288 |
landawn/AbacusUtil | src/com/landawn/abacus/util/FloatList.java | FloatList.reduce | public <E extends Exception> float reduce(final float identity, final Try.FloatBinaryOperator<E> accumulator) throws E {
"""
This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
float result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsFloat(result, elemen... | java | public <E extends Exception> float reduce(final float identity, final Try.FloatBinaryOperator<E> accumulator) throws E {
if (isEmpty()) {
return identity;
}
float result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsFloat(resul... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"float",
"reduce",
"(",
"final",
"float",
"identity",
",",
"final",
"Try",
".",
"FloatBinaryOperator",
"<",
"E",
">",
"accumulator",
")",
"throws",
"E",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"re... | This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
float result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsFloat(result, elementData[i]);
}
return result;
</code>
</pre>
@param identity
@param accumulator
@return | [
"This",
"is",
"equivalent",
"to",
":",
"<pre",
">",
"<code",
">",
"if",
"(",
"isEmpty",
"()",
")",
"{",
"return",
"identity",
";",
"}"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FloatList.java#L1105-L1117 |
rzwitserloot/lombok | src/core/lombok/javac/handlers/HandleSetter.java | HandleSetter.generateSetterForField | public void generateSetterForField(JavacNode fieldNode, JavacNode sourceNode, AccessLevel level, List<JCAnnotation> onMethod, List<JCAnnotation> onParam) {
"""
Generates a setter on the stated field.
Used by {@link HandleData}.
The difference between this call and the handle method is as follows:
If there... | java | public void generateSetterForField(JavacNode fieldNode, JavacNode sourceNode, AccessLevel level, List<JCAnnotation> onMethod, List<JCAnnotation> onParam) {
if (hasAnnotation(Setter.class, fieldNode)) {
//The annotation will make it happen, so we can skip it.
return;
}
createSetterForField(level, fieldNod... | [
"public",
"void",
"generateSetterForField",
"(",
"JavacNode",
"fieldNode",
",",
"JavacNode",
"sourceNode",
",",
"AccessLevel",
"level",
",",
"List",
"<",
"JCAnnotation",
">",
"onMethod",
",",
"List",
"<",
"JCAnnotation",
">",
"onParam",
")",
"{",
"if",
"(",
"h... | Generates a setter on the stated field.
Used by {@link HandleData}.
The difference between this call and the handle method is as follows:
If there is a {@code lombok.Setter} annotation on the field, it is used and the
same rules apply (e.g. warning if the method already exists, stated access level applies).
If not, ... | [
"Generates",
"a",
"setter",
"on",
"the",
"stated",
"field",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/HandleSetter.java#L111-L118 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.