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
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java
JobFileTableMapper.getJobCostPut
private Put getJobCostPut(Double jobCost, JobKey jobKey) { """ generates a put for the job cost @param jobCost @param jobKey @return the put with job cost """ Put pJobCost = new Put(jobKeyConv.toBytes(jobKey)); pJobCost.addColumn(Constants.INFO_FAM_BYTES, Constants.JOBCOST_BYTES, Bytes.toByt...
java
private Put getJobCostPut(Double jobCost, JobKey jobKey) { Put pJobCost = new Put(jobKeyConv.toBytes(jobKey)); pJobCost.addColumn(Constants.INFO_FAM_BYTES, Constants.JOBCOST_BYTES, Bytes.toBytes(jobCost)); return pJobCost; }
[ "private", "Put", "getJobCostPut", "(", "Double", "jobCost", ",", "JobKey", "jobKey", ")", "{", "Put", "pJobCost", "=", "new", "Put", "(", "jobKeyConv", ".", "toBytes", "(", "jobKey", ")", ")", ";", "pJobCost", ".", "addColumn", "(", "Constants", ".", "I...
generates a put for the job cost @param jobCost @param jobKey @return the put with job cost
[ "generates", "a", "put", "for", "the", "job", "cost" ]
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java#L536-L541
nohana/Amalgam
amalgam/src/main/java/com/amalgam/os/BundleUtils.java
BundleUtils.buildKey
public static String buildKey(Class<?> clazz, String name) { """ Build a custom bundle key name, to avoid conflict the bundle key name among the activities. This is also useful to build a intent extra key name. @param clazz the class. @param name the key name, in most case the name is UPPER_UNDERSCORE. @retu...
java
public static String buildKey(Class<?> clazz, String name) { return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(name).toString(); }
[ "public", "static", "String", "buildKey", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "clazz", ".", "getCanonicalName", "(", ")", ")", ".", "append", "(", "\".\"...
Build a custom bundle key name, to avoid conflict the bundle key name among the activities. This is also useful to build a intent extra key name. @param clazz the class. @param name the key name, in most case the name is UPPER_UNDERSCORE. @return the full qualified key name.
[ "Build", "a", "custom", "bundle", "key", "name", "to", "avoid", "conflict", "the", "bundle", "key", "name", "among", "the", "activities", ".", "This", "is", "also", "useful", "to", "build", "a", "intent", "extra", "key", "name", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L51-L53
wcm-io-caravan/caravan-hal
resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java
HalResource.setLink
public HalResource setLink(String relation, Link link) { """ Sets link for the given relation. Overwrites existing one. If {@code link} is {@code null} it gets ignored. @param relation Link relation @param link Link to add @return HAL resource """ if (link == null) { return this; } return ...
java
public HalResource setLink(String relation, Link link) { if (link == null) { return this; } return addResources(HalResourceType.LINKS, relation, false, new Link[] { link }); }
[ "public", "HalResource", "setLink", "(", "String", "relation", ",", "Link", "link", ")", "{", "if", "(", "link", "==", "null", ")", "{", "return", "this", ";", "}", "return", "addResources", "(", "HalResourceType", ".", "LINKS", ",", "relation", ",", "fa...
Sets link for the given relation. Overwrites existing one. If {@code link} is {@code null} it gets ignored. @param relation Link relation @param link Link to add @return HAL resource
[ "Sets", "link", "for", "the", "given", "relation", ".", "Overwrites", "existing", "one", ".", "If", "{" ]
train
https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L302-L309
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/system/exec/SudoFeature.java
SudoFeature.hasSudo
public synchronized static boolean hasSudo() { """ Determines whether sudo is supported on the local machine @return """ if (!sudoTested) { String[] cmdArr = new String[]{"which", "sudo"}; List<String> cmd = new ArrayList<String>(cmdArr.length); Collections.addAll(cmd, cmdArr); ProcessBuild...
java
public synchronized static boolean hasSudo() { if (!sudoTested) { String[] cmdArr = new String[]{"which", "sudo"}; List<String> cmd = new ArrayList<String>(cmdArr.length); Collections.addAll(cmd, cmdArr); ProcessBuilder whichsudo = new ProcessBuilder(cmd); try { Process p = whichsudo.start(...
[ "public", "synchronized", "static", "boolean", "hasSudo", "(", ")", "{", "if", "(", "!", "sudoTested", ")", "{", "String", "[", "]", "cmdArr", "=", "new", "String", "[", "]", "{", "\"which\"", ",", "\"sudo\"", "}", ";", "List", "<", "String", ">", "c...
Determines whether sudo is supported on the local machine @return
[ "Determines", "whether", "sudo", "is", "supported", "on", "the", "local", "machine" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/system/exec/SudoFeature.java#L52-L88
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java
DatabasesInner.exportAsync
public Observable<ImportExportResponseInner> exportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequest parameters) { """ Exports a database to a bacpac. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure ...
java
public Observable<ImportExportResponseInner> exportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequest parameters) { return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<ImportExportResponseInner>, ImportEx...
[ "public", "Observable", "<", "ImportExportResponseInner", ">", "exportAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ",", "ExportRequest", "parameters", ")", "{", "return", "exportWithServiceResponseAsync", "(", "...
Exports a database to a bacpac. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the database to be exported. @param parameters The r...
[ "Exports", "a", "database", "to", "a", "bacpac", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L2127-L2134
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/comp/JTiledImage.java
JTiledImage.calcOffset
public void calcOffset(Container compAnchor, Point offset) { """ Calculate the offset from the component to this component. @param compAnchor The component that would be the upper left hand of this screen. @param offset The offset to set for return. """ offset.x = 0; offset.y = 0; Con...
java
public void calcOffset(Container compAnchor, Point offset) { offset.x = 0; offset.y = 0; Container parent = this; while (parent != null) { offset.x -= parent.getLocation().x; offset.y -= parent.getLocation().y; parent = parent.getParent(); ...
[ "public", "void", "calcOffset", "(", "Container", "compAnchor", ",", "Point", "offset", ")", "{", "offset", ".", "x", "=", "0", ";", "offset", ".", "y", "=", "0", ";", "Container", "parent", "=", "this", ";", "while", "(", "parent", "!=", "null", ")"...
Calculate the offset from the component to this component. @param compAnchor The component that would be the upper left hand of this screen. @param offset The offset to set for return.
[ "Calculate", "the", "offset", "from", "the", "component", "to", "this", "component", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/comp/JTiledImage.java#L122-L138
Azure/azure-sdk-for-java
network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java
NetworkWatchersInner.beginVerifyIPFlowAsync
public Observable<VerificationIPFlowResultInner> beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { """ Verify IP flow from the specified VM to a location given the currently configured NSG rules. @param resourceGroupName The name of the resour...
java
public Observable<VerificationIPFlowResultInner> beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1<ServiceResponse<VerificationIP...
[ "public", "Observable", "<", "VerificationIPFlowResultInner", ">", "beginVerifyIPFlowAsync", "(", "String", "resourceGroupName", ",", "String", "networkWatcherName", ",", "VerificationIPFlowParameters", "parameters", ")", "{", "return", "beginVerifyIPFlowWithServiceResponseAsync"...
Verify IP flow from the specified VM to a location given the currently configured NSG rules. @param resourceGroupName The name of the resource group. @param networkWatcherName The name of the network watcher. @param parameters Parameters that define the IP flow to be verified. @throws IllegalArgumentException thrown i...
[ "Verify", "IP", "flow", "from", "the", "specified", "VM", "to", "a", "location", "given", "the", "currently", "configured", "NSG", "rules", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1060-L1067
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java
PublicanPODocBookBuilder.processPOInitialContentBugLink
protected void processPOInitialContentBugLink(final POBuildData buildData, final InitialContent initialContent, final Map<String, TranslationDetails> translations) throws BuildProcessingException { """ Add any bug link strings for a specific initial content container. @param buildData ...
java
protected void processPOInitialContentBugLink(final POBuildData buildData, final InitialContent initialContent, final Map<String, TranslationDetails> translations) throws BuildProcessingException { try { final DocBookXMLPreProcessor preProcessor = buildData.getXMLPreProcessor(); ...
[ "protected", "void", "processPOInitialContentBugLink", "(", "final", "POBuildData", "buildData", ",", "final", "InitialContent", "initialContent", ",", "final", "Map", "<", "String", ",", "TranslationDetails", ">", "translations", ")", "throws", "BuildProcessingException"...
Add any bug link strings for a specific initial content container. @param buildData Information and data structures for the build. @param initialContent The initial content to create any bug link translation strings for. @param translations The mapping of original strings to tra...
[ "Add", "any", "bug", "link", "strings", "for", "a", "specific", "initial", "content", "container", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java#L1272-L1284
prestodb/presto
presto-main/src/main/java/com/facebook/presto/util/Reflection.java
Reflection.constructorMethodHandle
public static MethodHandle constructorMethodHandle(StandardErrorCode errorCode, Constructor constructor) { """ Returns a MethodHandle corresponding to the specified constructor. <p> Warning: The way Oracle JVM implements producing MethodHandle for a constructor involves creating JNI global weak references. G1 p...
java
public static MethodHandle constructorMethodHandle(StandardErrorCode errorCode, Constructor constructor) { try { return MethodHandles.lookup().unreflectConstructor(constructor); } catch (IllegalAccessException e) { throw new PrestoException(errorCode, e); } ...
[ "public", "static", "MethodHandle", "constructorMethodHandle", "(", "StandardErrorCode", "errorCode", ",", "Constructor", "constructor", ")", "{", "try", "{", "return", "MethodHandles", ".", "lookup", "(", ")", ".", "unreflectConstructor", "(", "constructor", ")", "...
Returns a MethodHandle corresponding to the specified constructor. <p> Warning: The way Oracle JVM implements producing MethodHandle for a constructor involves creating JNI global weak references. G1 processes such references serially. As a result, calling this method in a tight loop can create significant GC pressure ...
[ "Returns", "a", "MethodHandle", "corresponding", "to", "the", "specified", "constructor", ".", "<p", ">", "Warning", ":", "The", "way", "Oracle", "JVM", "implements", "producing", "MethodHandle", "for", "a", "constructor", "involves", "creating", "JNI", "global", ...
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/util/Reflection.java#L139-L147
UrielCh/ovh-java-sdk
ovh-java-sdk-clusterhadoop/src/main/java/net/minidev/ovh/api/ApiOvhClusterhadoop.java
ApiOvhClusterhadoop.serviceName_node_hostname_GET
public OvhNode serviceName_node_hostname_GET(String serviceName, String hostname) throws IOException { """ Get this object properties REST: GET /cluster/hadoop/{serviceName}/node/{hostname} @param serviceName [required] The internal name of your cluster @param hostname [required] Hostname of the node """ ...
java
public OvhNode serviceName_node_hostname_GET(String serviceName, String hostname) throws IOException { String qPath = "/cluster/hadoop/{serviceName}/node/{hostname}"; StringBuilder sb = path(qPath, serviceName, hostname); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhNode.clas...
[ "public", "OvhNode", "serviceName_node_hostname_GET", "(", "String", "serviceName", ",", "String", "hostname", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cluster/hadoop/{serviceName}/node/{hostname}\"", ";", "StringBuilder", "sb", "=", "path", "(", "...
Get this object properties REST: GET /cluster/hadoop/{serviceName}/node/{hostname} @param serviceName [required] The internal name of your cluster @param hostname [required] Hostname of the node
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-clusterhadoop/src/main/java/net/minidev/ovh/api/ApiOvhClusterhadoop.java#L229-L234
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.trimEnd
@Nullable @CheckReturnValue public static String trimEnd (@Nullable final String sSrc, final char cTail) { """ Trim the passed tail from the source value. If the source value does not end with the passed tail, nothing happens. @param sSrc The input source string @param cTail The char to be trimmed of th...
java
@Nullable @CheckReturnValue public static String trimEnd (@Nullable final String sSrc, final char cTail) { return endsWith (sSrc, cTail) ? sSrc.substring (0, sSrc.length () - 1) : sSrc; }
[ "@", "Nullable", "@", "CheckReturnValue", "public", "static", "String", "trimEnd", "(", "@", "Nullable", "final", "String", "sSrc", ",", "final", "char", "cTail", ")", "{", "return", "endsWith", "(", "sSrc", ",", "cTail", ")", "?", "sSrc", ".", "substring"...
Trim the passed tail from the source value. If the source value does not end with the passed tail, nothing happens. @param sSrc The input source string @param cTail The char to be trimmed of the end @return The trimmed string, or the original input string, if the tail was not found @see #trimStart(String, String) @see...
[ "Trim", "the", "passed", "tail", "from", "the", "source", "value", ".", "If", "the", "source", "value", "does", "not", "end", "with", "the", "passed", "tail", "nothing", "happens", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3414-L3419
Netflix/zuul
zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulEndPointRunner.java
ZuulEndPointRunner.newProxyEndpoint
protected ZuulFilter<HttpRequestMessage, HttpResponseMessage> newProxyEndpoint(HttpRequestMessage zuulRequest) { """ Override to inject your own proxy endpoint implementation @param zuulRequest - the request message @return the proxy endpoint """ return new ProxyEndpoint(zuulRequest, getChannelHand...
java
protected ZuulFilter<HttpRequestMessage, HttpResponseMessage> newProxyEndpoint(HttpRequestMessage zuulRequest) { return new ProxyEndpoint(zuulRequest, getChannelHandlerContext(zuulRequest), getNextStage(), MethodBinding.NO_OP_BINDING); }
[ "protected", "ZuulFilter", "<", "HttpRequestMessage", ",", "HttpResponseMessage", ">", "newProxyEndpoint", "(", "HttpRequestMessage", "zuulRequest", ")", "{", "return", "new", "ProxyEndpoint", "(", "zuulRequest", ",", "getChannelHandlerContext", "(", "zuulRequest", ")", ...
Override to inject your own proxy endpoint implementation @param zuulRequest - the request message @return the proxy endpoint
[ "Override", "to", "inject", "your", "own", "proxy", "endpoint", "implementation" ]
train
https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulEndPointRunner.java#L187-L189
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/RowUtil.java
RowUtil.getOrCreateRow
public static Row getOrCreateRow(Sheet sheet, int rowIndex) { """ 获取已有行或创建新行 @param sheet Excel表 @param rowIndex 行号 @return {@link Row} @since 4.0.2 """ Row row = sheet.getRow(rowIndex); if (null == row) { row = sheet.createRow(rowIndex); } return row; }
java
public static Row getOrCreateRow(Sheet sheet, int rowIndex) { Row row = sheet.getRow(rowIndex); if (null == row) { row = sheet.createRow(rowIndex); } return row; }
[ "public", "static", "Row", "getOrCreateRow", "(", "Sheet", "sheet", ",", "int", "rowIndex", ")", "{", "Row", "row", "=", "sheet", ".", "getRow", "(", "rowIndex", ")", ";", "if", "(", "null", "==", "row", ")", "{", "row", "=", "sheet", ".", "createRow...
获取已有行或创建新行 @param sheet Excel表 @param rowIndex 行号 @return {@link Row} @since 4.0.2
[ "获取已有行或创建新行" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/RowUtil.java#L29-L35
Esri/geometry-api-java
src/main/java/com/esri/core/geometry/Transformation2D.java
Transformation2D.setShear
public void setShear(double proportionX, double proportionY) { """ Set transformation to a shear. @param proportionX The proportion of shearing in x direction. @param proportionY The proportion of shearing in y direction. """ xx = 1; xy = proportionX; xd = 0; yx = proportionY; yy = 1; yd = 0;...
java
public void setShear(double proportionX, double proportionY) { xx = 1; xy = proportionX; xd = 0; yx = proportionY; yy = 1; yd = 0; }
[ "public", "void", "setShear", "(", "double", "proportionX", ",", "double", "proportionY", ")", "{", "xx", "=", "1", ";", "xy", "=", "proportionX", ";", "xd", "=", "0", ";", "yx", "=", "proportionY", ";", "yy", "=", "1", ";", "yd", "=", "0", ";", ...
Set transformation to a shear. @param proportionX The proportion of shearing in x direction. @param proportionY The proportion of shearing in y direction.
[ "Set", "transformation", "to", "a", "shear", "." ]
train
https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Transformation2D.java#L658-L665
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/MapELResolver.java
MapELResolver.getValue
@Override public Object getValue(ELContext context, Object base, Object property) { """ If the base object is a map, returns the value associated with the given key, as specified by the property argument. If the key was not found, null is returned. If the base is a Map, the propertyResolved property of the ELCo...
java
@Override public Object getValue(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } Object result = null; if (isResolvable(base)) { result = ((Map<?, ?>) base).get(property); context.setPropertyResolved(true); } return res...
[ "@", "Override", "public", "Object", "getValue", "(", "ELContext", "context", ",", "Object", "base", ",", "Object", "property", ")", "{", "if", "(", "context", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"context is null\"", ")", "...
If the base object is a map, returns the value associated with the given key, as specified by the property argument. If the key was not found, null is returned. If the base is a Map, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not tru...
[ "If", "the", "base", "object", "is", "a", "map", "returns", "the", "value", "associated", "with", "the", "given", "key", "as", "specified", "by", "the", "property", "argument", ".", "If", "the", "key", "was", "not", "found", "null", "is", "returned", "."...
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/MapELResolver.java#L189-L200
zaproxy/zaproxy
src/org/zaproxy/zap/view/TabbedPanel2.java
TabbedPanel2.addTab
public void addTab(String title, Icon icon, final Component c, boolean hideable, boolean visible, int index) { """ Adds a tab with the given component. @param title the title of the tab. @param icon the icon of the tab. @param c the component of the tab. @param hideable {@code true} if the tab can be hidden,...
java
public void addTab(String title, Icon icon, final Component c, boolean hideable, boolean visible, int index) { addTab(title, icon, c, hideable, visible, index, true); }
[ "public", "void", "addTab", "(", "String", "title", ",", "Icon", "icon", ",", "final", "Component", "c", ",", "boolean", "hideable", ",", "boolean", "visible", ",", "int", "index", ")", "{", "addTab", "(", "title", ",", "icon", ",", "c", ",", "hideable...
Adds a tab with the given component. @param title the title of the tab. @param icon the icon of the tab. @param c the component of the tab. @param hideable {@code true} if the tab can be hidden, {@code false} otherwise. @param visible {@code true} if the tab should be visible, {@code false} otherwise. @param index the...
[ "Adds", "a", "tab", "with", "the", "given", "component", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/TabbedPanel2.java#L342-L344
derari/cthul
strings/src/main/java/org/cthul/strings/AlphaIndex.java
AlphaIndex.toAlpha
public static String toAlpha(long i, boolean uppercase) { """ Like {@link #toAlpha(long)}, but allows to choose lower case. @param i number to convert @param uppercase whether output will be in upper case @return aplha-index of {@code i} """ final int A = (uppercase ? 'A' : 'a') - 1; if (i <...
java
public static String toAlpha(long i, boolean uppercase) { final int A = (uppercase ? 'A' : 'a') - 1; if (i < 0) throw new IllegalArgumentException( "Argument must be non-negative, was " + i); if (i == Long.MAX_VALUE) throw new IllegalArgumentException(...
[ "public", "static", "String", "toAlpha", "(", "long", "i", ",", "boolean", "uppercase", ")", "{", "final", "int", "A", "=", "(", "uppercase", "?", "'", "'", ":", "'", "'", ")", "-", "1", ";", "if", "(", "i", "<", "0", ")", "throw", "new", "Ille...
Like {@link #toAlpha(long)}, but allows to choose lower case. @param i number to convert @param uppercase whether output will be in upper case @return aplha-index of {@code i}
[ "Like", "{" ]
train
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/AlphaIndex.java#L44-L61
aws/aws-sdk-java
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/DescribeInputResult.java
DescribeInputResult.withTags
public DescribeInputResult withTags(java.util.Map<String, String> tags) { """ A collection of key-value pairs. @param tags A collection of key-value pairs. @return Returns a reference to this object so that method calls can be chained together. """ setTags(tags); return this; }
java
public DescribeInputResult withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "DescribeInputResult", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
A collection of key-value pairs. @param tags A collection of key-value pairs. @return Returns a reference to this object so that method calls can be chained together.
[ "A", "collection", "of", "key", "-", "value", "pairs", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/DescribeInputResult.java#L666-L669
google/closure-compiler
src/com/google/javascript/jscomp/deps/DepsGenerator.java
DepsGenerator.writeDepInfos
private static void writeDepInfos(PrintStream out, Collection<DependencyInfo> depInfos) throws IOException { """ Writes goog.addDependency() lines for each DependencyInfo in depInfos. """ // Print dependencies. // Lines look like this: // goog.addDependency('../../path/to/file.js', ['goog.Del...
java
private static void writeDepInfos(PrintStream out, Collection<DependencyInfo> depInfos) throws IOException { // Print dependencies. // Lines look like this: // goog.addDependency('../../path/to/file.js', ['goog.Delay'], // ['goog.Disposable', 'goog.Timer']); for (DependencyInfo depInfo : d...
[ "private", "static", "void", "writeDepInfos", "(", "PrintStream", "out", ",", "Collection", "<", "DependencyInfo", ">", "depInfos", ")", "throws", "IOException", "{", "// Print dependencies.", "// Lines look like this:", "// goog.addDependency('../../path/to/file.js', ['goog.De...
Writes goog.addDependency() lines for each DependencyInfo in depInfos.
[ "Writes", "goog", ".", "addDependency", "()", "lines", "for", "each", "DependencyInfo", "in", "depInfos", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DepsGenerator.java#L543-L552
openengsb/openengsb
connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/EntryFactory.java
EntryFactory.namedDescriptiveObject
public static Entry namedDescriptiveObject(Dn dn, String... descriptions) { """ Returns an {@link Entry} having the given {@link Dn}. The attribute type of the Rdn is 'common name'. The description is optional in that it may also be null or the empty String. Callers can rely on this distinction, i.e. storing an ...
java
public static Entry namedDescriptiveObject(Dn dn, String... descriptions) { Entry entry = namedObject(dn); addDescriptions(entry, descriptions); return entry; }
[ "public", "static", "Entry", "namedDescriptiveObject", "(", "Dn", "dn", ",", "String", "...", "descriptions", ")", "{", "Entry", "entry", "=", "namedObject", "(", "dn", ")", ";", "addDescriptions", "(", "entry", ",", "descriptions", ")", ";", "return", "entr...
Returns an {@link Entry} having the given {@link Dn}. The attribute type of the Rdn is 'common name'. The description is optional in that it may also be null or the empty String. Callers can rely on this distinction, i.e. storing an empty string will also retrieve an empty string and storing null will also retrieve nul...
[ "Returns", "an", "{" ]
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/EntryFactory.java#L222-L226
apereo/cas
core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/principal/AbstractServiceFactory.java
AbstractServiceFactory.getSourceParameter
protected static String getSourceParameter(final HttpServletRequest request, final String... paramNames) { """ Gets source parameter. @param request the request @param paramNames the param names @return the source parameter """ if (request != null) { val parameterMap = request.getPa...
java
protected static String getSourceParameter(final HttpServletRequest request, final String... paramNames) { if (request != null) { val parameterMap = request.getParameterMap(); return Stream.of(paramNames) .filter(p -> parameterMap.containsKey(p) || request.getAttribute(p)...
[ "protected", "static", "String", "getSourceParameter", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "...", "paramNames", ")", "{", "if", "(", "request", "!=", "null", ")", "{", "val", "parameterMap", "=", "request", ".", "getParameterMa...
Gets source parameter. @param request the request @param paramNames the param names @return the source parameter
[ "Gets", "source", "parameter", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/principal/AbstractServiceFactory.java#L55-L64
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LoOP.java
LoOP.computePLOFs
protected double computePLOFs(Relation<O> relation, KNNQuery<O> knn, WritableDoubleDataStore pdists, WritableDoubleDataStore plofs) { """ Compute the LOF values, using the pdist distances. @param relation Data relation @param knn kNN query @param pdists Precomputed distances @param plofs Storage for PLOFs. ...
java
protected double computePLOFs(Relation<O> relation, KNNQuery<O> knn, WritableDoubleDataStore pdists, WritableDoubleDataStore plofs) { FiniteProgress progressPLOFs = LOG.isVerbose() ? new FiniteProgress("PLOFs for objects", relation.size(), LOG) : null; double nplof = 0.; for(DBIDIter iditer = relation.iterD...
[ "protected", "double", "computePLOFs", "(", "Relation", "<", "O", ">", "relation", ",", "KNNQuery", "<", "O", ">", "knn", ",", "WritableDoubleDataStore", "pdists", ",", "WritableDoubleDataStore", "plofs", ")", "{", "FiniteProgress", "progressPLOFs", "=", "LOG", ...
Compute the LOF values, using the pdist distances. @param relation Data relation @param knn kNN query @param pdists Precomputed distances @param plofs Storage for PLOFs. @return Normalization factor.
[ "Compute", "the", "LOF", "values", "using", "the", "pdist", "distances", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LoOP.java#L275-L307
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java
AbstractVectorModel.nearest
public List<Map.Entry<K, Float>> nearest(Vector vector, int size) { """ 获取与向量最相似的词语 @param vector 向量 @param size topN个 @return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列 """ MaxHeap<Map.Entry<K, Float>> maxHeap = new MaxHeap<Map.Entry<K, Float>>(size, new Comparator<Map.Entry<K, Float>>() { ...
java
public List<Map.Entry<K, Float>> nearest(Vector vector, int size) { MaxHeap<Map.Entry<K, Float>> maxHeap = new MaxHeap<Map.Entry<K, Float>>(size, new Comparator<Map.Entry<K, Float>>() { @Override public int compare(Map.Entry<K, Float> o1, Map.Entry<K, Float> o2) {...
[ "public", "List", "<", "Map", ".", "Entry", "<", "K", ",", "Float", ">", ">", "nearest", "(", "Vector", "vector", ",", "int", "size", ")", "{", "MaxHeap", "<", "Map", ".", "Entry", "<", "K", ",", "Float", ">", ">", "maxHeap", "=", "new", "MaxHeap...
获取与向量最相似的词语 @param vector 向量 @param size topN个 @return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列
[ "获取与向量最相似的词语" ]
train
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java#L125-L141
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_DDRM.java
LinearSolverChol_DDRM.solve
@Override public void solve(DMatrixRMaj B , DMatrixRMaj X ) { """ <p> Using the decomposition, finds the value of 'X' in the linear equation below:<br> A*x = b<br> where A has dimension of n by n, x and b are n by m dimension. </p> <p> *Note* that 'b' and 'x' can be the same matrix instance. </p> ...
java
@Override public void solve(DMatrixRMaj B , DMatrixRMaj X ) { if( B.numRows != n ) { throw new IllegalArgumentException("Unexpected matrix size"); } X.reshape(n,B.numCols); if(decomposer.isLower()) { solveLower(A,B,X,vv); } else { throw ne...
[ "@", "Override", "public", "void", "solve", "(", "DMatrixRMaj", "B", ",", "DMatrixRMaj", "X", ")", "{", "if", "(", "B", ".", "numRows", "!=", "n", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Unexpected matrix size\"", ")", ";", "}", "X", ...
<p> Using the decomposition, finds the value of 'X' in the linear equation below:<br> A*x = b<br> where A has dimension of n by n, x and b are n by m dimension. </p> <p> *Note* that 'b' and 'x' can be the same matrix instance. </p> @param B A matrix that is n by m. Not modified. @param X An n by m matrix where the ...
[ "<p", ">", "Using", "the", "decomposition", "finds", "the", "value", "of", "X", "in", "the", "linear", "equation", "below", ":", "<br", ">" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_DDRM.java#L80-L92
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dictionary/ts/BaseChineseDictionary.java
BaseChineseDictionary.load
static boolean load(Map<String, String> storage, boolean reverse, String... pathArray) { """ 读取词典 @param storage 储存空间 @param reverse 是否翻转键值对 @param pathArray 路径 @return 是否加载成功 """ StringDictionary dictionary = new StringDictionary("="); for (String path : pathArray) { if...
java
static boolean load(Map<String, String> storage, boolean reverse, String... pathArray) { StringDictionary dictionary = new StringDictionary("="); for (String path : pathArray) { if (!dictionary.load(path)) return false; } if (reverse) dictionary = dictionary.rever...
[ "static", "boolean", "load", "(", "Map", "<", "String", ",", "String", ">", "storage", ",", "boolean", "reverse", ",", "String", "...", "pathArray", ")", "{", "StringDictionary", "dictionary", "=", "new", "StringDictionary", "(", "\"=\"", ")", ";", "for", ...
读取词典 @param storage 储存空间 @param reverse 是否翻转键值对 @param pathArray 路径 @return 是否加载成功
[ "读取词典" ]
train
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/ts/BaseChineseDictionary.java#L75-L90
OpenLiberty/open-liberty
dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/ProbeMethodAdapter.java
ProbeMethodAdapter.setProbeListeners
protected void setProbeListeners(ProbeImpl probe, Collection<ProbeListener> listeners) { """ Associate a collection of listeners with the specified probe. @param probe the injected probe @param listeners the listeners that will receive events from the injected probe """ Set<ProbeListener> enabled ...
java
protected void setProbeListeners(ProbeImpl probe, Collection<ProbeListener> listeners) { Set<ProbeListener> enabled = enabledProbes.get(probe); if (enabled == null) { enabled = new HashSet<ProbeListener>(); enabledProbes.put(probe, enabled); } enabled.addAll(liste...
[ "protected", "void", "setProbeListeners", "(", "ProbeImpl", "probe", ",", "Collection", "<", "ProbeListener", ">", "listeners", ")", "{", "Set", "<", "ProbeListener", ">", "enabled", "=", "enabledProbes", ".", "get", "(", "probe", ")", ";", "if", "(", "enabl...
Associate a collection of listeners with the specified probe. @param probe the injected probe @param listeners the listeners that will receive events from the injected probe
[ "Associate", "a", "collection", "of", "listeners", "with", "the", "specified", "probe", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/ProbeMethodAdapter.java#L216-L223
aspectran/aspectran
core/src/main/java/com/aspectran/core/util/ReflectionUtils.java
ReflectionUtils.toComponentTypeArray
public static Object toComponentTypeArray(Object val, Class<?> componentType) { """ Converts an array of objects to an array of the specified component type. @param val an array of objects to be converted @param componentType the {@code Class} object representing the component type of the new array @return an...
java
public static Object toComponentTypeArray(Object val, Class<?> componentType) { if (val != null) { int len = Array.getLength(val); Object arr = Array.newInstance(componentType, len); for (int i = 0; i < len; i++) { Array.set(arr, i, Array.get(val, i)); ...
[ "public", "static", "Object", "toComponentTypeArray", "(", "Object", "val", ",", "Class", "<", "?", ">", "componentType", ")", "{", "if", "(", "val", "!=", "null", ")", "{", "int", "len", "=", "Array", ".", "getLength", "(", "val", ")", ";", "Object", ...
Converts an array of objects to an array of the specified component type. @param val an array of objects to be converted @param componentType the {@code Class} object representing the component type of the new array @return an array of the objects with the specified component type
[ "Converts", "an", "array", "of", "objects", "to", "an", "array", "of", "the", "specified", "component", "type", "." ]
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ReflectionUtils.java#L275-L286
JoeKerouac/utils
src/main/java/com/joe/utils/collection/CollectionUtil.java
CollectionUtil.grow
public static ByteBuffer grow(ByteBuffer buffer, int size) { """ 对ByteBuffer扩容(扩容后position为buffer.capacity(),mark为-1,limit为新buffer的capacity) @param buffer 原ByteBuffer @param size 要增加的大小 @return 扩容后的ByteBuffer,扩容后的capacity等于原buffer的capacity + size """ return grow(buffer, 0, buffer.capacity(), siz...
java
public static ByteBuffer grow(ByteBuffer buffer, int size) { return grow(buffer, 0, buffer.capacity(), size); }
[ "public", "static", "ByteBuffer", "grow", "(", "ByteBuffer", "buffer", ",", "int", "size", ")", "{", "return", "grow", "(", "buffer", ",", "0", ",", "buffer", ".", "capacity", "(", ")", ",", "size", ")", ";", "}" ]
对ByteBuffer扩容(扩容后position为buffer.capacity(),mark为-1,limit为新buffer的capacity) @param buffer 原ByteBuffer @param size 要增加的大小 @return 扩容后的ByteBuffer,扩容后的capacity等于原buffer的capacity + size
[ "对ByteBuffer扩容(扩容后position为buffer", ".", "capacity", "()", ",mark为", "-", "1,limit为新buffer的capacity)" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/collection/CollectionUtil.java#L226-L228
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.createOrUpdate
public AppServicePlanInner createOrUpdate(String resourceGroupName, String name, AppServicePlanInner appServicePlan) { """ Creates or updates an App Service Plan. Creates or updates an App Service Plan. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the ...
java
public AppServicePlanInner createOrUpdate(String resourceGroupName, String name, AppServicePlanInner appServicePlan) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, appServicePlan).toBlocking().last().body(); }
[ "public", "AppServicePlanInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "name", ",", "AppServicePlanInner", "appServicePlan", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "name", ",", "appServiceP...
Creates or updates an App Service Plan. Creates or updates 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 appServicePlan Details of the App Service plan. @throws IllegalArgumentException thrown if parameters fail ...
[ "Creates", "or", "updates", "an", "App", "Service", "Plan", ".", "Creates", "or", "updates", "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#L675-L677
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.absentRelationship
public static void absentRelationship(Class<?> configuredClass, Class<?> targetClass) { """ Thrown when there isn't correspondence between classes. @param configuredClass configured class @param targetClass target class """ throw new AbsentRelationshipException(MSG.INSTANCE.message(noRelationshipException...
java
public static void absentRelationship(Class<?> configuredClass, Class<?> targetClass){ throw new AbsentRelationshipException(MSG.INSTANCE.message(noRelationshipException,configuredClass.getSimpleName(),targetClass.getSimpleName())); }
[ "public", "static", "void", "absentRelationship", "(", "Class", "<", "?", ">", "configuredClass", ",", "Class", "<", "?", ">", "targetClass", ")", "{", "throw", "new", "AbsentRelationshipException", "(", "MSG", ".", "INSTANCE", ".", "message", "(", "noRelation...
Thrown when there isn't correspondence between classes. @param configuredClass configured class @param targetClass target class
[ "Thrown", "when", "there", "isn", "t", "correspondence", "between", "classes", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L609-L611
zaproxy/zaproxy
src/org/parosproxy/paros/extension/ExtensionLoader.java
ExtensionLoader.initModelAllExtension
private void initModelAllExtension(Model model, double progressFactor) { """ Init all extensions with the same Model @param model the model to apply to all extensions """ double factorPerc = progressFactor / getExtensionCount(); for (int i = 0; i < getExtensionCount(); i++) { ...
java
private void initModelAllExtension(Model model, double progressFactor) { double factorPerc = progressFactor / getExtensionCount(); for (int i = 0; i < getExtensionCount(); i++) { Extension extension = getExtension(i); try { extension.initModel(model...
[ "private", "void", "initModelAllExtension", "(", "Model", "model", ",", "double", "progressFactor", ")", "{", "double", "factorPerc", "=", "progressFactor", "/", "getExtensionCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getExtensi...
Init all extensions with the same Model @param model the model to apply to all extensions
[ "Init", "all", "extensions", "with", "the", "same", "Model" ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/ExtensionLoader.java#L1310-L1325
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.addSiteCommand
protected void addSiteCommand(String label, String help, Command cmd) { """ Internally registers a SITE sub-command @param label The command name @param help The help message @param cmd The command function """ siteCommands.put(label.toUpperCase(), new CommandInfo(cmd, help, true)); }
java
protected void addSiteCommand(String label, String help, Command cmd) { siteCommands.put(label.toUpperCase(), new CommandInfo(cmd, help, true)); }
[ "protected", "void", "addSiteCommand", "(", "String", "label", ",", "String", "help", ",", "Command", "cmd", ")", "{", "siteCommands", ".", "put", "(", "label", ".", "toUpperCase", "(", ")", ",", "new", "CommandInfo", "(", "cmd", ",", "help", ",", "true"...
Internally registers a SITE sub-command @param label The command name @param help The help message @param cmd The command function
[ "Internally", "registers", "a", "SITE", "sub", "-", "command" ]
train
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L411-L413
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/GroupWidget.java
GroupWidget.addChild
@Override public boolean addChild(Widget child, int index, boolean preventLayout) { """ Add another {@link Widget} as a child of this one. @param child The {@code Widget} to add as a child. @param index Position at which to add the child. @param preventLayout The {@code Widget} whether to call layout()...
java
@Override public boolean addChild(Widget child, int index, boolean preventLayout) { return super.addChild(child, index, preventLayout); }
[ "@", "Override", "public", "boolean", "addChild", "(", "Widget", "child", ",", "int", "index", ",", "boolean", "preventLayout", ")", "{", "return", "super", ".", "addChild", "(", "child", ",", "index", ",", "preventLayout", ")", ";", "}" ]
Add another {@link Widget} as a child of this one. @param child The {@code Widget} to add as a child. @param index Position at which to add the child. @param preventLayout The {@code Widget} whether to call layout(). @return {@code True} if {@code child} was added; {@code false} if {@code child} was previously added t...
[ "Add", "another", "{", "@link", "Widget", "}", "as", "a", "child", "of", "this", "one", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/GroupWidget.java#L163-L166
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java
FastDatePrinter.appendDigits
private static void appendDigits(final Appendable buffer, final int value) throws IOException { """ Appends two digits to the given buffer. @param buffer the buffer to append to. @param value the value to append digits from. """ buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10...
java
private static void appendDigits(final Appendable buffer, final int value) throws IOException { buffer.append((char) (value / 10 + '0')); buffer.append((char) (value % 10 + '0')); }
[ "private", "static", "void", "appendDigits", "(", "final", "Appendable", "buffer", ",", "final", "int", "value", ")", "throws", "IOException", "{", "buffer", ".", "append", "(", "(", "char", ")", "(", "value", "/", "10", "+", "'", "'", ")", ")", ";", ...
Appends two digits to the given buffer. @param buffer the buffer to append to. @param value the value to append digits from.
[ "Appends", "two", "digits", "to", "the", "given", "buffer", "." ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java#L413-L416
Impetus/Kundera
src/kundera-hbase/kundera-hbase/src/main/java/com/impetus/client/hbase/HBaseClient.java
HBaseClient.getBatchSize
private void getBatchSize(String persistenceUnit, Map<String, Object> puProperties) { """ Gets the batch size. @param persistenceUnit the persistence unit @param puProperties the pu properties @return the batch size """ String batch_Size = puProperties != null ? (String) puProperties.get(Persist...
java
private void getBatchSize(String persistenceUnit, Map<String, Object> puProperties) { String batch_Size = puProperties != null ? (String) puProperties.get(PersistenceProperties.KUNDERA_BATCH_SIZE) : null; if (batch_Size != null) { setBatchSize(Integer.valueOf(batc...
[ "private", "void", "getBatchSize", "(", "String", "persistenceUnit", ",", "Map", "<", "String", ",", "Object", ">", "puProperties", ")", "{", "String", "batch_Size", "=", "puProperties", "!=", "null", "?", "(", "String", ")", "puProperties", ".", "get", "(",...
Gets the batch size. @param persistenceUnit the persistence unit @param puProperties the pu properties @return the batch size
[ "Gets", "the", "batch", "size", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase/src/main/java/com/impetus/client/hbase/HBaseClient.java#L921-L935
EdwardRaff/JSAT
JSAT/src/jsat/text/tokenizer/NaiveTokenizer.java
NaiveTokenizer.setMaxTokenLength
public void setMaxTokenLength(int maxTokenLength) { """ Sets the maximum allowed length for any token. Any token discovered exceeding the length will not be accepted and skipped over. The default is unbounded. @param maxTokenLength the maximum token length to accept as a valid token """ if(maxToke...
java
public void setMaxTokenLength(int maxTokenLength) { if(maxTokenLength < 1) throw new IllegalArgumentException("Max token length must be positive, not " + maxTokenLength); if(maxTokenLength <= minTokenLength) throw new IllegalArgumentException("Max token length must be larger ...
[ "public", "void", "setMaxTokenLength", "(", "int", "maxTokenLength", ")", "{", "if", "(", "maxTokenLength", "<", "1", ")", "throw", "new", "IllegalArgumentException", "(", "\"Max token length must be positive, not \"", "+", "maxTokenLength", ")", ";", "if", "(", "ma...
Sets the maximum allowed length for any token. Any token discovered exceeding the length will not be accepted and skipped over. The default is unbounded. @param maxTokenLength the maximum token length to accept as a valid token
[ "Sets", "the", "maximum", "allowed", "length", "for", "any", "token", ".", "Any", "token", "discovered", "exceeding", "the", "length", "will", "not", "be", "accepted", "and", "skipped", "over", ".", "The", "default", "is", "unbounded", "." ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/text/tokenizer/NaiveTokenizer.java#L137-L144
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/ProxyTask.java
ProxyTask.getNewRemoteTask
public RemoteTask getNewRemoteTask(Application app, Map<String,Object> properties) { """ Get a remote session from the pool and initialize it. If the pool is empty, create a new remote session. @param strUserID The user name/ID of the user, or null if unknown. @return The remote Task. """ try { ...
java
public RemoteTask getNewRemoteTask(Application app, Map<String,Object> properties) { try { // Map<String,Object> propApp = this.getApplicationProperties(properties); // Map<String,Object> propInitial = ProxyTask.getInitialProperties(this.getBasicServlet(), SERVLET_TYPE.PROXY); ...
[ "public", "RemoteTask", "getNewRemoteTask", "(", "Application", "app", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "try", "{", "// Map<String,Object> propApp = this.getApplicationProperties(properties);", "// Map<String,Object> propInitial = ProxyTask...
Get a remote session from the pool and initialize it. If the pool is empty, create a new remote session. @param strUserID The user name/ID of the user, or null if unknown. @return The remote Task.
[ "Get", "a", "remote", "session", "from", "the", "pool", "and", "initialize", "it", ".", "If", "the", "pool", "is", "empty", "create", "a", "new", "remote", "session", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/ProxyTask.java#L306-L324
TimeAndSpaceIO/SmoothieMap
src/main/java/net/openhft/smoothie/SmoothieMap.java
SmoothieMap.nextSegmentIndex
private long nextSegmentIndex(long segmentIndex, Segment segment) { """ Extension rules make order of iteration of segments a little weird, avoiding visiting the same segment twice <p>Geven segmentsMask = 0b1111, iterates segments in order: 0000 1000 0100 1100 0010 .. etc, i. e. grows "from left to right...
java
private long nextSegmentIndex(long segmentIndex, Segment segment) { long segmentsTier = this.segmentsTier; segmentIndex <<= -segmentsTier; segmentIndex = Long.reverse(segmentIndex); int numberOfArrayIndexesWithThisSegment = 1 << (segmentsTier - segment.tier); segmentIndex += numb...
[ "private", "long", "nextSegmentIndex", "(", "long", "segmentIndex", ",", "Segment", "segment", ")", "{", "long", "segmentsTier", "=", "this", ".", "segmentsTier", ";", "segmentIndex", "<<=", "-", "segmentsTier", ";", "segmentIndex", "=", "Long", ".", "reverse", ...
Extension rules make order of iteration of segments a little weird, avoiding visiting the same segment twice <p>Geven segmentsMask = 0b1111, iterates segments in order: 0000 1000 0100 1100 0010 .. etc, i. e. grows "from left to right" <p>In all lines above - +1 increment, that might be +2, +4 or higher, depending on ...
[ "Extension", "rules", "make", "order", "of", "iteration", "of", "segments", "a", "little", "weird", "avoiding", "visiting", "the", "same", "segment", "twice" ]
train
https://github.com/TimeAndSpaceIO/SmoothieMap/blob/c798f6cae1d377f6913e8821a1fcf5bf45ee0412/src/main/java/net/openhft/smoothie/SmoothieMap.java#L1015-L1026
rackerlabs/clouddocs-maven-plugin
src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/util/RelativePath.java
RelativePath.matchPathLists
private static String matchPathLists(List<String> r,List<String> f) { """ figure out a string representing the relative path of 'f' with respect to 'r' @param r home path @param f path of file """ int i; int j; String s; // start at the beginning of the lists // iterate while both lists are equal ...
java
private static String matchPathLists(List<String> r,List<String> f) { int i; int j; String s; // start at the beginning of the lists // iterate while both lists are equal s = ""; i = r.size()-1; j = f.size()-1; // first eliminate common root while((i >= 0)&&(j >= 0)&&(r.get(i).equals(f.get(j)))) { ...
[ "private", "static", "String", "matchPathLists", "(", "List", "<", "String", ">", "r", ",", "List", "<", "String", ">", "f", ")", "{", "int", "i", ";", "int", "j", ";", "String", "s", ";", "// start at the beginning of the lists", "// iterate while both lists ...
figure out a string representing the relative path of 'f' with respect to 'r' @param r home path @param f path of file
[ "figure", "out", "a", "string", "representing", "the", "relative", "path", "of", "f", "with", "respect", "to", "r" ]
train
https://github.com/rackerlabs/clouddocs-maven-plugin/blob/ba8554dc340db674307efdaac647c6fd2b58a34b/src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/util/RelativePath.java#L42-L71
ludovicianul/selenium-on-steroids
src/main/java/com/insidecoding/sos/io/FileUtils.java
FileUtils.getPropertyAsInteger
public int getPropertyAsInteger(final String bundleName, final String key) { """ Gets the value as int from the resource bundles corresponding to the supplied key. <br/> @param bundleName the name of the bunlde to search in @param key the key to search for @return {@code -1} if the property is not found ...
java
public int getPropertyAsInteger(final String bundleName, final String key) { LOG.info("Getting value for key: " + key + " from bundle: " + bundleName); ResourceBundle bundle = bundles.get(bundleName); try { return Integer.parseInt(bundle.getString(key)); } catch (MissingResourceException e) { LOG.info...
[ "public", "int", "getPropertyAsInteger", "(", "final", "String", "bundleName", ",", "final", "String", "key", ")", "{", "LOG", ".", "info", "(", "\"Getting value for key: \"", "+", "key", "+", "\" from bundle: \"", "+", "bundleName", ")", ";", "ResourceBundle", ...
Gets the value as int from the resource bundles corresponding to the supplied key. <br/> @param bundleName the name of the bunlde to search in @param key the key to search for @return {@code -1} if the property is not found or the value is not a number; the corresponding value otherwise
[ "Gets", "the", "value", "as", "int", "from", "the", "resource", "bundles", "corresponding", "to", "the", "supplied", "key", ".", "<br", "/", ">" ]
train
https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/io/FileUtils.java#L331-L344
LearnLib/automatalib
util/src/main/java/net/automatalib/util/minimizer/MinimizationResult.java
MinimizationResult.getRepresentative
public S getRepresentative(Block<S, L> block) { """ Chooses a representative (i.e., an arbitrary element of the set of states) from a block. @param block the block. @return an arbitrary element of the state set of the given block. """ return block.getStates().choose().getOriginalState(); }
java
public S getRepresentative(Block<S, L> block) { return block.getStates().choose().getOriginalState(); }
[ "public", "S", "getRepresentative", "(", "Block", "<", "S", ",", "L", ">", "block", ")", "{", "return", "block", ".", "getStates", "(", ")", ".", "choose", "(", ")", ".", "getOriginalState", "(", ")", ";", "}" ]
Chooses a representative (i.e., an arbitrary element of the set of states) from a block. @param block the block. @return an arbitrary element of the state set of the given block.
[ "Chooses", "a", "representative", "(", "i", ".", "e", ".", "an", "arbitrary", "element", "of", "the", "set", "of", "states", ")", "from", "a", "block", "." ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/minimizer/MinimizationResult.java#L105-L107
rterp/GMapsFX
GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptRuntime.java
JavascriptRuntime.getArrayConstructor
@Override public String getArrayConstructor(String javascriptObjectType, Object[] ary) { """ Gets an array parameter constructor as a String, which then can be passed to the execute() method. @param javascriptObjectType type The type of JavaScript object array to create @param ary The array elements @ret...
java
@Override public String getArrayConstructor(String javascriptObjectType, Object[] ary) { String fn = getArrayFunction("new " + javascriptObjectType, ary); return fn; }
[ "@", "Override", "public", "String", "getArrayConstructor", "(", "String", "javascriptObjectType", ",", "Object", "[", "]", "ary", ")", "{", "String", "fn", "=", "getArrayFunction", "(", "\"new \"", "+", "javascriptObjectType", ",", "ary", ")", ";", "return", ...
Gets an array parameter constructor as a String, which then can be passed to the execute() method. @param javascriptObjectType type The type of JavaScript object array to create @param ary The array elements @return A string which can be passed to the JavaScript environment to create a new array.
[ "Gets", "an", "array", "parameter", "constructor", "as", "a", "String", "which", "then", "can", "be", "passed", "to", "the", "execute", "()", "method", "." ]
train
https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptRuntime.java#L93-L97
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java
ValueNumberFrameModelingVisitor.loadStaticField
private void loadStaticField(XField staticField, Instruction obj) { """ Load a static field. @param staticField the field @param obj the Instruction loading the field """ if (RLE_DEBUG) { System.out.println("[loadStaticField for field " + staticField + " in instruction " + handle); ...
java
private void loadStaticField(XField staticField, Instruction obj) { if (RLE_DEBUG) { System.out.println("[loadStaticField for field " + staticField + " in instruction " + handle); } ValueNumberFrame frame = getFrame(); AvailableLoad availableLoad = new AvailableLoad(staticF...
[ "private", "void", "loadStaticField", "(", "XField", "staticField", ",", "Instruction", "obj", ")", "{", "if", "(", "RLE_DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"[loadStaticField for field \"", "+", "staticField", "+", "\" in instruction \""...
Load a static field. @param staticField the field @param obj the Instruction loading the field
[ "Load", "a", "static", "field", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java#L736-L767
intuit/QuickBooks-V3-Java-SDK
ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPBatchClientConnectionInterceptor.java
HTTPBatchClientConnectionInterceptor.setResponseElements
private void setResponseElements(IntuitMessage intuitMessage, HttpResponse httpResponse) throws FMSException { """ Method to set the response elements by reading the values from HttpResponse @param intuitMessage the intuit message object @param httpResponse the http response object @throws com.intuit.ipp.exce...
java
private void setResponseElements(IntuitMessage intuitMessage, HttpResponse httpResponse) throws FMSException { ResponseElements responseElements = intuitMessage.getResponseElements(); if(httpResponse.getLastHeader(RequestElements.HEADER_PARAM_CONTENT_ENCODING) != null) { responseElements...
[ "private", "void", "setResponseElements", "(", "IntuitMessage", "intuitMessage", ",", "HttpResponse", "httpResponse", ")", "throws", "FMSException", "{", "ResponseElements", "responseElements", "=", "intuitMessage", ".", "getResponseElements", "(", ")", ";", "if", "(", ...
Method to set the response elements by reading the values from HttpResponse @param intuitMessage the intuit message object @param httpResponse the http response object @throws com.intuit.ipp.exception.FMSException the FMSException
[ "Method", "to", "set", "the", "response", "elements", "by", "reading", "the", "values", "from", "HttpResponse" ]
train
https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPBatchClientConnectionInterceptor.java#L443-L472
spring-projects/spring-social
spring-social-config/src/main/java/org/springframework/social/config/support/ProviderConfigurationSupport.java
ProviderConfigurationSupport.getConnectionFactoryBeanDefinition
protected BeanDefinition getConnectionFactoryBeanDefinition(String appId, String appSecret, Map<String, Object> allAttributes) { """ Creates a BeanDefinition for a provider connection factory. Although most providers will not need to override this method, it does allow for overriding to address any provider-speci...
java
protected BeanDefinition getConnectionFactoryBeanDefinition(String appId, String appSecret, Map<String, Object> allAttributes) { return BeanDefinitionBuilder.genericBeanDefinition(connectionFactoryClass).addConstructorArgValue(appId).addConstructorArgValue(appSecret).getBeanDefinition(); }
[ "protected", "BeanDefinition", "getConnectionFactoryBeanDefinition", "(", "String", "appId", ",", "String", "appSecret", ",", "Map", "<", "String", ",", "Object", ">", "allAttributes", ")", "{", "return", "BeanDefinitionBuilder", ".", "genericBeanDefinition", "(", "co...
Creates a BeanDefinition for a provider connection factory. Although most providers will not need to override this method, it does allow for overriding to address any provider-specific needs. @param appId The application's App ID @param appSecret The application's App Secret @param allAttributes All attributes availabl...
[ "Creates", "a", "BeanDefinition", "for", "a", "provider", "connection", "factory", ".", "Although", "most", "providers", "will", "not", "need", "to", "override", "this", "method", "it", "does", "allow", "for", "overriding", "to", "address", "any", "provider", ...
train
https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-config/src/main/java/org/springframework/social/config/support/ProviderConfigurationSupport.java#L71-L73
rosette-api/java
api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java
HttpRosetteAPI.getSupportedLanguages
@Override public SupportedLanguagesResponse getSupportedLanguages(String endpoint) throws HttpRosetteAPIException { """ Gets the set of language and script codes supported by the specified Rosette API endpoint. @return SupportedLanguagesResponse @throws HttpRosetteAPIException for an error returned from th...
java
@Override public SupportedLanguagesResponse getSupportedLanguages(String endpoint) throws HttpRosetteAPIException { if (DOC_ENDPOINTS.contains(endpoint) || NAME_DEDUPLICATION_SERVICE_PATH.equals(endpoint)) { return sendGetRequest(urlBase + endpoint + SUPPORTED_LANGUAGES_SUBPATH, SupportedLangua...
[ "@", "Override", "public", "SupportedLanguagesResponse", "getSupportedLanguages", "(", "String", "endpoint", ")", "throws", "HttpRosetteAPIException", "{", "if", "(", "DOC_ENDPOINTS", ".", "contains", "(", "endpoint", ")", "||", "NAME_DEDUPLICATION_SERVICE_PATH", ".", "...
Gets the set of language and script codes supported by the specified Rosette API endpoint. @return SupportedLanguagesResponse @throws HttpRosetteAPIException for an error returned from the Rosette API.
[ "Gets", "the", "set", "of", "language", "and", "script", "codes", "supported", "by", "the", "specified", "Rosette", "API", "endpoint", "." ]
train
https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L240-L247
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java
TasksInner.getDetails
public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { """ Returns a task with extended information that includes all secrets. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container re...
java
public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { return getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().single().body(); }
[ "public", "TaskInner", "getDetails", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "String", "taskName", ")", "{", "return", "getDetailsWithServiceResponseAsync", "(", "resourceGroupName", ",", "registryName", ",", "taskName", ")", ".", "toBl...
Returns a task with extended information that includes all secrets. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param taskName The name of the container registry task. @throws IllegalArgumentException thrown i...
[ "Returns", "a", "task", "with", "extended", "information", "that", "includes", "all", "secrets", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L861-L863
jhg023/SimpleNet
src/main/java/simplenet/packet/Packet.java
Packet.putChar
public Packet putChar(char c, ByteOrder order) { """ Writes a single {@code char} with the specified {@link ByteOrder} to this {@link Packet}'s payload. @param c A {@code char}. @param order The internal byte order of the {@code char}. @return The {@link Packet} to allow for chained writes. """ ...
java
public Packet putChar(char c, ByteOrder order) { var buffer = HEAP_BUFFER_POOL.take(Character.BYTES); var array = buffer.putChar(order == ByteOrder.LITTLE_ENDIAN ? Character.reverseBytes(c) : c).array(); try { return enqueue(Arrays.copyOfRange(array, 0, Character.BYTES)); ...
[ "public", "Packet", "putChar", "(", "char", "c", ",", "ByteOrder", "order", ")", "{", "var", "buffer", "=", "HEAP_BUFFER_POOL", ".", "take", "(", "Character", ".", "BYTES", ")", ";", "var", "array", "=", "buffer", ".", "putChar", "(", "order", "==", "B...
Writes a single {@code char} with the specified {@link ByteOrder} to this {@link Packet}'s payload. @param c A {@code char}. @param order The internal byte order of the {@code char}. @return The {@link Packet} to allow for chained writes.
[ "Writes", "a", "single", "{", "@code", "char", "}", "with", "the", "specified", "{", "@link", "ByteOrder", "}", "to", "this", "{", "@link", "Packet", "}", "s", "payload", "." ]
train
https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/packet/Packet.java#L155-L164
apiman/apiman
gateway/platforms/war/src/main/java/io/apiman/gateway/platforms/war/WarEngineConfig.java
WarEngineConfig.getConfigProperty
public String getConfigProperty(String propertyName, String defaultValue) { """ Returns the given configuration property name or the provided default value if not found. @param propertyName the property name @param defaultValue the default value @return the config property """ return getConfig().ge...
java
public String getConfigProperty(String propertyName, String defaultValue) { return getConfig().getString(propertyName, defaultValue); }
[ "public", "String", "getConfigProperty", "(", "String", "propertyName", ",", "String", "defaultValue", ")", "{", "return", "getConfig", "(", ")", ".", "getString", "(", "propertyName", ",", "defaultValue", ")", ";", "}" ]
Returns the given configuration property name or the provided default value if not found. @param propertyName the property name @param defaultValue the default value @return the config property
[ "Returns", "the", "given", "configuration", "property", "name", "or", "the", "provided", "default", "value", "if", "not", "found", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/war/src/main/java/io/apiman/gateway/platforms/war/WarEngineConfig.java#L86-L88
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfAction.java
PdfAction.createSubmitForm
public static PdfAction createSubmitForm(String file, Object names[], int flags) { """ Creates a submit form. @param file the URI to submit the form to @param names the objects to submit @param flags submit properties @return A PdfAction """ PdfAction action = new PdfAction(); action.put(Pd...
java
public static PdfAction createSubmitForm(String file, Object names[], int flags) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.SUBMITFORM); PdfDictionary dic = new PdfDictionary(); dic.put(PdfName.F, new PdfString(file)); dic.put(PdfName.FS, PdfName.URL); ...
[ "public", "static", "PdfAction", "createSubmitForm", "(", "String", "file", ",", "Object", "names", "[", "]", ",", "int", "flags", ")", "{", "PdfAction", "action", "=", "new", "PdfAction", "(", ")", ";", "action", ".", "put", "(", "PdfName", ".", "S", ...
Creates a submit form. @param file the URI to submit the form to @param names the objects to submit @param flags submit properties @return A PdfAction
[ "Creates", "a", "submit", "form", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfAction.java#L392-L403
leancloud/java-sdk-all
android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/GameLoginSignUtil.java
GameLoginSignUtil.sendRequest
private static void sendRequest(String url, byte[] body, String publicKey, ICheckLoginSignHandler callback) { """ 发送验签请求 @param url 请求url @param body 请求body @param publicKey 验签所使用的公钥 @param callback 验签结果回调 """ HttpURLConnection conn = null; OutputStream out = null; InputStream ...
java
private static void sendRequest(String url, byte[] body, String publicKey, ICheckLoginSignHandler callback) { HttpURLConnection conn = null; OutputStream out = null; InputStream is = null; InputStreamReader isr = null; try { URL urlReq = new URL(url); ...
[ "private", "static", "void", "sendRequest", "(", "String", "url", ",", "byte", "[", "]", "body", ",", "String", "publicKey", ",", "ICheckLoginSignHandler", "callback", ")", "{", "HttpURLConnection", "conn", "=", "null", ";", "OutputStream", "out", "=", "null",...
发送验签请求 @param url 请求url @param body 请求body @param publicKey 验签所使用的公钥 @param callback 验签结果回调
[ "发送验签请求" ]
train
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/GameLoginSignUtil.java#L93-L158
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.addItemsAtPosition
public void addItemsAtPosition(int position, @NonNull IDrawerItem... drawerItems) { """ add new items to the current DrawerItem list at a specific position @param position @param drawerItems """ mDrawerBuilder.getItemAdapter().add(position, drawerItems); }
java
public void addItemsAtPosition(int position, @NonNull IDrawerItem... drawerItems) { mDrawerBuilder.getItemAdapter().add(position, drawerItems); }
[ "public", "void", "addItemsAtPosition", "(", "int", "position", ",", "@", "NonNull", "IDrawerItem", "...", "drawerItems", ")", "{", "mDrawerBuilder", ".", "getItemAdapter", "(", ")", ".", "add", "(", "position", ",", "drawerItems", ")", ";", "}" ]
add new items to the current DrawerItem list at a specific position @param position @param drawerItems
[ "add", "new", "items", "to", "the", "current", "DrawerItem", "list", "at", "a", "specific", "position" ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L802-L804
ludovicianul/selenium-on-steroids
src/main/java/com/insidecoding/sos/io/FileUtils.java
FileUtils.writeToFile
public void writeToFile(final String filePath, final String toWrite, final boolean overwrite, final String fileEncoding) throws IOException { """ Writes the specific string content {@code toWrite} to the specified file {@code filePath}. If the file doesn't exists one will be created and the content will be...
java
public void writeToFile(final String filePath, final String toWrite, final boolean overwrite, final String fileEncoding) throws IOException { File file = new File(filePath); if (!file.exists()) { boolean created = file.createNewFile(); LOG.info("File successfully created: " + created); } BufferedWr...
[ "public", "void", "writeToFile", "(", "final", "String", "filePath", ",", "final", "String", "toWrite", ",", "final", "boolean", "overwrite", ",", "final", "String", "fileEncoding", ")", "throws", "IOException", "{", "File", "file", "=", "new", "File", "(", ...
Writes the specific string content {@code toWrite} to the specified file {@code filePath}. If the file doesn't exists one will be created and the content will be written. If the file exists and {@code overwrite} is true the content of the file will be overwritten otherwise the content will be appended to the existing f...
[ "Writes", "the", "specific", "string", "content", "{", "@code", "toWrite", "}", "to", "the", "specified", "file", "{", "@code", "filePath", "}", ".", "If", "the", "file", "doesn", "t", "exists", "one", "will", "be", "created", "and", "the", "content", "w...
train
https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/io/FileUtils.java#L702-L723
google/closure-compiler
src/com/google/javascript/jscomp/modules/ClosureRequireProcessor.java
ClosureRequireProcessor.getAllRequires
static ImmutableList<Require> getAllRequires(Node nameDeclaration) { """ Returns all Require built from the given statement, or null if it is not a require @param nameDeclaration a VAR, LET, or CONST @return all Requires contained in this declaration """ Node rhs = nameDeclaration.getFirstChild...
java
static ImmutableList<Require> getAllRequires(Node nameDeclaration) { Node rhs = nameDeclaration.getFirstChild().isDestructuringLhs() ? nameDeclaration.getFirstChild().getSecondChild() : nameDeclaration.getFirstFirstChild(); // This may be a require, requireType, or forwardDeclare...
[ "static", "ImmutableList", "<", "Require", ">", "getAllRequires", "(", "Node", "nameDeclaration", ")", "{", "Node", "rhs", "=", "nameDeclaration", ".", "getFirstChild", "(", ")", ".", "isDestructuringLhs", "(", ")", "?", "nameDeclaration", ".", "getFirstChild", ...
Returns all Require built from the given statement, or null if it is not a require @param nameDeclaration a VAR, LET, or CONST @return all Requires contained in this declaration
[ "Returns", "all", "Require", "built", "from", "the", "given", "statement", "or", "null", "if", "it", "is", "not", "a", "require" ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/modules/ClosureRequireProcessor.java#L66-L78
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java
SpiderTransaction.addFieldReferences
public void addFieldReferences(TableDefinition tableDef, Collection<String> fieldNames) { """ Add a column to the "_fields" row belonging to the given table for the given scalar field names. This row serves as a registry of scalar fields actually used by objects in the table. Field references go in the Terms tab...
java
public void addFieldReferences(TableDefinition tableDef, Collection<String> fieldNames) { for (String fieldName : fieldNames) { addColumn(SpiderService.termsStoreName(tableDef), FIELD_REGISTRY_ROW_KEY, fieldName); } }
[ "public", "void", "addFieldReferences", "(", "TableDefinition", "tableDef", ",", "Collection", "<", "String", ">", "fieldNames", ")", "{", "for", "(", "String", "fieldName", ":", "fieldNames", ")", "{", "addColumn", "(", "SpiderService", ".", "termsStoreName", "...
Add a column to the "_fields" row belonging to the given table for the given scalar field names. This row serves as a registry of scalar fields actually used by objects in the table. Field references go in the Terms table using the format: <pre> _fields = {{field 1}:null, {field 2}:null, ...} </pre> @param tableDef ...
[ "Add", "a", "column", "to", "the", "_fields", "row", "belonging", "to", "the", "given", "table", "for", "the", "given", "scalar", "field", "names", ".", "This", "row", "serves", "as", "a", "registry", "of", "scalar", "fields", "actually", "used", "by", "...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L239-L243
killbill/killbill
util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java
InternalCallContextFactory.createInternalTenantContextWithoutAccountRecordId
public InternalTenantContext createInternalTenantContextWithoutAccountRecordId(final TenantContext context) { """ Create an internal tenant callcontext from a tenant callcontext <p/> This is used for r/o operations - we don't need the account id in that case. You should almost never use that one, you always wan...
java
public InternalTenantContext createInternalTenantContextWithoutAccountRecordId(final TenantContext context) { // If tenant id is null, this will default to the default tenant record id (multi-tenancy disabled) final Long tenantRecordId = getTenantRecordIdSafe(context); return createInternalTenan...
[ "public", "InternalTenantContext", "createInternalTenantContextWithoutAccountRecordId", "(", "final", "TenantContext", "context", ")", "{", "// If tenant id is null, this will default to the default tenant record id (multi-tenancy disabled)", "final", "Long", "tenantRecordId", "=", "getT...
Create an internal tenant callcontext from a tenant callcontext <p/> This is used for r/o operations - we don't need the account id in that case. You should almost never use that one, you always want to populate the accountRecordId @param context tenant callcontext (tenantId can be null only if multi-tenancy is disabl...
[ "Create", "an", "internal", "tenant", "callcontext", "from", "a", "tenant", "callcontext", "<p", "/", ">", "This", "is", "used", "for", "r", "/", "o", "operations", "-", "we", "don", "t", "need", "the", "account", "id", "in", "that", "case", ".", "You"...
train
https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java#L114-L118
spring-projects/spring-session-data-mongodb
src/main/java/org/springframework/session/data/mongo/AbstractMongoSessionConverter.java
AbstractMongoSessionConverter.ensureIndexes
protected void ensureIndexes(IndexOperations sessionCollectionIndexes) { """ Method ensures that there is a TTL index on {@literal expireAt} field. It's has {@literal expireAfterSeconds} set to zero seconds, so the expiration time is controlled by the application. It can be extended in custom converters when the...
java
protected void ensureIndexes(IndexOperations sessionCollectionIndexes) { for (IndexInfo info : sessionCollectionIndexes.getIndexInfo()) { if (EXPIRE_AT_FIELD_NAME.equals(info.getName())) { LOG.debug("TTL index on field " + EXPIRE_AT_FIELD_NAME + " already exists"); return; } } LOG.info("Creating T...
[ "protected", "void", "ensureIndexes", "(", "IndexOperations", "sessionCollectionIndexes", ")", "{", "for", "(", "IndexInfo", "info", ":", "sessionCollectionIndexes", ".", "getIndexInfo", "(", ")", ")", "{", "if", "(", "EXPIRE_AT_FIELD_NAME", ".", "equals", "(", "i...
Method ensures that there is a TTL index on {@literal expireAt} field. It's has {@literal expireAfterSeconds} set to zero seconds, so the expiration time is controlled by the application. It can be extended in custom converters when there is a need for creating additional custom indexes. @param sessionCollectionIndexe...
[ "Method", "ensures", "that", "there", "is", "a", "TTL", "index", "on", "{", "@literal", "expireAt", "}", "field", ".", "It", "s", "has", "{", "@literal", "expireAfterSeconds", "}", "set", "to", "zero", "seconds", "so", "the", "expiration", "time", "is", ...
train
https://github.com/spring-projects/spring-session-data-mongodb/blob/c507bb2d2a9b52ea9846ffaf1ac7c71cb0e6690e/src/main/java/org/springframework/session/data/mongo/AbstractMongoSessionConverter.java#L69-L81
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractFunction.java
AbstractFunction.atan2
@NonNull public static Expression atan2(@NonNull Expression x, @NonNull Expression y) { """ Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta). @param x the abscissa coordinate @param y the ordinate coordinate @return the theta component of the p...
java
@NonNull public static Expression atan2(@NonNull Expression x, @NonNull Expression y) { if (x == null || y == null) { throw new IllegalArgumentException("x and y cannot be null."); } return new Expression.FunctionExpression("ATAN2()", Arrays.asList(x, y)); }
[ "@", "NonNull", "public", "static", "Expression", "atan2", "(", "@", "NonNull", "Expression", "x", ",", "@", "NonNull", "Expression", "y", ")", "{", "if", "(", "x", "==", "null", "||", "y", "==", "null", ")", "{", "throw", "new", "IllegalArgumentExceptio...
Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta). @param x the abscissa coordinate @param y the ordinate coordinate @return the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.
[ "Returns", "the", "angle", "theta", "from", "the", "conversion", "of", "rectangular", "coordinates", "(", "x", "y", ")", "to", "polar", "coordinates", "(", "r", "theta", ")", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractFunction.java#L181-L187
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java
NetworkInterfacesInner.listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync
public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { """ Gets all network interfaces in a virtual machine scale set. @param resourceGroupName The name of the ...
java
public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { return listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleS...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "NetworkInterfaceInner", ">", ">", ">", "listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "virtualMachineScaleSetName", ...
Gets all network interfaces in a virtual machine scale set. @param resourceGroupName The name of the resource group. @param virtualMachineScaleSetName The name of the virtual machine scale set. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;NetworkI...
[ "Gets", "all", "network", "interfaces", "in", "a", "virtual", "machine", "scale", "set", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1682-L1694
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java
NodeSet.indexOf
public int indexOf(Node elem, int index) { """ Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem Node to look for @param index Index of where to start the search @return the index of the first occurrence of th...
java
public int indexOf(Node elem, int index) { runTo(-1); if (null == m_map) return -1; for (int i = index; i < m_firstFree; i++) { Node node = m_map[i]; if ((null != node) && node.equals(elem)) return i; } return -1; }
[ "public", "int", "indexOf", "(", "Node", "elem", ",", "int", "index", ")", "{", "runTo", "(", "-", "1", ")", ";", "if", "(", "null", "==", "m_map", ")", "return", "-", "1", ";", "for", "(", "int", "i", "=", "index", ";", "i", "<", "m_firstFree"...
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. @param elem Node to look for @param index Index of where to start the search @return the index of the first occurrence of the object argument in this vector at position index or late...
[ "Searches", "for", "the", "first", "occurence", "of", "the", "given", "argument", "beginning", "the", "search", "at", "index", "and", "testing", "for", "equality", "using", "the", "equals", "method", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java#L1324-L1340
Crab2died/Excel4J
src/main/java/com/github/crab2died/ExcelUtils.java
ExcelUtils.mapSheet2Excel
public void mapSheet2Excel(List<MapSheetWrapper> sheetWrappers, String templatePath, OutputStream os) throws Excel4JException { """ 基于模板、注解的多sheet导出{@code Map[String, List[?]]}类型数据 模板定制详见定制说明 @param sheetWrappers sheet包装类 @param templatePath Excel模板 @param os 输出流 @throws Excel4JExcep...
java
public void mapSheet2Excel(List<MapSheetWrapper> sheetWrappers, String templatePath, OutputStream os) throws Excel4JException { try (SheetTemplate sheetTemplate = exportExcelByMapHandler(sheetWrappers, templatePath)) { sheetTemplate.write2Stream(os); } catch (IOException e) { ...
[ "public", "void", "mapSheet2Excel", "(", "List", "<", "MapSheetWrapper", ">", "sheetWrappers", ",", "String", "templatePath", ",", "OutputStream", "os", ")", "throws", "Excel4JException", "{", "try", "(", "SheetTemplate", "sheetTemplate", "=", "exportExcelByMapHandler...
基于模板、注解的多sheet导出{@code Map[String, List[?]]}类型数据 模板定制详见定制说明 @param sheetWrappers sheet包装类 @param templatePath Excel模板 @param os 输出流 @throws Excel4JException 异常
[ "基于模板、注解的多sheet导出", "{", "@code", "Map", "[", "String", "List", "[", "?", "]]", "}", "类型数据", "模板定制详见定制说明" ]
train
https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L906-L914
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.checkArgument
public static void checkArgument(boolean validCondition, String argName, String message, Object... args) throws IllegalArgumentException { """ Throws an IllegalArgumentException if the validCondition argument is false. @param validCondition The result of the condition to validate. @param argName The nam...
java
public static void checkArgument(boolean validCondition, String argName, String message, Object... args) throws IllegalArgumentException { if (!validCondition) { throw new IllegalArgumentException(badArgumentMessage(argName, message, args)); } }
[ "public", "static", "void", "checkArgument", "(", "boolean", "validCondition", ",", "String", "argName", ",", "String", "message", ",", "Object", "...", "args", ")", "throws", "IllegalArgumentException", "{", "if", "(", "!", "validCondition", ")", "{", "throw", ...
Throws an IllegalArgumentException if the validCondition argument is false. @param validCondition The result of the condition to validate. @param argName The name of the argument (to be included in the exception message). @param message The message to include in the exception. This should not include the...
[ "Throws", "an", "IllegalArgumentException", "if", "the", "validCondition", "argument", "is", "false", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L208-L212
xetorthio/jedis
src/main/java/redis/clients/jedis/BinaryJedis.java
BinaryJedis.decrBy
@Override public Long decrBy(final byte[] key, final long decrement) { """ DECRBY work just like {@link #decr(byte[]) INCR} but instead to decrement by 1 the decrement is integer. <p> INCR commands are limited to 64 bit signed integers. <p> Note: this is actually a string operation, that is, in Redis there ...
java
@Override public Long decrBy(final byte[] key, final long decrement) { checkIsInMultiOrPipeline(); client.decrBy(key, decrement); return client.getIntegerReply(); }
[ "@", "Override", "public", "Long", "decrBy", "(", "final", "byte", "[", "]", "key", ",", "final", "long", "decrement", ")", "{", "checkIsInMultiOrPipeline", "(", ")", ";", "client", ".", "decrBy", "(", "key", ",", "decrement", ")", ";", "return", "client...
DECRBY work just like {@link #decr(byte[]) INCR} but instead to decrement by 1 the decrement is integer. <p> INCR commands are limited to 64 bit signed integers. <p> Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64 ...
[ "DECRBY", "work", "just", "like", "{" ]
train
https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L732-L737
osglworks/java-tool-ext
src/main/java/org/osgl/util/Token.java
Token.generateToken
@Deprecated public static String generateToken(String secret, long seconds, String oid, String... payload) { """ This method is deprecated. please use {@link #generateToken(byte[], long, String, String...)} instead Generate a token string with secret key, ID and optionally payloads @param secret the secret...
java
@Deprecated public static String generateToken(String secret, long seconds, String oid, String... payload) { return generateToken(secret.getBytes(Charsets.UTF_8), seconds, oid, payload); }
[ "@", "Deprecated", "public", "static", "String", "generateToken", "(", "String", "secret", ",", "long", "seconds", ",", "String", "oid", ",", "String", "...", "payload", ")", "{", "return", "generateToken", "(", "secret", ".", "getBytes", "(", "Charsets", "....
This method is deprecated. please use {@link #generateToken(byte[], long, String, String...)} instead Generate a token string with secret key, ID and optionally payloads @param secret the secret to encrypt to token string @param seconds the expiration of the token in seconds @param oid the ID of the token (could be cu...
[ "This", "method", "is", "deprecated", ".", "please", "use", "{", "@link", "#generateToken", "(", "byte", "[]", "long", "String", "String", "...", ")", "}", "instead" ]
train
https://github.com/osglworks/java-tool-ext/blob/43f034bd0a42e571e437f44aa20487d45248a30b/src/main/java/org/osgl/util/Token.java#L323-L326
openengsb/openengsb
api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java
TransformationDescription.mapField
public void mapField(String sourceField, String targetField, Map<String, String> mapping) { """ Adds a map transformation step to the transformation description. The value of the source field is mapped based on the mapping to another value which is forwarded to the target field. The values in the models need to b...
java
public void mapField(String sourceField, String targetField, Map<String, String> mapping) { TransformationStep step = new TransformationStep(); step.setTargetField(targetField); step.setSourceFields(sourceField); step.setOperationParams(mapping); step.setOperationName("map"); ...
[ "public", "void", "mapField", "(", "String", "sourceField", ",", "String", "targetField", ",", "Map", "<", "String", ",", "String", ">", "mapping", ")", "{", "TransformationStep", "step", "=", "new", "TransformationStep", "(", ")", ";", "step", ".", "setTarg...
Adds a map transformation step to the transformation description. The value of the source field is mapped based on the mapping to another value which is forwarded to the target field. The values in the models need to be working with the values of the mapping (e.g. assigning 'hello' to Integer field will not work).
[ "Adds", "a", "map", "transformation", "step", "to", "the", "transformation", "description", ".", "The", "value", "of", "the", "source", "field", "is", "mapped", "based", "on", "the", "mapping", "to", "another", "value", "which", "is", "forwarded", "to", "the...
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java#L125-L132
dlemmermann/CalendarFX
CalendarFXView/src/main/java/com/calendarfx/util/Util.java
Util.findScrollBar
public static ScrollBar findScrollBar(Parent parent, Orientation orientation) { """ Searches for a {@link ScrollBar} of the given orientation (vertical, horizontal) somewhere in the containment hierarchy of the given parent node. @param parent the parent node @param orientation the orientation (horizonta...
java
public static ScrollBar findScrollBar(Parent parent, Orientation orientation) { for (Node node : parent.getChildrenUnmodifiable()) { if (node instanceof ScrollBar) { ScrollBar b = (ScrollBar) node; if (b.getOrientation().equals(orientation)) { retu...
[ "public", "static", "ScrollBar", "findScrollBar", "(", "Parent", "parent", ",", "Orientation", "orientation", ")", "{", "for", "(", "Node", "node", ":", "parent", ".", "getChildrenUnmodifiable", "(", ")", ")", "{", "if", "(", "node", "instanceof", "ScrollBar",...
Searches for a {@link ScrollBar} of the given orientation (vertical, horizontal) somewhere in the containment hierarchy of the given parent node. @param parent the parent node @param orientation the orientation (horizontal, vertical) @return a scrollbar or null if none can be found
[ "Searches", "for", "a", "{", "@link", "ScrollBar", "}", "of", "the", "given", "orientation", "(", "vertical", "horizontal", ")", "somewhere", "in", "the", "containment", "hierarchy", "of", "the", "given", "parent", "node", "." ]
train
https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/util/Util.java#L240-L258
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
ValueFactoryImpl.createValue
public Value createValue(JCRPath value) throws RepositoryException { """ Create Value from JCRPath. @param value JCRPath @return Value @throws RepositoryException if error """ if (value == null) return null; try { return new PathValue(value.getInternalPath(), location...
java
public Value createValue(JCRPath value) throws RepositoryException { if (value == null) return null; try { return new PathValue(value.getInternalPath(), locationFactory); } catch (IOException e) { throw new RepositoryException("Cannot create PATH Value f...
[ "public", "Value", "createValue", "(", "JCRPath", "value", ")", "throws", "RepositoryException", "{", "if", "(", "value", "==", "null", ")", "return", "null", ";", "try", "{", "return", "new", "PathValue", "(", "value", ".", "getInternalPath", "(", ")", ",...
Create Value from JCRPath. @param value JCRPath @return Value @throws RepositoryException if error
[ "Create", "Value", "from", "JCRPath", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java#L327-L339
OpenLiberty/open-liberty
dev/com.ibm.ws.jbatch.cdi/src/com/ibm/ws/jbatch/cdi/internal/CDIBatchArtifactFactoryImpl.java
CDIBatchArtifactFactoryImpl.getUniqueBeanForClassName
@FFDCIgnore( { """ Use the given BeanManager to lookup the set of CDI-registered beans with the given class name. @return the bean with the given className. It returns null if there are zero matches or if there is no umabiguous resolution (i.e. more than 1 match) """ ClassNotFoundException.class, BatchCDIA...
java
@FFDCIgnore({ ClassNotFoundException.class, BatchCDIAmbiguousResolutionCheckedException.class }) protected Bean<?> getUniqueBeanForClassName(BeanManager bm, String className) { // Ignore exceptions since will just failover to another loading mechanism try { Class<?> clazz = getContextCla...
[ "@", "FFDCIgnore", "(", "{", "ClassNotFoundException", ".", "class", ",", "BatchCDIAmbiguousResolutionCheckedException", ".", "class", "}", ")", "protected", "Bean", "<", "?", ">", "getUniqueBeanForClassName", "(", "BeanManager", "bm", ",", "String", "className", ")...
Use the given BeanManager to lookup the set of CDI-registered beans with the given class name. @return the bean with the given className. It returns null if there are zero matches or if there is no umabiguous resolution (i.e. more than 1 match)
[ "Use", "the", "given", "BeanManager", "to", "lookup", "the", "set", "of", "CDI", "-", "registered", "beans", "with", "the", "given", "class", "name", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jbatch.cdi/src/com/ibm/ws/jbatch/cdi/internal/CDIBatchArtifactFactoryImpl.java#L179-L196
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java
GVRShaderData.setIntArray
public void setIntArray(String key, int val[]) { """ Set the value for an integer vector uniform. <p> @param key name of uniform to set. @param val integer array with new data. The size of the array must be at least as large as the uniform being updated. @throws IllegalArgumentException if key is not in unifo...
java
public void setIntArray(String key, int val[]) { checkKeyIsUniform(key); NativeShaderData.setIntVec(getNative(), key, val, val.length); }
[ "public", "void", "setIntArray", "(", "String", "key", ",", "int", "val", "[", "]", ")", "{", "checkKeyIsUniform", "(", "key", ")", ";", "NativeShaderData", ".", "setIntVec", "(", "getNative", "(", ")", ",", "key", ",", "val", ",", "val", ".", "length"...
Set the value for an integer vector uniform. <p> @param key name of uniform to set. @param val integer array with new data. The size of the array must be at least as large as the uniform being updated. @throws IllegalArgumentException if key is not in uniform descriptor or array is wrong length. @see #getIntVec(String)
[ "Set", "the", "value", "for", "an", "integer", "vector", "uniform", ".", "<p", ">" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java#L433-L437
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/network/Network.java
Network.createDefaultNetwork
public static Network createDefaultNetwork(Model mo, int bw) { """ Create and attach a default network view to the given model. Basically, the Network consists of a main non-blocking switch connected to all the existing nodes in the model using links with the given bandwidth in Mbit/sec. Note: replace the pr...
java
public static Network createDefaultNetwork(Model mo, int bw) { Network net = new Network(); Switch mainSwitch = net.newSwitch(); // Main non-blocking switch for (Node n : mo.getMapping().getAllNodes()) { net.connect(bw, mainSwitch, n); // Connect all nodes with 1Gbit/s links ...
[ "public", "static", "Network", "createDefaultNetwork", "(", "Model", "mo", ",", "int", "bw", ")", "{", "Network", "net", "=", "new", "Network", "(", ")", ";", "Switch", "mainSwitch", "=", "net", ".", "newSwitch", "(", ")", ";", "// Main non-blocking switch",...
Create and attach a default network view to the given model. Basically, the Network consists of a main non-blocking switch connected to all the existing nodes in the model using links with the given bandwidth in Mbit/sec. Note: replace the previous Network view attached to the model (if exists). @param mo the mode...
[ "Create", "and", "attach", "a", "default", "network", "view", "to", "the", "given", "model", ".", "Basically", "the", "Network", "consists", "of", "a", "main", "non", "-", "blocking", "switch", "connected", "to", "all", "the", "existing", "nodes", "in", "t...
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Network.java#L415-L427
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/event/MoveIDToCodeHandler.java
MoveIDToCodeHandler.doRecordChange
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { """ Called when a change is the record status is about to happen/has happened. @param field If this file change is due to a field, this is the field. @param iChangeType The type of change that occurred. @param bDisplayOption I...
java
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); if (iChangeType == DBConstants.AFTER_REFRESH_TYPE) iErrorCode = this.moveIDToCodeField(); else if ((iChang...
[ "public", "int", "doRecordChange", "(", "FieldInfo", "field", ",", "int", "iChangeType", ",", "boolean", "bDisplayOption", ")", "{", "int", "iErrorCode", "=", "super", ".", "doRecordChange", "(", "field", ",", "iChangeType", ",", "bDisplayOption", ")", ";", "i...
Called when a change is the record status is about to happen/has happened. @param field If this file change is due to a field, this is the field. @param iChangeType The type of change that occurred. @param bDisplayOption If true, display any changes. @return an error code.
[ "Called", "when", "a", "change", "is", "the", "record", "status", "is", "about", "to", "happen", "/", "has", "happened", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/MoveIDToCodeHandler.java#L70-L91
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/biclustering/AbstractBiclustering.java
AbstractBiclustering.valueAt
protected double valueAt(int row, int col) { """ Returns the value of the data matrix at row <code>row</code> and column <code>col</code>. @param row the row in the data matrix according to the current order of rows (refers to database entry <code>database.get(rowIDs[row])</code>) @param col the column in t...
java
protected double valueAt(int row, int col) { iter.seek(row); return relation.get(iter).doubleValue(col); }
[ "protected", "double", "valueAt", "(", "int", "row", ",", "int", "col", ")", "{", "iter", ".", "seek", "(", "row", ")", ";", "return", "relation", ".", "get", "(", "iter", ")", ".", "doubleValue", "(", "col", ")", ";", "}" ]
Returns the value of the data matrix at row <code>row</code> and column <code>col</code>. @param row the row in the data matrix according to the current order of rows (refers to database entry <code>database.get(rowIDs[row])</code>) @param col the column in the data matrix according to the current order of rows (refer...
[ "Returns", "the", "value", "of", "the", "data", "matrix", "at", "row", "<code", ">", "row<", "/", "code", ">", "and", "column", "<code", ">", "col<", "/", "code", ">", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/biclustering/AbstractBiclustering.java#L189-L192
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/convert/IntegerConverter.java
IntegerConverter.toIntegerWithDefault
public static int toIntegerWithDefault(Object value, int defaultValue) { """ Converts value into integer or returns default value when conversion is not possible. @param value the value to convert. @param defaultValue the default value. @return integer value or default when conversion is not supported...
java
public static int toIntegerWithDefault(Object value, int defaultValue) { Integer result = toNullableInteger(value); return result != null ? (int) result : defaultValue; }
[ "public", "static", "int", "toIntegerWithDefault", "(", "Object", "value", ",", "int", "defaultValue", ")", "{", "Integer", "result", "=", "toNullableInteger", "(", "value", ")", ";", "return", "result", "!=", "null", "?", "(", "int", ")", "result", ":", "...
Converts value into integer or returns default value when conversion is not possible. @param value the value to convert. @param defaultValue the default value. @return integer value or default when conversion is not supported. @see IntegerConverter#toNullableInteger(Object)
[ "Converts", "value", "into", "integer", "or", "returns", "default", "value", "when", "conversion", "is", "not", "possible", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/convert/IntegerConverter.java#L59-L62
StanKocken/EfficientAdapter
efficientadapter/src/main/java/com/skocken/efficientadapter/lib/adapter/AdapterHelper.java
AdapterHelper.updateWith
void updateWith(EfficientAdapter<T> efficientAdapter, List<T> list) { """ Update the adapter list with this new list. Using this method, instead of clear/addAll will allow the implementation to compute the best way to update the elements. For example, if you have only one item which was in the previous list and...
java
void updateWith(EfficientAdapter<T> efficientAdapter, List<T> list) { new AdapterUpdater<>(efficientAdapter).update(list); }
[ "void", "updateWith", "(", "EfficientAdapter", "<", "T", ">", "efficientAdapter", ",", "List", "<", "T", ">", "list", ")", "{", "new", "AdapterUpdater", "<>", "(", "efficientAdapter", ")", ".", "update", "(", "list", ")", ";", "}" ]
Update the adapter list with this new list. Using this method, instead of clear/addAll will allow the implementation to compute the best way to update the elements. For example, if you have only one item which was in the previous list and which is not on the new, the Updater has an opportunity to just call `remove` on ...
[ "Update", "the", "adapter", "list", "with", "this", "new", "list", ".", "Using", "this", "method", "instead", "of", "clear", "/", "addAll", "will", "allow", "the", "implementation", "to", "compute", "the", "best", "way", "to", "update", "the", "elements", ...
train
https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/adapter/AdapterHelper.java#L249-L251
infinispan/infinispan
core/src/main/java/org/infinispan/expiration/impl/ExpirationManagerImpl.java
ExpirationManagerImpl.deleteFromStoresAndNotify
private void deleteFromStoresAndNotify(K key, V value, Metadata metadata) { """ Deletes the key from the store as well as notifies the cache listeners of the expiration of the given key, value, metadata combination. <p> This method must be invoked while holding data container lock for the given key to ensure ev...
java
private void deleteFromStoresAndNotify(K key, V value, Metadata metadata) { deleteFromStores(key); CompletionStages.join(cacheNotifier.notifyCacheEntryExpired(key, value, metadata, null)); }
[ "private", "void", "deleteFromStoresAndNotify", "(", "K", "key", ",", "V", "value", ",", "Metadata", "metadata", ")", "{", "deleteFromStores", "(", "key", ")", ";", "CompletionStages", ".", "join", "(", "cacheNotifier", ".", "notifyCacheEntryExpired", "(", "key"...
Deletes the key from the store as well as notifies the cache listeners of the expiration of the given key, value, metadata combination. <p> This method must be invoked while holding data container lock for the given key to ensure events are ordered properly. @param key @param value @param metadata
[ "Deletes", "the", "key", "from", "the", "store", "as", "well", "as", "notifies", "the", "cache", "listeners", "of", "the", "expiration", "of", "the", "given", "key", "value", "metadata", "combination", ".", "<p", ">", "This", "method", "must", "be", "invok...
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/expiration/impl/ExpirationManagerImpl.java#L205-L208
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/Collectors.java
Collectors.toSet
@NotNull public static <T> Collector<T, ?, Set<T>> toSet() { """ Returns a {@code Collector} that fills new {@code Set} with input elements. @param <T> the type of the input elements @return a {@code Collector} """ return new CollectorsImpl<T, Set<T>, Set<T>>( new Supplier<Set<...
java
@NotNull public static <T> Collector<T, ?, Set<T>> toSet() { return new CollectorsImpl<T, Set<T>, Set<T>>( new Supplier<Set<T>>() { @NotNull @Override public Set<T> get() { return new HashSet<T>(); ...
[ "@", "NotNull", "public", "static", "<", "T", ">", "Collector", "<", "T", ",", "?", ",", "Set", "<", "T", ">", ">", "toSet", "(", ")", "{", "return", "new", "CollectorsImpl", "<", "T", ",", "Set", "<", "T", ">", ",", "Set", "<", "T", ">", ">"...
Returns a {@code Collector} that fills new {@code Set} with input elements. @param <T> the type of the input elements @return a {@code Collector}
[ "Returns", "a", "{", "@code", "Collector", "}", "that", "fills", "new", "{", "@code", "Set", "}", "with", "input", "elements", "." ]
train
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Collectors.java#L122-L141
centic9/commons-dost
src/main/java/org/dstadler/commons/graphviz/DotUtils.java
DotUtils.checkDot
public static boolean checkDot() throws IOException { """ Verify if dot can be started and print out the version to stdout. @return True if "dot -V" ran successfully, false otherwise @throws IOException If running dot fails. """ // call graphviz-dot via commons-exec CommandLine cmdLine = new CommandL...
java
public static boolean checkDot() throws IOException { // call graphviz-dot via commons-exec CommandLine cmdLine = new CommandLine(DOT_EXE); cmdLine.addArgument("-V"); DefaultExecutor executor = new DefaultExecutor(); executor.setExitValue(0); ExecuteWatchdog watchdog = new ExecuteWatchdog(60000); executor...
[ "public", "static", "boolean", "checkDot", "(", ")", "throws", "IOException", "{", "// call graphviz-dot via commons-exec", "CommandLine", "cmdLine", "=", "new", "CommandLine", "(", "DOT_EXE", ")", ";", "cmdLine", ".", "addArgument", "(", "\"-V\"", ")", ";", "Defa...
Verify if dot can be started and print out the version to stdout. @return True if "dot -V" ran successfully, false otherwise @throws IOException If running dot fails.
[ "Verify", "if", "dot", "can", "be", "started", "and", "print", "out", "the", "version", "to", "stdout", "." ]
train
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/graphviz/DotUtils.java#L143-L159
alkacon/opencms-core
src/org/opencms/ui/apps/CmsAppWorkplaceUi.java
CmsAppWorkplaceUi.showApp
public void showApp(I_CmsWorkplaceAppConfiguration appConfig, String state) { """ Navigates to the given app.<p> @param appConfig the app configuration @param state the app state to call """ getNavigator().navigateTo(appConfig.getId() + "/" + state); }
java
public void showApp(I_CmsWorkplaceAppConfiguration appConfig, String state) { getNavigator().navigateTo(appConfig.getId() + "/" + state); }
[ "public", "void", "showApp", "(", "I_CmsWorkplaceAppConfiguration", "appConfig", ",", "String", "state", ")", "{", "getNavigator", "(", ")", ".", "navigateTo", "(", "appConfig", ".", "getId", "(", ")", "+", "\"/\"", "+", "state", ")", ";", "}" ]
Navigates to the given app.<p> @param appConfig the app configuration @param state the app state to call
[ "Navigates", "to", "the", "given", "app", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsAppWorkplaceUi.java#L490-L493
tvesalainen/util
util/src/main/java/org/vesalainen/math/ConvexPolygon.java
ConvexPolygon.updateConvexPolygon
public static ConvexPolygon updateConvexPolygon(ConvexPolygon polygon, DenseMatrix64F points) { """ Creates a minimum convex polygon that contains every point either as a boundary or inside. <p>Existing points are removed. @param polygon @param points @return """ assert points.numCols == 2; ...
java
public static ConvexPolygon updateConvexPolygon(ConvexPolygon polygon, DenseMatrix64F points) { assert points.numCols == 2; int rows = points.numRows; double[] d = points.data; for (int row=0;row<rows;row++) { polygon.addPoint(d[2*row], d[2*row+1]); ...
[ "public", "static", "ConvexPolygon", "updateConvexPolygon", "(", "ConvexPolygon", "polygon", ",", "DenseMatrix64F", "points", ")", "{", "assert", "points", ".", "numCols", "==", "2", ";", "int", "rows", "=", "points", ".", "numRows", ";", "double", "[", "]", ...
Creates a minimum convex polygon that contains every point either as a boundary or inside. <p>Existing points are removed. @param polygon @param points @return
[ "Creates", "a", "minimum", "convex", "polygon", "that", "contains", "every", "point", "either", "as", "a", "boundary", "or", "inside", ".", "<p", ">", "Existing", "points", "are", "removed", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/ConvexPolygon.java#L243-L253
HanSolo/SteelSeries-Swing
src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java
AbstractRadial.setLedPosition
@Override public void setLedPosition(final double X, final double Y) { """ Sets the position of the gauge threshold led to the given values @param X @param Y """ ledPosition.setLocation(X, Y); repaint(getInnerBounds()); }
java
@Override public void setLedPosition(final double X, final double Y) { ledPosition.setLocation(X, Y); repaint(getInnerBounds()); }
[ "@", "Override", "public", "void", "setLedPosition", "(", "final", "double", "X", ",", "final", "double", "Y", ")", "{", "ledPosition", ".", "setLocation", "(", "X", ",", "Y", ")", ";", "repaint", "(", "getInnerBounds", "(", ")", ")", ";", "}" ]
Sets the position of the gauge threshold led to the given values @param X @param Y
[ "Sets", "the", "position", "of", "the", "gauge", "threshold", "led", "to", "the", "given", "values" ]
train
https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L432-L436
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
FSNamesystem.inHostsList
private boolean inHostsList(DatanodeID node, String ipAddr) { """ Keeps track of which datanodes/ipaddress are allowed to connect to the namenode. """ Set<String> hostsList = hostsReader.getHosts(); try { if (hostsList.isEmpty() || (ipAddr != null && hostsList.contains(ipAddr)) ...
java
private boolean inHostsList(DatanodeID node, String ipAddr) { Set<String> hostsList = hostsReader.getHosts(); try { if (hostsList.isEmpty() || (ipAddr != null && hostsList.contains(ipAddr)) || hostsList.contains(node.getHost()) || hostsList.contains(node.getName()) ...
[ "private", "boolean", "inHostsList", "(", "DatanodeID", "node", ",", "String", "ipAddr", ")", "{", "Set", "<", "String", ">", "hostsList", "=", "hostsReader", ".", "getHosts", "(", ")", ";", "try", "{", "if", "(", "hostsList", ".", "isEmpty", "(", ")", ...
Keeps track of which datanodes/ipaddress are allowed to connect to the namenode.
[ "Keeps", "track", "of", "which", "datanodes", "/", "ipaddress", "are", "allowed", "to", "connect", "to", "the", "namenode", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L8256-L8290
mapbox/mapbox-java
services-core/src/main/java/com/mapbox/core/utils/ColorUtils.java
ColorUtils.toHexString
public static String toHexString(int red, int green, int blue) { """ Converts red, green, blue values to a hex string that can then be used in a URL when making API request. Note that this does <b>Not</b> add the hex key before the string. @param red the value of the color which needs to be converted @param g...
java
public static String toHexString(int red, int green, int blue) { String hexColor = String.format("%02X%02X%02X", red, green, blue); if (hexColor.length() < 6) { hexColor = "000000".substring(0, 6 - hexColor.length()) + hexColor; } return hexColor; }
[ "public", "static", "String", "toHexString", "(", "int", "red", ",", "int", "green", ",", "int", "blue", ")", "{", "String", "hexColor", "=", "String", ".", "format", "(", "\"%02X%02X%02X\"", ",", "red", ",", "green", ",", "blue", ")", ";", "if", "(", ...
Converts red, green, blue values to a hex string that can then be used in a URL when making API request. Note that this does <b>Not</b> add the hex key before the string. @param red the value of the color which needs to be converted @param green the value of the color which needs to be converted @param blue the value ...
[ "Converts", "red", "green", "blue", "values", "to", "a", "hex", "string", "that", "can", "then", "be", "used", "in", "a", "URL", "when", "making", "API", "request", ".", "Note", "that", "this", "does", "<b", ">", "Not<", "/", "b", ">", "add", "the", ...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-core/src/main/java/com/mapbox/core/utils/ColorUtils.java#L24-L32
Graylog2/graylog2-server
graylog2-server/src/main/java/org/graylog2/database/PaginatedDbService.java
PaginatedDbService.getSortBuilder
protected DBSort.SortBuilder getSortBuilder(String order, String field) { """ Returns a sort builder for the given order and field name. @param order the order. either "asc" or "desc" @param field the field to sort on @return the sort builder """ DBSort.SortBuilder sortBuilder; if ("desc"....
java
protected DBSort.SortBuilder getSortBuilder(String order, String field) { DBSort.SortBuilder sortBuilder; if ("desc".equalsIgnoreCase(order)) { sortBuilder = DBSort.desc(field); } else { sortBuilder = DBSort.asc(field); } return sortBuilder; }
[ "protected", "DBSort", ".", "SortBuilder", "getSortBuilder", "(", "String", "order", ",", "String", "field", ")", "{", "DBSort", ".", "SortBuilder", "sortBuilder", ";", "if", "(", "\"desc\"", ".", "equalsIgnoreCase", "(", "order", ")", ")", "{", "sortBuilder",...
Returns a sort builder for the given order and field name. @param order the order. either "asc" or "desc" @param field the field to sort on @return the sort builder
[ "Returns", "a", "sort", "builder", "for", "the", "given", "order", "and", "field", "name", "." ]
train
https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/database/PaginatedDbService.java#L226-L234
Whiley/WhileyCompiler
src/main/java/wyil/check/DefiniteAssignmentCheck.java
DefiniteAssignmentCheck.visitBlock
@Override public ControlFlow visitBlock(Stmt.Block block, DefinitelyAssignedSet environment) { """ Check that all variables used in a given list of statements are definitely assigned. Furthermore, update the set of definitely assigned variables to include any which are definitely assigned at the end of these s...
java
@Override public ControlFlow visitBlock(Stmt.Block block, DefinitelyAssignedSet environment) { DefinitelyAssignedSet nextEnvironment = environment; DefinitelyAssignedSet breakEnvironment = null; for(int i=0;i!=block.size();++i) { Stmt s = block.get(i); ControlFlow nf = visitStatement(s, nextEnvironment); ...
[ "@", "Override", "public", "ControlFlow", "visitBlock", "(", "Stmt", ".", "Block", "block", ",", "DefinitelyAssignedSet", "environment", ")", "{", "DefinitelyAssignedSet", "nextEnvironment", "=", "environment", ";", "DefinitelyAssignedSet", "breakEnvironment", "=", "nul...
Check that all variables used in a given list of statements are definitely assigned. Furthermore, update the set of definitely assigned variables to include any which are definitely assigned at the end of these statements. @param block The list of statements to visit. @param environment The set of variables which are ...
[ "Check", "that", "all", "variables", "used", "in", "a", "given", "list", "of", "statements", "are", "definitely", "assigned", ".", "Furthermore", "update", "the", "set", "of", "definitely", "assigned", "variables", "to", "include", "any", "which", "are", "defi...
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/DefiniteAssignmentCheck.java#L149-L164
smartsheet-platform/smartsheet-java-sdk
src/main/java/com/smartsheet/api/SmartsheetFactory.java
SmartsheetFactory.createDefaultGovAccountClient
public static Smartsheet createDefaultGovAccountClient() { """ <p>Creates a Smartsheet client with default parameters using the Smartsheetgov URI. SMARTSHEET_ACCESS_TOKEN must be set in the environment.</p> @return the Smartsheet client """ String accessToken = System.getenv("SMARTSHEET_ACCESS_TOKE...
java
public static Smartsheet createDefaultGovAccountClient() { String accessToken = System.getenv("SMARTSHEET_ACCESS_TOKEN"); SmartsheetImpl smartsheet = new SmartsheetImpl(GOV_BASE_URI, accessToken); return smartsheet; }
[ "public", "static", "Smartsheet", "createDefaultGovAccountClient", "(", ")", "{", "String", "accessToken", "=", "System", ".", "getenv", "(", "\"SMARTSHEET_ACCESS_TOKEN\"", ")", ";", "SmartsheetImpl", "smartsheet", "=", "new", "SmartsheetImpl", "(", "GOV_BASE_URI", ",...
<p>Creates a Smartsheet client with default parameters using the Smartsheetgov URI. SMARTSHEET_ACCESS_TOKEN must be set in the environment.</p> @return the Smartsheet client
[ "<p", ">", "Creates", "a", "Smartsheet", "client", "with", "default", "parameters", "using", "the", "Smartsheetgov", "URI", ".", "SMARTSHEET_ACCESS_TOKEN", "must", "be", "set", "in", "the", "environment", ".", "<", "/", "p", ">" ]
train
https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/SmartsheetFactory.java#L71-L75
gallandarakhneorg/afc
advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java
MapComposedElement.addPoint
public final int addPoint(Point2D<?, ?> point, int indexGroup) { """ Add the specified point at the end of the specified group. @param point the new point. @param indexGroup the index of the group. @return the index of the point in the element. @throws IndexOutOfBoundsException in case of error. """ re...
java
public final int addPoint(Point2D<?, ?> point, int indexGroup) { return addPoint(point.getX(), point.getY(), indexGroup); }
[ "public", "final", "int", "addPoint", "(", "Point2D", "<", "?", ",", "?", ">", "point", ",", "int", "indexGroup", ")", "{", "return", "addPoint", "(", "point", ".", "getX", "(", ")", ",", "point", ".", "getY", "(", ")", ",", "indexGroup", ")", ";",...
Add the specified point at the end of the specified group. @param point the new point. @param indexGroup the index of the group. @return the index of the point in the element. @throws IndexOutOfBoundsException in case of error.
[ "Add", "the", "specified", "point", "at", "the", "end", "of", "the", "specified", "group", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L592-L594
Impetus/Kundera
src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java
MongoDBClient.parseAndScroll
private DBCursor parseAndScroll(String jsonClause, String collectionName) throws JSONParseException { """ Parses the and scroll. @param jsonClause the json clause @param collectionName the collection name @return the DB cursor @throws JSONParseException the JSON parse exception """ BasicDBObje...
java
private DBCursor parseAndScroll(String jsonClause, String collectionName) throws JSONParseException { BasicDBObject clause = (BasicDBObject) JSON.parse(jsonClause); DBCursor cursor = mongoDb.getCollection(collectionName).find(clause); return cursor; }
[ "private", "DBCursor", "parseAndScroll", "(", "String", "jsonClause", ",", "String", "collectionName", ")", "throws", "JSONParseException", "{", "BasicDBObject", "clause", "=", "(", "BasicDBObject", ")", "JSON", ".", "parse", "(", "jsonClause", ")", ";", "DBCursor...
Parses the and scroll. @param jsonClause the json clause @param collectionName the collection name @return the DB cursor @throws JSONParseException the JSON parse exception
[ "Parses", "the", "and", "scroll", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java#L1846-L1851
Scout24/appmon4j
core/src/main/java/de/is24/util/monitoring/database/MonitoringDataSource.java
MonitoringDataSource.getConnection
@Override public Connection getConnection(final String username, final String password) throws SQLException { """ <p> Delegates the call to the wrapped data source, wraps the returned connection and counts the connections returned. </p> @param username the name of the database user on whose behalf the ...
java
@Override public Connection getConnection(final String username, final String password) throws SQLException { return getConnection( new Callable<Connection>() { @Override public Connection call() throws SQLException { return MonitoringDataSource.this.original.getConnection(us...
[ "@", "Override", "public", "Connection", "getConnection", "(", "final", "String", "username", ",", "final", "String", "password", ")", "throws", "SQLException", "{", "return", "getConnection", "(", "new", "Callable", "<", "Connection", ">", "(", ")", "{", "@",...
<p> Delegates the call to the wrapped data source, wraps the returned connection and counts the connections returned. </p> @param username the name of the database user on whose behalf the connection isbeing made @param password the user's password @return a database <code>Connection</code> @throws java.sql.SQLE...
[ "<p", ">", "Delegates", "the", "call", "to", "the", "wrapped", "data", "source", "wraps", "the", "returned", "connection", "and", "counts", "the", "connections", "returned", ".", "<", "/", "p", ">" ]
train
https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/database/MonitoringDataSource.java#L303-L313
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java
CommerceWarehouseItemPersistenceImpl.removeByCPI_CPIU
@Override public void removeByCPI_CPIU(long CProductId, String CPInstanceUuid) { """ Removes all the commerce warehouse items where CProductId = &#63; and CPInstanceUuid = &#63; from the database. @param CProductId the c product ID @param CPInstanceUuid the cp instance uuid """ for (CommerceWarehouseIte...
java
@Override public void removeByCPI_CPIU(long CProductId, String CPInstanceUuid) { for (CommerceWarehouseItem commerceWarehouseItem : findByCPI_CPIU( CProductId, CPInstanceUuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceWarehouseItem); } }
[ "@", "Override", "public", "void", "removeByCPI_CPIU", "(", "long", "CProductId", ",", "String", "CPInstanceUuid", ")", "{", "for", "(", "CommerceWarehouseItem", "commerceWarehouseItem", ":", "findByCPI_CPIU", "(", "CProductId", ",", "CPInstanceUuid", ",", "QueryUtil"...
Removes all the commerce warehouse items where CProductId = &#63; and CPInstanceUuid = &#63; from the database. @param CProductId the c product ID @param CPInstanceUuid the cp instance uuid
[ "Removes", "all", "the", "commerce", "warehouse", "items", "where", "CProductId", "=", "&#63", ";", "and", "CPInstanceUuid", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java#L1393-L1400
JOML-CI/JOML
src/org/joml/AABBf.java
AABBf.setMax
public AABBf setMax(float maxX, float maxY, float maxZ) { """ Set the maximum corner coordinates. @param maxX the x coordinate of the maximum corner @param maxY the y coordinate of the maximum corner @param maxZ the z coordinate of the maximum corner @return this """ this.maxX = maxX; ...
java
public AABBf setMax(float maxX, float maxY, float maxZ) { this.maxX = maxX; this.maxY = maxY; this.maxZ = maxZ; return this; }
[ "public", "AABBf", "setMax", "(", "float", "maxX", ",", "float", "maxY", ",", "float", "maxZ", ")", "{", "this", ".", "maxX", "=", "maxX", ";", "this", ".", "maxY", "=", "maxY", ";", "this", ".", "maxZ", "=", "maxZ", ";", "return", "this", ";", "...
Set the maximum corner coordinates. @param maxX the x coordinate of the maximum corner @param maxY the y coordinate of the maximum corner @param maxZ the z coordinate of the maximum corner @return this
[ "Set", "the", "maximum", "corner", "coordinates", "." ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/AABBf.java#L135-L140
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowContext.java
PageFlowContext.get
public Object get(String name, PageFlowContextActivator activator) { """ This method will lookup a named object and return it. The object is looked up by name. If the object doesn't exist, the activator object is called to create a new instance of the object before it is returned. @param name The name of the ...
java
public Object get(String name, PageFlowContextActivator activator) { assert (name != null) : "Parameter 'name' must not be null"; assert (activator != null) : "Parameter 'activator' must not be null"; Object ret = _contexts.get(name); if (ret == null) { ret = activator.a...
[ "public", "Object", "get", "(", "String", "name", ",", "PageFlowContextActivator", "activator", ")", "{", "assert", "(", "name", "!=", "null", ")", ":", "\"Parameter 'name' must not be null\"", ";", "assert", "(", "activator", "!=", "null", ")", ":", "\"Paramete...
This method will lookup a named object and return it. The object is looked up by name. If the object doesn't exist, the activator object is called to create a new instance of the object before it is returned. @param name The name of the object to return @param activator An <code>PageFlowContextActivator</code> that w...
[ "This", "method", "will", "lookup", "a", "named", "object", "and", "return", "it", ".", "The", "object", "is", "looked", "up", "by", "name", ".", "If", "the", "object", "doesn", "t", "exist", "the", "activator", "object", "is", "called", "to", "create", ...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowContext.java#L121-L132
stratosphere/stratosphere
stratosphere-core/src/main/java/eu/stratosphere/api/common/PlanExecutor.java
PlanExecutor.createRemoteExecutor
public static PlanExecutor createRemoteExecutor(String hostname, int port, String... jarFiles) { """ Creates an executor that runs the plan on a remote environment. The remote executor is typically used to send the program to a cluster for execution. @param hostname The address of the JobManager to send the pr...
java
public static PlanExecutor createRemoteExecutor(String hostname, int port, String... jarFiles) { if (hostname == null) { throw new IllegalArgumentException("The hostname must not be null."); } if (port <= 0 || port > 0xffff) { throw new IllegalArgumentException("The port value is out of range."); } C...
[ "public", "static", "PlanExecutor", "createRemoteExecutor", "(", "String", "hostname", ",", "int", "port", ",", "String", "...", "jarFiles", ")", "{", "if", "(", "hostname", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The hostname...
Creates an executor that runs the plan on a remote environment. The remote executor is typically used to send the program to a cluster for execution. @param hostname The address of the JobManager to send the program to. @param port The port of the JobManager to send the program to. @param jarFiles A list of jar files ...
[ "Creates", "an", "executor", "that", "runs", "the", "plan", "on", "a", "remote", "environment", ".", "The", "remote", "executor", "is", "typically", "used", "to", "send", "the", "program", "to", "a", "cluster", "for", "execution", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/PlanExecutor.java#L80-L98
datacleaner/DataCleaner
engine/xml-config/src/main/java/org/datacleaner/configuration/DomConfigurationWriter.java
DomConfigurationWriter.toElement
public Element toElement(final CsvDatastore datastore, final String filename) { """ Externalizes a {@link CsvDatastore} to a XML element. @param datastore the datastore to externalize @param filename the filename/path to use in the XML element. Since the appropriate path will depend on the reading application...
java
public Element toElement(final CsvDatastore datastore, final String filename) { final Element datastoreElement = getDocument().createElement("csv-datastore"); datastoreElement.setAttribute("name", datastore.getName()); final String description = datastore.getDescription(); if (!Strings....
[ "public", "Element", "toElement", "(", "final", "CsvDatastore", "datastore", ",", "final", "String", "filename", ")", "{", "final", "Element", "datastoreElement", "=", "getDocument", "(", ")", ".", "createElement", "(", "\"csv-datastore\"", ")", ";", "datastoreEle...
Externalizes a {@link CsvDatastore} to a XML element. @param datastore the datastore to externalize @param filename the filename/path to use in the XML element. Since the appropriate path will depend on the reading application's environment (supported {@link Resource} types), this specific property of the datastore is...
[ "Externalizes", "a", "{", "@link", "CsvDatastore", "}", "to", "a", "XML", "element", "." ]
train
https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/xml-config/src/main/java/org/datacleaner/configuration/DomConfigurationWriter.java#L939-L966
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractTreeMap.java
AbstractTreeMap.tailMap
public SortedMap tailMap(Object startKey) { """ Answers a SortedMap of the specified portion of this TreeMap which contains keys greater or equal to the start key. The returned SortedMap is backed by this TreeMap so changes to one are reflected by the other. @param startKey the start key @return a submap w...
java
public SortedMap tailMap(Object startKey) { // Check for errors if (comparator == null) ((Comparable) startKey).compareTo(startKey); else comparator.compare(startKey, startKey); return makeSubMap(startKey, null); }
[ "public", "SortedMap", "tailMap", "(", "Object", "startKey", ")", "{", "// Check for errors", "if", "(", "comparator", "==", "null", ")", "(", "(", "Comparable", ")", "startKey", ")", ".", "compareTo", "(", "startKey", ")", ";", "else", "comparator", ".", ...
Answers a SortedMap of the specified portion of this TreeMap which contains keys greater or equal to the start key. The returned SortedMap is backed by this TreeMap so changes to one are reflected by the other. @param startKey the start key @return a submap where the keys are greater or equal to <code>startKey</code>...
[ "Answers", "a", "SortedMap", "of", "the", "specified", "portion", "of", "this", "TreeMap", "which", "contains", "keys", "greater", "or", "equal", "to", "the", "start", "key", ".", "The", "returned", "SortedMap", "is", "backed", "by", "this", "TreeMap", "so",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractTreeMap.java#L1142-L1149
michael-rapp/AndroidBottomSheet
library/src/main/java/de/mrapp/android/bottomsheet/model/Item.java
Item.setTitle
public final void setTitle(@NonNull final Context context, @StringRes final int resourceId) { """ Sets the title of the item. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resource id of the title, which shoul...
java
public final void setTitle(@NonNull final Context context, @StringRes final int resourceId) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); setTitle(context.getText(resourceId)); }
[ "public", "final", "void", "setTitle", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "StringRes", "final", "int", "resourceId", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "context", ",", "\"The context may not be null\"", ...
Sets the title of the item. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resource id of the title, which should be set, as an {@link Integer} value. The resource id must correspond to a valid string resource
[ "Sets", "the", "title", "of", "the", "item", "." ]
train
https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/library/src/main/java/de/mrapp/android/bottomsheet/model/Item.java#L146-L149
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Console.java
Console.error
public static void error(Throwable t, String template, Object... values) { """ 同 System.err.println()方法,打印控制台日志 @param t 异常对象 @param template 文本模板,被替换的部分用 {} 表示 @param values 值 """ err.println(StrUtil.format(template, values)); if (null != t) { t.printStackTrace(err); err.flush(); } }
java
public static void error(Throwable t, String template, Object... values) { err.println(StrUtil.format(template, values)); if (null != t) { t.printStackTrace(err); err.flush(); } }
[ "public", "static", "void", "error", "(", "Throwable", "t", ",", "String", "template", ",", "Object", "...", "values", ")", "{", "err", ".", "println", "(", "StrUtil", ".", "format", "(", "template", ",", "values", ")", ")", ";", "if", "(", "null", "...
同 System.err.println()方法,打印控制台日志 @param t 异常对象 @param template 文本模板,被替换的部分用 {} 表示 @param values 值
[ "同", "System", ".", "err", ".", "println", "()", "方法,打印控制台日志" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Console.java#L154-L160
landawn/AbacusUtil
src/com/landawn/abacus/util/stream/Stream.java
Stream.parallelZipp
public static <T, R> Stream<R> parallelZipp(final Collection<? extends Iterator<? extends T>> c, final Function<? super List<? extends T>, R> zipFunction) { """ Put the stream in try-catch to stop the back-end reading thread if error happens <br /> <code> try (Stream<Integer> stream = Stream.parallelZip(a, b, z...
java
public static <T, R> Stream<R> parallelZipp(final Collection<? extends Iterator<? extends T>> c, final Function<? super List<? extends T>, R> zipFunction) { return parallelZipp(c, zipFunction, DEFAULT_QUEUE_SIZE_PER_ITERATOR); }
[ "public", "static", "<", "T", ",", "R", ">", "Stream", "<", "R", ">", "parallelZipp", "(", "final", "Collection", "<", "?", "extends", "Iterator", "<", "?", "extends", "T", ">", ">", "c", ",", "final", "Function", "<", "?", "super", "List", "<", "?...
Put the stream in try-catch to stop the back-end reading thread if error happens <br /> <code> try (Stream<Integer> stream = Stream.parallelZip(a, b, zipFunction)) { stream.forEach(N::println); } </code> @param c @param zipFunction @return
[ "Put", "the", "stream", "in", "try", "-", "catch", "to", "stop", "the", "back", "-", "end", "reading", "thread", "if", "error", "happens", "<br", "/", ">", "<code", ">", "try", "(", "Stream<Integer", ">", "stream", "=", "Stream", ".", "parallelZip", "(...
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L7902-L7904
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java
JSONHelpers.loadExternalJSONFile
public static JSONObject loadExternalJSONFile(Context context, final String directory, final String file) { """ Load a JSON file from a private application directory as defined by {@link Environment}. @param directory One of the {@code DIRECTORY_*} constants def...
java
public static JSONObject loadExternalJSONFile(Context context, final String directory, final String file) { final File dir = context.getExternalFilesDir(directory); return loadJSONFile(dir, file); }
[ "public", "static", "JSONObject", "loadExternalJSONFile", "(", "Context", "context", ",", "final", "String", "directory", ",", "final", "String", "file", ")", "{", "final", "File", "dir", "=", "context", ".", "getExternalFilesDir", "(", "directory", ")", ";", ...
Load a JSON file from a private application directory as defined by {@link Environment}. @param directory One of the {@code DIRECTORY_*} constants defined by {@code Environment}. @param file Relative path to file in the public directory. @return New instance of {@link JSONObject}
[ "Load", "a", "JSON", "file", "from", "a", "private", "application", "directory", "as", "defined", "by", "{", "@link", "Environment", "}", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L1208-L1212
abel533/EasyXls
src/main/java/com/github/abel533/easyxls/common/FieldUtil.java
FieldUtil.getField
public static Field getField(Object source, String fieldName) { """ 获取字段中的Field @param source 对象 @param fieldName 字段名 @return 返回字段对象 """ if (source == null) { return null; } return getField(source.getClass(), fieldName); }
java
public static Field getField(Object source, String fieldName) { if (source == null) { return null; } return getField(source.getClass(), fieldName); }
[ "public", "static", "Field", "getField", "(", "Object", "source", ",", "String", "fieldName", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "null", ";", "}", "return", "getField", "(", "source", ".", "getClass", "(", ")", ",", "field...
获取字段中的Field @param source 对象 @param fieldName 字段名 @return 返回字段对象
[ "获取字段中的Field" ]
train
https://github.com/abel533/EasyXls/blob/f73be23745c2180d7c0b8f0a510e72e61cc37d5d/src/main/java/com/github/abel533/easyxls/common/FieldUtil.java#L19-L24
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/MilestonesApi.java
MilestonesApi.getMilestone
public Milestone getMilestone(Object projectIdOrPath, Integer milestoneId) throws GitLabApiException { """ Get the specified milestone. @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param milestoneId the ID of the milestone tp get @return a Milestone inst...
java
public Milestone getMilestone(Object projectIdOrPath, Integer milestoneId) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "milestones", milestoneId); return (response.readEntity(Milestone....
[ "public", "Milestone", "getMilestone", "(", "Object", "projectIdOrPath", ",", "Integer", "milestoneId", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "get", "(", "Response", ".", "Status", ".", "OK", ",", "getDefaultPerPageParam", "(", ")"...
Get the specified milestone. @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param milestoneId the ID of the milestone tp get @return a Milestone instance for the specified IDs @throws GitLabApiException if any exception occurs
[ "Get", "the", "specified", "milestone", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MilestonesApi.java#L365-L369