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
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionsUtilImpl.java
SipSessionsUtilImpl.addCorrespondingSipApplicationSession
public void addCorrespondingSipApplicationSession(MobicentsSipApplicationSessionKey newApplicationSession, MobicentsSipApplicationSessionKey correspondingSipApplicationSession, String headerName) { """ Add a mapping between a new session and a corresponding sipSession related to a headerName. See Also getCorrespon...
java
public void addCorrespondingSipApplicationSession(MobicentsSipApplicationSessionKey newApplicationSession, MobicentsSipApplicationSessionKey correspondingSipApplicationSession, String headerName) { if(headerName.equalsIgnoreCase(JoinHeader.NAME)) { joinApplicationSession.putIfAbsent(newApplicationSession, corres...
[ "public", "void", "addCorrespondingSipApplicationSession", "(", "MobicentsSipApplicationSessionKey", "newApplicationSession", ",", "MobicentsSipApplicationSessionKey", "correspondingSipApplicationSession", ",", "String", "headerName", ")", "{", "if", "(", "headerName", ".", "equa...
Add a mapping between a new session and a corresponding sipSession related to a headerName. See Also getCorrespondingSipSession method. @param newSession the new session @param correspondingSipSession the corresponding sip session to add @param headerName the header name
[ "Add", "a", "mapping", "between", "a", "new", "session", "and", "a", "corresponding", "sipSession", "related", "to", "a", "headerName", ".", "See", "Also", "getCorrespondingSipSession", "method", "." ]
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionsUtilImpl.java#L201-L209
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java
MCEDependenceMeasure.getMCEntropy
private double getMCEntropy(int[][] mat, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int size, int gridsize, double loggrid) { """ Compute the MCE entropy value. @param mat Partition size matrix @param partsx Partitions on X @param partsy Partitions on Y @param size Data set size @param gridsize Size ...
java
private double getMCEntropy(int[][] mat, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int size, int gridsize, double loggrid) { // Margin entropies: double[] mx = new double[gridsize]; double[] my = new double[gridsize]; for(int i = 0; i < gridsize; i++) { // Note: indexes are a bit tricky h...
[ "private", "double", "getMCEntropy", "(", "int", "[", "]", "[", "]", "mat", ",", "ArrayList", "<", "int", "[", "]", ">", "partsx", ",", "ArrayList", "<", "int", "[", "]", ">", "partsy", ",", "int", "size", ",", "int", "gridsize", ",", "double", "lo...
Compute the MCE entropy value. @param mat Partition size matrix @param partsx Partitions on X @param partsy Partitions on Y @param size Data set size @param gridsize Size of grids @param loggrid Logarithm of grid sizes, for normalization @return MCE score.
[ "Compute", "the", "MCE", "entropy", "value", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java#L221-L253
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/Utils.java
Utils.getImpl
protected static Object getImpl(String className, Class[] types, Object[] args) { """ Create a platform specific instance of a utils class. @param className the simple name of the class whois implementation is to be found. @param types used to select the constructor. @param args used to invoke the constructor...
java
protected static Object getImpl(String className, Class[] types, Object[] args) { // No tracing as this is used to load the trace factory. Object Impl; // For return. try { Class classToInstantiate = Class.forName(className); java.lang.reflect.Constructor constructor = c...
[ "protected", "static", "Object", "getImpl", "(", "String", "className", ",", "Class", "[", "]", "types", ",", "Object", "[", "]", "args", ")", "{", "// No tracing as this is used to load the trace factory.", "Object", "Impl", ";", "// For return.", "try", "{", "Cl...
Create a platform specific instance of a utils class. @param className the simple name of the class whois implementation is to be found. @param types used to select the constructor. @param args used to invoke the constructor. @return Object the utils class loaded.
[ "Create", "a", "platform", "specific", "instance", "of", "a", "utils", "class", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/Utils.java#L34-L53
infinispan/infinispan
server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/DistributedCacheConfigurationAdd.java
DistributedCacheConfigurationAdd.processModelNode
@Override void processModelNode(OperationContext context, String containerName, ModelNode cache, ConfigurationBuilder builder, List<Dependency<?>> dependencies) throws OperationFailedException { """ Implementation of abstract method processModelNode suitable for distributed cache @param context ...
java
@Override void processModelNode(OperationContext context, String containerName, ModelNode cache, ConfigurationBuilder builder, List<Dependency<?>> dependencies) throws OperationFailedException { // process the basic clustered configuration super.processModelNode(context, containerName, ...
[ "@", "Override", "void", "processModelNode", "(", "OperationContext", "context", ",", "String", "containerName", ",", "ModelNode", "cache", ",", "ConfigurationBuilder", "builder", ",", "List", "<", "Dependency", "<", "?", ">", ">", "dependencies", ")", "throws", ...
Implementation of abstract method processModelNode suitable for distributed cache @param context @param containerName @param builder @param dependencies @return
[ "Implementation", "of", "abstract", "method", "processModelNode", "suitable", "for", "distributed", "cache" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/DistributedCacheConfigurationAdd.java#L63-L89
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java
TransferManager.abortMultipartUploads
public void abortMultipartUploads(String bucketName, Date date) throws AmazonServiceException, AmazonClientException { """ <p> Aborts any multipart uploads that were initiated before the specified date. </p> <p> This method is useful for cleaning up any interrupted multipart uploads. <code>Transfe...
java
public void abortMultipartUploads(String bucketName, Date date) throws AmazonServiceException, AmazonClientException { MultipartUploadListing uploadListing = s3.listMultipartUploads(appendSingleObjectUserAgent( new ListMultipartUploadsRequest(bucketName))); do { f...
[ "public", "void", "abortMultipartUploads", "(", "String", "bucketName", ",", "Date", "date", ")", "throws", "AmazonServiceException", ",", "AmazonClientException", "{", "MultipartUploadListing", "uploadListing", "=", "s3", ".", "listMultipartUploads", "(", "appendSingleOb...
<p> Aborts any multipart uploads that were initiated before the specified date. </p> <p> This method is useful for cleaning up any interrupted multipart uploads. <code>TransferManager</code> attempts to abort any failed uploads, but in some cases this may not be possible, such as if network connectivity is completely l...
[ "<p", ">", "Aborts", "any", "multipart", "uploads", "that", "were", "initiated", "before", "the", "specified", "date", ".", "<", "/", "p", ">", "<p", ">", "This", "method", "is", "useful", "for", "cleaning", "up", "any", "interrupted", "multipart", "upload...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java#L1900-L1917
ist-dresden/composum
sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java
RequestUtil.getIntSelector
public static int getIntSelector(SlingHttpServletRequest request, int defaultValue) { """ Retrieves a number in the selectors and returns it if present otherwise the default value. @param request the request object with the selector info @param defaultValue the default number value """ String[...
java
public static int getIntSelector(SlingHttpServletRequest request, int defaultValue) { String[] selectors = request.getRequestPathInfo().getSelectors(); for (String selector : selectors) { try { return Integer.parseInt(selector); } catch (NumberFormatException nfex...
[ "public", "static", "int", "getIntSelector", "(", "SlingHttpServletRequest", "request", ",", "int", "defaultValue", ")", "{", "String", "[", "]", "selectors", "=", "request", ".", "getRequestPathInfo", "(", ")", ".", "getSelectors", "(", ")", ";", "for", "(", ...
Retrieves a number in the selectors and returns it if present otherwise the default value. @param request the request object with the selector info @param defaultValue the default number value
[ "Retrieves", "a", "number", "in", "the", "selectors", "and", "returns", "it", "if", "present", "otherwise", "the", "default", "value", "." ]
train
https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java#L89-L99
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.writeFile
public CmsFile writeFile(CmsDbContext dbc, CmsFile resource) throws CmsException { """ Writes a resource to the OpenCms VFS, including it's content.<p> Applies only to resources of type <code>{@link CmsFile}</code> i.e. resources that have a binary content attached.<p> Certain resource types might apply con...
java
public CmsFile writeFile(CmsDbContext dbc, CmsFile resource) throws CmsException { resource.setUserLastModified(dbc.currentUser().getId()); resource.setContents(resource.getContents()); // to be sure the content date is updated getVfsDriver(dbc).writeResource(dbc, dbc.currentProject().getUuid(...
[ "public", "CmsFile", "writeFile", "(", "CmsDbContext", "dbc", ",", "CmsFile", "resource", ")", "throws", "CmsException", "{", "resource", ".", "setUserLastModified", "(", "dbc", ".", "currentUser", "(", ")", ".", "getId", "(", ")", ")", ";", "resource", ".",...
Writes a resource to the OpenCms VFS, including it's content.<p> Applies only to resources of type <code>{@link CmsFile}</code> i.e. resources that have a binary content attached.<p> Certain resource types might apply content validation or transformation rules before the resource is actually written to the VFS. The r...
[ "Writes", "a", "resource", "to", "the", "OpenCms", "VFS", "including", "it", "s", "content", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9793-L9827
VoltDB/voltdb
third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java
HelpFormatter.renderWrappedTextBlock
private Appendable renderWrappedTextBlock(StringBuffer sb, int width, int nextLineTabStop, String text) { """ Render the specified text width a maximum width. This method differs from renderWrappedText by not removing leading spaces after a new line. @param sb The StringBuffer to place the rendered text into. ...
java
private Appendable renderWrappedTextBlock(StringBuffer sb, int width, int nextLineTabStop, String text) { try { BufferedReader in = new BufferedReader(new StringReader(text)); String line; boolean firstLine = true; while ((line = in.readLine()) != null...
[ "private", "Appendable", "renderWrappedTextBlock", "(", "StringBuffer", "sb", ",", "int", "width", ",", "int", "nextLineTabStop", ",", "String", "text", ")", "{", "try", "{", "BufferedReader", "in", "=", "new", "BufferedReader", "(", "new", "StringReader", "(", ...
Render the specified text width a maximum width. This method differs from renderWrappedText by not removing leading spaces after a new line. @param sb The StringBuffer to place the rendered text into. @param width The number of characters to display per line @param nextLineTabStop The position on the next line for the...
[ "Render", "the", "specified", "text", "width", "a", "maximum", "width", ".", "This", "method", "differs", "from", "renderWrappedText", "by", "not", "removing", "leading", "spaces", "after", "a", "new", "line", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L942-L968
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.isInheritedIn
public boolean isInheritedIn(Symbol clazz, Types types) { """ Is this symbol inherited into a given class? PRE: If symbol's owner is a interface, it is already assumed that the interface is a superinterface of given class. @param clazz The class for which we want to establish membership. This must be a subcl...
java
public boolean isInheritedIn(Symbol clazz, Types types) { switch ((int)(flags_field & Flags.AccessFlags)) { default: // error recovery case PUBLIC: return true; case PRIVATE: return this.owner == clazz; case PROTECTED: // we model interfaces as...
[ "public", "boolean", "isInheritedIn", "(", "Symbol", "clazz", ",", "Types", "types", ")", "{", "switch", "(", "(", "int", ")", "(", "flags_field", "&", "Flags", ".", "AccessFlags", ")", ")", "{", "default", ":", "// error recovery", "case", "PUBLIC", ":", ...
Is this symbol inherited into a given class? PRE: If symbol's owner is a interface, it is already assumed that the interface is a superinterface of given class. @param clazz The class for which we want to establish membership. This must be a subclass of the member's owner.
[ "Is", "this", "symbol", "inherited", "into", "a", "given", "class?", "PRE", ":", "If", "symbol", "s", "owner", "is", "a", "interface", "it", "is", "already", "assumed", "that", "the", "interface", "is", "a", "superinterface", "of", "given", "class", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L578-L604
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java
BoxApiCollaboration.getAddRequest
public BoxRequestsShare.AddCollaboration getAddRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, String login) { """ A request that adds a user as a collaborator to an item by using their login. @param collaborationItem item to be collaborated. @param role role of the collaboration @pa...
java
public BoxRequestsShare.AddCollaboration getAddRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, String login) { BoxRequestsShare.AddCollaboration collab = new BoxRequestsShare.AddCollaboration(getCollaborationsUrl(), createStubItem(collaborationItem), role, login, mSes...
[ "public", "BoxRequestsShare", ".", "AddCollaboration", "getAddRequest", "(", "BoxCollaborationItem", "collaborationItem", ",", "BoxCollaboration", ".", "Role", "role", ",", "String", "login", ")", "{", "BoxRequestsShare", ".", "AddCollaboration", "collab", "=", "new", ...
A request that adds a user as a collaborator to an item by using their login. @param collaborationItem item to be collaborated. @param role role of the collaboration @param login email address of the user to add @return request to add/create a collaboration
[ "A", "request", "that", "adds", "a", "user", "as", "a", "collaborator", "to", "an", "item", "by", "using", "their", "login", "." ]
train
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L168-L172
looly/hutool
hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java
SqlExecutor.executeQuery
private static <T> T executeQuery(PreparedStatement ps, RsHandler<T> rsh) throws SQLException { """ 执行查询 @param ps {@link PreparedStatement} @param rsh 结果集处理对象 @return 结果对象 @throws SQLException SQL执行异常 @since 4.1.13 """ ResultSet rs = null; try { rs = ps.executeQuery(); return rsh.handle(rs); ...
java
private static <T> T executeQuery(PreparedStatement ps, RsHandler<T> rsh) throws SQLException { ResultSet rs = null; try { rs = ps.executeQuery(); return rsh.handle(rs); } finally { DbUtil.close(rs); } }
[ "private", "static", "<", "T", ">", "T", "executeQuery", "(", "PreparedStatement", "ps", ",", "RsHandler", "<", "T", ">", "rsh", ")", "throws", "SQLException", "{", "ResultSet", "rs", "=", "null", ";", "try", "{", "rs", "=", "ps", ".", "executeQuery", ...
执行查询 @param ps {@link PreparedStatement} @param rsh 结果集处理对象 @return 结果对象 @throws SQLException SQL执行异常 @since 4.1.13
[ "执行查询" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L345-L353
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.ortho2D
public Matrix4d ortho2D(double left, double right, double bottom, double top) { """ Apply an orthographic projection transformation for a right-handed coordinate system to this matrix. <p> This method is equivalent to calling {@link #ortho(double, double, double, double, double, double) ortho()} with <code>zNea...
java
public Matrix4d ortho2D(double left, double right, double bottom, double top) { return ortho2D(left, right, bottom, top, this); }
[ "public", "Matrix4d", "ortho2D", "(", "double", "left", ",", "double", "right", ",", "double", "bottom", ",", "double", "top", ")", "{", "return", "ortho2D", "(", "left", ",", "right", ",", "bottom", ",", "top", ",", "this", ")", ";", "}" ]
Apply an orthographic projection transformation for a right-handed coordinate system to this matrix. <p> This method is equivalent to calling {@link #ortho(double, double, double, double, double, double) ortho()} with <code>zNear=-1</code> and <code>zFar=+1</code>. <p> If <code>M</code> is <code>this</code> matrix and ...
[ "Apply", "an", "orthographic", "projection", "transformation", "for", "a", "right", "-", "handed", "coordinate", "system", "to", "this", "matrix", ".", "<p", ">", "This", "method", "is", "equivalent", "to", "calling", "{", "@link", "#ortho", "(", "double", "...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10623-L10625
alkacon/opencms-core
src/org/opencms/file/collectors/CmsSubscriptionCollector.java
CmsSubscriptionCollector.getCalculatedTime
private long getCalculatedTime(long baseTime, String deltaDays, String key, long defaultTime) { """ Returns the calculated time with the days delta using the base time.<p> @param baseTime the base time to calculate the returned time from @param deltaDays the number of days which should be subtracted from the b...
java
private long getCalculatedTime(long baseTime, String deltaDays, String key, long defaultTime) { try { long days = Long.parseLong(deltaDays); long delta = 1000L * 60L * 60L * 24L * days; long result = baseTime - delta; if (result >= 0) { // result ...
[ "private", "long", "getCalculatedTime", "(", "long", "baseTime", ",", "String", "deltaDays", ",", "String", "key", ",", "long", "defaultTime", ")", "{", "try", "{", "long", "days", "=", "Long", ".", "parseLong", "(", "deltaDays", ")", ";", "long", "delta",...
Returns the calculated time with the days delta using the base time.<p> @param baseTime the base time to calculate the returned time from @param deltaDays the number of days which should be subtracted from the base time @param key the parameter key name used for error messages @param defaultTime the default time is us...
[ "Returns", "the", "calculated", "time", "with", "the", "days", "delta", "using", "the", "base", "time", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/collectors/CmsSubscriptionCollector.java#L381-L395
aspectran/aspectran
core/src/main/java/com/aspectran/core/util/ReflectionUtils.java
ReflectionUtils.getTypeDifferenceWeight
public static float getTypeDifferenceWeight(Class<?> paramType, Object destArg) { """ Algorithm that judges the match between the declared parameter types of a candidate method and a specific list of arguments that this method is supposed to be invoked with. @param paramType the parameter type to match @para...
java
public static float getTypeDifferenceWeight(Class<?> paramType, Object destArg) { if (!TypeUtils.isAssignableValue(paramType, destArg)) { return Float.MAX_VALUE; } return getTypeDifferenceWeight(paramType, (destArg != null ? destArg.getClass() : null)); }
[ "public", "static", "float", "getTypeDifferenceWeight", "(", "Class", "<", "?", ">", "paramType", ",", "Object", "destArg", ")", "{", "if", "(", "!", "TypeUtils", ".", "isAssignableValue", "(", "paramType", ",", "destArg", ")", ")", "{", "return", "Float", ...
Algorithm that judges the match between the declared parameter types of a candidate method and a specific list of arguments that this method is supposed to be invoked with. @param paramType the parameter type to match @param destArg the argument to match @return the type difference weight
[ "Algorithm", "that", "judges", "the", "match", "between", "the", "declared", "parameter", "types", "of", "a", "candidate", "method", "and", "a", "specific", "list", "of", "arguments", "that", "this", "method", "is", "supposed", "to", "be", "invoked", "with", ...
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ReflectionUtils.java#L119-L124
aoindustries/aocode-public
src/main/java/com/aoindustries/util/IntArrayList.java
IntArrayList.set
@Override public int set(int index, int element) { """ Replaces the element at the specified position in this list with the specified element. @param index index of element to replace. @param element element to be stored at the specified position. @return the element previously at the specified position. @...
java
@Override public int set(int index, int element) { RangeCheck(index); int oldValue = elementData[index]; elementData[index] = element; return oldValue; }
[ "@", "Override", "public", "int", "set", "(", "int", "index", ",", "int", "element", ")", "{", "RangeCheck", "(", "index", ")", ";", "int", "oldValue", "=", "elementData", "[", "index", "]", ";", "elementData", "[", "index", "]", "=", "element", ";", ...
Replaces the element at the specified position in this list with the specified element. @param index index of element to replace. @param element element to be stored at the specified position. @return the element previously at the specified position. @throws IndexOutOfBoundsException if index out of range <tt>(inde...
[ "Replaces", "the", "element", "at", "the", "specified", "position", "in", "this", "list", "with", "the", "specified", "element", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/IntArrayList.java#L387-L394
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.splitString
public static List<String> splitString(String line, char delim) { """ Splits a string on the given delimiter. Does include all empty elements on the split. @return the modifiable list from the split """ return splitString(line, 0, line.length(), delim, new ArrayList<String>()); }
java
public static List<String> splitString(String line, char delim) { return splitString(line, 0, line.length(), delim, new ArrayList<String>()); }
[ "public", "static", "List", "<", "String", ">", "splitString", "(", "String", "line", ",", "char", "delim", ")", "{", "return", "splitString", "(", "line", ",", "0", ",", "line", ".", "length", "(", ")", ",", "delim", ",", "new", "ArrayList", "<", "S...
Splits a string on the given delimiter. Does include all empty elements on the split. @return the modifiable list from the split
[ "Splits", "a", "string", "on", "the", "given", "delimiter", ".", "Does", "include", "all", "empty", "elements", "on", "the", "split", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L911-L913
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java
ShapeGenerator.createScrollButtonTogetherDecrease
public Shape createScrollButtonTogetherDecrease(int x, int y, int w, int h) { """ Return a path for a scroll bar decrease button. This is used when the buttons are placed together at one end of the scroll bar. @param x the X coordinate of the upper-left corner of the button @param y the Y coordinate of the ...
java
public Shape createScrollButtonTogetherDecrease(int x, int y, int w, int h) { path.reset(); path.moveTo(x + w, y); path.lineTo(x + w, y + h); path.lineTo(x, y + h); addScrollGapPath(x, y, w, h, false); path.closePath(); return path; }
[ "public", "Shape", "createScrollButtonTogetherDecrease", "(", "int", "x", ",", "int", "y", ",", "int", "w", ",", "int", "h", ")", "{", "path", ".", "reset", "(", ")", ";", "path", ".", "moveTo", "(", "x", "+", "w", ",", "y", ")", ";", "path", "."...
Return a path for a scroll bar decrease button. This is used when the buttons are placed together at one end of the scroll bar. @param x the X coordinate of the upper-left corner of the button @param y the Y coordinate of the upper-left corner of the button @param w the width of the button @param h the height of t...
[ "Return", "a", "path", "for", "a", "scroll", "bar", "decrease", "button", ".", "This", "is", "used", "when", "the", "buttons", "are", "placed", "together", "at", "one", "end", "of", "the", "scroll", "bar", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L690-L699
alkacon/opencms-core
src/org/opencms/workplace/tools/CmsToolDialog.java
CmsToolDialog.iconsBlockArea
public String iconsBlockArea(int segment, String headline) { """ Builds an block area for icons.<p> @param segment the HTML segment (START / END) @param headline the headline String for the block @return block area start / end segment @see CmsDialog#dialogBlock(int, String, boolean) """ Stri...
java
public String iconsBlockArea(int segment, String headline) { StringBuffer result = new StringBuffer(512); if (segment == HTML_START) { result.append("<!-- icons block area start -->\n"); result.append("<div class=\"dialogcontent\" unselectable=\"on\">"); result.appen...
[ "public", "String", "iconsBlockArea", "(", "int", "segment", ",", "String", "headline", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", "512", ")", ";", "if", "(", "segment", "==", "HTML_START", ")", "{", "result", ".", "append", "(", ...
Builds an block area for icons.<p> @param segment the HTML segment (START / END) @param headline the headline String for the block @return block area start / end segment @see CmsDialog#dialogBlock(int, String, boolean)
[ "Builds", "an", "block", "area", "for", "icons", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolDialog.java#L272-L294
op4j/op4j
src/main/java/org/op4j/functions/Call.java
Call.arrayOf
public static <R> Function<Object,R[]> arrayOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) { """ <p> Abbreviation for {{@link #methodForArrayOf(Type, String, Object...)}. </p> @since 1.1 @param methodName the name of the method @param optionalParameters the (opti...
java
public static <R> Function<Object,R[]> arrayOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) { return methodForArrayOf(resultType, methodName, optionalParameters); }
[ "public", "static", "<", "R", ">", "Function", "<", "Object", ",", "R", "[", "]", ">", "arrayOf", "(", "final", "Type", "<", "R", ">", "resultType", ",", "final", "String", "methodName", ",", "final", "Object", "...", "optionalParameters", ")", "{", "r...
<p> Abbreviation for {{@link #methodForArrayOf(Type, String, Object...)}. </p> @since 1.1 @param methodName the name of the method @param optionalParameters the (optional) parameters of the method. @return the result of the method execution
[ "<p", ">", "Abbreviation", "for", "{{", "@link", "#methodForArrayOf", "(", "Type", "String", "Object", "...", ")", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/Call.java#L708-L710
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuTexRefSetFormat
public static int cuTexRefSetFormat(CUtexref hTexRef, int fmt, int NumPackedComponents) { """ Sets the format for a texture reference. <pre> CUresult cuTexRefSetFormat ( CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents ) </pre> <div> <p>Sets the format for a texture reference. Specifies th...
java
public static int cuTexRefSetFormat(CUtexref hTexRef, int fmt, int NumPackedComponents) { return checkResult(cuTexRefSetFormatNative(hTexRef, fmt, NumPackedComponents)); }
[ "public", "static", "int", "cuTexRefSetFormat", "(", "CUtexref", "hTexRef", ",", "int", "fmt", ",", "int", "NumPackedComponents", ")", "{", "return", "checkResult", "(", "cuTexRefSetFormatNative", "(", "hTexRef", ",", "fmt", ",", "NumPackedComponents", ")", ")", ...
Sets the format for a texture reference. <pre> CUresult cuTexRefSetFormat ( CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents ) </pre> <div> <p>Sets the format for a texture reference. Specifies the format of the data to be read by the texture reference <tt>hTexRef</tt>. <tt>fmt</tt> and <tt>NumPackedComp...
[ "Sets", "the", "format", "for", "a", "texture", "reference", "." ]
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L9878-L9881
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.compareChars
private boolean compareChars(byte[] chars, int pos) { """ Compares specified character string with current string. The upper and lower case characters are considered as equals. @param chars the string to be compared @return true if specified string equals to current """ for (int i = 0; i < len; i+...
java
private boolean compareChars(byte[] chars, int pos) { for (int i = 0; i < len; i++) { if (differentChars((char) this.chars[i + this.pos], (char) chars[i + pos])) return false; } return true; }
[ "private", "boolean", "compareChars", "(", "byte", "[", "]", "chars", ",", "int", "pos", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "differentChars", "(", "(", "char", ")", "this", "."...
Compares specified character string with current string. The upper and lower case characters are considered as equals. @param chars the string to be compared @return true if specified string equals to current
[ "Compares", "specified", "character", "string", "with", "current", "string", ".", "The", "upper", "and", "lower", "case", "characters", "are", "considered", "as", "equals", "." ]
train
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L453-L458
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.addModel
private void addModel(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, Scanner scanner) { """ Scan the pom.xml file and add it as model. @param project The Maven project @param projectDescriptor The project descriptor. @param scanner The scanner. """ File pomXmlFile = pr...
java
private void addModel(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, Scanner scanner) { File pomXmlFile = project.getFile(); FileDescriptor mavenPomXmlDescriptor = scanner.scan(pomXmlFile, pomXmlFile.getAbsolutePath(), MavenScope.PROJECT); projectDescriptor.setModel(mav...
[ "private", "void", "addModel", "(", "MavenProject", "project", ",", "MavenProjectDirectoryDescriptor", "projectDescriptor", ",", "Scanner", "scanner", ")", "{", "File", "pomXmlFile", "=", "project", ".", "getFile", "(", ")", ";", "FileDescriptor", "mavenPomXmlDescript...
Scan the pom.xml file and add it as model. @param project The Maven project @param projectDescriptor The project descriptor. @param scanner The scanner.
[ "Scan", "the", "pom", ".", "xml", "file", "and", "add", "it", "as", "model", "." ]
train
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L216-L227
tzaeschke/zoodb
src/org/zoodb/internal/util/BucketTreeStack.java
BucketTreeStack.set
public E set(int index, E e) { """ Replaces the element at the specified position in this list with the specified element. @param index index of the element to replace @param e element to be stored at the specified position @return the element previously at the specified position @throws IndexOutOfBoundsExc...
java
public E set(int index, E e) { rangeCheck(index); return addElement(bucket, bucketDepth, index, e); }
[ "public", "E", "set", "(", "int", "index", ",", "E", "e", ")", "{", "rangeCheck", "(", "index", ")", ";", "return", "addElement", "(", "bucket", ",", "bucketDepth", ",", "index", ",", "e", ")", ";", "}" ]
Replaces the element at the specified position in this list with the specified element. @param index index of the element to replace @param e element to be stored at the specified position @return the element previously at the specified position @throws IndexOutOfBoundsException If the index exceed the index size
[ "Replaces", "the", "element", "at", "the", "specified", "position", "in", "this", "list", "with", "the", "specified", "element", "." ]
train
https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/BucketTreeStack.java#L167-L171
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndex.java
ClassReflectionIndex.getMethod
public Method getMethod(Class<?> returnType, String name, Class<?>... paramTypes) { """ Get a method declared on this object. @param returnType the method return type @param name the name of the method @param paramTypes the parameter types of the method @return the method, or {@code null} if no method ...
java
public Method getMethod(Class<?> returnType, String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return null; } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes));...
[ "public", "Method", "getMethod", "(", "Class", "<", "?", ">", "returnType", ",", "String", "name", ",", "Class", "<", "?", ">", "...", "paramTypes", ")", "{", "final", "Map", "<", "ParamList", ",", "Map", "<", "Class", "<", "?", ">", ",", "Method", ...
Get a method declared on this object. @param returnType the method return type @param name the name of the method @param paramTypes the parameter types of the method @return the method, or {@code null} if no method of that description exists
[ "Get", "a", "method", "declared", "on", "this", "object", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndex.java#L205-L215
i-net-software/jlessc
src/com/inet/lib/less/LessParser.java
LessParser.parseParameterList
@Nonnull Operation parseParameterList() { """ Parse a parameter list for a function. @return the operation """ Expression left = null; char ch; do { nesting++; Expression expr = parseExpression( (char)0 ); nesting--; left = concat( ...
java
@Nonnull Operation parseParameterList() { Expression left = null; char ch; do { nesting++; Expression expr = parseExpression( (char)0 ); nesting--; left = concat( left, ';', expr ); ch = read(); } while( ch == ';' ); ...
[ "@", "Nonnull", "Operation", "parseParameterList", "(", ")", "{", "Expression", "left", "=", "null", ";", "char", "ch", ";", "do", "{", "nesting", "++", ";", "Expression", "expr", "=", "parseExpression", "(", "(", "char", ")", "0", ")", ";", "nesting", ...
Parse a parameter list for a function. @return the operation
[ "Parse", "a", "parameter", "list", "for", "a", "function", "." ]
train
https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/LessParser.java#L1014-L1039
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/format/FormatFactory.java
FormatFactory.createAudioFormat
public static AudioFormat createAudioFormat(EncodingName name, int sampleRate, int sampleSize, int channels) { """ Creates new format descriptor @param name the encoding @param sampleRate sample rate value in Hertz @param sampleSize sample size in bits @param channels number of channels """ Audio...
java
public static AudioFormat createAudioFormat(EncodingName name, int sampleRate, int sampleSize, int channels) { AudioFormat fmt = createAudioFormat(name); fmt.setSampleRate(sampleRate); fmt.setSampleSize(sampleSize); fmt.setChannels(channels); return fmt; }
[ "public", "static", "AudioFormat", "createAudioFormat", "(", "EncodingName", "name", ",", "int", "sampleRate", ",", "int", "sampleSize", ",", "int", "channels", ")", "{", "AudioFormat", "fmt", "=", "createAudioFormat", "(", "name", ")", ";", "fmt", ".", "setSa...
Creates new format descriptor @param name the encoding @param sampleRate sample rate value in Hertz @param sampleSize sample size in bits @param channels number of channels
[ "Creates", "new", "format", "descriptor" ]
train
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/format/FormatFactory.java#L59-L65
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java
FixedFatJarExportPage.createLabel
protected Label createLabel(Composite parent, String text, boolean bold) { """ Creates a new label with an optional bold font. @param parent the parent control @param text the label text @param bold bold or not @return the new label control """ Label label= new Label(parent, SWT.NONE); if (bold) l...
java
protected Label createLabel(Composite parent, String text, boolean bold) { Label label= new Label(parent, SWT.NONE); if (bold) label.setFont(JFaceResources.getBannerFont()); label.setText(text); GridData gridData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false); label.setLayoutData(gridData); retur...
[ "protected", "Label", "createLabel", "(", "Composite", "parent", ",", "String", "text", ",", "boolean", "bold", ")", "{", "Label", "label", "=", "new", "Label", "(", "parent", ",", "SWT", ".", "NONE", ")", ";", "if", "(", "bold", ")", "label", ".", "...
Creates a new label with an optional bold font. @param parent the parent control @param text the label text @param bold bold or not @return the new label control
[ "Creates", "a", "new", "label", "with", "an", "optional", "bold", "font", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L315-L323
terrestris/shogun-core
src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/PermissionAwareCrudService.java
PermissionAwareCrudService.removeAndSaveGroupPermissions
public void removeAndSaveGroupPermissions(E entity, UserGroup userGroup, Permission... permissions) { """ This method removes (group) permissions from the passed entity and persists (!) the permission collection! @param entity The secured entity @param userGroup The user group from which the permission...
java
public void removeAndSaveGroupPermissions(E entity, UserGroup userGroup, Permission... permissions) { if (entity == null) { LOG.error("Could not remove permissions: The passed entity is NULL."); return; } // create a set from the passed array final HashSet<Permis...
[ "public", "void", "removeAndSaveGroupPermissions", "(", "E", "entity", ",", "UserGroup", "userGroup", ",", "Permission", "...", "permissions", ")", "{", "if", "(", "entity", "==", "null", ")", "{", "LOG", ".", "error", "(", "\"Could not remove permissions: The pas...
This method removes (group) permissions from the passed entity and persists (!) the permission collection! @param entity The secured entity @param userGroup The user group from which the permissions for the entity will be removed @param permissions The permissions to remove
[ "This", "method", "removes", "(", "group", ")", "permissions", "from", "the", "passed", "entity", "and", "persists", "(", "!", ")", "the", "permission", "collection!" ]
train
https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/PermissionAwareCrudService.java#L283-L333
nohana/Amalgam
amalgam/src/main/java/com/amalgam/view/MotionEventUtils.java
MotionEventUtils.getHorizontalMotionDirection
public static MotionDirection getHorizontalMotionDirection(MotionEvent e1, MotionEvent e2) { """ Calculate the horizontal move motion direction. @param e1 start point of the motion. @param e2 end point of the motion. @return the motion direction for the horizontal axis. """ return getHorizontalMotio...
java
public static MotionDirection getHorizontalMotionDirection(MotionEvent e1, MotionEvent e2) { return getHorizontalMotionDirection(e1, e2, DEFAULT_THRESHOLD); }
[ "public", "static", "MotionDirection", "getHorizontalMotionDirection", "(", "MotionEvent", "e1", ",", "MotionEvent", "e2", ")", "{", "return", "getHorizontalMotionDirection", "(", "e1", ",", "e2", ",", "DEFAULT_THRESHOLD", ")", ";", "}" ]
Calculate the horizontal move motion direction. @param e1 start point of the motion. @param e2 end point of the motion. @return the motion direction for the horizontal axis.
[ "Calculate", "the", "horizontal", "move", "motion", "direction", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/view/MotionEventUtils.java#L41-L43
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java
MainFrame.setSourceTab
void setSourceTab(String title, @CheckForNull BugInstance bug) { """ Sets the title of the source tabs for either docking or non-docking versions. """ mainFrameComponentFactory.setSourceTab(title, bug); }
java
void setSourceTab(String title, @CheckForNull BugInstance bug) { mainFrameComponentFactory.setSourceTab(title, bug); }
[ "void", "setSourceTab", "(", "String", "title", ",", "@", "CheckForNull", "BugInstance", "bug", ")", "{", "mainFrameComponentFactory", ".", "setSourceTab", "(", "title", ",", "bug", ")", ";", "}" ]
Sets the title of the source tabs for either docking or non-docking versions.
[ "Sets", "the", "title", "of", "the", "source", "tabs", "for", "either", "docking", "or", "non", "-", "docking", "versions", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java#L614-L616
r0adkll/PostOffice
library/src/main/java/com/r0adkll/postoffice/PostOffice.java
PostOffice.newAlertMail
public static Delivery newAlertMail(@NotNull Context ctx, @NotNull CharSequence title, @NotNull CharSequence message, @NotNull final AlertHandler handler) { """ Create an alert dialog 'Mail' delivery that provides the user with a 'Yes' or 'No' choice to @param ctx t...
java
public static Delivery newAlertMail(@NotNull Context ctx, @NotNull CharSequence title, @NotNull CharSequence message, @NotNull final AlertHandler handler){ // Compose the delivery Delivery.Builder builder = newMail(ctx) .setTitle(title) ...
[ "public", "static", "Delivery", "newAlertMail", "(", "@", "NotNull", "Context", "ctx", ",", "@", "NotNull", "CharSequence", "title", ",", "@", "NotNull", "CharSequence", "message", ",", "@", "NotNull", "final", "AlertHandler", "handler", ")", "{", "// Compose th...
Create an alert dialog 'Mail' delivery that provides the user with a 'Yes' or 'No' choice to @param ctx the application context @param title the dialog title @param message the dialog message @param handler the choice handler @return the alert choice handler
[ "Create", "an", "alert", "dialog", "Mail", "delivery", "that", "provides", "the", "user", "with", "a", "Yes", "or", "No", "choice", "to" ]
train
https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/PostOffice.java#L174-L198
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandRegistry.java
CommandRegistry.get
public Command get(String commandName, boolean forceCreate) { """ Retrieves the command associated with the specified name from the registry. @param commandName Name of the command sought. @param forceCreate If true and the command does not exist, one is created and added to the registry. @return The associa...
java
public Command get(String commandName, boolean forceCreate) { Command command = commands.get(commandName); if (command == null && forceCreate) { command = new Command(commandName); add(command); } return command; }
[ "public", "Command", "get", "(", "String", "commandName", ",", "boolean", "forceCreate", ")", "{", "Command", "command", "=", "commands", ".", "get", "(", "commandName", ")", ";", "if", "(", "command", "==", "null", "&&", "forceCreate", ")", "{", "command"...
Retrieves the command associated with the specified name from the registry. @param commandName Name of the command sought. @param forceCreate If true and the command does not exist, one is created and added to the registry. @return The associated command, or null if it does not exist (and forceCreate is false).
[ "Retrieves", "the", "command", "associated", "with", "the", "specified", "name", "from", "the", "registry", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandRegistry.java#L84-L93
apache/groovy
src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
IOGroovyMethods.withObjectOutputStream
public static <T> T withObjectOutputStream(OutputStream outputStream, @ClosureParams(value=SimpleType.class, options="java.io.ObjectOutputStream") Closure<T> closure) throws IOException { """ Create a new ObjectOutputStream for this output stream and then pass it to the closure. This method ensures the stream is...
java
public static <T> T withObjectOutputStream(OutputStream outputStream, @ClosureParams(value=SimpleType.class, options="java.io.ObjectOutputStream") Closure<T> closure) throws IOException { return withStream(newObjectOutputStream(outputStream), closure); }
[ "public", "static", "<", "T", ">", "T", "withObjectOutputStream", "(", "OutputStream", "outputStream", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"java.io.ObjectOutputStream\"", ")", "Closure", "<", "T", ">",...
Create a new ObjectOutputStream for this output stream and then pass it to the closure. This method ensures the stream is closed after the closure returns. @param outputStream am output stream @param closure a closure @return the value returned by the closure @throws IOException if an IOException occurs. @see #w...
[ "Create", "a", "new", "ObjectOutputStream", "for", "this", "output", "stream", "and", "then", "pass", "it", "to", "the", "closure", ".", "This", "method", "ensures", "the", "stream", "is", "closed", "after", "the", "closure", "returns", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L255-L257
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.packEntry
public static void packEntry(File fileToPack, File destZipFile, final String fileName) { """ Compresses the given file into a ZIP file. <p> The ZIP file must not be a directory and its parent directory must exist. @param fileToPack file that needs to be zipped. @param destZipFile ZIP file that will be crea...
java
public static void packEntry(File fileToPack, File destZipFile, final String fileName) { packEntry(fileToPack, destZipFile, new NameMapper() { public String map(String name) { return fileName; } }); }
[ "public", "static", "void", "packEntry", "(", "File", "fileToPack", ",", "File", "destZipFile", ",", "final", "String", "fileName", ")", "{", "packEntry", "(", "fileToPack", ",", "destZipFile", ",", "new", "NameMapper", "(", ")", "{", "public", "String", "ma...
Compresses the given file into a ZIP file. <p> The ZIP file must not be a directory and its parent directory must exist. @param fileToPack file that needs to be zipped. @param destZipFile ZIP file that will be created or overwritten. @param fileName the name for the file inside the archive
[ "Compresses", "the", "given", "file", "into", "a", "ZIP", "file", ".", "<p", ">", "The", "ZIP", "file", "must", "not", "be", "a", "directory", "and", "its", "parent", "directory", "must", "exist", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1459-L1465
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyRangeAxiomImpl_CustomFieldSerializer.java
OWLDataPropertyRangeAxiomImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataPropertyRangeAxiomImpl instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.goog...
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataPropertyRangeAxiomImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLDataPropertyRangeAxiomImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.clie...
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamWriter", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyRangeAxiomImpl_CustomFieldSerializer.java#L77-L80
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/message/ZipMessage.java
ZipMessage.addEntry
public ZipMessage addEntry(Resource resource) { """ Adds new zip archive entry. Resource can be a file or directory. In case of directory all files will be automatically added to the zip archive. Directory structures are retained throughout this process. @param resource @return """ try { ...
java
public ZipMessage addEntry(Resource resource) { try { addEntry(new Entry(resource.getFile())); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read zip entry content from given resource", e); } return this; }
[ "public", "ZipMessage", "addEntry", "(", "Resource", "resource", ")", "{", "try", "{", "addEntry", "(", "new", "Entry", "(", "resource", ".", "getFile", "(", ")", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "CitrusRu...
Adds new zip archive entry. Resource can be a file or directory. In case of directory all files will be automatically added to the zip archive. Directory structures are retained throughout this process. @param resource @return
[ "Adds", "new", "zip", "archive", "entry", ".", "Resource", "can", "be", "a", "file", "or", "directory", ".", "In", "case", "of", "directory", "all", "files", "will", "be", "automatically", "added", "to", "the", "zip", "archive", ".", "Directory", "structur...
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/message/ZipMessage.java#L68-L75
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java
StandardContextSpaceService.fireSpaceDestroyed
protected void fireSpaceDestroyed(Space space, boolean isLocalDestruction) { """ Notifies the listeners on the space destruction. @param space reference to the destroyed space. @param isLocalDestruction indicates if the space was destroyed in the current kernel. """ for (final SpaceRepositoryListener lis...
java
protected void fireSpaceDestroyed(Space space, boolean isLocalDestruction) { for (final SpaceRepositoryListener listener : this.listeners.getListeners(SpaceRepositoryListener.class)) { listener.spaceDestroyed(space, isLocalDestruction); } }
[ "protected", "void", "fireSpaceDestroyed", "(", "Space", "space", ",", "boolean", "isLocalDestruction", ")", "{", "for", "(", "final", "SpaceRepositoryListener", "listener", ":", "this", ".", "listeners", ".", "getListeners", "(", "SpaceRepositoryListener", ".", "cl...
Notifies the listeners on the space destruction. @param space reference to the destroyed space. @param isLocalDestruction indicates if the space was destroyed in the current kernel.
[ "Notifies", "the", "listeners", "on", "the", "space", "destruction", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/StandardContextSpaceService.java#L358-L362
tommyettinger/RegExodus
src/main/java/regexodus/Replacer.java
Replacer.replaceStep
public static boolean replaceStep(Matcher m, Substitution substitution, TextBuffer dest) { """ Replaces the next occurrence of a matcher's pattern in a matcher's target by a given substitution, appending the result to a buffer but not writing the remainder of m's match to the end of dest. <br> The substitution ...
java
public static boolean replaceStep(Matcher m, Substitution substitution, TextBuffer dest) { boolean firstPass = true; int c = 0, count = 1; while (c < count && m.find()) { if (m.end() == 0 && !firstPass) continue; //allow to replace at "^" if (m.start() > 0) m.getGroup(Ma...
[ "public", "static", "boolean", "replaceStep", "(", "Matcher", "m", ",", "Substitution", "substitution", ",", "TextBuffer", "dest", ")", "{", "boolean", "firstPass", "=", "true", ";", "int", "c", "=", "0", ",", "count", "=", "1", ";", "while", "(", "c", ...
Replaces the next occurrence of a matcher's pattern in a matcher's target by a given substitution, appending the result to a buffer but not writing the remainder of m's match to the end of dest. <br> The substitution starts from current matcher's position, current match not included. <br> You typically want to call {@c...
[ "Replaces", "the", "next", "occurrence", "of", "a", "matcher", "s", "pattern", "in", "a", "matcher", "s", "target", "by", "a", "given", "substitution", "appending", "the", "result", "to", "a", "buffer", "but", "not", "writing", "the", "remainder", "of", "m...
train
https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Replacer.java#L302-L314
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataview/PerWindowStateDataViewStore.java
PerWindowStateDataViewStore.createKeyedState
private <S extends State, V> S createKeyedState(StateDescriptor<S, V> stateDescriptor) throws Exception { """ Delegate the state registration to {@link KeyedStateBackend#createInternalState(TypeSerializer, StateDescriptor)}. We can't use {@link KeyedStateBackend#getOrCreateKeyedState(TypeSerializer, StateDescript...
java
private <S extends State, V> S createKeyedState(StateDescriptor<S, V> stateDescriptor) throws Exception { checkNotNull(keyedStateBackend.getKeySerializer(), "State key serializer has not been configured in the config. " + "This operation cannot use partitioned state."); if (!stateDescriptor.isSerializerInitia...
[ "private", "<", "S", "extends", "State", ",", "V", ">", "S", "createKeyedState", "(", "StateDescriptor", "<", "S", ",", "V", ">", "stateDescriptor", ")", "throws", "Exception", "{", "checkNotNull", "(", "keyedStateBackend", ".", "getKeySerializer", "(", ")", ...
Delegate the state registration to {@link KeyedStateBackend#createInternalState(TypeSerializer, StateDescriptor)}. We can't use {@link KeyedStateBackend#getOrCreateKeyedState(TypeSerializer, StateDescriptor)} here because it returns the same state instance not always a new instance.
[ "Delegate", "the", "state", "registration", "to", "{" ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataview/PerWindowStateDataViewStore.java#L65-L73
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/ast/prims/reducers/AstMean.java
AstMean.colwiseMean
private ValFrame colwiseMean(Frame fr, final boolean na_rm) { """ Compute column-wise means (i.e. means of each column), and return a frame having a single row. """ Frame res = new Frame(); Vec vec1 = Vec.makeCon(null, 0); assert vec1.length() == 1; for (int i = 0; i < fr.numCols(); i++) { ...
java
private ValFrame colwiseMean(Frame fr, final boolean na_rm) { Frame res = new Frame(); Vec vec1 = Vec.makeCon(null, 0); assert vec1.length() == 1; for (int i = 0; i < fr.numCols(); i++) { Vec v = fr.vec(i); boolean valid = (v.isNumeric() || v.isTime() || v.isBinary()) && v.length() > 0 && ...
[ "private", "ValFrame", "colwiseMean", "(", "Frame", "fr", ",", "final", "boolean", "na_rm", ")", "{", "Frame", "res", "=", "new", "Frame", "(", ")", ";", "Vec", "vec1", "=", "Vec", ".", "makeCon", "(", "null", ",", "0", ")", ";", "assert", "vec1", ...
Compute column-wise means (i.e. means of each column), and return a frame having a single row.
[ "Compute", "column", "-", "wise", "means", "(", "i", ".", "e", ".", "means", "of", "each", "column", ")", "and", "return", "a", "frame", "having", "a", "single", "row", "." ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/reducers/AstMean.java#L155-L170
grpc/grpc-java
okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/OptionalMethod.java
OptionalMethod.invokeWithoutCheckedException
public Object invokeWithoutCheckedException(T target, Object... args) { """ Invokes the method on {@code target}. Throws an error if the method is not supported. Any RuntimeException thrown by the method is thrown, checked exceptions are wrapped in an {@link AssertionError}. @throws IllegalArgumentException i...
java
public Object invokeWithoutCheckedException(T target, Object... args) { try { return invoke(target, args); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof RuntimeException) { throw (RuntimeException) targetExcep...
[ "public", "Object", "invokeWithoutCheckedException", "(", "T", "target", ",", "Object", "...", "args", ")", "{", "try", "{", "return", "invoke", "(", "target", ",", "args", ")", ";", "}", "catch", "(", "InvocationTargetException", "e", ")", "{", "Throwable",...
Invokes the method on {@code target}. Throws an error if the method is not supported. Any RuntimeException thrown by the method is thrown, checked exceptions are wrapped in an {@link AssertionError}. @throws IllegalArgumentException if the arguments are invalid
[ "Invokes", "the", "method", "on", "{", "@code", "target", "}", ".", "Throws", "an", "error", "if", "the", "method", "is", "not", "supported", ".", "Any", "RuntimeException", "thrown", "by", "the", "method", "is", "thrown", "checked", "exceptions", "are", "...
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/OptionalMethod.java#L133-L145
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java
ImageMiscOps.insertBand
public static void insertBand( GrayS64 input, int band , InterleavedS64 output) { """ Inserts a single band into a multi-band image overwriting the original band @param input Single band image @param band Which band the image is to be inserted into @param output The multi-band image which the input image is t...
java
public static void insertBand( GrayS64 input, int band , InterleavedS64 output) { final int numBands = output.numBands; for (int y = 0; y < input.height; y++) { int indexIn = input.getStartIndex() + y * input.getStride(); int indexOut = output.getStartIndex() + y * output.getStride() + band; int end = ind...
[ "public", "static", "void", "insertBand", "(", "GrayS64", "input", ",", "int", "band", ",", "InterleavedS64", "output", ")", "{", "final", "int", "numBands", "=", "output", ".", "numBands", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "input",...
Inserts a single band into a multi-band image overwriting the original band @param input Single band image @param band Which band the image is to be inserted into @param output The multi-band image which the input image is to be inserted into
[ "Inserts", "a", "single", "band", "into", "a", "multi", "-", "band", "image", "overwriting", "the", "original", "band" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L1790-L1801
Javacord/Javacord
javacord-api/src/main/java/org/javacord/api/entity/emoji/CustomEmojiBuilder.java
CustomEmojiBuilder.setImage
public CustomEmojiBuilder setImage(InputStream image, String type) { """ Sets the image of the emoji. @param image The image of the emoji. @param type The type of the image, e.g. "png", "jpg" or "gif". @return The current instance in order to chain call methods. """ delegate.setImage(image, type);...
java
public CustomEmojiBuilder setImage(InputStream image, String type) { delegate.setImage(image, type); return this; }
[ "public", "CustomEmojiBuilder", "setImage", "(", "InputStream", "image", ",", "String", "type", ")", "{", "delegate", ".", "setImage", "(", "image", ",", "type", ")", ";", "return", "this", ";", "}" ]
Sets the image of the emoji. @param image The image of the emoji. @param type The type of the image, e.g. "png", "jpg" or "gif". @return The current instance in order to chain call methods.
[ "Sets", "the", "image", "of", "the", "emoji", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/emoji/CustomEmojiBuilder.java#L157-L160
albfernandez/itext2
src/main/java/com/lowagie/text/rtf/RtfWriter2.java
RtfWriter2.importRtfFragment
public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings) throws IOException, DocumentException { """ Adds a fragment of an RTF document to the current RTF document being generated. Since this fragment doesn't contain font or color tables, all fonts and colors are mapped to the defaul...
java
public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings) throws IOException, DocumentException { importRtfFragment(documentSource, mappings, null); }
[ "public", "void", "importRtfFragment", "(", "InputStream", "documentSource", ",", "RtfImportMappings", "mappings", ")", "throws", "IOException", ",", "DocumentException", "{", "importRtfFragment", "(", "documentSource", ",", "mappings", ",", "null", ")", ";", "}" ]
Adds a fragment of an RTF document to the current RTF document being generated. Since this fragment doesn't contain font or color tables, all fonts and colors are mapped to the default font and color. If the font and color mappings are known, they can be specified via the mappings parameter. @param documentSource The ...
[ "Adds", "a", "fragment", "of", "an", "RTF", "document", "to", "the", "current", "RTF", "document", "being", "generated", ".", "Since", "this", "fragment", "doesn", "t", "contain", "font", "or", "color", "tables", "all", "fonts", "and", "colors", "are", "ma...
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/RtfWriter2.java#L311-L313
jasminb/jsonapi-converter
src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java
ResourceConverter.createIdentifier
private String createIdentifier(JsonNode object) { """ Generates unique resource identifier by combining resource type and resource id fields. <br /> By specification id/type combination guarantees uniqueness. @param object data object @return concatenated id and type values """ JsonNode idNode = object.g...
java
private String createIdentifier(JsonNode object) { JsonNode idNode = object.get(ID); String id = idNode != null ? idNode.asText().trim() : ""; if (id.isEmpty() && deserializationFeatures.contains(DeserializationFeature.REQUIRE_RESOURCE_ID)) { throw new IllegalArgumentException(String.format("Resource must ha...
[ "private", "String", "createIdentifier", "(", "JsonNode", "object", ")", "{", "JsonNode", "idNode", "=", "object", ".", "get", "(", "ID", ")", ";", "String", "id", "=", "idNode", "!=", "null", "?", "idNode", ".", "asText", "(", ")", ".", "trim", "(", ...
Generates unique resource identifier by combining resource type and resource id fields. <br /> By specification id/type combination guarantees uniqueness. @param object data object @return concatenated id and type values
[ "Generates", "unique", "resource", "identifier", "by", "combining", "resource", "type", "and", "resource", "id", "fields", ".", "<br", "/", ">", "By", "specification", "id", "/", "type", "combination", "guarantees", "uniqueness", "." ]
train
https://github.com/jasminb/jsonapi-converter/blob/73b41c3b9274e70e62b3425071ca8afdc7bddaf6/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java#L603-L614
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java
CoverageUtilities.isGrass
public static boolean isGrass( String path ) { """ Checks if the given path is a GRASS raster file. <p>Note that there is no check on the existence of the file. @param path the path to check. @return true if the file is a grass raster. """ File file = new File(path); File cellFolderFile ...
java
public static boolean isGrass( String path ) { File file = new File(path); File cellFolderFile = file.getParentFile(); File mapsetFile = cellFolderFile.getParentFile(); File windFile = new File(mapsetFile, "WIND"); return cellFolderFile.getName().toLowerCase().equals("cell") && w...
[ "public", "static", "boolean", "isGrass", "(", "String", "path", ")", "{", "File", "file", "=", "new", "File", "(", "path", ")", ";", "File", "cellFolderFile", "=", "file", ".", "getParentFile", "(", ")", ";", "File", "mapsetFile", "=", "cellFolderFile", ...
Checks if the given path is a GRASS raster file. <p>Note that there is no check on the existence of the file. @param path the path to check. @return true if the file is a grass raster.
[ "Checks", "if", "the", "given", "path", "is", "a", "GRASS", "raster", "file", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1301-L1307
hal/core
gui/src/main/java/org/jboss/as/console/client/widgets/nav/v3/FinderColumn.java
FinderColumn.applySecurity
private void applySecurity(final SecurityContext securityContext, boolean update) { """ Central point for security context changes This will be called when: a) the widget is attached (default) b) the security context changes (i.e. scoped roles) """ // System.out.println("<< Process SecurityContex...
java
private void applySecurity(final SecurityContext securityContext, boolean update) { // System.out.println("<< Process SecurityContext on column "+title+": "+securityContext+">>"); // calculate accessible menu items filterNonPrivilegeOperations(securityContext, accessibleTopMenuItems, topMenuIt...
[ "private", "void", "applySecurity", "(", "final", "SecurityContext", "securityContext", ",", "boolean", "update", ")", "{", "// System.out.println(\"<< Process SecurityContext on column \"+title+\": \"+securityContext+\">>\");", "// calculate accessible menu items", "filterNonPrivilegeOp...
Central point for security context changes This will be called when: a) the widget is attached (default) b) the security context changes (i.e. scoped roles)
[ "Central", "point", "for", "security", "context", "changes", "This", "will", "be", "called", "when", ":" ]
train
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/widgets/nav/v3/FinderColumn.java#L331-L360
code4everything/util
src/main/java/com/zhazhapan/util/Checker.java
Checker.checkNull
public static Integer checkNull(Integer value, Integer elseValue) { """ 检查Integer是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Integer} @since 1.0.8 """ return isNull(value) ? elseValue : value; }
java
public static Integer checkNull(Integer value, Integer elseValue) { return isNull(value) ? elseValue : value; }
[ "public", "static", "Integer", "checkNull", "(", "Integer", "value", ",", "Integer", "elseValue", ")", "{", "return", "isNull", "(", "value", ")", "?", "elseValue", ":", "value", ";", "}" ]
检查Integer是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Integer} @since 1.0.8
[ "检查Integer是否为null" ]
train
https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Checker.java#L1212-L1214
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/MaintenanceScheduleHelper.java
MaintenanceScheduleHelper.validateDuration
public static void validateDuration(final String duration) { """ Validates the format of the maintenance window duration @param duration in "HH:mm:ss" string format. This format is popularly used but can be confused with time of the day, hence conversion to ISO specified format for time duration is required....
java
public static void validateDuration(final String duration) { try { if (StringUtils.hasText(duration)) { convertDurationToLocalTime(duration); } } catch (final DateTimeParseException e) { throw new InvalidMaintenanceScheduleException("Provided duration ...
[ "public", "static", "void", "validateDuration", "(", "final", "String", "duration", ")", "{", "try", "{", "if", "(", "StringUtils", ".", "hasText", "(", "duration", ")", ")", "{", "convertDurationToLocalTime", "(", "duration", ")", ";", "}", "}", "catch", ...
Validates the format of the maintenance window duration @param duration in "HH:mm:ss" string format. This format is popularly used but can be confused with time of the day, hence conversion to ISO specified format for time duration is required. @throws InvalidMaintenanceScheduleException if the duration doesn't have ...
[ "Validates", "the", "format", "of", "the", "maintenance", "window", "duration" ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/MaintenanceScheduleHelper.java#L178-L186
rwl/CSparseJ
src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_usolve.java
Scs_usolve.cs_usolve
public static boolean cs_usolve(Scs U, float[] x) { """ Solves an upper triangular system Ux=b, where x and b are dense vectors. The diagonal of U must be the last entry of each column. @param U upper triangular matrix in column-compressed form @param x size n, right hand side on input, solution on output ...
java
public static boolean cs_usolve(Scs U, float[] x) { int p, j, n, Up[], Ui[]; float Ux[]; if (!Scs_util.CS_CSC(U) || x == null) return (false); /* check inputs */ n = U.n; Up = U.p; Ui = U.i; Ux = U.x; for (j = n - 1; j >= 0; j--) { ...
[ "public", "static", "boolean", "cs_usolve", "(", "Scs", "U", ",", "float", "[", "]", "x", ")", "{", "int", "p", ",", "j", ",", "n", ",", "Up", "[", "]", ",", "Ui", "[", "]", ";", "float", "Ux", "[", "]", ";", "if", "(", "!", "Scs_util", "."...
Solves an upper triangular system Ux=b, where x and b are dense vectors. The diagonal of U must be the last entry of each column. @param U upper triangular matrix in column-compressed form @param x size n, right hand side on input, solution on output @return true if successful, false on error
[ "Solves", "an", "upper", "triangular", "system", "Ux", "=", "b", "where", "x", "and", "b", "are", "dense", "vectors", ".", "The", "diagonal", "of", "U", "must", "be", "the", "last", "entry", "of", "each", "column", "." ]
train
https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_usolve.java#L46-L62
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java
MavenModelScannerPlugin.addPluginExecutions
private void addPluginExecutions(MavenPluginDescriptor mavenPluginDescriptor, Plugin plugin, Store store) { """ Adds information about plugin executions. @param mavenPluginDescriptor The descriptor for the plugin. @param plugin The Plugin. @param store The database. """ List<PluginExecution> ex...
java
private void addPluginExecutions(MavenPluginDescriptor mavenPluginDescriptor, Plugin plugin, Store store) { List<PluginExecution> executions = plugin.getExecutions(); for (PluginExecution pluginExecution : executions) { MavenPluginExecutionDescriptor executionDescriptor = store.create(MavenP...
[ "private", "void", "addPluginExecutions", "(", "MavenPluginDescriptor", "mavenPluginDescriptor", ",", "Plugin", "plugin", ",", "Store", "store", ")", "{", "List", "<", "PluginExecution", ">", "executions", "=", "plugin", ".", "getExecutions", "(", ")", ";", "for",...
Adds information about plugin executions. @param mavenPluginDescriptor The descriptor for the plugin. @param plugin The Plugin. @param store The database.
[ "Adds", "information", "about", "plugin", "executions", "." ]
train
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L500-L512
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/cpc/CpcSketch.java
CpcSketch.modifyOffset
private static void modifyOffset(final CpcSketch sketch, final int newOffset) { """ This moves the sliding window @param sketch the given sketch @param newOffset the new offset, which must be oldOffset + 1 """ assert ((newOffset >= 0) && (newOffset <= 56)); assert (newOffset == (sketch.windowOffset +...
java
private static void modifyOffset(final CpcSketch sketch, final int newOffset) { assert ((newOffset >= 0) && (newOffset <= 56)); assert (newOffset == (sketch.windowOffset + 1)); assert (newOffset == CpcUtil.determineCorrectOffset(sketch.lgK, sketch.numCoupons)); assert (sketch.slidingWindow != null); ...
[ "private", "static", "void", "modifyOffset", "(", "final", "CpcSketch", "sketch", ",", "final", "int", "newOffset", ")", "{", "assert", "(", "(", "newOffset", ">=", "0", ")", "&&", "(", "newOffset", "<=", "56", ")", ")", ";", "assert", "(", "newOffset", ...
This moves the sliding window @param sketch the given sketch @param newOffset the new offset, which must be oldOffset + 1
[ "This", "moves", "the", "sliding", "window" ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/CpcSketch.java#L508-L552
VoltDB/voltdb
third_party/java/src/org/HdrHistogram_voltpatches/DoubleHistogram.java
DoubleHistogram.copyCorrectedForCoordinatedOmission
public DoubleHistogram copyCorrectedForCoordinatedOmission(final double expectedIntervalBetweenValueSamples) { """ Get a copy of this histogram, corrected for coordinated omission. <p> To compensate for the loss of sampled values when a recorded value is larger than the expected interval between value samples, ...
java
public DoubleHistogram copyCorrectedForCoordinatedOmission(final double expectedIntervalBetweenValueSamples) { final DoubleHistogram targetHistogram = new DoubleHistogram(configuredHighestToLowestValueRatio, getNumberOfSignificantValueDigits()); targetHistogram.setTrackableValueRange(cur...
[ "public", "DoubleHistogram", "copyCorrectedForCoordinatedOmission", "(", "final", "double", "expectedIntervalBetweenValueSamples", ")", "{", "final", "DoubleHistogram", "targetHistogram", "=", "new", "DoubleHistogram", "(", "configuredHighestToLowestValueRatio", ",", "getNumberOf...
Get a copy of this histogram, corrected for coordinated omission. <p> To compensate for the loss of sampled values when a recorded value is larger than the expected interval between value samples, the new histogram will include an auto-generated additional series of decreasingly-smaller (down to the expectedIntervalBet...
[ "Get", "a", "copy", "of", "this", "histogram", "corrected", "for", "coordinated", "omission", ".", "<p", ">", "To", "compensate", "for", "the", "loss", "of", "sampled", "values", "when", "a", "recorded", "value", "is", "larger", "than", "the", "expected", ...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/DoubleHistogram.java#L613-L619
JodaOrg/joda-time
src/main/java/org/joda/time/DateTimeZone.java
DateTimeZone.getMillisKeepLocal
public long getMillisKeepLocal(DateTimeZone newZone, long oldInstant) { """ Gets the millisecond instant in another zone keeping the same local time. <p> The conversion is performed by converting the specified UTC millis to local millis in this zone, then converting back to UTC millis in the new zone. @param...
java
public long getMillisKeepLocal(DateTimeZone newZone, long oldInstant) { if (newZone == null) { newZone = DateTimeZone.getDefault(); } if (newZone == this) { return oldInstant; } long instantLocal = convertUTCToLocal(oldInstant); return newZone.conv...
[ "public", "long", "getMillisKeepLocal", "(", "DateTimeZone", "newZone", ",", "long", "oldInstant", ")", "{", "if", "(", "newZone", "==", "null", ")", "{", "newZone", "=", "DateTimeZone", ".", "getDefault", "(", ")", ";", "}", "if", "(", "newZone", "==", ...
Gets the millisecond instant in another zone keeping the same local time. <p> The conversion is performed by converting the specified UTC millis to local millis in this zone, then converting back to UTC millis in the new zone. @param newZone the new zone, null means default @param oldInstant the UTC millisecond inst...
[ "Gets", "the", "millisecond", "instant", "in", "another", "zone", "keeping", "the", "same", "local", "time", ".", "<p", ">", "The", "conversion", "is", "performed", "by", "converting", "the", "specified", "UTC", "millis", "to", "local", "millis", "in", "this...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L1059-L1068
jenkinsci/support-core-plugin
src/main/java/com/cloudbees/jenkins/support/util/StreamUtils.java
StreamUtils.isNonWhitespaceControlCharacter
public static boolean isNonWhitespaceControlCharacter(@NonNull byte[] b) { """ Check if the content of a byte array is binary @param b byte array to check @return true if the content is binary (Non-white Control Characters) """ ByteBuffer head = ByteBuffer.allocate(DEFAULT_PROBE_SIZE); int to...
java
public static boolean isNonWhitespaceControlCharacter(@NonNull byte[] b) { ByteBuffer head = ByteBuffer.allocate(DEFAULT_PROBE_SIZE); int toCopy = Math.min(head.remaining(), b.length); if (toCopy == 0) { throw new IllegalStateException("No more room to buffer header, should have chos...
[ "public", "static", "boolean", "isNonWhitespaceControlCharacter", "(", "@", "NonNull", "byte", "[", "]", "b", ")", "{", "ByteBuffer", "head", "=", "ByteBuffer", ".", "allocate", "(", "DEFAULT_PROBE_SIZE", ")", ";", "int", "toCopy", "=", "Math", ".", "min", "...
Check if the content of a byte array is binary @param b byte array to check @return true if the content is binary (Non-white Control Characters)
[ "Check", "if", "the", "content", "of", "a", "byte", "array", "is", "binary" ]
train
https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/util/StreamUtils.java#L46-L56
couchbase/java-dcp-client
src/main/java/com/couchbase/client/dcp/DefaultConnectionNameGenerator.java
DefaultConnectionNameGenerator.forProduct
public static DefaultConnectionNameGenerator forProduct(String productName, String productVersion, String... comments) { """ Returns a new connection name generator that includes the given product information in the User Agent string. @param productName Product name to include in the User Agent string. @param ...
java
public static DefaultConnectionNameGenerator forProduct(String productName, String productVersion, String... comments) { return new DefaultConnectionNameGenerator( new UserAgentBuilder().append(productName, productVersion, comments)); }
[ "public", "static", "DefaultConnectionNameGenerator", "forProduct", "(", "String", "productName", ",", "String", "productVersion", ",", "String", "...", "comments", ")", "{", "return", "new", "DefaultConnectionNameGenerator", "(", "new", "UserAgentBuilder", "(", ")", ...
Returns a new connection name generator that includes the given product information in the User Agent string. @param productName Product name to include in the User Agent string. @param productVersion Optional product version to include in the User Agent string. May be null. @param comments Optional comments to includ...
[ "Returns", "a", "new", "connection", "name", "generator", "that", "includes", "the", "given", "product", "information", "in", "the", "User", "Agent", "string", "." ]
train
https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/DefaultConnectionNameGenerator.java#L55-L58
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BeanRegistry.java
BeanRegistry.postProcessAfterInitialization
@SuppressWarnings("unchecked") @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { """ If the managed bean is of the desired type, add it to the registry. """ if (clazz.isInstance(bean)) { register((V) bean); } ...
java
@SuppressWarnings("unchecked") @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (clazz.isInstance(bean)) { register((V) bean); } return bean; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "Object", "postProcessAfterInitialization", "(", "Object", "bean", ",", "String", "beanName", ")", "throws", "BeansException", "{", "if", "(", "clazz", ".", "isInstance", "(", "bean", ...
If the managed bean is of the desired type, add it to the registry.
[ "If", "the", "managed", "bean", "is", "of", "the", "desired", "type", "add", "it", "to", "the", "registry", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BeanRegistry.java#L61-L69
kmi/iserve
iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java
ServiceManagerSparql.deleteService
@Override public boolean deleteService(URI serviceUri) throws ServiceException { """ Deletes the given service After successfully deleting a service, implementations of this method should raise a {@code ServiceDeletedEvent} @param serviceUri the URI of the service to delete @return True if it was delete...
java
@Override public boolean deleteService(URI serviceUri) throws ServiceException { if (serviceUri == null || !serviceUri.isAbsolute()) { log.warn("The Service URI is either absent or relative. Provide an absolute URI"); return false; } if (!this.graphStoreManager.canBe...
[ "@", "Override", "public", "boolean", "deleteService", "(", "URI", "serviceUri", ")", "throws", "ServiceException", "{", "if", "(", "serviceUri", "==", "null", "||", "!", "serviceUri", ".", "isAbsolute", "(", ")", ")", "{", "log", ".", "warn", "(", "\"The ...
Deletes the given service After successfully deleting a service, implementations of this method should raise a {@code ServiceDeletedEvent} @param serviceUri the URI of the service to delete @return True if it was deleted or false otherwise @throws uk.ac.open.kmi.iserve.sal.exception.ServiceException
[ "Deletes", "the", "given", "service" ]
train
https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java#L506-L530
kuali/ojb-1.0.4
src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java
OjbTagsHandler.forAllExtents
public void forAllExtents(String template, Properties attributes) throws XDocletException { """ Processes the template for all extents of the current class. @param template The template @param attributes The attributes of the tag @exception XDocletException if an error occurs @doc.ta...
java
public void forAllExtents(String template, Properties attributes) throws XDocletException { for (Iterator it = _curClassDef.getExtentClasses(); it.hasNext(); ) { _curExtent = (ClassDescriptorDef)it.next(); generate(template); } _curExtent = null; }
[ "public", "void", "forAllExtents", "(", "String", "template", ",", "Properties", "attributes", ")", "throws", "XDocletException", "{", "for", "(", "Iterator", "it", "=", "_curClassDef", ".", "getExtentClasses", "(", ")", ";", "it", ".", "hasNext", "(", ")", ...
Processes the template for all extents of the current class. @param template The template @param attributes The attributes of the tag @exception XDocletException if an error occurs @doc.tag type="block"
[ "Processes", "the", "template", "for", "all", "extents", "of", "the", "current", "class", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L347-L355
OpenTSDB/opentsdb
src/core/BatchedDataPoints.java
BatchedDataPoints.setSeries
@Override public void setSeries(final String metric, final Map<String, String> tags) { """ Sets the metric name and tags of this batch. This method only need be called if there is a desire to reuse the data structure after the data has been flushed. This will reset all cached information in this data structure...
java
@Override public void setSeries(final String metric, final Map<String, String> tags) { IncomingDataPoints.checkMetricAndTags(metric, tags); try { row_key = IncomingDataPoints.rowKeyTemplate(tsdb, metric, tags); RowKey.prefixKeyWithSalt(row_key); reset(); } catch (RuntimeException e) ...
[ "@", "Override", "public", "void", "setSeries", "(", "final", "String", "metric", ",", "final", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "IncomingDataPoints", ".", "checkMetricAndTags", "(", "metric", ",", "tags", ")", ";", "try", "{", ...
Sets the metric name and tags of this batch. This method only need be called if there is a desire to reuse the data structure after the data has been flushed. This will reset all cached information in this data structure. @throws IllegalArgumentException if the metric name is empty or contains illegal characters or if ...
[ "Sets", "the", "metric", "name", "and", "tags", "of", "this", "batch", ".", "This", "method", "only", "need", "be", "called", "if", "there", "is", "a", "desire", "to", "reuse", "the", "data", "structure", "after", "the", "data", "has", "been", "flushed",...
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/BatchedDataPoints.java#L101-L115
Azure/azure-sdk-for-java
applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java
WorkbooksInner.createOrUpdateAsync
public Observable<WorkbookInner> createOrUpdateAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { """ Create a new workbook. @param resourceGroupName The name of the resource group. @param resourceName The name of the Application Insights component resource. @param workbo...
java
public Observable<WorkbookInner> createOrUpdateAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties).map(new Func1<ServiceResponse<WorkbookInner>, WorkbookInner>() { ...
[ "public", "Observable", "<", "WorkbookInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "resourceName", ",", "WorkbookInner", "workbookProperties", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", "...
Create a new workbook. @param resourceGroupName The name of the resource group. @param resourceName The name of the Application Insights component resource. @param workbookProperties Properties that need to be specified to create a new workbook. @throws IllegalArgumentException thrown if parameters fail the validation...
[ "Create", "a", "new", "workbook", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java#L483-L490
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.listSiteAnalysesAsync
public Observable<Page<AnalysisDefinitionInner>> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { """ Get Site Analyses. Get Site Analyses. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Nam...
java
public Observable<Page<AnalysisDefinitionInner>> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { return listSiteAnalysesWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory) .map(new Func1<ServiceResponse<Page<Analys...
[ "public", "Observable", "<", "Page", "<", "AnalysisDefinitionInner", ">", ">", "listSiteAnalysesAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "siteName", ",", "final", "String", "diagnosticCategory", ")", "{", "return", "listSiteAnalyses...
Get Site Analyses. Get Site Analyses. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param diagnosticCategory Diagnostic Category @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;AnalysisD...
[ "Get", "Site", "Analyses", ".", "Get", "Site", "Analyses", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L440-L448
square/dagger
core/src/main/java/dagger/internal/Linker.java
Linker.requestBinding
public Binding<?> requestBinding(String key, Object requiredBy, ClassLoader classLoader) { """ Returns the binding if it exists immediately. Otherwise this returns null. If the returned binding didn't exist or was unlinked, it will be enqueued to be linked. """ return requestBinding(key, requiredBy, clas...
java
public Binding<?> requestBinding(String key, Object requiredBy, ClassLoader classLoader) { return requestBinding(key, requiredBy, classLoader, true, true); }
[ "public", "Binding", "<", "?", ">", "requestBinding", "(", "String", "key", ",", "Object", "requiredBy", ",", "ClassLoader", "classLoader", ")", "{", "return", "requestBinding", "(", "key", ",", "requiredBy", ",", "classLoader", ",", "true", ",", "true", ")"...
Returns the binding if it exists immediately. Otherwise this returns null. If the returned binding didn't exist or was unlinked, it will be enqueued to be linked.
[ "Returns", "the", "binding", "if", "it", "exists", "immediately", ".", "Otherwise", "this", "returns", "null", ".", "If", "the", "returned", "binding", "didn", "t", "exist", "or", "was", "unlinked", "it", "will", "be", "enqueued", "to", "be", "linked", "."...
train
https://github.com/square/dagger/blob/572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde/core/src/main/java/dagger/internal/Linker.java#L249-L251
code4everything/util
src/main/java/com/zhazhapan/util/Checker.java
Checker.checkNull
public static Short checkNull(Short value, short elseValue) { """ 检查Short是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Short} @since 1.0.8 """ return checkNull(value, Short.valueOf(elseValue)); }
java
public static Short checkNull(Short value, short elseValue) { return checkNull(value, Short.valueOf(elseValue)); }
[ "public", "static", "Short", "checkNull", "(", "Short", "value", ",", "short", "elseValue", ")", "{", "return", "checkNull", "(", "value", ",", "Short", ".", "valueOf", "(", "elseValue", ")", ")", ";", "}" ]
检查Short是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Short} @since 1.0.8
[ "检查Short是否为null" ]
train
https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Checker.java#L1349-L1351
jayantk/jklol
src/com/jayantkrish/jklol/cfg/CfgParseChart.java
CfgParseChart.getOutsideEntries
public Factor getOutsideEntries(int spanStart, int spanEnd) { """ Get the outside unnormalized probabilities over productions at a particular span in the tree. """ Tensor entries = new DenseTensor(parentVar.getVariableNumsArray(), parentVar.getVariableSizes(), outsideChart[spanStart][spanEnd]); ...
java
public Factor getOutsideEntries(int spanStart, int spanEnd) { Tensor entries = new DenseTensor(parentVar.getVariableNumsArray(), parentVar.getVariableSizes(), outsideChart[spanStart][spanEnd]); return new TableFactor(parentVar, entries); }
[ "public", "Factor", "getOutsideEntries", "(", "int", "spanStart", ",", "int", "spanEnd", ")", "{", "Tensor", "entries", "=", "new", "DenseTensor", "(", "parentVar", ".", "getVariableNumsArray", "(", ")", ",", "parentVar", ".", "getVariableSizes", "(", ")", ","...
Get the outside unnormalized probabilities over productions at a particular span in the tree.
[ "Get", "the", "outside", "unnormalized", "probabilities", "over", "productions", "at", "a", "particular", "span", "in", "the", "tree", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParseChart.java#L267-L271
jcuda/jcusolver
JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverDn.java
JCusolverDn.cusolverDnSsygvd_bufferSize
public static int cusolverDnSsygvd_bufferSize( cusolverDnHandle handle, int itype, int jobz, int uplo, int n, Pointer A, int lda, Pointer B, int ldb, Pointer W, int[] lwork) { """ generalized symmetric eige...
java
public static int cusolverDnSsygvd_bufferSize( cusolverDnHandle handle, int itype, int jobz, int uplo, int n, Pointer A, int lda, Pointer B, int ldb, Pointer W, int[] lwork) { return checkResult(cu...
[ "public", "static", "int", "cusolverDnSsygvd_bufferSize", "(", "cusolverDnHandle", "handle", ",", "int", "itype", ",", "int", "jobz", ",", "int", "uplo", ",", "int", "n", ",", "Pointer", "A", ",", "int", "lda", ",", "Pointer", "B", ",", "int", "ldb", ","...
generalized symmetric eigenvalue solver, A*x = lambda*B*x, by divide-and-conquer
[ "generalized", "symmetric", "eigenvalue", "solver", "A", "*", "x", "=", "lambda", "*", "B", "*", "x", "by", "divide", "-", "and", "-", "conquer" ]
train
https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverDn.java#L3237-L3251
rnorth/visible-assertions
src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java
VisibleAssertions.assertNotEquals
public static void assertNotEquals(String message, Object expected, Object actual) { """ Assert that an actual value is not equal to an expected value. <p> Equality is tested with the standard Object equals() method, unless both values are null. <p> If the assertion passes, a green tick will be shown. If the a...
java
public static void assertNotEquals(String message, Object expected, Object actual) { if (areBothNull(expected, actual)) { fail(message); } else if (isObjectEquals(expected, actual)) { fail(message); } else { pass(message); } }
[ "public", "static", "void", "assertNotEquals", "(", "String", "message", ",", "Object", "expected", ",", "Object", "actual", ")", "{", "if", "(", "areBothNull", "(", "expected", ",", "actual", ")", ")", "{", "fail", "(", "message", ")", ";", "}", "else",...
Assert that an actual value is not equal to an expected value. <p> Equality is tested with the standard Object equals() method, unless both values are null. <p> If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown. @param message message to display alongside the asser...
[ "Assert", "that", "an", "actual", "value", "is", "not", "equal", "to", "an", "expected", "value", ".", "<p", ">", "Equality", "is", "tested", "with", "the", "standard", "Object", "equals", "()", "method", "unless", "both", "values", "are", "null", ".", "...
train
https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L237-L245
voldemort/voldemort
src/java/voldemort/utils/RebalanceUtils.java
RebalanceUtils.validateClusterPartitionCounts
public static void validateClusterPartitionCounts(final Cluster lhs, final Cluster rhs) { """ Confirms that both clusters have the same number of total partitions. @param lhs @param rhs """ if(lhs.getNumberOfPartitions() != rhs.getNumberOfPartitions()) throw new VoldemortException("Tota...
java
public static void validateClusterPartitionCounts(final Cluster lhs, final Cluster rhs) { if(lhs.getNumberOfPartitions() != rhs.getNumberOfPartitions()) throw new VoldemortException("Total number of partitions should be equal [ lhs cluster (" + lhs.getNumberO...
[ "public", "static", "void", "validateClusterPartitionCounts", "(", "final", "Cluster", "lhs", ",", "final", "Cluster", "rhs", ")", "{", "if", "(", "lhs", ".", "getNumberOfPartitions", "(", ")", "!=", "rhs", ".", "getNumberOfPartitions", "(", ")", ")", "throw",...
Confirms that both clusters have the same number of total partitions. @param lhs @param rhs
[ "Confirms", "that", "both", "clusters", "have", "the", "same", "number", "of", "total", "partitions", "." ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L150-L156
recommenders/rival
rival-evaluate/src/main/java/net/recommenders/rival/evaluation/statistics/ConfidenceInterval.java
ConfidenceInterval.getConfidenceInterval
public <V> double[] getConfidenceInterval(final double alpha, final Map<V, Double> baselineMetricPerDimension, final Map<V, Double> testMetricPerDimension, final boolean pairedSamples) { """ Method that takes two metrics as parameters. It will compute the differences between both (only considering the keys in the...
java
public <V> double[] getConfidenceInterval(final double alpha, final Map<V, Double> baselineMetricPerDimension, final Map<V, Double> testMetricPerDimension, final boolean pairedSamples) { if (pairedSamples) { Set<V> overlap = new HashSet<V>(baselineMetricPerDimension.keySet()); overlap.re...
[ "public", "<", "V", ">", "double", "[", "]", "getConfidenceInterval", "(", "final", "double", "alpha", ",", "final", "Map", "<", "V", ",", "Double", ">", "baselineMetricPerDimension", ",", "final", "Map", "<", "V", ",", "Double", ">", "testMetricPerDimension...
Method that takes two metrics as parameters. It will compute the differences between both (only considering the keys in the overlap) @param <V> type of keys for metrics @param alpha probability of incorrectly rejecting the null hypothesis (1 - confidence_level) @param baselineMetricPerDimension baseline metric, one va...
[ "Method", "that", "takes", "two", "metrics", "as", "parameters", ".", "It", "will", "compute", "the", "differences", "between", "both", "(", "only", "considering", "the", "keys", "in", "the", "overlap", ")" ]
train
https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/statistics/ConfidenceInterval.java#L125-L155
agmip/ace-core
src/main/java/org/agmip/ace/io/AceGenerator.java
AceGenerator.writeBlock
private static void writeBlock(OutputStream dest, Iterator<IAceBaseComponent> i) throws IOException { """ Write the current {@link IAceBaseComponent} to an {@link OutputStream}. <p> This method automatically calls {@link IAceBaseComponent#rebuildComponent} to retrieve all subcomponents. @param dest Desti...
java
private static void writeBlock(OutputStream dest, Iterator<IAceBaseComponent> i) throws IOException { while (i.hasNext()) { dest.write(i.next().rebuildComponent()); if (i.hasNext()) { dest.write(",".getBytes("UTF-8")); } } }
[ "private", "static", "void", "writeBlock", "(", "OutputStream", "dest", ",", "Iterator", "<", "IAceBaseComponent", ">", "i", ")", "throws", "IOException", "{", "while", "(", "i", ".", "hasNext", "(", ")", ")", "{", "dest", ".", "write", "(", "i", ".", ...
Write the current {@link IAceBaseComponent} to an {@link OutputStream}. <p> This method automatically calls {@link IAceBaseComponent#rebuildComponent} to retrieve all subcomponents. @param dest Destination {@link OutputStream} @param i Iterator of all items of a specific {@link IAceBaseComponent}. @throws IOExcepti...
[ "Write", "the", "current", "{", "@link", "IAceBaseComponent", "}", "to", "an", "{", "@link", "OutputStream", "}", ".", "<p", ">", "This", "method", "automatically", "calls", "{", "@link", "IAceBaseComponent#rebuildComponent", "}", "to", "retrieve", "all", "subco...
train
https://github.com/agmip/ace-core/blob/51957e79b4567d0083c52d0720f4a268c3a02f44/src/main/java/org/agmip/ace/io/AceGenerator.java#L146-L154
kiswanij/jk-util
src/main/java/com/jk/util/JKIOUtil.java
JKIOUtil.getExtension
public static String getExtension(final String fileName, final boolean withPoint) { """ Gets the extension. @param fileName the file name @param withPoint the with point @return the extension """ final int lastIndexOf = fileName.lastIndexOf("."); if (!withPoint) { return fileName.substring(last...
java
public static String getExtension(final String fileName, final boolean withPoint) { final int lastIndexOf = fileName.lastIndexOf("."); if (!withPoint) { return fileName.substring(lastIndexOf + 1); } return fileName.substring(lastIndexOf); }
[ "public", "static", "String", "getExtension", "(", "final", "String", "fileName", ",", "final", "boolean", "withPoint", ")", "{", "final", "int", "lastIndexOf", "=", "fileName", ".", "lastIndexOf", "(", "\".\"", ")", ";", "if", "(", "!", "withPoint", ")", ...
Gets the extension. @param fileName the file name @param withPoint the with point @return the extension
[ "Gets", "the", "extension", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L297-L303
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.lastIndexOf
public static int lastIndexOf(short[] array, short value) { """ 返回数组中指定元素所在最后的位置,未找到返回{@link #INDEX_NOT_FOUND} @param array 数组 @param value 被检查的元素 @return 数组中指定元素所在位置,未找到返回{@link #INDEX_NOT_FOUND} @since 3.0.7 """ if (null != array) { for (int i = array.length - 1; i >= 0; i--) { if (value ==...
java
public static int lastIndexOf(short[] array, short value) { if (null != array) { for (int i = array.length - 1; i >= 0; i--) { if (value == array[i]) { return i; } } } return INDEX_NOT_FOUND; }
[ "public", "static", "int", "lastIndexOf", "(", "short", "[", "]", "array", ",", "short", "value", ")", "{", "if", "(", "null", "!=", "array", ")", "{", "for", "(", "int", "i", "=", "array", ".", "length", "-", "1", ";", "i", ">=", "0", ";", "i"...
返回数组中指定元素所在最后的位置,未找到返回{@link #INDEX_NOT_FOUND} @param array 数组 @param value 被检查的元素 @return 数组中指定元素所在位置,未找到返回{@link #INDEX_NOT_FOUND} @since 3.0.7
[ "返回数组中指定元素所在最后的位置,未找到返回", "{", "@link", "#INDEX_NOT_FOUND", "}" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1119-L1128
mgormley/pacaya
src/main/java/edu/jhu/pacaya/sch/util/dist/TruncatedNormal.java
TruncatedNormal.probabilityTruncZero
public static double probabilityTruncZero(double a, double b, double mu, double sigma) { """ returns the probability of x falling within the range of a to b under a normal distribution with mean mu and standard deviation sigma if the distribution is truncated below 0 and renormalized a and b should both be gr...
java
public static double probabilityTruncZero(double a, double b, double mu, double sigma) { // clip at zero a = Math.max(a, 0.0); b = Math.max(b, 0.0); final double denom = sigma * SQRT2; final double scaledSDA = (a - mu) / denom; final double scaledSDB = (b - mu) / denom; ...
[ "public", "static", "double", "probabilityTruncZero", "(", "double", "a", ",", "double", "b", ",", "double", "mu", ",", "double", "sigma", ")", "{", "// clip at zero", "a", "=", "Math", ".", "max", "(", "a", ",", "0.0", ")", ";", "b", "=", "Math", "....
returns the probability of x falling within the range of a to b under a normal distribution with mean mu and standard deviation sigma if the distribution is truncated below 0 and renormalized a and b should both be greater than or equal to 0 but this is not checked
[ "returns", "the", "probability", "of", "x", "falling", "within", "the", "range", "of", "a", "to", "b", "under", "a", "normal", "distribution", "with", "mean", "mu", "and", "standard", "deviation", "sigma", "if", "the", "distribution", "is", "truncated", "bel...
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/sch/util/dist/TruncatedNormal.java#L89-L102
jenkinsci/java-client-api
jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java
JenkinsServer.createView
public JenkinsServer createView(FolderJob folder, String viewName, String viewXml, Boolean crumbFlag) throws IOException { """ Create a view on the server using the provided xml and in the provided folder. @param folder the folder. @param viewName the view name. @param viewXml the view xml. @par...
java
public JenkinsServer createView(FolderJob folder, String viewName, String viewXml, Boolean crumbFlag) throws IOException { client.post_xml(UrlUtils.toBaseUrl(folder) + "createView?name=" + EncodingUtils.formParameter(viewName), viewXml, crumbFlag); return this; }
[ "public", "JenkinsServer", "createView", "(", "FolderJob", "folder", ",", "String", "viewName", ",", "String", "viewXml", ",", "Boolean", "crumbFlag", ")", "throws", "IOException", "{", "client", ".", "post_xml", "(", "UrlUtils", ".", "toBaseUrl", "(", "folder",...
Create a view on the server using the provided xml and in the provided folder. @param folder the folder. @param viewName the view name. @param viewXml the view xml. @param crumbFlag <code>true</code> to add <b>crumbIssuer</b> <code>false</code> otherwise. @throws IOException in case of an error.
[ "Create", "a", "view", "on", "the", "server", "using", "the", "provided", "xml", "and", "in", "the", "provided", "folder", "." ]
train
https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L442-L447
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/net/MediaType.java
MediaType.withParameter
public MediaType withParameter(String attribute, String value) { """ <em>Replaces</em> all parameters with the given attribute with a single parameter with the given value. If multiple parameters with the same attributes are necessary use {@link #withParameters}. Prefer {@link #withCharset} for setting the {@cod...
java
public MediaType withParameter(String attribute, String value) { checkNotNull(attribute); checkNotNull(value); String normalizedAttribute = normalizeToken(attribute); ImmutableListMultimap.Builder<String, String> builder = ImmutableListMultimap.builder(); for (Entry<String, String> entry : parameter...
[ "public", "MediaType", "withParameter", "(", "String", "attribute", ",", "String", "value", ")", "{", "checkNotNull", "(", "attribute", ")", ";", "checkNotNull", "(", "value", ")", ";", "String", "normalizedAttribute", "=", "normalizeToken", "(", "attribute", ")...
<em>Replaces</em> all parameters with the given attribute with a single parameter with the given value. If multiple parameters with the same attributes are necessary use {@link #withParameters}. Prefer {@link #withCharset} for setting the {@code charset} parameter when using a {@link Charset} object. @throws IllegalAr...
[ "<em", ">", "Replaces<", "/", "em", ">", "all", "parameters", "with", "the", "given", "attribute", "with", "a", "single", "parameter", "with", "the", "given", "value", ".", "If", "multiple", "parameters", "with", "the", "same", "attributes", "are", "necessar...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/net/MediaType.java#L608-L623
nohana/Amalgam
amalgam/src/main/java/com/amalgam/widget/ToastUtils.java
ToastUtils.showOnUiThread
public static void showOnUiThread(Context applicationContext, int stringResId, int duration) { """ Show toast on the UI thread. @param applicationContext the application context. @param stringResId to show. @param duration the display duration. """ Handler handler = HandlerUtils.getMainHandler(); ...
java
public static void showOnUiThread(Context applicationContext, int stringResId, int duration) { Handler handler = HandlerUtils.getMainHandler(); showOnUiThread(applicationContext, stringResId, duration, handler); }
[ "public", "static", "void", "showOnUiThread", "(", "Context", "applicationContext", ",", "int", "stringResId", ",", "int", "duration", ")", "{", "Handler", "handler", "=", "HandlerUtils", ".", "getMainHandler", "(", ")", ";", "showOnUiThread", "(", "applicationCon...
Show toast on the UI thread. @param applicationContext the application context. @param stringResId to show. @param duration the display duration.
[ "Show", "toast", "on", "the", "UI", "thread", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/widget/ToastUtils.java#L39-L42
rzwitserloot/lombok
src/core/lombok/Lombok.java
Lombok.checkNotNull
public static <T> T checkNotNull(T value, String message) { """ Ensures that the {@code value} is not {@code null}. @param <T> Type of the parameter. @param value the value to test for null. @param message the message of the {@link NullPointerException}. @return the value if it is not null. @throws NullPoin...
java
public static <T> T checkNotNull(T value, String message) { if (value == null) throw new NullPointerException(message); return value; }
[ "public", "static", "<", "T", ">", "T", "checkNotNull", "(", "T", "value", ",", "String", "message", ")", "{", "if", "(", "value", "==", "null", ")", "throw", "new", "NullPointerException", "(", "message", ")", ";", "return", "value", ";", "}" ]
Ensures that the {@code value} is not {@code null}. @param <T> Type of the parameter. @param value the value to test for null. @param message the message of the {@link NullPointerException}. @return the value if it is not null. @throws NullPointerException with the {@code message} if the value is null.
[ "Ensures", "that", "the", "{", "@code", "value", "}", "is", "not", "{", "@code", "null", "}", "." ]
train
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/Lombok.java#L81-L84
wcm-io/wcm-io-wcm
ui/granite/src/main/java/io/wcm/wcm/ui/granite/resource/GraniteUiSyntheticResource.java
GraniteUiSyntheticResource.copySubtree
public static void copySubtree(@NotNull Resource targetParent, @NotNull Resource source) { """ Copy the given source resource as synthetic child under the target parent resource, including all children. @param targetParent Target parent resource @param source Source resource """ Resource targetChild = Gr...
java
public static void copySubtree(@NotNull Resource targetParent, @NotNull Resource source) { Resource targetChild = GraniteUiSyntheticResource.child(targetParent, source.getName(), source.getResourceType(), source.getValueMap()); for (Resource sourceChild : source.getChildren()) { copySubtree(targetChild, s...
[ "public", "static", "void", "copySubtree", "(", "@", "NotNull", "Resource", "targetParent", ",", "@", "NotNull", "Resource", "source", ")", "{", "Resource", "targetChild", "=", "GraniteUiSyntheticResource", ".", "child", "(", "targetParent", ",", "source", ".", ...
Copy the given source resource as synthetic child under the target parent resource, including all children. @param targetParent Target parent resource @param source Source resource
[ "Copy", "the", "given", "source", "resource", "as", "synthetic", "child", "under", "the", "target", "parent", "resource", "including", "all", "children", "." ]
train
https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/ui/granite/src/main/java/io/wcm/wcm/ui/granite/resource/GraniteUiSyntheticResource.java#L232-L237
detro/browsermob-proxy-client
src/main/java/com/github/detro/browsermobproxyclient/BMPCProxy.java
BMPCProxy.newPage
public void newPage(String pageRef) { """ Starts a new page on the existing HAR. All the traffic recorded in the HAR from this point on will be considered part of this new Page. @param pageRef Name of this new pageRef that should be used by the HAR. If "null" defaults to "Page N", where "N" is the number of...
java
public void newPage(String pageRef) { try { // Request BMP to create a new HAR for this Proxy HttpPut request = new HttpPut(requestURIBuilder() .setPath(proxyURIPath() + "/har/pageRef") .build()); // Add form parameters to the request ...
[ "public", "void", "newPage", "(", "String", "pageRef", ")", "{", "try", "{", "// Request BMP to create a new HAR for this Proxy", "HttpPut", "request", "=", "new", "HttpPut", "(", "requestURIBuilder", "(", ")", ".", "setPath", "(", "proxyURIPath", "(", ")", "+", ...
Starts a new page on the existing HAR. All the traffic recorded in the HAR from this point on will be considered part of this new Page. @param pageRef Name of this new pageRef that should be used by the HAR. If "null" defaults to "Page N", where "N" is the number of pages so far.
[ "Starts", "a", "new", "page", "on", "the", "existing", "HAR", ".", "All", "the", "traffic", "recorded", "in", "the", "HAR", "from", "this", "point", "on", "will", "be", "considered", "part", "of", "this", "new", "Page", "." ]
train
https://github.com/detro/browsermob-proxy-client/blob/da03deff8211b7e1153e36100c5ba60acd470a4f/src/main/java/com/github/detro/browsermobproxyclient/BMPCProxy.java#L324-L354
super-csv/super-csv
super-csv/src/main/java/org/supercsv/cellprocessor/FmtBool.java
FmtBool.execute
public Object execute(final Object value, final CsvContext context) { """ {@inheritDoc} @throws SuperCsvCellProcessorException if value is null or is not a Boolean """ validateInputNotNull(value, context); if( !(value instanceof Boolean) ) { throw new SuperCsvCellProcessorException(Boolean.class,...
java
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if( !(value instanceof Boolean) ) { throw new SuperCsvCellProcessorException(Boolean.class, value, context, this); } final String result = ((Boolean) value).booleanValue() ? trueValue : falseValu...
[ "public", "Object", "execute", "(", "final", "Object", "value", ",", "final", "CsvContext", "context", ")", "{", "validateInputNotNull", "(", "value", ",", "context", ")", ";", "if", "(", "!", "(", "value", "instanceof", "Boolean", ")", ")", "{", "throw", ...
{@inheritDoc} @throws SuperCsvCellProcessorException if value is null or is not a Boolean
[ "{", "@inheritDoc", "}" ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/FmtBool.java#L74-L83
demidenko05/beigesoft-orm
src/main/java/org/beigesoft/orm/service/ASrvOrm.java
ASrvOrm.evalRowCount
@Override public final <T> Integer evalRowCount( final Map<String, Object> pAddParam, final Class<T> pEntityClass) throws Exception { """ <p>Calculate total rows for pagination.</p> @param <T> - type of business object, @param pAddParam additional param @param pEntityClass entity class @return Inte...
java
@Override public final <T> Integer evalRowCount( final Map<String, Object> pAddParam, final Class<T> pEntityClass) throws Exception { String query = "select count(*) as TOTALROWS from " + pEntityClass .getSimpleName().toUpperCase() + ";"; return evalRowCountByQuery(pAddParam, pEntityClass, que...
[ "@", "Override", "public", "final", "<", "T", ">", "Integer", "evalRowCount", "(", "final", "Map", "<", "String", ",", "Object", ">", "pAddParam", ",", "final", "Class", "<", "T", ">", "pEntityClass", ")", "throws", "Exception", "{", "String", "query", "...
<p>Calculate total rows for pagination.</p> @param <T> - type of business object, @param pAddParam additional param @param pEntityClass entity class @return Integer row count @throws Exception - an exception
[ "<p", ">", "Calculate", "total", "rows", "for", "pagination", ".", "<", "/", "p", ">" ]
train
https://github.com/demidenko05/beigesoft-orm/blob/f1b2c70701a111741a436911ca24ef9d38eba0b9/src/main/java/org/beigesoft/orm/service/ASrvOrm.java#L519-L526
katjahahn/PortEx
src/main/java/com/github/katjahahn/tools/visualizer/Visualizer.java
Visualizer.variate
private Color variate(Color color) { """ Shift the given section color one step. This creates a color similar to the given color, but still different enough to tell the new color apart from the old one. @param color @return modified color """ assert color != null; final int diff = 30; // darken t...
java
private Color variate(Color color) { assert color != null; final int diff = 30; // darken the color for value of diff int newRed = shiftColorPart(color.getRed() - diff); int newGreen = shiftColorPart(color.getGreen() - diff); int newBlue = shiftColorPart(color.getBlue() - diff); Color newColor = new Color...
[ "private", "Color", "variate", "(", "Color", "color", ")", "{", "assert", "color", "!=", "null", ";", "final", "int", "diff", "=", "30", ";", "// darken the color for value of diff", "int", "newRed", "=", "shiftColorPart", "(", "color", ".", "getRed", "(", "...
Shift the given section color one step. This creates a color similar to the given color, but still different enough to tell the new color apart from the old one. @param color @return modified color
[ "Shift", "the", "given", "section", "color", "one", "step", "." ]
train
https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/tools/visualizer/Visualizer.java#L636-L650
lite2073/email-validator
src/com/dominicsayers/isemail/dns/DNSLookup.java
DNSLookup.hasRecords
public static boolean hasRecords(String hostName, String dnsType) throws DNSLookupException { """ Checks if a host name has a valid record. @param hostName The hostname @param dnsType The kind of record (A, AAAA, MX, ...) @return Whether the record is available or not @throws DNSLookupException Appear...
java
public static boolean hasRecords(String hostName, String dnsType) throws DNSLookupException { return DNSLookup.doLookup(hostName, dnsType) > 0; }
[ "public", "static", "boolean", "hasRecords", "(", "String", "hostName", ",", "String", "dnsType", ")", "throws", "DNSLookupException", "{", "return", "DNSLookup", ".", "doLookup", "(", "hostName", ",", "dnsType", ")", ">", "0", ";", "}" ]
Checks if a host name has a valid record. @param hostName The hostname @param dnsType The kind of record (A, AAAA, MX, ...) @return Whether the record is available or not @throws DNSLookupException Appears on a fatal error like dnsType invalid or initial context error.
[ "Checks", "if", "a", "host", "name", "has", "a", "valid", "record", "." ]
train
https://github.com/lite2073/email-validator/blob/cfdda77ed630854b44d62def0d5b7228d5c4e712/src/com/dominicsayers/isemail/dns/DNSLookup.java#L29-L32
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/DerivativeLaplacian.java
DerivativeLaplacian.process
public static void process(GrayU8 orig, GrayS16 deriv, @Nullable ImageBorder_S32<GrayU8> border ) { """ Computes the Laplacian of input image. @param orig Input image. Not modified. @param deriv Where the Laplacian is written to. Modified. """ deriv.reshape(orig.width,orig.height); if( BoofConcurren...
java
public static void process(GrayU8 orig, GrayS16 deriv, @Nullable ImageBorder_S32<GrayU8> border ) { deriv.reshape(orig.width,orig.height); if( BoofConcurrency.USE_CONCURRENT ) { DerivativeLaplacian_Inner_MT.process(orig,deriv); } else { DerivativeLaplacian_Inner.process(orig,deriv); } if( border != nu...
[ "public", "static", "void", "process", "(", "GrayU8", "orig", ",", "GrayS16", "deriv", ",", "@", "Nullable", "ImageBorder_S32", "<", "GrayU8", ">", "border", ")", "{", "deriv", ".", "reshape", "(", "orig", ".", "width", ",", "orig", ".", "height", ")", ...
Computes the Laplacian of input image. @param orig Input image. Not modified. @param deriv Where the Laplacian is written to. Modified.
[ "Computes", "the", "Laplacian", "of", "input", "image", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/derivative/DerivativeLaplacian.java#L74-L87
LearnLib/automatalib
visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java
DOT.renderDOTExternal
public static void renderDOTExternal(File dotFile, String format) throws IOException { """ Renders a GraphVIZ description from a file, using an external program for displaying. Convenience method, see {@link #renderDOTExternal(Reader, String)}. @throws IOException if opening the file resulted in errors. "...
java
public static void renderDOTExternal(File dotFile, String format) throws IOException { renderDOTExternal(IOUtil.asBufferedUTF8Reader(dotFile), format); }
[ "public", "static", "void", "renderDOTExternal", "(", "File", "dotFile", ",", "String", "format", ")", "throws", "IOException", "{", "renderDOTExternal", "(", "IOUtil", ".", "asBufferedUTF8Reader", "(", "dotFile", ")", ",", "format", ")", ";", "}" ]
Renders a GraphVIZ description from a file, using an external program for displaying. Convenience method, see {@link #renderDOTExternal(Reader, String)}. @throws IOException if opening the file resulted in errors.
[ "Renders", "a", "GraphVIZ", "description", "from", "a", "file", "using", "an", "external", "program", "for", "displaying", ".", "Convenience", "method", "see", "{", "@link", "#renderDOTExternal", "(", "Reader", "String", ")", "}", "." ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java#L229-L231
JakeWharton/ActionBarSherlock
actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java
SearchView.setQuery
public void setQuery(CharSequence query, boolean submit) { """ Sets a query string in the text field and optionally submits the query as well. @param query the query string. This replaces any query text already present in the text field. @param submit whether to submit the query right now or only update the c...
java
public void setQuery(CharSequence query, boolean submit) { mQueryTextView.setText(query); if (query != null) { mQueryTextView.setSelection(mQueryTextView.length()); mUserQuery = query; } // If the query is not empty and submit is requested, submit the query ...
[ "public", "void", "setQuery", "(", "CharSequence", "query", ",", "boolean", "submit", ")", "{", "mQueryTextView", ".", "setText", "(", "query", ")", ";", "if", "(", "query", "!=", "null", ")", "{", "mQueryTextView", ".", "setSelection", "(", "mQueryTextView"...
Sets a query string in the text field and optionally submits the query as well. @param query the query string. This replaces any query text already present in the text field. @param submit whether to submit the query right now or only update the contents of text field.
[ "Sets", "a", "query", "string", "in", "the", "text", "field", "and", "optionally", "submits", "the", "query", "as", "well", "." ]
train
https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L533-L544
rythmengine/rythmengine
src/main/java/org/rythmengine/RythmEngine.java
RythmEngine.invokeTemplate
public void invokeTemplate(int line, String name, ITemplate caller, ITag.__ParameterList params, ITag.__Body body, ITag.__Body context) { """ Invoke a template <p/> <p>Not an API for user application</p> @param line @param name @param caller @param params @param body @param context """ invoke...
java
public void invokeTemplate(int line, String name, ITemplate caller, ITag.__ParameterList params, ITag.__Body body, ITag.__Body context) { invokeTemplate(line, name, caller, params, body, context, false); }
[ "public", "void", "invokeTemplate", "(", "int", "line", ",", "String", "name", ",", "ITemplate", "caller", ",", "ITag", ".", "__ParameterList", "params", ",", "ITag", ".", "__Body", "body", ",", "ITag", ".", "__Body", "context", ")", "{", "invokeTemplate", ...
Invoke a template <p/> <p>Not an API for user application</p> @param line @param name @param caller @param params @param body @param context
[ "Invoke", "a", "template", "<p", "/", ">", "<p", ">", "Not", "an", "API", "for", "user", "application<", "/", "p", ">" ]
train
https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/RythmEngine.java#L1674-L1676
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java
BindingFactory.bindToInstance
protected Binding bindToInstance(TypeReference bind, String functionName, String instanceExpression, boolean isSingleton, boolean isEager) { """ Bind a type to an instance expression. @param bind the type to bind. @param functionName the name of the binding function. It may be <code>null</code> for the defa...
java
protected Binding bindToInstance(TypeReference bind, String functionName, String instanceExpression, boolean isSingleton, boolean isEager) { final BindKey type; final BindValue value; if (!Strings.isEmpty(functionName) && functionName.startsWith(CONFIGURE_PREFIX)) { final String fname = functionName.substri...
[ "protected", "Binding", "bindToInstance", "(", "TypeReference", "bind", ",", "String", "functionName", ",", "String", "instanceExpression", ",", "boolean", "isSingleton", ",", "boolean", "isEager", ")", "{", "final", "BindKey", "type", ";", "final", "BindValue", "...
Bind a type to an instance expression. @param bind the type to bind. @param functionName the name of the binding function. It may be <code>null</code> for the default name. @param instanceExpression the expression that represents the instance. @param isSingleton indicates if the instance is a singleton. @param isEager...
[ "Bind", "a", "type", "to", "an", "instance", "expression", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java#L230-L263
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java
ClusterManagerMetrics.createTypeToResourceCountMap
private Map<ResourceType, MetricsTimeVaryingLong> createTypeToResourceCountMap( Collection<ResourceType> resourceTypes, String actionType) { """ Create a map of resource type -> cumulative counts. @param resourceTypes The resource types. @param actionType A string indicating granted, revoked, etc. @retu...
java
private Map<ResourceType, MetricsTimeVaryingLong> createTypeToResourceCountMap( Collection<ResourceType> resourceTypes, String actionType) { Map<ResourceType, MetricsTimeVaryingLong> m = new HashMap<ResourceType, MetricsTimeVaryingLong>(); for (ResourceType t : resourceTypes) { String name...
[ "private", "Map", "<", "ResourceType", ",", "MetricsTimeVaryingLong", ">", "createTypeToResourceCountMap", "(", "Collection", "<", "ResourceType", ">", "resourceTypes", ",", "String", "actionType", ")", "{", "Map", "<", "ResourceType", ",", "MetricsTimeVaryingLong", "...
Create a map of resource type -> cumulative counts. @param resourceTypes The resource types. @param actionType A string indicating granted, revoked, etc. @return The map.
[ "Create", "a", "map", "of", "resource", "type", "-", ">", "cumulative", "counts", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java#L363-L374
liferay/com-liferay-commerce
commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListItemPersistenceImpl.java
CommerceWishListItemPersistenceImpl.findByCProductId
@Override public List<CommerceWishListItem> findByCProductId(long CProductId, int start, int end) { """ Returns a range of all the commerce wish list items where CProductId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end<...
java
@Override public List<CommerceWishListItem> findByCProductId(long CProductId, int start, int end) { return findByCProductId(CProductId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceWishListItem", ">", "findByCProductId", "(", "long", "CProductId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCProductId", "(", "CProductId", ",", "start", ",", "end", ",", "null", ")",...
Returns a range of all the commerce wish list items where CProductId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "wish", "list", "items", "where", "CProductId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListItemPersistenceImpl.java#L1241-L1245
OpenTSDB/opentsdb
src/tools/CliOptions.java
CliOptions.getConfig
static final Config getConfig(final ArgP argp) throws IOException { """ Attempts to load a configuration given a file or default files and overrides with command line arguments @return A config object with user settings or defaults @throws IOException If there was an error opening any of the config files @thro...
java
static final Config getConfig(final ArgP argp) throws IOException { // load configuration final Config config; final String config_file = argp.get("--config", ""); if (!config_file.isEmpty()) config = new Config(config_file); else config = new Config(true); // load CLI overloads ...
[ "static", "final", "Config", "getConfig", "(", "final", "ArgP", "argp", ")", "throws", "IOException", "{", "// load configuration", "final", "Config", "config", ";", "final", "String", "config_file", "=", "argp", ".", "get", "(", "\"--config\"", ",", "\"\"", "...
Attempts to load a configuration given a file or default files and overrides with command line arguments @return A config object with user settings or defaults @throws IOException If there was an error opening any of the config files @throws FileNotFoundException If the user provided config file was not found @since 2....
[ "Attempts", "to", "load", "a", "configuration", "given", "a", "file", "or", "default", "files", "and", "overrides", "with", "command", "line", "arguments" ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/CliOptions.java#L94-L109
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java
MaterialComboBox.addItem
public void addItem(String text, T value, OptGroup optGroup) { """ Add item directly to combobox component with existing OptGroup @param text - The text you want to labeled on the option item @param value - The value you want to pass through in this option @param optGroup - Add directly this option int...
java
public void addItem(String text, T value, OptGroup optGroup) { if (!values.contains(value)) { values.add(value); optGroup.add(buildOption(text, value)); } }
[ "public", "void", "addItem", "(", "String", "text", ",", "T", "value", ",", "OptGroup", "optGroup", ")", "{", "if", "(", "!", "values", ".", "contains", "(", "value", ")", ")", "{", "values", ".", "add", "(", "value", ")", ";", "optGroup", ".", "ad...
Add item directly to combobox component with existing OptGroup @param text - The text you want to labeled on the option item @param value - The value you want to pass through in this option @param optGroup - Add directly this option into the existing group
[ "Add", "item", "directly", "to", "combobox", "component", "with", "existing", "OptGroup" ]
train
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L237-L242
OpenTSDB/opentsdb
src/meta/Annotation.java
Annotation.getStorageJSON
@VisibleForTesting byte[] getStorageJSON() { """ Serializes the object in a uniform matter for storage. Needed for successful CAS calls @return The serialized object as a byte array """ // TODO - precalculate size final ByteArrayOutputStream output = new ByteArrayOutputStream(); try { fin...
java
@VisibleForTesting byte[] getStorageJSON() { // TODO - precalculate size final ByteArrayOutputStream output = new ByteArrayOutputStream(); try { final JsonGenerator json = JSON.getFactory().createGenerator(output); json.writeStartObject(); if (tsuid != null && !tsuid.isEmpty()) { ...
[ "@", "VisibleForTesting", "byte", "[", "]", "getStorageJSON", "(", ")", "{", "// TODO - precalculate size", "final", "ByteArrayOutputStream", "output", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "try", "{", "final", "JsonGenerator", "json", "=", "JSON", "...
Serializes the object in a uniform matter for storage. Needed for successful CAS calls @return The serialized object as a byte array
[ "Serializes", "the", "object", "in", "a", "uniform", "matter", "for", "storage", ".", "Needed", "for", "successful", "CAS", "calls" ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/Annotation.java#L517-L545
Ordinastie/MalisisCore
src/main/java/net/malisis/core/network/MalisisNetwork.java
MalisisNetwork.sendToPlayersWatchingChunk
public void sendToPlayersWatchingChunk(IMessage message, Chunk chunk) { """ Send the {@link IMessage} to all the players currently watching that specific chunk.<br> The {@link IMessageHandler} for the message type should be on the CLIENT side. @param message the message @param chunk the chunk """ Entity...
java
public void sendToPlayersWatchingChunk(IMessage message, Chunk chunk) { EntityUtils.getPlayersWatchingChunk(chunk).forEach(p -> sendTo(message, p)); }
[ "public", "void", "sendToPlayersWatchingChunk", "(", "IMessage", "message", ",", "Chunk", "chunk", ")", "{", "EntityUtils", ".", "getPlayersWatchingChunk", "(", "chunk", ")", ".", "forEach", "(", "p", "->", "sendTo", "(", "message", ",", "p", ")", ")", ";", ...
Send the {@link IMessage} to all the players currently watching that specific chunk.<br> The {@link IMessageHandler} for the message type should be on the CLIENT side. @param message the message @param chunk the chunk
[ "Send", "the", "{", "@link", "IMessage", "}", "to", "all", "the", "players", "currently", "watching", "that", "specific", "chunk", ".", "<br", ">", "The", "{", "@link", "IMessageHandler", "}", "for", "the", "message", "type", "should", "be", "on", "the", ...
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/network/MalisisNetwork.java#L84-L87
astrapi69/jaulp-wicket
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/parameter/PageParametersExtensions.java
PageParametersExtensions.getParameter
public static String getParameter(final String parameterName) { """ Gets the parameter value from given parameter name. Looks in the query and post parameters. @param parameterName the parameter name @return the parameter value """ final Request request = RequestCycle.get().getRequest(); return getPar...
java
public static String getParameter(final String parameterName) { final Request request = RequestCycle.get().getRequest(); return getParameter(request, parameterName); }
[ "public", "static", "String", "getParameter", "(", "final", "String", "parameterName", ")", "{", "final", "Request", "request", "=", "RequestCycle", ".", "get", "(", ")", ".", "getRequest", "(", ")", ";", "return", "getParameter", "(", "request", ",", "param...
Gets the parameter value from given parameter name. Looks in the query and post parameters. @param parameterName the parameter name @return the parameter value
[ "Gets", "the", "parameter", "value", "from", "given", "parameter", "name", ".", "Looks", "in", "the", "query", "and", "post", "parameters", "." ]
train
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/parameter/PageParametersExtensions.java#L220-L224
apache/reef
lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/JobSubmissionHelper.java
JobSubmissionHelper.getFileResourceProto
private static FileResource getFileResourceProto(final String fileName, final FileType type) throws IOException { """ Turns a pathname into the right protocol for job submission. @param fileName @param type @return @throws IOException """ File file = new File(fileName); if (file.exists()) { ...
java
private static FileResource getFileResourceProto(final String fileName, final FileType type) throws IOException { File file = new File(fileName); if (file.exists()) { // It is a local file and can be added. if (file.isDirectory()) { // If it is a directory, create a JAR file of it and add th...
[ "private", "static", "FileResource", "getFileResourceProto", "(", "final", "String", "fileName", ",", "final", "FileType", "type", ")", "throws", "IOException", "{", "File", "file", "=", "new", "File", "(", "fileName", ")", ";", "if", "(", "file", ".", "exis...
Turns a pathname into the right protocol for job submission. @param fileName @param type @return @throws IOException
[ "Turns", "a", "pathname", "into", "the", "right", "protocol", "for", "job", "submission", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/client/JobSubmissionHelper.java#L141-L170
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.listConversationWebhooks
ConversationWebhookList listConversationWebhooks(final int offset, final int limit) throws UnauthorizedException, GeneralException { """ Gets a ConversationWebhook listing with the specified pagination options. @param offset Number of objects to skip. @param limit Number of objects to skip. @retu...
java
ConversationWebhookList listConversationWebhooks(final int offset, final int limit) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; return messageBirdService.requestList(url, offset, limit, ConversationWebhookList.class); ...
[ "ConversationWebhookList", "listConversationWebhooks", "(", "final", "int", "offset", ",", "final", "int", "limit", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "String", "url", "=", "CONVERSATIONS_BASE_URL", "+", "CONVERSATION_WEBHOOK_PATH", ";",...
Gets a ConversationWebhook listing with the specified pagination options. @param offset Number of objects to skip. @param limit Number of objects to skip. @return List of webhooks.
[ "Gets", "a", "ConversationWebhook", "listing", "with", "the", "specified", "pagination", "options", "." ]
train
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L882-L886
alkacon/opencms-core
src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsToolbarNewButton.java
CmsToolbarNewButton.makeDetailPageItem
private CmsCreatableListItem makeDetailPageItem(CmsNewResourceInfo typeInfo) { """ Creates a list item representing a detail page to be created.<p> @param typeInfo the bean for the type for which the detail page item should be created @return the detail page list item """ CmsListInfoBean info = ...
java
private CmsCreatableListItem makeDetailPageItem(CmsNewResourceInfo typeInfo) { CmsListInfoBean info = new CmsListInfoBean(); String subtitle = typeInfo.getSubTitle(); String title = Messages.get().key( typeInfo.isFunction() ? Messages.GUI_FUNCTION_PAGE_TITLE_1 : Messages.GUI_DETAIL_...
[ "private", "CmsCreatableListItem", "makeDetailPageItem", "(", "CmsNewResourceInfo", "typeInfo", ")", "{", "CmsListInfoBean", "info", "=", "new", "CmsListInfoBean", "(", ")", ";", "String", "subtitle", "=", "typeInfo", ".", "getSubTitle", "(", ")", ";", "String", "...
Creates a list item representing a detail page to be created.<p> @param typeInfo the bean for the type for which the detail page item should be created @return the detail page list item
[ "Creates", "a", "list", "item", "representing", "a", "detail", "page", "to", "be", "created", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsToolbarNewButton.java#L154-L169
hawkular/hawkular-agent
hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/LoggingJBossASClient.java
LoggingJBossASClient.setLoggerLevel
public void setLoggerLevel(String loggerName, String level) throws Exception { """ Sets the logger to the given level. If the logger does not exist yet, it will be created. @param loggerName the logger name (this is also known as the category name) @param level the new level of the logger (e.g. DEBUG, INFO, E...
java
public void setLoggerLevel(String loggerName, String level) throws Exception { final Address addr = Address.root().add(SUBSYSTEM, LOGGING, LOGGER, loggerName); final ModelNode request; if (isLogger(loggerName)) { request = createWriteAttributeRequest("level", level, addr); ...
[ "public", "void", "setLoggerLevel", "(", "String", "loggerName", ",", "String", "level", ")", "throws", "Exception", "{", "final", "Address", "addr", "=", "Address", ".", "root", "(", ")", ".", "add", "(", "SUBSYSTEM", ",", "LOGGING", ",", "LOGGER", ",", ...
Sets the logger to the given level. If the logger does not exist yet, it will be created. @param loggerName the logger name (this is also known as the category name) @param level the new level of the logger (e.g. DEBUG, INFO, ERROR, etc.) @throws Exception any error
[ "Sets", "the", "logger", "to", "the", "given", "level", ".", "If", "the", "logger", "does", "not", "exist", "yet", "it", "will", "be", "created", "." ]
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/LoggingJBossASClient.java#L69-L95
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/util/DistanceFormat.java
DistanceFormat.asMapArea
public static String asMapArea(MapWidget map, double area) { """ Area formatting method. Requires an area as parameter, expressed in the CRS units of the given map. @param map The map for which an area should be formatted. This map may be configured to use the metric system or the English system. @param area...
java
public static String asMapArea(MapWidget map, double area) { double unitLength = map.getUnitLength(); double distance = area * unitLength * unitLength; String unit = "m"; if (map.getMapModel().getMapInfo().getDisplayUnitType() == UnitType.METRIC) { // Right now, the distance is expressed in meter. Switch to...
[ "public", "static", "String", "asMapArea", "(", "MapWidget", "map", ",", "double", "area", ")", "{", "double", "unitLength", "=", "map", ".", "getUnitLength", "(", ")", ";", "double", "distance", "=", "area", "*", "unitLength", "*", "unitLength", ";", "Str...
Area formatting method. Requires an area as parameter, expressed in the CRS units of the given map. @param map The map for which an area should be formatted. This map may be configured to use the metric system or the English system. @param area The original area, expressed in the coordinate reference system of the giv...
[ "Area", "formatting", "method", ".", "Requires", "an", "area", "as", "parameter", "expressed", "in", "the", "CRS", "units", "of", "the", "given", "map", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/DistanceFormat.java#L101-L127