repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java | HttpHeaderMap.addDateHeader | public void addDateHeader (@Nonnull @Nonempty final String sName, @Nonnull final LocalDateTime aLDT) {
"""
Add the passed header as a date header.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param aLDT
The LocalDateTime to set as a date. May not be <code>null</code>.
"""
ad... | java | public void addDateHeader (@Nonnull @Nonempty final String sName, @Nonnull final LocalDateTime aLDT)
{
addDateHeader (sName, PDTFactory.createZonedDateTime (aLDT));
} | [
"public",
"void",
"addDateHeader",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"final",
"LocalDateTime",
"aLDT",
")",
"{",
"addDateHeader",
"(",
"sName",
",",
"PDTFactory",
".",
"createZonedDateTime",
"(",
"aLDT",
")"... | Add the passed header as a date header.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param aLDT
The LocalDateTime to set as a date. May not be <code>null</code>. | [
"Add",
"the",
"passed",
"header",
"as",
"a",
"date",
"header",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java#L317-L320 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/JSONWorldDataHelper.java | JSONWorldDataHelper.buildPositionStats | public static void buildPositionStats(JsonObject json, EntityPlayerMP player) {
"""
Builds the player position data to be used as observation signals by the listener.
@param json a JSON object into which the positional information will be added.
"""
json.addProperty("XPos", player.posX);
json... | java | public static void buildPositionStats(JsonObject json, EntityPlayerMP player)
{
json.addProperty("XPos", player.posX);
json.addProperty("YPos", player.posY);
json.addProperty("ZPos", player.posZ);
json.addProperty("Pitch", player.rotationPitch);
json.addProperty("Yaw", pla... | [
"public",
"static",
"void",
"buildPositionStats",
"(",
"JsonObject",
"json",
",",
"EntityPlayerMP",
"player",
")",
"{",
"json",
".",
"addProperty",
"(",
"\"XPos\"",
",",
"player",
".",
"posX",
")",
";",
"json",
".",
"addProperty",
"(",
"\"YPos\"",
",",
"play... | Builds the player position data to be used as observation signals by the listener.
@param json a JSON object into which the positional information will be added. | [
"Builds",
"the",
"player",
"position",
"data",
"to",
"be",
"used",
"as",
"observation",
"signals",
"by",
"the",
"listener",
"."
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/JSONWorldDataHelper.java#L138-L145 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/Segment3ifx.java | Segment3ifx.z2Property | @Pure
public IntegerProperty z2Property() {
"""
Replies the property that is the z coordinate of the second segment point.
@return the z2 property.
"""
if (this.p2.z == null) {
this.p2.z = new SimpleIntegerProperty(this, MathFXAttributeNames.Z2);
}
return this.p2.z;
} | java | @Pure
public IntegerProperty z2Property() {
if (this.p2.z == null) {
this.p2.z = new SimpleIntegerProperty(this, MathFXAttributeNames.Z2);
}
return this.p2.z;
} | [
"@",
"Pure",
"public",
"IntegerProperty",
"z2Property",
"(",
")",
"{",
"if",
"(",
"this",
".",
"p2",
".",
"z",
"==",
"null",
")",
"{",
"this",
".",
"p2",
".",
"z",
"=",
"new",
"SimpleIntegerProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"Z2"... | Replies the property that is the z coordinate of the second segment point.
@return the z2 property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"z",
"coordinate",
"of",
"the",
"second",
"segment",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/Segment3ifx.java#L294-L300 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java | CaptchaPanel.newImage | protected Image newImage(final String id, final IModel<CaptchaModelBean> model) {
"""
Factory method for creating a new {@link Image}. This method is invoked in the constructor
from the derived classes and can be overridden so users can provide their own version of a
Button.
@param id
the wicket id
@param m... | java | protected Image newImage(final String id, final IModel<CaptchaModelBean> model)
{
return newImage(id, model.getObject().getCaptchaImageResource());
} | [
"protected",
"Image",
"newImage",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"CaptchaModelBean",
">",
"model",
")",
"{",
"return",
"newImage",
"(",
"id",
",",
"model",
".",
"getObject",
"(",
")",
".",
"getCaptchaImageResource",
"(",
")",
")... | Factory method for creating a new {@link Image}. This method is invoked in the constructor
from the derived classes and can be overridden so users can provide their own version of a
Button.
@param id
the wicket id
@param model
the model.
@return the new {@link Image} | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"Image",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"the... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java#L76-L79 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDriver.java | OperaDriver.findElement | protected WebElement findElement(String by, String using, OperaWebElement el) {
"""
Find a single element using the selenium atoms.
@param by how to find the element, strings defined in RemoteWebDriver
@param using the value to use to find the element
@param el the element to search within
@return an e... | java | protected WebElement findElement(String by, String using, OperaWebElement el) {
checkNotNull(using, "Cannot find elements when the selector is null");
assertConnected();
using = OperaStrings.escapeJsString(using);
boolean isAvailable;
Integer id;
String script;
if (el == null) {
// S... | [
"protected",
"WebElement",
"findElement",
"(",
"String",
"by",
",",
"String",
"using",
",",
"OperaWebElement",
"el",
")",
"{",
"checkNotNull",
"(",
"using",
",",
"\"Cannot find elements when the selector is null\"",
")",
";",
"assertConnected",
"(",
")",
";",
"using... | Find a single element using the selenium atoms.
@param by how to find the element, strings defined in RemoteWebDriver
@param using the value to use to find the element
@param el the element to search within
@return an element | [
"Find",
"a",
"single",
"element",
"using",
"the",
"selenium",
"atoms",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDriver.java#L452-L499 |
jbundle/jbundle | base/model/src/main/java/org/jbundle/base/model/Utility.java | Utility.getAs | public static Object getAs(Map<String,Object> properties, String strKey, Class<?> classData, Object objDefault) {
"""
Get this property from the map and convert it to the target class.
@param properties The map object to get the property from.
@param strKey The key of the property.
@param classData The target c... | java | public static Object getAs(Map<String,Object> properties, String strKey, Class<?> classData, Object objDefault)
{
if (properties == null)
return objDefault;
Object objData = properties.get(strKey);
try {
return Converter.convertObjectToDatatype(objData, classData, obj... | [
"public",
"static",
"Object",
"getAs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"String",
"strKey",
",",
"Class",
"<",
"?",
">",
"classData",
",",
"Object",
"objDefault",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"r... | Get this property from the map and convert it to the target class.
@param properties The map object to get the property from.
@param strKey The key of the property.
@param classData The target class to convert the property to.
@param objDefault The default value.
@return The data in the correct class. | [
"Get",
"this",
"property",
"from",
"the",
"map",
"and",
"convert",
"it",
"to",
"the",
"target",
"class",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/model/src/main/java/org/jbundle/base/model/Utility.java#L459-L469 |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/Validator.java | Validator.validatePseudoScopedBean | private static void validatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager) {
"""
Checks to make sure that pseudo scoped beans (i.e. @Dependent scoped beans) have no circular dependencies.
"""
if (bean.getInjectionPoints().isEmpty()) {
// Skip validation if there are no injectio... | java | private static void validatePseudoScopedBean(Bean<?> bean, BeanManagerImpl beanManager) {
if (bean.getInjectionPoints().isEmpty()) {
// Skip validation if there are no injection points (e.g. for classes which are not intended to be used as beans)
return;
}
reallyValidateP... | [
"private",
"static",
"void",
"validatePseudoScopedBean",
"(",
"Bean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"if",
"(",
"bean",
".",
"getInjectionPoints",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Skip validation if the... | Checks to make sure that pseudo scoped beans (i.e. @Dependent scoped beans) have no circular dependencies. | [
"Checks",
"to",
"make",
"sure",
"that",
"pseudo",
"scoped",
"beans",
"(",
"i",
".",
"e",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java#L923-L929 |
javers/javers | javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java | QueryBuilder.byValueObject | public static QueryBuilder byValueObject(Class ownerEntityClass, String path) {
"""
Query for selecting changes (or snapshots)
made on all ValueObjects at given path, owned by any instance of given Entity.
<br/><br/>
See <b>path</b> parameter hints in {@link #byValueObjectId(Object, Class, String)}.
"""
... | java | public static QueryBuilder byValueObject(Class ownerEntityClass, String path){
Validate.argumentsAreNotNull(ownerEntityClass, path);
return new QueryBuilder(new VoOwnerFilterDefinition(ownerEntityClass, path));
} | [
"public",
"static",
"QueryBuilder",
"byValueObject",
"(",
"Class",
"ownerEntityClass",
",",
"String",
"path",
")",
"{",
"Validate",
".",
"argumentsAreNotNull",
"(",
"ownerEntityClass",
",",
"path",
")",
";",
"return",
"new",
"QueryBuilder",
"(",
"new",
"VoOwnerFil... | Query for selecting changes (or snapshots)
made on all ValueObjects at given path, owned by any instance of given Entity.
<br/><br/>
See <b>path</b> parameter hints in {@link #byValueObjectId(Object, Class, String)}. | [
"Query",
"for",
"selecting",
"changes",
"(",
"or",
"snapshots",
")",
"made",
"on",
"all",
"ValueObjects",
"at",
"given",
"path",
"owned",
"by",
"any",
"instance",
"of",
"given",
"Entity",
".",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java#L131-L134 |
RestComm/sip-servlets | sip-servlets-client/src/main/java/org/mobicents/servlet/sip/SipConnector.java | SipConnector.sendHeartBeat | public void sendHeartBeat(String ipAddress, int port) throws Exception {
"""
Send a heartbeat to the specified Ip address and port
via this listening point. This method can be used to send out a period
Double CR-LF for NAT keepalive as defined in RFC5626
@since 1.7
@param ipAddress
@param port
"""
... | java | public void sendHeartBeat(String ipAddress, int port) throws Exception {
MBeanServer mbeanServer = getMBeanServer();
Set<ObjectName> queryNames = mbeanServer.queryNames(new ObjectName("*:type=Service,*"), null);
for(ObjectName objectName : queryNames) {
mbeanServer.invoke(objectName, "sendHeartB... | [
"public",
"void",
"sendHeartBeat",
"(",
"String",
"ipAddress",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"MBeanServer",
"mbeanServer",
"=",
"getMBeanServer",
"(",
")",
";",
"Set",
"<",
"ObjectName",
">",
"queryNames",
"=",
"mbeanServer",
".",
"query... | Send a heartbeat to the specified Ip address and port
via this listening point. This method can be used to send out a period
Double CR-LF for NAT keepalive as defined in RFC5626
@since 1.7
@param ipAddress
@param port | [
"Send",
"a",
"heartbeat",
"to",
"the",
"specified",
"Ip",
"address",
"and",
"port",
"via",
"this",
"listening",
"point",
".",
"This",
"method",
"can",
"be",
"used",
"to",
"send",
"out",
"a",
"period",
"Double",
"CR",
"-",
"LF",
"for",
"NAT",
"keepalive",... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-client/src/main/java/org/mobicents/servlet/sip/SipConnector.java#L267-L275 |
jMotif/GI | src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java | RulePrunerFactory.performPruning | public static GrammarRules performPruning(double[] ts, GrammarRules grammarRules) {
"""
Performs pruning.
@param ts the input time series.
@param grammarRules the grammar.
@return pruned ruleset.
"""
RulePruningAlgorithm pruner = new RulePruningAlgorithm(grammarRules, ts.length);
pruner.pruneRules... | java | public static GrammarRules performPruning(double[] ts, GrammarRules grammarRules) {
RulePruningAlgorithm pruner = new RulePruningAlgorithm(grammarRules, ts.length);
pruner.pruneRules();
return pruner.regularizePrunedRules();
} | [
"public",
"static",
"GrammarRules",
"performPruning",
"(",
"double",
"[",
"]",
"ts",
",",
"GrammarRules",
"grammarRules",
")",
"{",
"RulePruningAlgorithm",
"pruner",
"=",
"new",
"RulePruningAlgorithm",
"(",
"grammarRules",
",",
"ts",
".",
"length",
")",
";",
"pr... | Performs pruning.
@param ts the input time series.
@param grammarRules the grammar.
@return pruned ruleset. | [
"Performs",
"pruning",
"."
] | train | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java#L68-L72 |
KlausBrunner/solarpositioning | src/main/java/net/e175/klaus/solarpositioning/SPA.java | SPA.calculateSolarPosition | public static AzimuthZenithAngle calculateSolarPosition(final GregorianCalendar date, final double latitude,
final double longitude, final double elevation, final double deltaT) {
"""
Calculate topocentric solar position, i.e. the location of the sun on t... | java | public static AzimuthZenithAngle calculateSolarPosition(final GregorianCalendar date, final double latitude,
final double longitude, final double elevation, final double deltaT) {
return calculateSolarPosition(date, latitude, longitude, elevation, delt... | [
"public",
"static",
"AzimuthZenithAngle",
"calculateSolarPosition",
"(",
"final",
"GregorianCalendar",
"date",
",",
"final",
"double",
"latitude",
",",
"final",
"double",
"longitude",
",",
"final",
"double",
"elevation",
",",
"final",
"double",
"deltaT",
")",
"{",
... | Calculate topocentric solar position, i.e. the location of the sun on the sky for a certain point in time on a
certain point of the Earth's surface.
This follows the SPA algorithm described in Reda, I.; Andreas, A. (2003): Solar Position Algorithm for Solar
Radiation Applications. NREL Report No. TP-560-34302, Revised... | [
"Calculate",
"topocentric",
"solar",
"position",
"i",
".",
"e",
".",
"the",
"location",
"of",
"the",
"sun",
"on",
"the",
"sky",
"for",
"a",
"certain",
"point",
"in",
"time",
"on",
"a",
"certain",
"point",
"of",
"the",
"Earth",
"s",
"surface",
"."
] | train | https://github.com/KlausBrunner/solarpositioning/blob/25db9b5e966ea325d88bb3b374103f104de256de/src/main/java/net/e175/klaus/solarpositioning/SPA.java#L150-L153 |
google/j2objc | jre_emul/android/platform/external/okhttp/okio/okio/src/main/java/okio/AsyncTimeout.java | AsyncTimeout.awaitTimeout | private static synchronized AsyncTimeout awaitTimeout() throws InterruptedException {
"""
Removes and returns the node at the head of the list, waiting for it to
time out if necessary. Returns null if the situation changes while waiting:
either a newer node is inserted at the head, or the node being waited on
h... | java | private static synchronized AsyncTimeout awaitTimeout() throws InterruptedException {
// Get the next eligible node.
AsyncTimeout node = head.next;
// The queue is empty. Wait for something to be enqueued.
if (node == null) {
AsyncTimeout.class.wait();
return null;
}
long waitNanos... | [
"private",
"static",
"synchronized",
"AsyncTimeout",
"awaitTimeout",
"(",
")",
"throws",
"InterruptedException",
"{",
"// Get the next eligible node.",
"AsyncTimeout",
"node",
"=",
"head",
".",
"next",
";",
"// The queue is empty. Wait for something to be enqueued.",
"if",
"(... | Removes and returns the node at the head of the list, waiting for it to
time out if necessary. Returns null if the situation changes while waiting:
either a newer node is inserted at the head, or the node being waited on
has been removed. | [
"Removes",
"and",
"returns",
"the",
"node",
"at",
"the",
"head",
"of",
"the",
"list",
"waiting",
"for",
"it",
"to",
"time",
"out",
"if",
"necessary",
".",
"Returns",
"null",
"if",
"the",
"situation",
"changes",
"while",
"waiting",
":",
"either",
"a",
"ne... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/okhttp/okio/okio/src/main/java/okio/AsyncTimeout.java#L305-L331 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/StatementExecutor.java | StatementExecutor.queryForAll | public List<T> queryForAll(ConnectionSource connectionSource, ObjectCache objectCache) throws SQLException {
"""
Return a list of all of the data in the table. Should be used carefully if the table is large. Consider using the
{@link Dao#iterator} if this is the case.
"""
prepareQueryForAll();
return quer... | java | public List<T> queryForAll(ConnectionSource connectionSource, ObjectCache objectCache) throws SQLException {
prepareQueryForAll();
return query(connectionSource, preparedQueryForAll, objectCache);
} | [
"public",
"List",
"<",
"T",
">",
"queryForAll",
"(",
"ConnectionSource",
"connectionSource",
",",
"ObjectCache",
"objectCache",
")",
"throws",
"SQLException",
"{",
"prepareQueryForAll",
"(",
")",
";",
"return",
"query",
"(",
"connectionSource",
",",
"preparedQueryFo... | Return a list of all of the data in the table. Should be used carefully if the table is large. Consider using the
{@link Dao#iterator} if this is the case. | [
"Return",
"a",
"list",
"of",
"all",
"of",
"the",
"data",
"in",
"the",
"table",
".",
"Should",
"be",
"used",
"carefully",
"if",
"the",
"table",
"is",
"large",
".",
"Consider",
"using",
"the",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L124-L127 |
lastaflute/lasta-di | src/main/java/org/lastaflute/di/util/LdiSrl.java | LdiSrl.indexOfFirstIgnoreCase | public static IndexOfInfo indexOfFirstIgnoreCase(final String str, final String... delimiters) {
"""
Get the index of the first-found delimiter ignoring case.
<pre>
indexOfFirst("foo.bar/baz.qux", "A", "U")
returns the index of "ar/baz..."
</pre>
@param str The target string. (NotNull)
@param delimiters The ... | java | public static IndexOfInfo indexOfFirstIgnoreCase(final String str, final String... delimiters) {
return doIndexOfFirst(true, str, delimiters);
} | [
"public",
"static",
"IndexOfInfo",
"indexOfFirstIgnoreCase",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"...",
"delimiters",
")",
"{",
"return",
"doIndexOfFirst",
"(",
"true",
",",
"str",
",",
"delimiters",
")",
";",
"}"
] | Get the index of the first-found delimiter ignoring case.
<pre>
indexOfFirst("foo.bar/baz.qux", "A", "U")
returns the index of "ar/baz..."
</pre>
@param str The target string. (NotNull)
@param delimiters The array of delimiters. (NotNull)
@return The information of index. (NullAllowed: if delimiter not found) | [
"Get",
"the",
"index",
"of",
"the",
"first",
"-",
"found",
"delimiter",
"ignoring",
"case",
".",
"<pre",
">",
"indexOfFirst",
"(",
"foo",
".",
"bar",
"/",
"baz",
".",
"qux",
"A",
"U",
")",
"returns",
"the",
"index",
"of",
"ar",
"/",
"baz",
"...",
"... | train | https://github.com/lastaflute/lasta-di/blob/c4e123610c53a04cc836c5e456660e32d613447b/src/main/java/org/lastaflute/di/util/LdiSrl.java#L393-L395 |
samskivert/pythagoras | src/main/java/pythagoras/f/Matrix3.java | Matrix3.setToRotation | public Matrix3 setToRotation (IVector3 from, IVector3 to) {
"""
Sets this to a rotation matrix that rotates one vector onto another.
@return a reference to this matrix, for chaining.
"""
float angle = from.angle(to);
return (angle < 0.0001f) ?
setToIdentity() : setToRotation(angl... | java | public Matrix3 setToRotation (IVector3 from, IVector3 to) {
float angle = from.angle(to);
return (angle < 0.0001f) ?
setToIdentity() : setToRotation(angle, from.cross(to).normalizeLocal());
} | [
"public",
"Matrix3",
"setToRotation",
"(",
"IVector3",
"from",
",",
"IVector3",
"to",
")",
"{",
"float",
"angle",
"=",
"from",
".",
"angle",
"(",
"to",
")",
";",
"return",
"(",
"angle",
"<",
"0.0001f",
")",
"?",
"setToIdentity",
"(",
")",
":",
"setToRo... | Sets this to a rotation matrix that rotates one vector onto another.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"rotation",
"matrix",
"that",
"rotates",
"one",
"vector",
"onto",
"another",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Matrix3.java#L155-L159 |
m-m-m/util | io/src/main/java/net/sf/mmm/util/file/base/FileUtilImpl.java | FileUtilImpl.copyRecursive | private void copyRecursive(File source, File destination, FileFilter filter) {
"""
This method copies the file or directory given by {@code source} into the given {@code destination}. <br>
<b>ATTENTION:</b><br>
In order to allow giving the copy of {@code source} a new {@link File#getName() name}, the {@code dest... | java | private void copyRecursive(File source, File destination, FileFilter filter) {
if (source.isDirectory()) {
boolean okay = destination.mkdir();
if (!okay) {
throw new FileCreationFailedException(destination.getAbsolutePath(), true);
}
File[] children;
if (filter == null) {
... | [
"private",
"void",
"copyRecursive",
"(",
"File",
"source",
",",
"File",
"destination",
",",
"FileFilter",
"filter",
")",
"{",
"if",
"(",
"source",
".",
"isDirectory",
"(",
")",
")",
"{",
"boolean",
"okay",
"=",
"destination",
".",
"mkdir",
"(",
")",
";",... | This method copies the file or directory given by {@code source} into the given {@code destination}. <br>
<b>ATTENTION:</b><br>
In order to allow giving the copy of {@code source} a new {@link File#getName() name}, the {@code destination} has
to point to the final place where the copy should appear rather than the dire... | [
"This",
"method",
"copies",
"the",
"file",
"or",
"directory",
"given",
"by",
"{",
"@code",
"source",
"}",
"into",
"the",
"given",
"{",
"@code",
"destination",
"}",
".",
"<br",
">",
"<b",
">",
"ATTENTION",
":",
"<",
"/",
"b",
">",
"<br",
">",
"In",
... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/io/src/main/java/net/sf/mmm/util/file/base/FileUtilImpl.java#L245-L264 |
JDBDT/jdbdt | src/main/java/org/jdbdt/JDBDT.java | JDBDT.assertUnchanged | @SafeVarargs
public static void assertUnchanged(String message, DataSource... dataSources) throws DBAssertionError {
"""
Assert that no changes occurred for the given data sources
(error message variant).
@param message Assertion error message.
@param dataSources Data sources.
@throws DBAssertionError if t... | java | @SafeVarargs
public static void assertUnchanged(String message, DataSource... dataSources) throws DBAssertionError {
multipleUnchangedAssertions(CallInfo.create(message), dataSources);
} | [
"@",
"SafeVarargs",
"public",
"static",
"void",
"assertUnchanged",
"(",
"String",
"message",
",",
"DataSource",
"...",
"dataSources",
")",
"throws",
"DBAssertionError",
"{",
"multipleUnchangedAssertions",
"(",
"CallInfo",
".",
"create",
"(",
"message",
")",
",",
"... | Assert that no changes occurred for the given data sources
(error message variant).
@param message Assertion error message.
@param dataSources Data sources.
@throws DBAssertionError if the assertion fails.
@see #assertUnchanged(String,DataSource)
@since 1.2 | [
"Assert",
"that",
"no",
"changes",
"occurred",
"for",
"the",
"given",
"data",
"sources",
"(",
"error",
"message",
"variant",
")",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L412-L415 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java | Cells.getURL | public URL getURL(String nameSpace, String cellName) {
"""
Returns the {@code URL} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if
this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the name of the... | java | public URL getURL(String nameSpace, String cellName) {
return getValue(nameSpace, cellName, URL.class);
} | [
"public",
"URL",
"getURL",
"(",
"String",
"nameSpace",
",",
"String",
"cellName",
")",
"{",
"return",
"getValue",
"(",
"nameSpace",
",",
"cellName",
",",
"URL",
".",
"class",
")",
";",
"}"
] | Returns the {@code URL} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if
this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the name of the Cell we want to retrieve from this Cells object.
@return the {@code... | [
"Returns",
"the",
"{",
"@code",
"URL",
"}",
"value",
"of",
"the",
"{",
"@link",
"Cell",
"}",
"(",
"associated",
"to",
"{",
"@code",
"table",
"}",
")",
"whose",
"name",
"iscellName",
"or",
"null",
"if",
"this",
"Cells",
"object",
"contains",
"no",
"cell... | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1363-L1365 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Schedule.java | Schedule.setEnddate | public void setEnddate(Object enddate) throws PageException {
"""
set the value enddate The date when the scheduled task ends.
@param enddate value to set
@throws PageException
"""
if (StringUtil.isEmpty(enddate)) return;
this.enddate = new DateImpl(DateCaster.toDateAdvanced(enddate, pageContext.getTimeZ... | java | public void setEnddate(Object enddate) throws PageException {
if (StringUtil.isEmpty(enddate)) return;
this.enddate = new DateImpl(DateCaster.toDateAdvanced(enddate, pageContext.getTimeZone()));
} | [
"public",
"void",
"setEnddate",
"(",
"Object",
"enddate",
")",
"throws",
"PageException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"enddate",
")",
")",
"return",
";",
"this",
".",
"enddate",
"=",
"new",
"DateImpl",
"(",
"DateCaster",
".",
"toDate... | set the value enddate The date when the scheduled task ends.
@param enddate value to set
@throws PageException | [
"set",
"the",
"value",
"enddate",
"The",
"date",
"when",
"the",
"scheduled",
"task",
"ends",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Schedule.java#L258-L261 |
tumblr/jumblr | src/main/java/com/tumblr/jumblr/JumblrClient.java | JumblrClient.blogPost | public Post blogPost(String blogName, Long postId) {
"""
Get an individual post by id
@param blogName the name of the blog
@param postId the id of the post to get
@return the Post or null
"""
HashMap<String, String> options = new HashMap<String, String>();
options.put("id", postId.toString()... | java | public Post blogPost(String blogName, Long postId) {
HashMap<String, String> options = new HashMap<String, String>();
options.put("id", postId.toString());
List<Post> posts = this.blogPosts(blogName, options);
return posts.size() > 0 ? posts.get(0) : null;
} | [
"public",
"Post",
"blogPost",
"(",
"String",
"blogName",
",",
"Long",
"postId",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"options",
".",
"put",
"(",
"\... | Get an individual post by id
@param blogName the name of the blog
@param postId the id of the post to get
@return the Post or null | [
"Get",
"an",
"individual",
"post",
"by",
"id"
] | train | https://github.com/tumblr/jumblr/blob/373629fd545defb016e227ea758f092507fbd624/src/main/java/com/tumblr/jumblr/JumblrClient.java#L204-L209 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java | IdentityPatchContext.getEntry | PatchEntry getEntry(final String name, boolean addOn) {
"""
Get a patch entry for either a layer or add-on.
@param name the layer name
@param addOn whether the target is an add-on
@return the patch entry, {@code null} if it there is no such layer
"""
return addOn ? addOns.get(name) : layers.get(n... | java | PatchEntry getEntry(final String name, boolean addOn) {
return addOn ? addOns.get(name) : layers.get(name);
} | [
"PatchEntry",
"getEntry",
"(",
"final",
"String",
"name",
",",
"boolean",
"addOn",
")",
"{",
"return",
"addOn",
"?",
"addOns",
".",
"get",
"(",
"name",
")",
":",
"layers",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Get a patch entry for either a layer or add-on.
@param name the layer name
@param addOn whether the target is an add-on
@return the patch entry, {@code null} if it there is no such layer | [
"Get",
"a",
"patch",
"entry",
"for",
"either",
"a",
"layer",
"or",
"add",
"-",
"on",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java#L135-L137 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteSecret | public DeletedSecretBundle deleteSecret(String vaultBaseUrl, String secretName) {
"""
Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permiss... | java | public DeletedSecretBundle deleteSecret(String vaultBaseUrl, String secretName) {
return deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body();
} | [
"public",
"DeletedSecretBundle",
"deleteSecret",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
")",
"{",
"return",
"deleteSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")"... | Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@para... | [
"Deletes",
"a",
"secret",
"from",
"a",
"specified",
"key",
"vault",
".",
"The",
"DELETE",
"operation",
"applies",
"to",
"any",
"secret",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"DELETE",
"cannot",
"be",
"applied",
"to",
"an",
"individual",
"version",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3531-L3533 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.toLong | public static final Function<String,Long> toLong(final RoundingMode roundingMode, final Locale locale) {
"""
<p>
Converts a String into a Long, using the specified locale for determining
decimal point. Rounding mode is used for removing the
decimal part of the number. The integer part of the input string must b... | java | public static final Function<String,Long> toLong(final RoundingMode roundingMode, final Locale locale) {
return new ToLong(roundingMode, locale);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"Long",
">",
"toLong",
"(",
"final",
"RoundingMode",
"roundingMode",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"new",
"ToLong",
"(",
"roundingMode",
",",
"locale",
")",
";",
"}"
] | <p>
Converts a String into a Long, using the specified locale for determining
decimal point. Rounding mode is used for removing the
decimal part of the number. The integer part of the input string must be between
{@link Long#MIN_VALUE} and {@link Long#MAX_VALUE}
</p>
@param roundingMode the rounding mode to be used wh... | [
"<p",
">",
"Converts",
"a",
"String",
"into",
"a",
"Long",
"using",
"the",
"specified",
"locale",
"for",
"determining",
"decimal",
"point",
".",
"Rounding",
"mode",
"is",
"used",
"for",
"removing",
"the",
"decimal",
"part",
"of",
"the",
"number",
".",
"The... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L806-L808 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphAddHostNode | public static int cuGraphAddHostNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies, CUDA_HOST_NODE_PARAMS nodeParams) {
"""
Creates a host execution node and adds it to a graph.<br>
<br>
Creates a new CPU execution node and adds it to \p hGraph with \p numDependencies
... | java | public static int cuGraphAddHostNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies, CUDA_HOST_NODE_PARAMS nodeParams)
{
return checkResult(cuGraphAddHostNodeNative(phGraphNode, hGraph, dependencies, numDependencies, nodeParams));
} | [
"public",
"static",
"int",
"cuGraphAddHostNode",
"(",
"CUgraphNode",
"phGraphNode",
",",
"CUgraph",
"hGraph",
",",
"CUgraphNode",
"dependencies",
"[",
"]",
",",
"long",
"numDependencies",
",",
"CUDA_HOST_NODE_PARAMS",
"nodeParams",
")",
"{",
"return",
"checkResult",
... | Creates a host execution node and adds it to a graph.<br>
<br>
Creates a new CPU execution node and adds it to \p hGraph with \p numDependencies
dependencies specified via \p dependencies and arguments specified in \p nodeParams.
It is possible for \p numDependencies to be 0, in which case the node will be placed
at th... | [
"Creates",
"a",
"host",
"execution",
"node",
"and",
"adds",
"it",
"to",
"a",
"graph",
".",
"<br",
">",
"<br",
">",
"Creates",
"a",
"new",
"CPU",
"execution",
"node",
"and",
"adds",
"it",
"to",
"\\",
"p",
"hGraph",
"with",
"\\",
"p",
"numDependencies",
... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12390-L12393 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java | AbstractRenderer.buildContextURL | protected String buildContextURL(ODataRequestContext requestContext, Object data) throws ODataRenderException {
"""
Build the 'Context URL' from a given OData request context.
@param requestContext The given OData request context
@param data Result data
@return The built 'Context URL'
@throws OData... | java | protected String buildContextURL(ODataRequestContext requestContext, Object data) throws ODataRenderException {
ODataUri oDataUri = requestContext.getUri();
if (ODataUriUtil.isActionCallUri(oDataUri) || ODataUriUtil.isFunctionCallUri(oDataUri)) {
return buildContextUrlFromOperationCall(oData... | [
"protected",
"String",
"buildContextURL",
"(",
"ODataRequestContext",
"requestContext",
",",
"Object",
"data",
")",
"throws",
"ODataRenderException",
"{",
"ODataUri",
"oDataUri",
"=",
"requestContext",
".",
"getUri",
"(",
")",
";",
"if",
"(",
"ODataUriUtil",
".",
... | Build the 'Context URL' from a given OData request context.
@param requestContext The given OData request context
@param data Result data
@return The built 'Context URL'
@throws ODataRenderException If unable to build context url | [
"Build",
"the",
"Context",
"URL",
"from",
"a",
"given",
"OData",
"request",
"context",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java#L205-L220 |
apiman/apiman | common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java | PluginUtils.getM2Path | public static File getM2Path(File m2Dir, PluginCoordinates coordinates) {
"""
Find the plugin artifact in the local .m2 directory.
@param m2Dir the maven m2 directory
@param coordinates the coordinates
@return the M2 path
"""
String artifactSubPath = getMavenPath(coordinates);
return new Fil... | java | public static File getM2Path(File m2Dir, PluginCoordinates coordinates) {
String artifactSubPath = getMavenPath(coordinates);
return new File(m2Dir, artifactSubPath);
} | [
"public",
"static",
"File",
"getM2Path",
"(",
"File",
"m2Dir",
",",
"PluginCoordinates",
"coordinates",
")",
"{",
"String",
"artifactSubPath",
"=",
"getMavenPath",
"(",
"coordinates",
")",
";",
"return",
"new",
"File",
"(",
"m2Dir",
",",
"artifactSubPath",
")",
... | Find the plugin artifact in the local .m2 directory.
@param m2Dir the maven m2 directory
@param coordinates the coordinates
@return the M2 path | [
"Find",
"the",
"plugin",
"artifact",
"in",
"the",
"local",
".",
"m2",
"directory",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java#L126-L129 |
groovyfx-project/groovyfx | src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java | FXBindableASTTransformation.addJavaFXPropertyToClass | private void addJavaFXPropertyToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) {
"""
Iterate through the properties of the class and convert each eligible property to a JavaFX property.
@param source The SourceUnit
@param node The AnnotationNode
@param classNode The declaring class... | java | private void addJavaFXPropertyToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) {
for (PropertyNode propertyNode : classNode.getProperties()) {
FieldNode field = propertyNode.getField();
// look to see if per-field handlers will catch this one...
if (hasFXB... | [
"private",
"void",
"addJavaFXPropertyToClass",
"(",
"SourceUnit",
"source",
",",
"AnnotationNode",
"node",
",",
"ClassNode",
"classNode",
")",
"{",
"for",
"(",
"PropertyNode",
"propertyNode",
":",
"classNode",
".",
"getProperties",
"(",
")",
")",
"{",
"FieldNode",... | Iterate through the properties of the class and convert each eligible property to a JavaFX property.
@param source The SourceUnit
@param node The AnnotationNode
@param classNode The declaring class | [
"Iterate",
"through",
"the",
"properties",
"of",
"the",
"class",
"and",
"convert",
"each",
"eligible",
"property",
"to",
"a",
"JavaFX",
"property",
"."
] | train | https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L236-L250 |
Bedework/bw-util | bw-util-options/src/main/java/org/bedework/util/options/Options.java | Options.getOptProperty | @Override
public Object getOptProperty(final String name) throws OptionsException {
"""
Get optional property.
@param name String property name
@return Object value
@throws OptionsException
"""
if (useSystemwideValues) {
return findValue(optionsRoot, makePathElements(name), -1);
}
ret... | java | @Override
public Object getOptProperty(final String name) throws OptionsException {
if (useSystemwideValues) {
return findValue(optionsRoot, makePathElements(name), -1);
}
return findValue(localOptionsRoot, makePathElements(name), -1);
} | [
"@",
"Override",
"public",
"Object",
"getOptProperty",
"(",
"final",
"String",
"name",
")",
"throws",
"OptionsException",
"{",
"if",
"(",
"useSystemwideValues",
")",
"{",
"return",
"findValue",
"(",
"optionsRoot",
",",
"makePathElements",
"(",
"name",
")",
",",
... | Get optional property.
@param name String property name
@return Object value
@throws OptionsException | [
"Get",
"optional",
"property",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-options/src/main/java/org/bedework/util/options/Options.java#L338-L345 |
buschmais/jqa-core-framework | shared/src/main/java/com/buschmais/jqassistant/core/shared/reflection/ClassHelper.java | ClassHelper.createInstance | public <T> T createInstance(Class<T> type, String typeName) {
"""
Create an instance of the given class.
@param type The type.
@param typeName The type name.
@param <T> The type.
@return The scanner plugin instance.
"""
try {
return type.cast(getType(typeName).newInstance());... | java | public <T> T createInstance(Class<T> type, String typeName) {
try {
return type.cast(getType(typeName).newInstance());
} catch (InstantiationException | IllegalAccessException e) {
throw new IllegalArgumentException("Cannot create instance of class " + type.getName(), e);
... | [
"public",
"<",
"T",
">",
"T",
"createInstance",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"typeName",
")",
"{",
"try",
"{",
"return",
"type",
".",
"cast",
"(",
"getType",
"(",
"typeName",
")",
".",
"newInstance",
"(",
")",
")",
";",
"}",
... | Create an instance of the given class.
@param type The type.
@param typeName The type name.
@param <T> The type.
@return The scanner plugin instance. | [
"Create",
"an",
"instance",
"of",
"the",
"given",
"class",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/shared/src/main/java/com/buschmais/jqassistant/core/shared/reflection/ClassHelper.java#L42-L48 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/diagram/ProcessDiagramLayoutFactory.java | ProcessDiagramLayoutFactory.getProcessDiagramLayout | public DiagramLayout getProcessDiagramLayout(InputStream bpmnXmlStream, InputStream imageStream) {
"""
Provides positions and dimensions of elements in a process diagram as
provided by {@link RepositoryService#getProcessDiagram(String)}.
Currently, it only supports BPMN 2.0 models.
@param bpmnXmlStream
BPM... | java | public DiagramLayout getProcessDiagramLayout(InputStream bpmnXmlStream, InputStream imageStream) {
Document bpmnModel = parseXml(bpmnXmlStream);
return getBpmnProcessDiagramLayout(bpmnModel, imageStream);
} | [
"public",
"DiagramLayout",
"getProcessDiagramLayout",
"(",
"InputStream",
"bpmnXmlStream",
",",
"InputStream",
"imageStream",
")",
"{",
"Document",
"bpmnModel",
"=",
"parseXml",
"(",
"bpmnXmlStream",
")",
";",
"return",
"getBpmnProcessDiagramLayout",
"(",
"bpmnModel",
"... | Provides positions and dimensions of elements in a process diagram as
provided by {@link RepositoryService#getProcessDiagram(String)}.
Currently, it only supports BPMN 2.0 models.
@param bpmnXmlStream
BPMN 2.0 XML file
@param imageStream
BPMN 2.0 diagram in PNG format (JPEG and other formats supported
by {@link Image... | [
"Provides",
"positions",
"and",
"dimensions",
"of",
"elements",
"in",
"a",
"process",
"diagram",
"as",
"provided",
"by",
"{",
"@link",
"RepositoryService#getProcessDiagram",
"(",
"String",
")",
"}",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/diagram/ProcessDiagramLayoutFactory.java#L78-L81 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/MercatorUtils.java | MercatorUtils.getResolution | public static double getResolution( int zoom, int tileSize ) {
"""
Resolution (meters/pixel) for given zoom level (measured at Equator)
@param zoom zoomlevel.
@param tileSize tile size.
@return resolution.
"""
// return (2 * Math.PI * 6378137) / (this.tileSize * 2**zoom)
double initial... | java | public static double getResolution( int zoom, int tileSize ) {
// return (2 * Math.PI * 6378137) / (this.tileSize * 2**zoom)
double initialResolution = 2 * Math.PI * 6378137 / tileSize;
return initialResolution / Math.pow(2, zoom);
} | [
"public",
"static",
"double",
"getResolution",
"(",
"int",
"zoom",
",",
"int",
"tileSize",
")",
"{",
"// return (2 * Math.PI * 6378137) / (this.tileSize * 2**zoom)",
"double",
"initialResolution",
"=",
"2",
"*",
"Math",
".",
"PI",
"*",
"6378137",
"/",
"tileSize",
";... | Resolution (meters/pixel) for given zoom level (measured at Equator)
@param zoom zoomlevel.
@param tileSize tile size.
@return resolution. | [
"Resolution",
"(",
"meters",
"/",
"pixel",
")",
"for",
"given",
"zoom",
"level",
"(",
"measured",
"at",
"Equator",
")"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/MercatorUtils.java#L284-L288 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java | ST_Touches.geomTouches | public static Boolean geomTouches(Geometry a,Geometry b) {
"""
Return true if the geometry A touches the geometry B
@param a Geometry Geometry.
@param b Geometry instance
@return true if the geometry A touches the geometry B
"""
if(a==null || b==null) {
return null;
}
ret... | java | public static Boolean geomTouches(Geometry a,Geometry b) {
if(a==null || b==null) {
return null;
}
return a.touches(b);
} | [
"public",
"static",
"Boolean",
"geomTouches",
"(",
"Geometry",
"a",
",",
"Geometry",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"a",
".",
"touches",
"(",
"b",
")",
";",
"}... | Return true if the geometry A touches the geometry B
@param a Geometry Geometry.
@param b Geometry instance
@return true if the geometry A touches the geometry B | [
"Return",
"true",
"if",
"the",
"geometry",
"A",
"touches",
"the",
"geometry",
"B"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java#L50-L55 |
sahan/RoboZombie | robozombie/src/main/java/org/apache/http42/client/utils/URIBuilder.java | URIBuilder.setParameter | public URIBuilder setParameter(final String param, final String value) {
"""
Sets parameter of URI query overriding existing value if set. The parameter name and value
are expected to be unescaped and may contain non ASCII characters.
"""
if (this.queryParams == null) {
this.queryParams = ... | java | public URIBuilder setParameter(final String param, final String value) {
if (this.queryParams == null) {
this.queryParams = new ArrayList<NameValuePair>();
}
if (!this.queryParams.isEmpty()) {
for (Iterator<NameValuePair> it = this.queryParams.iterator(); it.hasNext(); ) ... | [
"public",
"URIBuilder",
"setParameter",
"(",
"final",
"String",
"param",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"queryParams",
"==",
"null",
")",
"{",
"this",
".",
"queryParams",
"=",
"new",
"ArrayList",
"<",
"NameValuePair",
">... | Sets parameter of URI query overriding existing value if set. The parameter name and value
are expected to be unescaped and may contain non ASCII characters. | [
"Sets",
"parameter",
"of",
"URI",
"query",
"overriding",
"existing",
"value",
"if",
"set",
".",
"The",
"parameter",
"name",
"and",
"value",
"are",
"expected",
"to",
"be",
"unescaped",
"and",
"may",
"contain",
"non",
"ASCII",
"characters",
"."
] | train | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/org/apache/http42/client/utils/URIBuilder.java#L283-L299 |
JOML-CI/JOML | src/org/joml/Intersectiond.java | Intersectiond.intersectRayAab | public static boolean intersectRayAab(Vector3dc origin, Vector3dc dir, Vector3dc min, Vector3dc max, Vector2d result) {
"""
Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the axis-aligned box specified as its minimum corner <code>min</code> and maximum corner <co... | java | public static boolean intersectRayAab(Vector3dc origin, Vector3dc dir, Vector3dc min, Vector3dc max, Vector2d result) {
return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result);
} | [
"public",
"static",
"boolean",
"intersectRayAab",
"(",
"Vector3dc",
"origin",
",",
"Vector3dc",
"dir",
",",
"Vector3dc",
"min",
",",
"Vector3dc",
"max",
",",
"Vector2d",
"result",
")",
"{",
"return",
"intersectRayAab",
"(",
"origin",
".",
"x",
"(",
")",
",",... | Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the axis-aligned box specified as its minimum corner <code>min</code> and maximum corner <code>max</code>,
and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and ... | [
"Test",
"whether",
"the",
"ray",
"with",
"the",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"axis",
"-",
"aligned",
"box",
"specified",
"as",
"its",
"minimum",
"corn... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectiond.java#L2411-L2413 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PRStream.java | PRStream.setData | public void setData(byte[] data, boolean compress, int compressionLevel) {
"""
Sets the data associated with the stream, either compressed or
uncompressed. Note that the data will never be compressed if
Document.compress is set to false.
@param data raw data, decrypted and uncompressed.
@param compress true ... | java | public void setData(byte[] data, boolean compress, int compressionLevel) {
remove(PdfName.FILTER);
this.offset = -1;
if (Document.compress && compress) {
try {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Deflater deflater = new Deflater... | [
"public",
"void",
"setData",
"(",
"byte",
"[",
"]",
"data",
",",
"boolean",
"compress",
",",
"int",
"compressionLevel",
")",
"{",
"remove",
"(",
"PdfName",
".",
"FILTER",
")",
";",
"this",
".",
"offset",
"=",
"-",
"1",
";",
"if",
"(",
"Document",
"."... | Sets the data associated with the stream, either compressed or
uncompressed. Note that the data will never be compressed if
Document.compress is set to false.
@param data raw data, decrypted and uncompressed.
@param compress true if you want the stream to be compressed.
@param compressionLevel a value between -1 and 9... | [
"Sets",
"the",
"data",
"associated",
"with",
"the",
"stream",
"either",
"compressed",
"or",
"uncompressed",
".",
"Note",
"that",
"the",
"data",
"will",
"never",
"be",
"compressed",
"if",
"Document",
".",
"compress",
"is",
"set",
"to",
"false",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PRStream.java#L155-L177 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidShell.java | RaidShell.showConfig | private int showConfig(String cmd, String argv[], int startindex)
throws IOException {
"""
Apply operation specified by 'cmd' on all parameters
starting from argv[startindex].
"""
int exitCode = 0;
PolicyInfo[] all = raidnode.getAllPolicies();
for (PolicyInfo p: all) {
out.println(p);
... | java | private int showConfig(String cmd, String argv[], int startindex)
throws IOException {
int exitCode = 0;
PolicyInfo[] all = raidnode.getAllPolicies();
for (PolicyInfo p: all) {
out.println(p);
}
return exitCode;
} | [
"private",
"int",
"showConfig",
"(",
"String",
"cmd",
",",
"String",
"argv",
"[",
"]",
",",
"int",
"startindex",
")",
"throws",
"IOException",
"{",
"int",
"exitCode",
"=",
"0",
";",
"PolicyInfo",
"[",
"]",
"all",
"=",
"raidnode",
".",
"getAllPolicies",
"... | Apply operation specified by 'cmd' on all parameters
starting from argv[startindex]. | [
"Apply",
"operation",
"specified",
"by",
"cmd",
"on",
"all",
"parameters",
"starting",
"from",
"argv",
"[",
"startindex",
"]",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidShell.java#L780-L788 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Util.java | Util.bytesToNumber | public static long bytesToNumber(byte[] buffer, int start, int length) {
"""
Reconstructs a number that is represented by more than one byte in a network packet in big-endian order.
@param buffer the byte array containing the packet data
@param start the index of the first byte containing a numeric value
@par... | java | public static long bytesToNumber(byte[] buffer, int start, int length) {
long result = 0;
for (int index = start; index < start + length; index++) {
result = (result << 8) + unsign(buffer[index]);
}
return result;
} | [
"public",
"static",
"long",
"bytesToNumber",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"index",
"=",
"start",
";",
"index",
"<",
"start",
"+",
"length",
... | Reconstructs a number that is represented by more than one byte in a network packet in big-endian order.
@param buffer the byte array containing the packet data
@param start the index of the first byte containing a numeric value
@param length the number of bytes making up the value
@return the reconstructed number | [
"Reconstructs",
"a",
"number",
"that",
"is",
"represented",
"by",
"more",
"than",
"one",
"byte",
"in",
"a",
"network",
"packet",
"in",
"big",
"-",
"endian",
"order",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Util.java#L242-L248 |
unbescape/unbescape | src/main/java/org/unbescape/properties/PropertiesEscape.java | PropertiesEscape.unescapeProperties | public static void unescapeProperties(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform a Java Properties (key or value) <strong>unescape</strong> operation on a <tt>String</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments a... | java | public static void unescapeProperties(final String text, final Writer writer)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (text == null) {
return;
}
if (text.indexOf('... | [
"public",
"static",
"void",
"unescapeProperties",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'writ... | <p>
Perform a Java Properties (key or value) <strong>unescape</strong> operation on a <tt>String</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments are required. Unescape operations
will always perform <em>complete</em> Java Properties unescape of SECs and u-based escapes.
... | [
"<p",
">",
"Perform",
"a",
"Java",
"Properties",
"(",
"key",
"or",
"value",
")",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Wr... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L1405-L1422 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/xtend-gen/org/eclipse/xtext/xbase/compiler/LoopExtensions.java | LoopExtensions.forEach | public <T extends Object> void forEach(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super LoopParams> loopInitializer, final Procedure1<? super T> procedure) {
"""
Iterates elements and execute the procedure.
A prefix, a separator and a suffix can be initialized with the loopIn... | java | public <T extends Object> void forEach(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super LoopParams> loopInitializer, final Procedure1<? super T> procedure) {
boolean _isEmpty = IterableExtensions.isEmpty(elements);
if (_isEmpty) {
return;
}
LoopParams _loopPar... | [
"public",
"<",
"T",
"extends",
"Object",
">",
"void",
"forEach",
"(",
"final",
"ITreeAppendable",
"appendable",
",",
"final",
"Iterable",
"<",
"T",
">",
"elements",
",",
"final",
"Procedure1",
"<",
"?",
"super",
"LoopParams",
">",
"loopInitializer",
",",
"fi... | Iterates elements and execute the procedure.
A prefix, a separator and a suffix can be initialized with the loopInitializer lambda. | [
"Iterates",
"elements",
"and",
"execute",
"the",
"procedure",
".",
"A",
"prefix",
"a",
"separator",
"and",
"a",
"suffix",
"can",
"be",
"initialized",
"with",
"the",
"loopInitializer",
"lambda",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/xtend-gen/org/eclipse/xtext/xbase/compiler/LoopExtensions.java#L26-L42 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/logging/LoggingUtil.java | LoggingUtil.remoteHost | public static String remoteHost(HttpHeaders headers, Channel channel) {
"""
Returns a remote host from the specified {@link HttpHeaders} and {@link Channel}.
"""
requireNonNull(headers, "headers");
requireNonNull(channel, "channel");
String host = headers.authority();
if (host =... | java | public static String remoteHost(HttpHeaders headers, Channel channel) {
requireNonNull(headers, "headers");
requireNonNull(channel, "channel");
String host = headers.authority();
if (host == null) {
host = ((InetSocketAddress) channel.remoteAddress()).getHostString();
... | [
"public",
"static",
"String",
"remoteHost",
"(",
"HttpHeaders",
"headers",
",",
"Channel",
"channel",
")",
"{",
"requireNonNull",
"(",
"headers",
",",
"\"headers\"",
")",
";",
"requireNonNull",
"(",
"channel",
",",
"\"channel\"",
")",
";",
"String",
"host",
"=... | Returns a remote host from the specified {@link HttpHeaders} and {@link Channel}. | [
"Returns",
"a",
"remote",
"host",
"from",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/logging/LoggingUtil.java#L35-L48 |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.generatePackageDiagrams | private static void generatePackageDiagrams(RootDoc root, Options opt, String outputFolder)
throws IOException {
"""
Generates the package diagrams for all of the packages that contain classes among those
returned by RootDoc.class()
"""
Set<String> packages = new HashSet<String>();
for (ClassDoc classD... | java | private static void generatePackageDiagrams(RootDoc root, Options opt, String outputFolder)
throws IOException {
Set<String> packages = new HashSet<String>();
for (ClassDoc classDoc : root.classes()) {
PackageDoc packageDoc = classDoc.containingPackage();
if(!packages.contains(packageDoc.name())) {
p... | [
"private",
"static",
"void",
"generatePackageDiagrams",
"(",
"RootDoc",
"root",
",",
"Options",
"opt",
",",
"String",
"outputFolder",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"String",
">",
"packages",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")... | Generates the package diagrams for all of the packages that contain classes among those
returned by RootDoc.class() | [
"Generates",
"the",
"package",
"diagrams",
"for",
"all",
"of",
"the",
"packages",
"that",
"contain",
"classes",
"among",
"those",
"returned",
"by",
"RootDoc",
".",
"class",
"()"
] | train | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L87-L101 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java | PathfindableModel.moveTo | private void moveTo(double extrp, int dx, int dy) {
"""
Move to destination.
@param extrp The extrapolation value.
@param dx The destination horizontal location.
@param dy The destination vertical location.
"""
final Force force = getMovementForce(transformable.getX(), transformable.getY(), dx, dy... | java | private void moveTo(double extrp, int dx, int dy)
{
final Force force = getMovementForce(transformable.getX(), transformable.getY(), dx, dy);
final double sx = force.getDirectionHorizontal();
final double sy = force.getDirectionVertical();
// Move object
moveX = sx;
... | [
"private",
"void",
"moveTo",
"(",
"double",
"extrp",
",",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"final",
"Force",
"force",
"=",
"getMovementForce",
"(",
"transformable",
".",
"getX",
"(",
")",
",",
"transformable",
".",
"getY",
"(",
")",
",",
"dx",
... | Move to destination.
@param extrp The extrapolation value.
@param dx The destination horizontal location.
@param dy The destination vertical location. | [
"Move",
"to",
"destination",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java#L315-L353 |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/HessianOutput.java | HessianOutput.printString | public void printString(String v, int offset, int length)
throws IOException {
"""
Prints a string to the stream, encoded as UTF-8
@param v the string to print.
"""
for (int i = 0; i < length; i++) {
char ch = v.charAt(i + offset);
if (ch < 0x80)
os.w... | java | public void printString(String v, int offset, int length)
throws IOException
{
for (int i = 0; i < length; i++) {
char ch = v.charAt(i + offset);
if (ch < 0x80)
os.write(ch);
else if (ch < 0x800) {
os.write(0xc0 + ((ch >> 6) & 0x1f... | [
"public",
"void",
"printString",
"(",
"String",
"v",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"char",
"ch",
"=",
"v",
".",
... | Prints a string to the stream, encoded as UTF-8
@param v the string to print. | [
"Prints",
"a",
"string",
"to",
"the",
"stream",
"encoded",
"as",
"UTF",
"-",
"8"
] | train | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/HessianOutput.java#L915-L933 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listHybridConnectionsAsync | public Observable<Page<HybridConnectionInner>> listHybridConnectionsAsync(final String resourceGroupName, final String name) {
"""
Retrieve all Hybrid Connections in use in an App Service plan.
Retrieve all Hybrid Connections in use in an App Service plan.
@param resourceGroupName Name of the resource group to... | java | public Observable<Page<HybridConnectionInner>> listHybridConnectionsAsync(final String resourceGroupName, final String name) {
return listHybridConnectionsWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<HybridConnectionInner>>, Page<HybridConnectionInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"HybridConnectionInner",
">",
">",
"listHybridConnectionsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listHybridConnectionsWithServiceResponseAsync",
"(",
"resourceGroup... | Retrieve all Hybrid Connections in use in an App Service plan.
Retrieve all Hybrid Connections in use in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Retrieve",
"all",
"Hybrid",
"Connections",
"in",
"use",
"in",
"an",
"App",
"Service",
"plan",
".",
"Retrieve",
"all",
"Hybrid",
"Connections",
"in",
"use",
"in",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1720-L1728 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java | StructurizrDocumentationTemplate.addCodeSection | @Nonnull
public Section addCodeSection(@Nullable Component component, @Nonnull Format format, @Nonnull String content) {
"""
Adds a "Code" section relating to a {@link Component}.
@param component the {@link Component} the documentation content relates to
@param format the {@link Format} of the ... | java | @Nonnull
public Section addCodeSection(@Nullable Component component, @Nonnull Format format, @Nonnull String content) {
return addSection(component, "Code", format, content);
} | [
"@",
"Nonnull",
"public",
"Section",
"addCodeSection",
"(",
"@",
"Nullable",
"Component",
"component",
",",
"@",
"Nonnull",
"Format",
"format",
",",
"@",
"Nonnull",
"String",
"content",
")",
"{",
"return",
"addSection",
"(",
"component",
",",
"\"Code\"",
",",
... | Adds a "Code" section relating to a {@link Component}.
@param component the {@link Component} the documentation content relates to
@param format the {@link Format} of the documentation content
@param content a String containing the documentation content
@return a documentation {@link Sect... | [
"Adds",
"a",
"Code",
"section",
"relating",
"to",
"a",
"{",
"@link",
"Component",
"}",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java#L278-L281 |
codegist/crest | core/src/main/java/org/codegist/crest/interceptor/AbstractRequestInterceptor.java | AbstractRequestInterceptor.newParamConfig | public ParamConfigBuilder newParamConfig(Class<?> type, Type genericType) {
"""
Returns a new param config for the given class and generic type
@param type param config class
@param genericType param config generic type
@return the new param config
"""
return paramConfigBuilderFactory.newInstance(t... | java | public ParamConfigBuilder newParamConfig(Class<?> type, Type genericType){
return paramConfigBuilderFactory.newInstance(type, genericType);
} | [
"public",
"ParamConfigBuilder",
"newParamConfig",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Type",
"genericType",
")",
"{",
"return",
"paramConfigBuilderFactory",
".",
"newInstance",
"(",
"type",
",",
"genericType",
")",
";",
"}"
] | Returns a new param config for the given class and generic type
@param type param config class
@param genericType param config generic type
@return the new param config | [
"Returns",
"a",
"new",
"param",
"config",
"for",
"the",
"given",
"class",
"and",
"generic",
"type"
] | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/interceptor/AbstractRequestInterceptor.java#L59-L61 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.instanceOf | @ArgumentsChecked
@Throws( {
"""
Ensures that a passed argument is a member of a specific type.
@param type
class that the given object is a member of
@param obj
the object reference that should be a member of a specific {@code type}
@param name
name of object reference (in source code)
@return the given... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalInstanceOfArgumentException.class })
@SuppressWarnings("unchecked")
public static <T> T instanceOf(@Nonnull final Class<?> type, @Nonnull final Object obj, @Nullable final String name) {
Check.notNull(type, "type");
Check.notNull(obj, "obj");... | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalInstanceOfArgumentException",
".",
"class",
"}",
")",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"instance... | Ensures that a passed argument is a member of a specific type.
@param type
class that the given object is a member of
@param obj
the object reference that should be a member of a specific {@code type}
@param name
name of object reference (in source code)
@return the given object cast to type
@throws IllegalInstanceOf... | [
"Ensures",
"that",
"a",
"passed",
"argument",
"is",
"a",
"member",
"of",
"a",
"specific",
"type",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1162-L1172 |
facebookarchive/hive-dwrf | hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java | Slice.getBytes | public void getBytes(int index, OutputStream out, int length)
throws IOException {
"""
Transfers a portion of data from this slice into the specified stream starting at the
specified absolute {@code index}.
@param length the number of bytes to transfer
@throws IndexOutOfBoundsException if the spec... | java | public void getBytes(int index, OutputStream out, int length)
throws IOException
{
checkIndexLength(index, length);
out.write(base, index, length);
} | [
"public",
"void",
"getBytes",
"(",
"int",
"index",
",",
"OutputStream",
"out",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"checkIndexLength",
"(",
"index",
",",
"length",
")",
";",
"out",
".",
"write",
"(",
"base",
",",
"index",
",",
"lengt... | Transfers a portion of data from this slice into the specified stream starting at the
specified absolute {@code index}.
@param length the number of bytes to transfer
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
if {@code index + length} is greater than
{@code this.length()... | [
"Transfers",
"a",
"portion",
"of",
"data",
"from",
"this",
"slice",
"into",
"the",
"specified",
"stream",
"starting",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L391-L397 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/extraction/SURFExtractor.java | SURFExtractor.extractFeaturesInternal | protected double[][] extractFeaturesInternal(BufferedImage image) {
"""
Detects key points inside the image and computes descriptions at those points.
"""
ImageFloat32 boofcvImage = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class);
// create the SURF detector and descriptor in Bo... | java | protected double[][] extractFeaturesInternal(BufferedImage image) {
ImageFloat32 boofcvImage = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class);
// create the SURF detector and descriptor in BoofCV v0.15
ConfigFastHessian conf = new ConfigFastHessian(detectThreshold, 2, maxFeaturesPerS... | [
"protected",
"double",
"[",
"]",
"[",
"]",
"extractFeaturesInternal",
"(",
"BufferedImage",
"image",
")",
"{",
"ImageFloat32",
"boofcvImage",
"=",
"ConvertBufferedImage",
".",
"convertFromSingle",
"(",
"image",
",",
"null",
",",
"ImageFloat32",
".",
"class",
")",
... | Detects key points inside the image and computes descriptions at those points. | [
"Detects",
"key",
"points",
"inside",
"the",
"image",
"and",
"computes",
"descriptions",
"at",
"those",
"points",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/extraction/SURFExtractor.java#L44-L59 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getShippingAddress | public ShippingAddress getShippingAddress(final String accountCode, final long shippingAddressId) {
"""
Get an existing shipping address
<p>
@param accountCode recurly account id
@param shippingAddressId the shipping address id to fetch
@return the newly created shipping address on success
"""
re... | java | public ShippingAddress getShippingAddress(final String accountCode, final long shippingAddressId) {
return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE + "/" + shippingAddressId,
ShippingAddress.class);
} | [
"public",
"ShippingAddress",
"getShippingAddress",
"(",
"final",
"String",
"accountCode",
",",
"final",
"long",
"shippingAddressId",
")",
"{",
"return",
"doGET",
"(",
"Accounts",
".",
"ACCOUNTS_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
"ShippingAddresses",
"... | Get an existing shipping address
<p>
@param accountCode recurly account id
@param shippingAddressId the shipping address id to fetch
@return the newly created shipping address on success | [
"Get",
"an",
"existing",
"shipping",
"address",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1192-L1195 |
openxc/openxc-android | library/src/main/java/com/openxc/VehicleManager.java | VehicleManager.addListener | public void addListener(MessageKey key, VehicleMessage.Listener listener) {
"""
Register to receive a callback when a message with the given key is
received.
@param key The key you want to receive updates.
@param listener An listener instance to receive the callback.
"""
addListener(ExactKeyMatche... | java | public void addListener(MessageKey key, VehicleMessage.Listener listener) {
addListener(ExactKeyMatcher.buildExactMatcher(key), listener);
} | [
"public",
"void",
"addListener",
"(",
"MessageKey",
"key",
",",
"VehicleMessage",
".",
"Listener",
"listener",
")",
"{",
"addListener",
"(",
"ExactKeyMatcher",
".",
"buildExactMatcher",
"(",
"key",
")",
",",
"listener",
")",
";",
"}"
] | Register to receive a callback when a message with the given key is
received.
@param key The key you want to receive updates.
@param listener An listener instance to receive the callback. | [
"Register",
"to",
"receive",
"a",
"callback",
"when",
"a",
"message",
"with",
"the",
"given",
"key",
"is",
"received",
"."
] | train | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/VehicleManager.java#L393-L395 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java | WCheckBoxSelectExample.addInsideAFieldLayoutExamples | private void addInsideAFieldLayoutExamples() {
"""
When a WCheckBoxSelect is added to a WFieldLayout the legend is moved. The first CheckBoxSelect has a frame, the
second doesn't
"""
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect inside a WFieldLayout"));
add(new ExplanatoryText("When a WCheckBoxSelec... | java | private void addInsideAFieldLayoutExamples() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect inside a WFieldLayout"));
add(new ExplanatoryText("When a WCheckBoxSelect is inside a WField its label is exposed in a way which appears and behaves like a regular "
+ "HTML label. This allows WCheckBoxSelects to b... | [
"private",
"void",
"addInsideAFieldLayoutExamples",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"WCheckBoxSelect inside a WFieldLayout\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"When a WCheckBoxSelect is i... | When a WCheckBoxSelect is added to a WFieldLayout the legend is moved. The first CheckBoxSelect has a frame, the
second doesn't | [
"When",
"a",
"WCheckBoxSelect",
"is",
"added",
"to",
"a",
"WFieldLayout",
"the",
"legend",
"is",
"moved",
".",
"The",
"first",
"CheckBoxSelect",
"has",
"a",
"frame",
"the",
"second",
"doesn",
"t"
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L177-L204 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java | H2InboundLink.handleHTTP2AlpnConnect | public boolean handleHTTP2AlpnConnect(HttpInboundLink link) {
"""
Handle a connection initiated via ALPN "h2"
@param link the initial inbound link
@return true if the upgrade was sucessful
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "handleHTTP2A... | java | public boolean handleHTTP2AlpnConnect(HttpInboundLink link) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "handleHTTP2AlpnConnect entry");
}
initialHttpInboundLink = link;
Integer streamID = new Integer(0);
H2VirtualConnectionImp... | [
"public",
"boolean",
"handleHTTP2AlpnConnect",
"(",
"HttpInboundLink",
"link",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"handleHT... | Handle a connection initiated via ALPN "h2"
@param link the initial inbound link
@return true if the upgrade was sucessful | [
"Handle",
"a",
"connection",
"initiated",
"via",
"ALPN",
"h2"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L291-L315 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/RedisClient.java | RedisClient.connectPubSub | public <K, V> StatefulRedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec, RedisURI redisURI) {
"""
Open a new pub/sub connection to the Redis server using the supplied {@link RedisURI} and use the supplied
{@link RedisCodec codec} to encode/decode keys and values.
@param codec Use this codec to e... | java | public <K, V> StatefulRedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec, RedisURI redisURI) {
assertNotNull(redisURI);
return getConnection(connectPubSubAsync(codec, redisURI, redisURI.getTimeout()));
} | [
"public",
"<",
"K",
",",
"V",
">",
"StatefulRedisPubSubConnection",
"<",
"K",
",",
"V",
">",
"connectPubSub",
"(",
"RedisCodec",
"<",
"K",
",",
"V",
">",
"codec",
",",
"RedisURI",
"redisURI",
")",
"{",
"assertNotNull",
"(",
"redisURI",
")",
";",
"return"... | Open a new pub/sub connection to the Redis server using the supplied {@link RedisURI} and use the supplied
{@link RedisCodec codec} to encode/decode keys and values.
@param codec Use this codec to encode/decode keys and values, must not be {@literal null}
@param redisURI the Redis server to connect to, must not be {@l... | [
"Open",
"a",
"new",
"pub",
"/",
"sub",
"connection",
"to",
"the",
"Redis",
"server",
"using",
"the",
"supplied",
"{",
"@link",
"RedisURI",
"}",
"and",
"use",
"the",
"supplied",
"{",
"@link",
"RedisCodec",
"codec",
"}",
"to",
"encode",
"/",
"decode",
"key... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisClient.java#L396-L400 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java | Infer.reportInstError | void reportInstError(UndetVar uv, InferenceBound ib) {
"""
Incorporation error: mismatch between inferred type and given bound.
"""
reportInferenceError(
String.format("inferred.do.not.conform.to.%s.bounds", StringUtils.toLowerCase(ib.name())),
uv.getInst(),
... | java | void reportInstError(UndetVar uv, InferenceBound ib) {
reportInferenceError(
String.format("inferred.do.not.conform.to.%s.bounds", StringUtils.toLowerCase(ib.name())),
uv.getInst(),
uv.getBounds(ib));
} | [
"void",
"reportInstError",
"(",
"UndetVar",
"uv",
",",
"InferenceBound",
"ib",
")",
"{",
"reportInferenceError",
"(",
"String",
".",
"format",
"(",
"\"inferred.do.not.conform.to.%s.bounds\"",
",",
"StringUtils",
".",
"toLowerCase",
"(",
"ib",
".",
"name",
"(",
")"... | Incorporation error: mismatch between inferred type and given bound. | [
"Incorporation",
"error",
":",
"mismatch",
"between",
"inferred",
"type",
"and",
"given",
"bound",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java#L1270-L1275 |
tzaeschke/zoodb | src/org/zoodb/internal/util/FormattedStringBuilder.java | FormattedStringBuilder.appendRightAligned | public FormattedStringBuilder appendRightAligned(String s, int alignPosition) {
"""
Appends to the line the white spaces and then the string <tt>s</tt>
so that the end of the string <tt>s</tt> is at the position
<tt>alignPosition</tt>. If the string is longer than the free space
in the buffer to the align posit... | java | public FormattedStringBuilder appendRightAligned(String s, int alignPosition) {
int lineStart = _delegate.lastIndexOf(NL);
int currentLength = _delegate.length();
int rightPosition = alignPosition;
if(lineStart != -1) {
lineStart += NL.length();
rightPositio... | [
"public",
"FormattedStringBuilder",
"appendRightAligned",
"(",
"String",
"s",
",",
"int",
"alignPosition",
")",
"{",
"int",
"lineStart",
"=",
"_delegate",
".",
"lastIndexOf",
"(",
"NL",
")",
";",
"int",
"currentLength",
"=",
"_delegate",
".",
"length",
"(",
")... | Appends to the line the white spaces and then the string <tt>s</tt>
so that the end of the string <tt>s</tt> is at the position
<tt>alignPosition</tt>. If the string is longer than the free space
in the buffer to the align position then an IllegalArgumentException
is thrown.
@param s String to append.
@param alignPosi... | [
"Appends",
"to",
"the",
"line",
"the",
"white",
"spaces",
"and",
"then",
"the",
"string",
"<tt",
">",
"s<",
"/",
"tt",
">",
"so",
"that",
"the",
"end",
"of",
"the",
"string",
"<tt",
">",
"s<",
"/",
"tt",
">",
"is",
"at",
"the",
"position",
"<tt",
... | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/FormattedStringBuilder.java#L149-L166 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.toBean | public static <T> T toBean(String jsonString, Type beanType, boolean ignoreError) {
"""
JSON字符串转为实体类对象,转换异常将被抛出
@param <T> Bean类型
@param jsonString JSON字符串
@param beanType 实体类对象类型
@return 实体类对象
@since 4.3.2
"""
return toBean(parseObj(jsonString), beanType, ignoreError);
} | java | public static <T> T toBean(String jsonString, Type beanType, boolean ignoreError) {
return toBean(parseObj(jsonString), beanType, ignoreError);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"toBean",
"(",
"String",
"jsonString",
",",
"Type",
"beanType",
",",
"boolean",
"ignoreError",
")",
"{",
"return",
"toBean",
"(",
"parseObj",
"(",
"jsonString",
")",
",",
"beanType",
",",
"ignoreError",
")",
";",
"... | JSON字符串转为实体类对象,转换异常将被抛出
@param <T> Bean类型
@param jsonString JSON字符串
@param beanType 实体类对象类型
@return 实体类对象
@since 4.3.2 | [
"JSON字符串转为实体类对象,转换异常将被抛出"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L355-L357 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java | AbstractEJBRuntime.createBeanMetaData | public BeanMetaData createBeanMetaData(BeanInitData bid, EJBModuleMetaDataImpl mmd) // d640935
throws EJBConfigurationException, ContainerException {
"""
Create bean metadata with the specified module and component data. The
resulting BeanMetaData object is partially initialized; sufficiently ... | java | public BeanMetaData createBeanMetaData(BeanInitData bid, EJBModuleMetaDataImpl mmd) // d640935
throws EJBConfigurationException, ContainerException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "create... | [
"public",
"BeanMetaData",
"createBeanMetaData",
"(",
"BeanInitData",
"bid",
",",
"EJBModuleMetaDataImpl",
"mmd",
")",
"// d640935",
"throws",
"EJBConfigurationException",
",",
"ContainerException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTr... | Create bean metadata with the specified module and component data. The
resulting BeanMetaData object is partially initialized; sufficiently that
remote homes can be bound lazily into the namespace. Before the metadata
is usable, {@link #finishBMDInit} must be called. | [
"Create",
"bean",
"metadata",
"with",
"the",
"specified",
"module",
"and",
"component",
"data",
".",
"The",
"resulting",
"BeanMetaData",
"object",
"is",
"partially",
"initialized",
";",
"sufficiently",
"that",
"remote",
"homes",
"can",
"be",
"bound",
"lazily",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1228-L1261 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/pager/QueryPagers.java | QueryPagers.pageRowLocally | public static Iterator<ColumnFamily> pageRowLocally(final ColumnFamilyStore cfs, ByteBuffer key, final int pageSize) {
"""
Convenience method to (locally) page an internal row.
Used to 2ndary index a wide row without dying.
"""
SliceFromReadCommand command = new SliceFromReadCommand(cfs.metadata.ksNam... | java | public static Iterator<ColumnFamily> pageRowLocally(final ColumnFamilyStore cfs, ByteBuffer key, final int pageSize)
{
SliceFromReadCommand command = new SliceFromReadCommand(cfs.metadata.ksName, key, cfs.name, System.currentTimeMillis(), new IdentityQueryFilter());
final SliceQueryPager pager = new... | [
"public",
"static",
"Iterator",
"<",
"ColumnFamily",
">",
"pageRowLocally",
"(",
"final",
"ColumnFamilyStore",
"cfs",
",",
"ByteBuffer",
"key",
",",
"final",
"int",
"pageSize",
")",
"{",
"SliceFromReadCommand",
"command",
"=",
"new",
"SliceFromReadCommand",
"(",
"... | Convenience method to (locally) page an internal row.
Used to 2ndary index a wide row without dying. | [
"Convenience",
"method",
"to",
"(",
"locally",
")",
"page",
"an",
"internal",
"row",
".",
"Used",
"to",
"2ndary",
"index",
"a",
"wide",
"row",
"without",
"dying",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/pager/QueryPagers.java#L138-L170 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createEntityRole | public UUID createEntityRole(UUID appId, String versionId, UUID entityId, CreateEntityRoleOptionalParameter createEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@... | java | public UUID createEntityRole(UUID appId, String versionId, UUID entityId, CreateEntityRoleOptionalParameter createEntityRoleOptionalParameter) {
return createEntityRoleWithServiceResponseAsync(appId, versionId, entityId, createEntityRoleOptionalParameter).toBlocking().single().body();
} | [
"public",
"UUID",
"createEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreateEntityRoleOptionalParameter",
"createEntityRoleOptionalParameter",
")",
"{",
"return",
"createEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thro... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7752-L7754 |
Steveice10/OpenNBT | src/main/java/com/github/steveice10/opennbt/NBTIO.java | NBTIO.writeTag | public static void writeTag(OutputStream out, Tag tag, boolean littleEndian) throws IOException {
"""
Writes an NBT tag.
@param out Output stream to write to.
@param tag Tag to write.
@param littleEndian Whether to write little endian NBT.
@throws java.io.IOException If an I/O error occurs.... | java | public static void writeTag(OutputStream out, Tag tag, boolean littleEndian) throws IOException {
writeTag((DataOutput) (littleEndian ? new LittleEndianDataOutputStream(out) : new DataOutputStream(out)), tag);
} | [
"public",
"static",
"void",
"writeTag",
"(",
"OutputStream",
"out",
",",
"Tag",
"tag",
",",
"boolean",
"littleEndian",
")",
"throws",
"IOException",
"{",
"writeTag",
"(",
"(",
"DataOutput",
")",
"(",
"littleEndian",
"?",
"new",
"LittleEndianDataOutputStream",
"(... | Writes an NBT tag.
@param out Output stream to write to.
@param tag Tag to write.
@param littleEndian Whether to write little endian NBT.
@throws java.io.IOException If an I/O error occurs. | [
"Writes",
"an",
"NBT",
"tag",
"."
] | train | https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/NBTIO.java#L216-L218 |
geomajas/geomajas-project-server | command/src/main/java/org/geomajas/command/geometry/GeometryAreaCommand.java | GeometryAreaCommand.execute | @Override
public void execute(GeometryAreaRequest request, GeometryAreaResponse response) throws Exception {
"""
Calculate the geographical area for each of the requested geometries. The current algorithm uses the global
sinusoidal projection (a so-called equal-area projection) and assumes a spherical earth. Mor... | java | @Override
public void execute(GeometryAreaRequest request, GeometryAreaResponse response) throws Exception {
List<Double> areas = new ArrayList<Double>(request.getGeometries().size());
for (org.geomajas.geometry.Geometry g : request.getGeometries()) {
Geometry geometry = converter.toInternal(g);
double area ... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"GeometryAreaRequest",
"request",
",",
"GeometryAreaResponse",
"response",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Double",
">",
"areas",
"=",
"new",
"ArrayList",
"<",
"Double",
">",
"(",
"request",
"."... | Calculate the geographical area for each of the requested geometries. The current algorithm uses the global
sinusoidal projection (a so-called equal-area projection) and assumes a spherical earth. More accurate
projections exist (Albers, Mollweide, ...) but they are more complicated and cause tolerance problems when
di... | [
"Calculate",
"the",
"geographical",
"area",
"for",
"each",
"of",
"the",
"requested",
"geometries",
".",
"The",
"current",
"algorithm",
"uses",
"the",
"global",
"sinusoidal",
"projection",
"(",
"a",
"so",
"-",
"called",
"equal",
"-",
"area",
"projection",
")",
... | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/command/src/main/java/org/geomajas/command/geometry/GeometryAreaCommand.java#L72-L102 |
watchrabbit/rabbit-commons | src/main/java/com/watchrabbit/commons/sleep/Sleep.java | Sleep.sleep | public static void sleep(long timeout, TimeUnit unit) throws SystemException {
"""
Causes the current thread to wait until the specified waiting time
elapses.
<p>
Any {@code InterruptedException}'s are suppress and logged. Any
{@code Exception}'s thrown by callable are propagate as SystemException
@param ... | java | public static void sleep(long timeout, TimeUnit unit) throws SystemException {
suppress((Long sleepTimeout) -> Thread.sleep(sleepTimeout))
.accept(TimeUnit.MILLISECONDS.convert(timeout, unit));
} | [
"public",
"static",
"void",
"sleep",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"SystemException",
"{",
"suppress",
"(",
"(",
"Long",
"sleepTimeout",
")",
"->",
"Thread",
".",
"sleep",
"(",
"sleepTimeout",
")",
")",
".",
"accept",
"(",... | Causes the current thread to wait until the specified waiting time
elapses.
<p>
Any {@code InterruptedException}'s are suppress and logged. Any
{@code Exception}'s thrown by callable are propagate as SystemException
@param timeout the maximum time to wait
@param unit the time unit of the {@code timeout} argument
@thr... | [
"Causes",
"the",
"current",
"thread",
"to",
"wait",
"until",
"the",
"specified",
"waiting",
"time",
"elapses",
"."
] | train | https://github.com/watchrabbit/rabbit-commons/blob/b11c9f804b5ab70b9264635c34a02f5029bd2a5d/src/main/java/com/watchrabbit/commons/sleep/Sleep.java#L42-L45 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.expectPrivate | public static synchronized <T> IExpectationSetters<T> expectPrivate(Class<?> clazz, Method method,
Object... arguments) throws Exception {
"""
Used to specify expectations on private static methods. If possible use
variant with only method na... | java | public static synchronized <T> IExpectationSetters<T> expectPrivate(Class<?> clazz, Method method,
Object... arguments) throws Exception {
return doExpectPrivate(clazz, method, arguments);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"IExpectationSetters",
"<",
"T",
">",
"expectPrivate",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Method",
"method",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"doExpectPr... | Used to specify expectations on private static methods. If possible use
variant with only method name. | [
"Used",
"to",
"specify",
"expectations",
"on",
"private",
"static",
"methods",
".",
"If",
"possible",
"use",
"variant",
"with",
"only",
"method",
"name",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1140-L1143 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.dateAddStr | public static Expression dateAddStr(Expression expression, int n, DatePart part) {
"""
Returned expression results in Performs Date arithmetic. n and part are used to define an interval or duration,
which is then added (or subtracted) to the date string in a supported format, returning the result.
"""
... | java | public static Expression dateAddStr(Expression expression, int n, DatePart part) {
return x("DATE_ADD_STR(" + expression.toString() + ", " + n + ", \"" + part + "\")");
} | [
"public",
"static",
"Expression",
"dateAddStr",
"(",
"Expression",
"expression",
",",
"int",
"n",
",",
"DatePart",
"part",
")",
"{",
"return",
"x",
"(",
"\"DATE_ADD_STR(\"",
"+",
"expression",
".",
"toString",
"(",
")",
"+",
"\", \"",
"+",
"n",
"+",
"\", \... | Returned expression results in Performs Date arithmetic. n and part are used to define an interval or duration,
which is then added (or subtracted) to the date string in a supported format, returning the result. | [
"Returned",
"expression",
"results",
"in",
"Performs",
"Date",
"arithmetic",
".",
"n",
"and",
"part",
"are",
"used",
"to",
"define",
"an",
"interval",
"or",
"duration",
"which",
"is",
"then",
"added",
"(",
"or",
"subtracted",
")",
"to",
"the",
"date",
"str... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L90-L92 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putRegisteredService | public static void putRegisteredService(final RequestContext context, final RegisteredService registeredService) {
"""
Put registered service into flowscope.
@param context the context
@param registeredService the service
"""
context.getFlowScope().put(PARAMETER_REGISTERED_SERVICE, regist... | java | public static void putRegisteredService(final RequestContext context, final RegisteredService registeredService) {
context.getFlowScope().put(PARAMETER_REGISTERED_SERVICE, registeredService);
} | [
"public",
"static",
"void",
"putRegisteredService",
"(",
"final",
"RequestContext",
"context",
",",
"final",
"RegisteredService",
"registeredService",
")",
"{",
"context",
".",
"getFlowScope",
"(",
")",
".",
"put",
"(",
"PARAMETER_REGISTERED_SERVICE",
",",
"registered... | Put registered service into flowscope.
@param context the context
@param registeredService the service | [
"Put",
"registered",
"service",
"into",
"flowscope",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L340-L342 |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/settings/TextParameter.java | TextParameter.getSuffix | public static String getSuffix (final String string, final String prefix) {
"""
Returns the suffix of a specified {@link String}. The length of the suffix is equal to the length of
<i>string</i> minus the lenght of <i>prefix</i>, but of course only if the beginning of <i>string</i> does equal
<i>prefix<i>. If <i... | java | public static String getSuffix (final String string, final String prefix) {
if (string == null || prefix == null || prefix.length() > string.length()) return null;
final String stringPrefix = string.substring(0, prefix.length());
if (stringPrefix.equals(prefix)) return string.substring(prefix... | [
"public",
"static",
"String",
"getSuffix",
"(",
"final",
"String",
"string",
",",
"final",
"String",
"prefix",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"prefix",
"==",
"null",
"||",
"prefix",
".",
"length",
"(",
")",
">",
"string",
".",
"leng... | Returns the suffix of a specified {@link String}. The length of the suffix is equal to the length of
<i>string</i> minus the lenght of <i>prefix</i>, but of course only if the beginning of <i>string</i> does equal
<i>prefix<i>. If <i>prefix</i> is not a prefix of <i>string</i>, <code>null</code> is returned.
@param st... | [
"Returns",
"the",
"suffix",
"of",
"a",
"specified",
"{",
"@link",
"String",
"}",
".",
"The",
"length",
"of",
"the",
"suffix",
"is",
"equal",
"to",
"the",
"length",
"of",
"<i",
">",
"string<",
"/",
"i",
">",
"minus",
"the",
"lenght",
"of",
"<i",
">",
... | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/settings/TextParameter.java#L67-L72 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java | ScenarioPortrayal.removeDataSerieFromHistogram | public void removeDataSerieFromHistogram(String histogramID, int index) {
"""
Deletes a certain series of data from the histogram.
The index will be the order of the histogram.
@param histogramID
@param index - the index of the data
"""
if (this.histograms.containsKey(histogramID)) {
... | java | public void removeDataSerieFromHistogram(String histogramID, int index) {
if (this.histograms.containsKey(histogramID)) {
this.histograms.get(histogramID).removeSeries(index);
}
} | [
"public",
"void",
"removeDataSerieFromHistogram",
"(",
"String",
"histogramID",
",",
"int",
"index",
")",
"{",
"if",
"(",
"this",
".",
"histograms",
".",
"containsKey",
"(",
"histogramID",
")",
")",
"{",
"this",
".",
"histograms",
".",
"get",
"(",
"histogram... | Deletes a certain series of data from the histogram.
The index will be the order of the histogram.
@param histogramID
@param index - the index of the data | [
"Deletes",
"a",
"certain",
"series",
"of",
"data",
"from",
"the",
"histogram",
".",
"The",
"index",
"will",
"be",
"the",
"order",
"of",
"the",
"histogram",
"."
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java#L453-L457 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java | OmemoService.deleteStaleDevices | private OmemoCachedDeviceList deleteStaleDevices(OmemoDevice userDevice) {
"""
Return a copy of our deviceList, but with stale devices marked as inactive.
Never mark our own device as stale.
This method ignores {@link OmemoConfiguration#getDeleteStaleDevices()}!
In this case, a stale device is one of our devi... | java | private OmemoCachedDeviceList deleteStaleDevices(OmemoDevice userDevice) {
OmemoCachedDeviceList deviceList = getOmemoStoreBackend().loadCachedDeviceList(userDevice);
int maxAgeHours = OmemoConfiguration.getDeleteStaleDevicesAfterHours();
return removeStaleDevicesFromDeviceList(userDevice, userD... | [
"private",
"OmemoCachedDeviceList",
"deleteStaleDevices",
"(",
"OmemoDevice",
"userDevice",
")",
"{",
"OmemoCachedDeviceList",
"deviceList",
"=",
"getOmemoStoreBackend",
"(",
")",
".",
"loadCachedDeviceList",
"(",
"userDevice",
")",
";",
"int",
"maxAgeHours",
"=",
"Omem... | Return a copy of our deviceList, but with stale devices marked as inactive.
Never mark our own device as stale.
This method ignores {@link OmemoConfiguration#getDeleteStaleDevices()}!
In this case, a stale device is one of our devices, from which we haven't received an OMEMO message from
for more than {@link OmemoConf... | [
"Return",
"a",
"copy",
"of",
"our",
"deviceList",
"but",
"with",
"stale",
"devices",
"marked",
"as",
"inactive",
".",
"Never",
"mark",
"our",
"own",
"device",
"as",
"stale",
".",
"This",
"method",
"ignores",
"{",
"@link",
"OmemoConfiguration#getDeleteStaleDevice... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java#L919-L923 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/JSONs.java | JSONs.requiredVM | public static VM requiredVM(Model mo, JSONObject o, String id) throws JSONConverterException {
"""
Read an expected VM.
@param mo the associated model to browse
@param o the object to parse
@param id the key in the map that points to the VM identifier
@return the VM
@throws JSONConverterException if the ke... | java | public static VM requiredVM(Model mo, JSONObject o, String id) throws JSONConverterException {
checkKeys(o, id);
try {
return getVM(mo, (Integer) o.get(id));
} catch (ClassCastException e) {
throw new JSONConverterException("Unable to read a VM identifier from string at k... | [
"public",
"static",
"VM",
"requiredVM",
"(",
"Model",
"mo",
",",
"JSONObject",
"o",
",",
"String",
"id",
")",
"throws",
"JSONConverterException",
"{",
"checkKeys",
"(",
"o",
",",
"id",
")",
";",
"try",
"{",
"return",
"getVM",
"(",
"mo",
",",
"(",
"Inte... | Read an expected VM.
@param mo the associated model to browse
@param o the object to parse
@param id the key in the map that points to the VM identifier
@return the VM
@throws JSONConverterException if the key does not point to a VM identifier | [
"Read",
"an",
"expected",
"VM",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/JSONs.java#L341-L348 |
xwiki/xwiki-rendering | xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java | InternalWikiScannerContext.onVerbatim | public void onVerbatim(String str, WikiParameters params) {
"""
Waiting for following events to know if the verbatim is inline or not.
"""
checkBlockContainer();
fVerbatimContent = str;
fVerbatimParameters = params;
} | java | public void onVerbatim(String str, WikiParameters params)
{
checkBlockContainer();
fVerbatimContent = str;
fVerbatimParameters = params;
} | [
"public",
"void",
"onVerbatim",
"(",
"String",
"str",
",",
"WikiParameters",
"params",
")",
"{",
"checkBlockContainer",
"(",
")",
";",
"fVerbatimContent",
"=",
"str",
";",
"fVerbatimParameters",
"=",
"params",
";",
"}"
] | Waiting for following events to know if the verbatim is inline or not. | [
"Waiting",
"for",
"following",
"events",
"to",
"know",
"if",
"the",
"verbatim",
"is",
"inline",
"or",
"not",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java#L1131-L1137 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ModulesInner.java | ModulesInner.get | public ModuleInner get(String resourceGroupName, String automationAccountName, String moduleName) {
"""
Retrieve the module identified by module name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param moduleName The module name.
... | java | public ModuleInner get(String resourceGroupName, String automationAccountName, String moduleName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, moduleName).toBlocking().single().body();
} | [
"public",
"ModuleInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"moduleName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
",",
"moduleName",
")",
".... | Retrieve the module identified by module name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param moduleName The module name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if... | [
"Retrieve",
"the",
"module",
"identified",
"by",
"module",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ModulesInner.java#L194-L196 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/ReedSolomonCode.java | ReedSolomonCode.computeSyndrome | private boolean computeSyndrome(int[] data, int [] syndrome) {
"""
Compute the syndrome of the input [parity, message]
@param data [parity, message]
@param syndrome The syndromes (checksums) of the data
@return true If syndromes are all zeros
"""
boolean corruptionFound = false;
for (int i = 0; i < ... | java | private boolean computeSyndrome(int[] data, int [] syndrome) {
boolean corruptionFound = false;
for (int i = 0; i < paritySize; i++) {
syndrome[i] = GF.substitute(data, primitivePower[i]);
if (syndrome[i] != 0) {
corruptionFound = true;
}
}
return !corruptionFound;
} | [
"private",
"boolean",
"computeSyndrome",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"[",
"]",
"syndrome",
")",
"{",
"boolean",
"corruptionFound",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"paritySize",
";",
"i",
"++",
")",
... | Compute the syndrome of the input [parity, message]
@param data [parity, message]
@param syndrome The syndromes (checksums) of the data
@return true If syndromes are all zeros | [
"Compute",
"the",
"syndrome",
"of",
"the",
"input",
"[",
"parity",
"message",
"]"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/ReedSolomonCode.java#L299-L308 |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/utils/JDBCConnectionManager.java | JDBCConnectionManager.getConnection | public Connection getConnection(String url, String username, String password) throws SQLException {
"""
Retrieves the connection object. If the
connection doesnt exist or is dead, it will attempt to create a new
connection.
"""
boolean alive = isConnectionAlive();
if (!alive) {
createConnection(url, u... | java | public Connection getConnection(String url, String username, String password) throws SQLException {
boolean alive = isConnectionAlive();
if (!alive) {
createConnection(url, username, password);
}
return connection;
} | [
"public",
"Connection",
"getConnection",
"(",
"String",
"url",
",",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"boolean",
"alive",
"=",
"isConnectionAlive",
"(",
")",
";",
"if",
"(",
"!",
"alive",
")",
"{",
"createCo... | Retrieves the connection object. If the
connection doesnt exist or is dead, it will attempt to create a new
connection. | [
"Retrieves",
"the",
"connection",
"object",
".",
"If",
"the",
"connection",
"doesnt",
"exist",
"or",
"is",
"dead",
"it",
"will",
"attempt",
"to",
"create",
"a",
"new",
"connection",
"."
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/utils/JDBCConnectionManager.java#L94-L100 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/utilities/ServerUtility.java | ServerUtility.getServerResponseAsStream | private static InputStream getServerResponseAsStream(String protocol,
String user,
String pass,
String path) throws IOException {
"""
Hits the given Fedora Server URL and returns the ... | java | private static InputStream getServerResponseAsStream(String protocol,
String user,
String pass,
String path) throws IOException {
String url = getBaseURL(protocol) + path;
... | [
"private",
"static",
"InputStream",
"getServerResponseAsStream",
"(",
"String",
"protocol",
",",
"String",
"user",
",",
"String",
"pass",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"url",
"=",
"getBaseURL",
"(",
"protocol",
")",
"+",
"... | Hits the given Fedora Server URL and returns the response as a String.
Throws an IOException if the response code is not 200(OK). | [
"Hits",
"the",
"given",
"Fedora",
"Server",
"URL",
"and",
"returns",
"the",
"response",
"as",
"a",
"String",
".",
"Throws",
"an",
"IOException",
"if",
"the",
"response",
"code",
"is",
"not",
"200",
"(",
"OK",
")",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/utilities/ServerUtility.java#L144-L153 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.startJanus | public static Kernel startJanus(Class<? extends Agent> agentCls, Object... params)
throws Exception {
"""
Launch the Janus kernel and the first agent in the kernel.
<p>Thus function does not parse the command line. See {@link #main(String[])} for the command line management. When this
function is called, it... | java | public static Kernel startJanus(Class<? extends Agent> agentCls, Object... params)
throws Exception {
return startJanusWithModuleType(null, agentCls, params);
} | [
"public",
"static",
"Kernel",
"startJanus",
"(",
"Class",
"<",
"?",
"extends",
"Agent",
">",
"agentCls",
",",
"Object",
"...",
"params",
")",
"throws",
"Exception",
"{",
"return",
"startJanusWithModuleType",
"(",
"null",
",",
"agentCls",
",",
"params",
")",
... | Launch the Janus kernel and the first agent in the kernel.
<p>Thus function does not parse the command line. See {@link #main(String[])} for the command line management. When this
function is called, it is assumed that all the system's properties are correctly set.
<p>The platformModule parameter permits to specify t... | [
"Launch",
"the",
"Janus",
"kernel",
"and",
"the",
"first",
"agent",
"in",
"the",
"kernel",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L922-L925 |
abel533/EasyXls | src/main/java/com/github/abel533/easyxls/common/XlsUtil.java | XlsUtil.list2Xls | public static boolean list2Xls(List<?> list, String xmlPath, String filePath, String fileName) throws Exception {
"""
导出list对象到excel
@param list 导出的list
@param xmlPath xml完整路径
@param filePath 保存xls路径
@param fileName 保存xls文件名
@return 处理结果,true成功,false失败
@throws Exception
"""
//创建目录
... | java | public static boolean list2Xls(List<?> list, String xmlPath, String filePath, String fileName) throws Exception {
//创建目录
File file = new File(filePath);
if (!(file.exists())) {
if (!file.mkdirs()) {
throw new RuntimeException("创建导出目录失败!");
}
}
... | [
"public",
"static",
"boolean",
"list2Xls",
"(",
"List",
"<",
"?",
">",
"list",
",",
"String",
"xmlPath",
",",
"String",
"filePath",
",",
"String",
"fileName",
")",
"throws",
"Exception",
"{",
"//创建目录",
"File",
"file",
"=",
"new",
"File",
"(",
"filePath",
... | 导出list对象到excel
@param list 导出的list
@param xmlPath xml完整路径
@param filePath 保存xls路径
@param fileName 保存xls文件名
@return 处理结果,true成功,false失败
@throws Exception | [
"导出list对象到excel"
] | train | https://github.com/abel533/EasyXls/blob/f73be23745c2180d7c0b8f0a510e72e61cc37d5d/src/main/java/com/github/abel533/easyxls/common/XlsUtil.java#L313-L327 |
geomajas/geomajas-project-client-gwt2 | plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/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) {
return delegate.getSiblingCount(geometry, toDelegate(index));
} | [
"public",
"int",
"getSiblingCount",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"{",
"return",
"delegate",
".",
"getSiblingCount",
"(",
"geometry",
",",
"toDelegate",
"(",
"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 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-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/service/GeometryIndexService.java#L344-L346 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/impl/MapAssociationRowsHelpers.java | MapAssociationRowsHelpers.setMapValue | private static void setMapValue(Map<String, Object> target, String name, Map<String, Object> value) {
"""
Saves each entry of the map as a single property using the path separator.
<p>
For example { k1 = { k11 = v11, k12 = v12 } } becomes { k1.k11=v11, k1.k12=v12 }.
"""
for ( Map.Entry<String, Object> entr... | java | private static void setMapValue(Map<String, Object> target, String name, Map<String, Object> value) {
for ( Map.Entry<String, Object> entry : value.entrySet() ) {
set( target, name + PATH_SEPARATOR + entry.getKey(), entry.getValue() );
}
} | [
"private",
"static",
"void",
"setMapValue",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"target",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"value",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object... | Saves each entry of the map as a single property using the path separator.
<p>
For example { k1 = { k11 = v11, k12 = v12 } } becomes { k1.k11=v11, k1.k12=v12 }. | [
"Saves",
"each",
"entry",
"of",
"the",
"map",
"as",
"a",
"single",
"property",
"using",
"the",
"path",
"separator",
".",
"<p",
">",
"For",
"example",
"{",
"k1",
"=",
"{",
"k11",
"=",
"v11",
"k12",
"=",
"v12",
"}",
"}",
"becomes",
"{",
"k1",
".",
... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/impl/MapAssociationRowsHelpers.java#L149-L153 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java | RaXmlGen.writeConfigPropsXml | void writeConfigPropsXml(List<ConfigPropType> props, Writer out, int indent) throws IOException {
"""
Output config props xml part
@param props config properties
@param out Writer
@param indent space number
@throws IOException ioException
"""
if (props == null || props.size() == 0)
ret... | java | void writeConfigPropsXml(List<ConfigPropType> props, Writer out, int indent) throws IOException
{
if (props == null || props.size() == 0)
return;
for (ConfigPropType prop : props)
{
writeIndent(out, indent);
out.write("<config-property>");
writeEol(out);
... | [
"void",
"writeConfigPropsXml",
"(",
"List",
"<",
"ConfigPropType",
">",
"props",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"props",
"==",
"null",
"||",
"props",
".",
"size",
"(",
")",
"==",
"0",
")",
"ret... | Output config props xml part
@param props config properties
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"config",
"props",
"xml",
"part"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java#L166-L191 |
actframework/actframework | src/main/java/act/event/EventBus.java | EventBus.emitSync | public EventBus emitSync(Enum<?> event, Object... args) {
"""
Emit an enum event with parameters and force all listener to be called synchronously.
@param event
the target event
@param args
the arguments passed in
@see #emit(Enum, Object...)
"""
return _emitWithOnceBus(eventContextSync(event, ar... | java | public EventBus emitSync(Enum<?> event, Object... args) {
return _emitWithOnceBus(eventContextSync(event, args));
} | [
"public",
"EventBus",
"emitSync",
"(",
"Enum",
"<",
"?",
">",
"event",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"_emitWithOnceBus",
"(",
"eventContextSync",
"(",
"event",
",",
"args",
")",
")",
";",
"}"
] | Emit an enum event with parameters and force all listener to be called synchronously.
@param event
the target event
@param args
the arguments passed in
@see #emit(Enum, Object...) | [
"Emit",
"an",
"enum",
"event",
"with",
"parameters",
"and",
"force",
"all",
"listener",
"to",
"be",
"called",
"synchronously",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/event/EventBus.java#L1079-L1081 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/SimpleTimeZone.java | SimpleTimeZone.setEndRule | private void setEndRule(int month, int dayOfWeekInMonth, int dayOfWeek, int time, int mode) {
"""
Sets the daylight savings ending rule. For example, in the U.S., Daylight
Savings Time ends at the first Sunday in November, at 2 AM in standard time.
Therefore, you can set the end rule by calling:
setEndRule(Cale... | java | private void setEndRule(int month, int dayOfWeekInMonth, int dayOfWeek, int time, int mode){
assert (!isFrozen());
endMonth = month;
endDay = dayOfWeekInMonth;
endDayOfWeek = dayOfWeek;
endTime = time;
endTimeMode = mode;
decodeEndRule();
... | [
"private",
"void",
"setEndRule",
"(",
"int",
"month",
",",
"int",
"dayOfWeekInMonth",
",",
"int",
"dayOfWeek",
",",
"int",
"time",
",",
"int",
"mode",
")",
"{",
"assert",
"(",
"!",
"isFrozen",
"(",
")",
")",
";",
"endMonth",
"=",
"month",
";",
"endDay"... | Sets the daylight savings ending rule. For example, in the U.S., Daylight
Savings Time ends at the first Sunday in November, at 2 AM in standard time.
Therefore, you can set the end rule by calling:
setEndRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2*60*60*1000);
Various other types of rules can be specified by manipul... | [
"Sets",
"the",
"daylight",
"savings",
"ending",
"rule",
".",
"For",
"example",
"in",
"the",
"U",
".",
"S",
".",
"Daylight",
"Savings",
"Time",
"ends",
"at",
"the",
"first",
"Sunday",
"in",
"November",
"at",
"2",
"AM",
"in",
"standard",
"time",
".",
"Th... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/SimpleTimeZone.java#L509-L520 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UpdateIdentityProviderRequest.java | UpdateIdentityProviderRequest.withProviderDetails | public UpdateIdentityProviderRequest withProviderDetails(java.util.Map<String, String> providerDetails) {
"""
<p>
The identity provider details to be updated, such as <code>MetadataURL</code> and <code>MetadataFile</code>.
</p>
@param providerDetails
The identity provider details to be updated, such as <code... | java | public UpdateIdentityProviderRequest withProviderDetails(java.util.Map<String, String> providerDetails) {
setProviderDetails(providerDetails);
return this;
} | [
"public",
"UpdateIdentityProviderRequest",
"withProviderDetails",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"providerDetails",
")",
"{",
"setProviderDetails",
"(",
"providerDetails",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The identity provider details to be updated, such as <code>MetadataURL</code> and <code>MetadataFile</code>.
</p>
@param providerDetails
The identity provider details to be updated, such as <code>MetadataURL</code> and
<code>MetadataFile</code>.
@return Returns a reference to this object so that method calls can b... | [
"<p",
">",
"The",
"identity",
"provider",
"details",
"to",
"be",
"updated",
"such",
"as",
"<code",
">",
"MetadataURL<",
"/",
"code",
">",
"and",
"<code",
">",
"MetadataFile<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UpdateIdentityProviderRequest.java#L177-L180 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/async/AsyncContext31Impl.java | AsyncContext31Impl.startReadListener | public void startReadListener(ThreadContextManager tcm, SRTInputStream31 inputStream) throws Exception {
"""
A read listener has been set on the SRTInputStream and we will set it up to do its
first read on another thread.
"""
try {
ReadListenerRunnable rlRunnable = new ReadListenerRunnable... | java | public void startReadListener(ThreadContextManager tcm, SRTInputStream31 inputStream) throws Exception{
try {
ReadListenerRunnable rlRunnable = new ReadListenerRunnable(tcm, inputStream, this);
this.setReadListenerRunning(true);
com.ibm.ws.webcontainer.osgi.WebContainer.getEx... | [
"public",
"void",
"startReadListener",
"(",
"ThreadContextManager",
"tcm",
",",
"SRTInputStream31",
"inputStream",
")",
"throws",
"Exception",
"{",
"try",
"{",
"ReadListenerRunnable",
"rlRunnable",
"=",
"new",
"ReadListenerRunnable",
"(",
"tcm",
",",
"inputStream",
",... | A read listener has been set on the SRTInputStream and we will set it up to do its
first read on another thread. | [
"A",
"read",
"listener",
"has",
"been",
"set",
"on",
"the",
"SRTInputStream",
"and",
"we",
"will",
"set",
"it",
"up",
"to",
"do",
"its",
"first",
"read",
"on",
"another",
"thread",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/async/AsyncContext31Impl.java#L193-L208 |
netty/netty | transport/src/main/java/io/netty/channel/AbstractCoalescingBufferQueue.java | AbstractCoalescingBufferQueue.copyAndCompose | protected final ByteBuf copyAndCompose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next) {
"""
Compose {@code cumulation} and {@code next} into a new {@link ByteBufAllocator#ioBuffer()}.
@param alloc The allocator to use to allocate the new buffer.
@param cumulation The current cumulation.
@param next T... | java | protected final ByteBuf copyAndCompose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next) {
ByteBuf newCumulation = alloc.ioBuffer(cumulation.readableBytes() + next.readableBytes());
try {
newCumulation.writeBytes(cumulation).writeBytes(next);
} catch (Throwable cause) {
... | [
"protected",
"final",
"ByteBuf",
"copyAndCompose",
"(",
"ByteBufAllocator",
"alloc",
",",
"ByteBuf",
"cumulation",
",",
"ByteBuf",
"next",
")",
"{",
"ByteBuf",
"newCumulation",
"=",
"alloc",
".",
"ioBuffer",
"(",
"cumulation",
".",
"readableBytes",
"(",
")",
"+"... | Compose {@code cumulation} and {@code next} into a new {@link ByteBufAllocator#ioBuffer()}.
@param alloc The allocator to use to allocate the new buffer.
@param cumulation The current cumulation.
@param next The next buffer.
@return The result of {@code cumulation + next}. | [
"Compose",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/AbstractCoalescingBufferQueue.java#L292-L304 |
eclipse/hawkbit | hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java | AmqpMessageHandlerService.onMessage | @RabbitListener(queues = "$ {
"""
Method to handle all incoming DMF amqp messages.
@param message
incoming message
@param type
the message type
@param tenant
the contentType of the message
@return a message if <null> no message is send back to sender
"""hawkbit.dmf.rabbitmq.receiverQueue:dmf_receive... | java | @RabbitListener(queues = "${hawkbit.dmf.rabbitmq.receiverQueue:dmf_receiver}", containerFactory = "listenerContainerFactory")
public Message onMessage(final Message message,
@Header(name = MessageHeaderKey.TYPE, required = false) final String type,
@Header(name = MessageHeaderKey.TENANT, req... | [
"@",
"RabbitListener",
"(",
"queues",
"=",
"\"${hawkbit.dmf.rabbitmq.receiverQueue:dmf_receiver}\"",
",",
"containerFactory",
"=",
"\"listenerContainerFactory\"",
")",
"public",
"Message",
"onMessage",
"(",
"final",
"Message",
"message",
",",
"@",
"Header",
"(",
"name",
... | Method to handle all incoming DMF amqp messages.
@param message
incoming message
@param type
the message type
@param tenant
the contentType of the message
@return a message if <null> no message is send back to sender | [
"Method",
"to",
"handle",
"all",
"incoming",
"DMF",
"amqp",
"messages",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java#L106-L111 |
FitLayout/segmentation | src/main/java/org/fit/segm/grouping/op/SeparatorSet.java | SeparatorSet.isSeparatorAt | public boolean isSeparatorAt(int x, int y) {
"""
Checks if a point is covered by a separator.
@param x the point x coordinate
@param y the point y coordinate
@return <code>true</code> if any of the separators in this set covers the specified point
"""
return containsSeparatorAt(x, y, bsep) ||
... | java | public boolean isSeparatorAt(int x, int y)
{
return containsSeparatorAt(x, y, bsep) ||
containsSeparatorAt(x, y, hsep) ||
containsSeparatorAt(x, y, vsep);
} | [
"public",
"boolean",
"isSeparatorAt",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"containsSeparatorAt",
"(",
"x",
",",
"y",
",",
"bsep",
")",
"||",
"containsSeparatorAt",
"(",
"x",
",",
"y",
",",
"hsep",
")",
"||",
"containsSeparatorAt",
"(",
... | Checks if a point is covered by a separator.
@param x the point x coordinate
@param y the point y coordinate
@return <code>true</code> if any of the separators in this set covers the specified point | [
"Checks",
"if",
"a",
"point",
"is",
"covered",
"by",
"a",
"separator",
"."
] | train | https://github.com/FitLayout/segmentation/blob/12998087d576640c2f2a6360cf6088af95eea5f4/src/main/java/org/fit/segm/grouping/op/SeparatorSet.java#L131-L136 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.getReplacement | private static String getReplacement(Matcher matcher, Closure closure) {
"""
Get a replacement corresponding to the matched pattern for {@link org.codehaus.groovy.runtime.StringGroovyMethods#replaceAll(String, java.util.regex.Pattern, groovy.lang.Closure)}.
The closure take parameter:
<ul>
<li>Whole of match if... | java | private static String getReplacement(Matcher matcher, Closure closure) {
if (!hasGroup(matcher)) {
return InvokerHelper.toString(closure.call(matcher.group()));
}
int count = matcher.groupCount();
List<String> groups = new ArrayList<String>();
for (int i = 0; i <= co... | [
"private",
"static",
"String",
"getReplacement",
"(",
"Matcher",
"matcher",
",",
"Closure",
"closure",
")",
"{",
"if",
"(",
"!",
"hasGroup",
"(",
"matcher",
")",
")",
"{",
"return",
"InvokerHelper",
".",
"toString",
"(",
"closure",
".",
"call",
"(",
"match... | Get a replacement corresponding to the matched pattern for {@link org.codehaus.groovy.runtime.StringGroovyMethods#replaceAll(String, java.util.regex.Pattern, groovy.lang.Closure)}.
The closure take parameter:
<ul>
<li>Whole of match if the pattern include no capturing group</li>
<li>Object[] of capturing groups if the ... | [
"Get",
"a",
"replacement",
"corresponding",
"to",
"the",
"matched",
"pattern",
"for",
"{",
"@link",
"org",
".",
"codehaus",
".",
"groovy",
".",
"runtime",
".",
"StringGroovyMethods#replaceAll",
"(",
"String",
"java",
".",
"util",
".",
"regex",
".",
"Pattern",
... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1541-L1557 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.deleteVnetRouteAsync | public Observable<Void> deleteVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName) {
"""
Delete a Virtual Network route in an App Service plan.
Delete a Virtual Network route in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource be... | java | public Observable<Void> deleteVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName) {
return deleteVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteVnetRouteAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"vnetName",
",",
"String",
"routeName",
")",
"{",
"return",
"deleteVnetRouteWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Delete a Virtual Network route in an App Service plan.
Delete a Virtual Network route in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param vnetName Name of the Virtual Network.
@param routeName Name of the Virtual Ne... | [
"Delete",
"a",
"Virtual",
"Network",
"route",
"in",
"an",
"App",
"Service",
"plan",
".",
"Delete",
"a",
"Virtual",
"Network",
"route",
"in",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L3736-L3743 |
soulgalore/crawler | src/main/java/com/soulgalore/crawler/run/AbstractCrawl.java | AbstractCrawl.getOptions | @Override
protected Options getOptions() {
"""
Get hold of the default options.
@return the options that needs to run a crawl
"""
final Options options = super.getOptions();
final Option urlOption =
new Option("u",
"the page that is the startpoint of the crawl, examle http://m... | java | @Override
protected Options getOptions() {
final Options options = super.getOptions();
final Option urlOption =
new Option("u",
"the page that is the startpoint of the crawl, examle http://mydomain.com/mypage");
urlOption.setLongOpt(URL);
urlOption.setArgName("URL");
urlOption... | [
"@",
"Override",
"protected",
"Options",
"getOptions",
"(",
")",
"{",
"final",
"Options",
"options",
"=",
"super",
".",
"getOptions",
"(",
")",
";",
"final",
"Option",
"urlOption",
"=",
"new",
"Option",
"(",
"\"u\"",
",",
"\"the page that is the startpoint of th... | Get hold of the default options.
@return the options that needs to run a crawl | [
"Get",
"hold",
"of",
"the",
"default",
"options",
"."
] | train | https://github.com/soulgalore/crawler/blob/715ee7f1454eec14bebcb6d12563dfc32d9bbf48/src/main/java/com/soulgalore/crawler/run/AbstractCrawl.java#L77-L134 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsInner.java | ExpressRouteCircuitConnectionsInner.createOrUpdateAsync | public Observable<ExpressRouteCircuitConnectionInner> createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) {
"""
Creates or updates a Express Route Circuit Connection in the specified... | java | public Observable<ExpressRouteCircuitConnectionInner> createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, circui... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitConnectionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
",",
"String",
"connectionName",
",",
"ExpressRouteCircuitConnectionInner",
"expressR... | Creates or updates a Express Route Circuit Connection in the specified express route circuits.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@param connectionName The name of the express route circuit conne... | [
"Creates",
"or",
"updates",
"a",
"Express",
"Route",
"Circuit",
"Connection",
"in",
"the",
"specified",
"express",
"route",
"circuits",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsInner.java#L401-L408 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/DefaultPluginLoader.java | DefaultPluginLoader.loadClasses | protected void loadClasses(Path pluginPath, PluginClassLoader pluginClassLoader) {
"""
Add all {@code *.class} files from {@code classes} directories to plugin class loader.
"""
for (String directory : pluginClasspath.getClassesDirectories()) {
File file = pluginPath.resolve(directory).toFi... | java | protected void loadClasses(Path pluginPath, PluginClassLoader pluginClassLoader) {
for (String directory : pluginClasspath.getClassesDirectories()) {
File file = pluginPath.resolve(directory).toFile();
if (file.exists() && file.isDirectory()) {
pluginClassLoader.addFile(f... | [
"protected",
"void",
"loadClasses",
"(",
"Path",
"pluginPath",
",",
"PluginClassLoader",
"pluginClassLoader",
")",
"{",
"for",
"(",
"String",
"directory",
":",
"pluginClasspath",
".",
"getClassesDirectories",
"(",
")",
")",
"{",
"File",
"file",
"=",
"pluginPath",
... | Add all {@code *.class} files from {@code classes} directories to plugin class loader. | [
"Add",
"all",
"{"
] | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/DefaultPluginLoader.java#L64-L71 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.isDescendantOrEqual | public static boolean isDescendantOrEqual(String path, String descendant) {
"""
Determines if the <code>descendant</code> path is hierarchical a descendant of
<code>path</code> or equal to it.
@param path
the path to check
@param descendant
the potential descendant
@return <code>true</code> if the <code>de... | java | public static boolean isDescendantOrEqual(String path, String descendant)
{
if (path.equals(descendant))
{
return true;
}
else
{
String pattern = path.endsWith("/") ? path : path + "/";
return descendant.startsWith(pattern);
}
} | [
"public",
"static",
"boolean",
"isDescendantOrEqual",
"(",
"String",
"path",
",",
"String",
"descendant",
")",
"{",
"if",
"(",
"path",
".",
"equals",
"(",
"descendant",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"String",
"pattern",
"=",
"pa... | Determines if the <code>descendant</code> path is hierarchical a descendant of
<code>path</code> or equal to it.
@param path
the path to check
@param descendant
the potential descendant
@return <code>true</code> if the <code>descendant</code> is a descendant or equal;
<code>false</code> otherwise. | [
"Determines",
"if",
"the",
"<code",
">",
"descendant<",
"/",
"code",
">",
"path",
"is",
"hierarchical",
"a",
"descendant",
"of",
"<code",
">",
"path<",
"/",
"code",
">",
"or",
"equal",
"to",
"it",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L733-L744 |
Netflix/spectator | spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketTimer.java | BucketTimer.get | public static BucketTimer get(Id id, BucketFunction f) {
"""
Creates a timer object that manages a set of timers based on the bucket
function supplied. Calling record will be mapped to the record on the appropriate timer.
@param id
Identifier for the metric being registered.
@param f
Function to map values ... | java | public static BucketTimer get(Id id, BucketFunction f) {
return get(Spectator.globalRegistry(), id, f);
} | [
"public",
"static",
"BucketTimer",
"get",
"(",
"Id",
"id",
",",
"BucketFunction",
"f",
")",
"{",
"return",
"get",
"(",
"Spectator",
".",
"globalRegistry",
"(",
")",
",",
"id",
",",
"f",
")",
";",
"}"
] | Creates a timer object that manages a set of timers based on the bucket
function supplied. Calling record will be mapped to the record on the appropriate timer.
@param id
Identifier for the metric being registered.
@param f
Function to map values to buckets.
@return
Timer that manages sub-timers based on the bucket fu... | [
"Creates",
"a",
"timer",
"object",
"that",
"manages",
"a",
"set",
"of",
"timers",
"based",
"on",
"the",
"bucket",
"function",
"supplied",
".",
"Calling",
"record",
"will",
"be",
"mapped",
"to",
"the",
"record",
"on",
"the",
"appropriate",
"timer",
"."
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketTimer.java#L46-L48 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_PUT | public void billingAccount_line_serviceName_PUT(String billingAccount, String serviceName, OvhLine body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/line/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your... | java | public void billingAccount_line_serviceName_PUT(String billingAccount, String serviceName, OvhLine body) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_line_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhLine",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/line/{serviceName}\"",
";",
"StringBuild... | Alter this object properties
REST: PUT /telephony/{billingAccount}/line/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1485-L1489 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java | JobScheduleOperations.enableJobSchedule | public void enableJobSchedule(String jobScheduleId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Enables the specified job schedule, allowing jobs to be created according to its {@link Schedule}.
@param jobScheduleId The ID of the job schedule.
@param additio... | java | public void enableJobSchedule(String jobScheduleId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
JobScheduleEnableOptions options = new JobScheduleEnableOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
... | [
"public",
"void",
"enableJobSchedule",
"(",
"String",
"jobScheduleId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"JobScheduleEnableOptions",
"options",
"=",
"new",
"JobScheduleEn... | Enables the specified job schedule, allowing jobs to be created according to its {@link Schedule}.
@param jobScheduleId The ID of the job schedule.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
@throws BatchErrorException Exception throw... | [
"Enables",
"the",
"specified",
"job",
"schedule",
"allowing",
"jobs",
"to",
"be",
"created",
"according",
"to",
"its",
"{",
"@link",
"Schedule",
"}",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java#L320-L326 |
amaembo/streamex | src/main/java/one/util/streamex/EntryStream.java | EntryStream.prefixKeys | public EntryStream<K, V> prefixKeys(BinaryOperator<K> op) {
"""
Returns a new {@code EntryStream} which values are the same as this
stream values and keys are the results of applying the accumulation
function to this stream keys, going left to right.
<p>
This is a stateful
<a href="package-summary.html#Stre... | java | public EntryStream<K, V> prefixKeys(BinaryOperator<K> op) {
return prefix((a, b) -> new SimpleImmutableEntry<>(op.apply(a.getKey(), b.getKey()), b.getValue()));
} | [
"public",
"EntryStream",
"<",
"K",
",",
"V",
">",
"prefixKeys",
"(",
"BinaryOperator",
"<",
"K",
">",
"op",
")",
"{",
"return",
"prefix",
"(",
"(",
"a",
",",
"b",
")",
"->",
"new",
"SimpleImmutableEntry",
"<>",
"(",
"op",
".",
"apply",
"(",
"a",
".... | Returns a new {@code EntryStream} which values are the same as this
stream values and keys are the results of applying the accumulation
function to this stream keys, going left to right.
<p>
This is a stateful
<a href="package-summary.html#StreamOps">quasi-intermediate</a>
operation.
<p>
This method cannot take all t... | [
"Returns",
"a",
"new",
"{",
"@code",
"EntryStream",
"}",
"which",
"values",
"are",
"the",
"same",
"as",
"this",
"stream",
"values",
"and",
"keys",
"are",
"the",
"results",
"of",
"applying",
"the",
"accumulation",
"function",
"to",
"this",
"stream",
"keys",
... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/EntryStream.java#L1074-L1076 |
wcm-io-caravan/caravan-hal | docs/src/main/java/io/wcm/caravan/hal/docs/impl/TemplateRenderer.java | TemplateRenderer.renderLinkRelationHtml | public String renderLinkRelationHtml(io.wcm.caravan.hal.docs.impl.model.Service service, LinkRelation linkRelation)
throws IOException {
"""
Generate HTML file for link relation.
@param service Service
@param linkRelation Link relation
@return Rendered markup
@throws IOException
"""
Map<String, O... | java | public String renderLinkRelationHtml(io.wcm.caravan.hal.docs.impl.model.Service service, LinkRelation linkRelation)
throws IOException {
Map<String, Object> model = ImmutableMap.<String, Object>builder()
.put("service", service)
.put("linkRelation", linkRelation)
.build();
return r... | [
"public",
"String",
"renderLinkRelationHtml",
"(",
"io",
".",
"wcm",
".",
"caravan",
".",
"hal",
".",
"docs",
".",
"impl",
".",
"model",
".",
"Service",
"service",
",",
"LinkRelation",
"linkRelation",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
... | Generate HTML file for link relation.
@param service Service
@param linkRelation Link relation
@return Rendered markup
@throws IOException | [
"Generate",
"HTML",
"file",
"for",
"link",
"relation",
"."
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs/src/main/java/io/wcm/caravan/hal/docs/impl/TemplateRenderer.java#L83-L90 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayName | public static String getDisplayName(String localeID, ULocale displayLocale) {
"""
<strong>[icu]</strong> Returns the locale ID localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the locale whose name is to be displayed.
@param displayLocale the locale in which to di... | java | public static String getDisplayName(String localeID, ULocale displayLocale) {
return getDisplayNameInternal(new ULocale(localeID), displayLocale);
} | [
"public",
"static",
"String",
"getDisplayName",
"(",
"String",
"localeID",
",",
"ULocale",
"displayLocale",
")",
"{",
"return",
"getDisplayNameInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"displayLocale",
")",
";",
"}"
] | <strong>[icu]</strong> Returns the locale ID localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the locale whose name is to be displayed.
@param displayLocale the locale in which to display the locale name.
@return the localized locale name. | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"the",
"locale",
"ID",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
".",
"This",
"is",
"a",
"cover",
"for",
"the",
"ICU4C",
"API",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1789-L1791 |
kaazing/gateway | service/update.check/src/main/java/org/kaazing/gateway/service/update/check/UpdateCheckService.java | UpdateCheckService.checkForUpdate | public void checkForUpdate(UpdateCheckListener updateCheckListener) {
"""
Forces a check for an update and registers the listener if it is not already registered
@param updateCheckListener
"""
listeners.add(updateCheckListener);
if (scheduler != null) {
scheduler.schedule(new Updat... | java | public void checkForUpdate(UpdateCheckListener updateCheckListener) {
listeners.add(updateCheckListener);
if (scheduler != null) {
scheduler.schedule(new UpdateCheckTask(this, versionServiceUrl, productName), 0, SECONDS);
} else {
// the scheduler won't be provided if the... | [
"public",
"void",
"checkForUpdate",
"(",
"UpdateCheckListener",
"updateCheckListener",
")",
"{",
"listeners",
".",
"add",
"(",
"updateCheckListener",
")",
";",
"if",
"(",
"scheduler",
"!=",
"null",
")",
"{",
"scheduler",
".",
"schedule",
"(",
"new",
"UpdateCheck... | Forces a check for an update and registers the listener if it is not already registered
@param updateCheckListener | [
"Forces",
"a",
"check",
"for",
"an",
"update",
"and",
"registers",
"the",
"listener",
"if",
"it",
"is",
"not",
"already",
"registered"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/update.check/src/main/java/org/kaazing/gateway/service/update/check/UpdateCheckService.java#L123-L132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.