repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
oblac/jodd
jodd-core/src/main/java/jodd/util/CharArraySequence.java
CharArraySequence.from
public static CharArraySequence from(final char[] value, final int offset, final int len) { final char[] buffer = new char[value.length]; System.arraycopy(value, offset, buffer, 0, len); return new CharArraySequence(buffer); }
java
public static CharArraySequence from(final char[] value, final int offset, final int len) { final char[] buffer = new char[value.length]; System.arraycopy(value, offset, buffer, 0, len); return new CharArraySequence(buffer); }
[ "public", "static", "CharArraySequence", "from", "(", "final", "char", "[", "]", "value", ",", "final", "int", "offset", ",", "final", "int", "len", ")", "{", "final", "char", "[", "]", "buffer", "=", "new", "char", "[", "value", ".", "length", "]", ...
Static constructor that creates a char sequence by making a copy of provided char array.
[ "Static", "constructor", "that", "creates", "a", "char", "sequence", "by", "making", "a", "copy", "of", "provided", "char", "array", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/CharArraySequence.java#L53-L59
test
Creates a CharArraySequence from the specified char array.
Of course, here is the Java code you requested: ```java public static CharArraySequence from(final char[] value, final int offset, final int len) { final char[] buffer = new char[value.length]; System.arraycopy(value, offset, buffer, 0, len); return new CharArraySequence(buffer); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/transform/AbstractTransformBuilder.java
AbstractTransformBuilder.getFalseEastingScaleFactor
static public double getFalseEastingScaleFactor(NetcdfDataset ds, AttributeContainer ctv) { String units = getGeoCoordinateUnits(ds, ctv); return getFalseEastingScaleFactor(units); }
java
static public double getFalseEastingScaleFactor(NetcdfDataset ds, AttributeContainer ctv) { String units = getGeoCoordinateUnits(ds, ctv); return getFalseEastingScaleFactor(units); }
[ "static", "public", "double", "getFalseEastingScaleFactor", "(", "NetcdfDataset", "ds", ",", "AttributeContainer", "ctv", ")", "{", "String", "units", "=", "getGeoCoordinateUnits", "(", "ds", ",", "ctv", ")", ";", "return", "getFalseEastingScaleFactor", "(", "units"...
/* from CF: false_easting(false_northing): The value added to all abscissa(ordinate) values in the rectangular coordinates for a map projection. This value frequently is assigned to eliminate negative numbers. Expressed in the unit of the coordinate variable identified by the standard name projection_x_coordinate (proj...
[ "/", "*", "from", "CF", ":", "false_easting", "(", "false_northing", ")", ":", "The", "value", "added", "to", "all", "abscissa", "(", "ordinate", ")", "values", "in", "the", "rectangular", "coordinates", "for", "a", "map", "projection", ".", "This", "value...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/transform/AbstractTransformBuilder.java#L35-L38
test
Get the false easting scale factor for a dataset
Of course, here is the Java code you requested: ```java static public double getFalseEastingScaleFactor(NetcdfDataset ds, AttributeContainer ctv) { String units = getGeoCoordinateUnits(ds, ctv); return getFalseEastingScaleFactor(units); } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/metric/Intersection3D_F64.java
Intersection3D_F64.intersect
public static boolean intersect( PlaneGeneral3D_F64 a , PlaneGeneral3D_F64 b , LineParametric3D_F64 line ) { // Line's slope is the cross product of the two normal vectors GeometryMath_F64.cross(a.A,a.B,a.C,b.A,b.B,b.C,line.slope); if( line.slope.normSq() == 0 ) return false; // Closest point on plane 'a'...
java
public static boolean intersect( PlaneGeneral3D_F64 a , PlaneGeneral3D_F64 b , LineParametric3D_F64 line ) { // Line's slope is the cross product of the two normal vectors GeometryMath_F64.cross(a.A,a.B,a.C,b.A,b.B,b.C,line.slope); if( line.slope.normSq() == 0 ) return false; // Closest point on plane 'a'...
[ "public", "static", "boolean", "intersect", "(", "PlaneGeneral3D_F64", "a", ",", "PlaneGeneral3D_F64", "b", ",", "LineParametric3D_F64", "line", ")", "{", "// Line's slope is the cross product of the two normal vectors", "GeometryMath_F64", ".", "cross", "(", "a", ".", "A...
Finds the line which is the intersection between the two planes. For a valid solution to be returned the planes must not be parallel to each other. If the planes are parallel then the slope of the returned line will have a value of zero for each element. @param a (Input) Plane @param b (Input) Plane @param line (Out...
[ "Finds", "the", "line", "which", "is", "the", "intersection", "between", "the", "two", "planes", ".", "For", "a", "valid", "solution", "to", "be", "returned", "the", "planes", "must", "not", "be", "parallel", "to", "each", "other", ".", "If", "the", "pla...
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Intersection3D_F64.java#L106-L138
test
Computes the intersection between two lines
Of course, here is the Java code you requested: ```java public static boolean intersect( PlaneGeneral3D_F64 a , PlaneGeneral3D_F64 b , LineParametric3D_F64 line ) { // Line's slope is the cross product of the two normal vectors GeometryMath_F64.cross(a.A,a.B,a.C,b.A,b.B,b.C,line.slope); if( line.slope.normSq()...
oblac/jodd
jodd-core/src/main/java/jodd/util/StringUtil.java
StringUtil.remove
public static String remove(final String s, final String sub) { int c = 0; int sublen = sub.length(); if (sublen == 0) { return s; } int i = s.indexOf(sub, c); if (i == -1) { return s; } StringBuilder sb = new StringBuilder(s.length()); do { sb.append(s, c, i); c = i + sublen; } while...
java
public static String remove(final String s, final String sub) { int c = 0; int sublen = sub.length(); if (sublen == 0) { return s; } int i = s.indexOf(sub, c); if (i == -1) { return s; } StringBuilder sb = new StringBuilder(s.length()); do { sb.append(s, c, i); c = i + sublen; } while...
[ "public", "static", "String", "remove", "(", "final", "String", "s", ",", "final", "String", "sub", ")", "{", "int", "c", "=", "0", ";", "int", "sublen", "=", "sub", ".", "length", "(", ")", ";", "if", "(", "sublen", "==", "0", ")", "{", "return"...
Removes all substring occurrences from the string. @param s source string @param sub substring to remove
[ "Removes", "all", "substring", "occurrences", "from", "the", "string", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringUtil.java#L190-L209
test
Remove the first occurrence of the sub string from the first occurrence of the second.
Of course, here is the Java code you requested: ```java public static String remove(final String s, final String sub) { int c = 0; int sublen = sub.length(); if (sublen == 0) { return s; } int i = s.indexOf(sub, c); if (i == -1) { return s; } StringBuilder sb = new StringBuilder(s.length()); do...
oblac/jodd
jodd-servlet/src/main/java/jodd/servlet/filter/GzipFilter.java
GzipFilter.isGzipEligible
protected boolean isGzipEligible(final HttpServletRequest request) { // request parameter name if (requestParameterName.length() != 0) { String forceGzipString = request.getParameter(requestParameterName); if (forceGzipString != null) { return Converter.get().toBooleanValue(forceGzipString, false); }...
java
protected boolean isGzipEligible(final HttpServletRequest request) { // request parameter name if (requestParameterName.length() != 0) { String forceGzipString = request.getParameter(requestParameterName); if (forceGzipString != null) { return Converter.get().toBooleanValue(forceGzipString, false); }...
[ "protected", "boolean", "isGzipEligible", "(", "final", "HttpServletRequest", "request", ")", "{", "// request parameter name", "if", "(", "requestParameterName", ".", "length", "(", ")", "!=", "0", ")", "{", "String", "forceGzipString", "=", "request", ".", "getP...
Determine if request is eligible for GZipping.
[ "Determine", "if", "request", "is", "eligible", "for", "GZipping", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/filter/GzipFilter.java#L192-L260
test
Checks if gzip is eligible for the given request.
Of course, here is the Java code you requested: ```java protected boolean isGzipEligible(final HttpServletRequest request) { // request parameter name if (requestParameterName.length() != 0) { String forceGzipString = request.getParameter(requestParameterName); if (forceGzipString != null) { return Con...
Unidata/thredds
cdm/src/main/java/ucar/nc2/time/CalendarDateUnit.java
CalendarDateUnit.withCalendar
static public CalendarDateUnit withCalendar(Calendar calt, String udunitString) { if (calt == null) calt = Calendar.getDefault(); return new CalendarDateUnit(calt, udunitString); }
java
static public CalendarDateUnit withCalendar(Calendar calt, String udunitString) { if (calt == null) calt = Calendar.getDefault(); return new CalendarDateUnit(calt, udunitString); }
[ "static", "public", "CalendarDateUnit", "withCalendar", "(", "Calendar", "calt", ",", "String", "udunitString", ")", "{", "if", "(", "calt", "==", "null", ")", "calt", "=", "Calendar", ".", "getDefault", "(", ")", ";", "return", "new", "CalendarDateUnit", "(...
Create a CalendarDateUnit from a calendar and a udunit string = "unit since calendarDate" @param calt use this Calendar, or null for default calendar @param udunitString "unit since calendarDate" @return CalendarDateUnit @throws IllegalArgumentException if udunitString is not paresable
[ "Create", "a", "CalendarDateUnit", "from", "a", "calendar", "and", "a", "udunit", "string", "=", "unit", "since", "calendarDate" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/time/CalendarDateUnit.java#L77-L80
test
Creates a new instance of CalendarDateUnit with the specified calendar and UDT.
Of course, here is the Java code you requested: ```java static public CalendarDateUnit withCalendar(Calendar calt, String udunitString) { if (calt == null) calt = Calendar.getDefault(); return new CalendarDateUnit(calt, udunitString); } ``` Hope this helps!
jboss/jboss-common-core
src/main/java/org/jboss/util/xml/catalog/Catalog.java
Catalog.normalizeURI
protected String normalizeURI(String uriref) { String newRef = ""; byte[] bytes; if (uriref == null) { return null; } try { bytes = uriref.getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { // this can't happen catalogManager.debug.message(1, "UTF-8 is an u...
java
protected String normalizeURI(String uriref) { String newRef = ""; byte[] bytes; if (uriref == null) { return null; } try { bytes = uriref.getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { // this can't happen catalogManager.debug.message(1, "UTF-8 is an u...
[ "protected", "String", "normalizeURI", "(", "String", "uriref", ")", "{", "String", "newRef", "=", "\"\"", ";", "byte", "[", "]", "bytes", ";", "if", "(", "uriref", "==", "null", ")", "{", "return", "null", ";", "}", "try", "{", "bytes", "=", "uriref...
Perform character normalization on a URI reference. @param uriref The URI reference @return The normalized URI reference.
[ "Perform", "character", "normalization", "on", "a", "URI", "reference", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Catalog.java#L2038-L2076
test
Normalize a URI.
Of course, here is the Java code you requested: ```java protected String normalizeURI(String uriref) { String newRef = ""; byte[] bytes; if (uriref == null) { return null; } try { bytes = uriref.getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { // this can't ha...
phax/ph-genericode
src/main/java/com/helger/genericode/builder/GenericodeValidator.java
GenericodeValidator.gc04ColumnSet
@Nonnull public static GenericodeValidator <com.helger.genericode.v04.ColumnSetDocument> gc04ColumnSet () { return new GenericodeValidator<> (EGenericodeDocumentType.GC04_COLUMN_SET); }
java
@Nonnull public static GenericodeValidator <com.helger.genericode.v04.ColumnSetDocument> gc04ColumnSet () { return new GenericodeValidator<> (EGenericodeDocumentType.GC04_COLUMN_SET); }
[ "@", "Nonnull", "public", "static", "GenericodeValidator", "<", "com", ".", "helger", ".", "genericode", ".", "v04", ".", "ColumnSetDocument", ">", "gc04ColumnSet", "(", ")", "{", "return", "new", "GenericodeValidator", "<>", "(", "EGenericodeDocumentType", ".", ...
Create a validator builder for com.helger.genericode.v04.ColumnSetDocument. @return The builder and never <code>null</code>
[ "Create", "a", "validator", "builder", "for", "com", ".", "helger", ".", "genericode", ".", "v04", ".", "ColumnSetDocument", "." ]
76ef5bb0744af42bd3decd41c2bf0829c87ae71d
https://github.com/phax/ph-genericode/blob/76ef5bb0744af42bd3decd41c2bf0829c87ae71d/src/main/java/com/helger/genericode/builder/GenericodeValidator.java#L67-L71
test
Create a new validation for the CGC04 column set.
Of course, here is the Java code you requested: ```java @Nonnull public static GenericodeValidator <com.helger.genericode.v04.ColumnSetDocument> gc04ColumnSet () { return new GenericodeValidator<> (EGenericodeDocumentType.GC04_COLUMN_SET); } ``` Hope this helps!
spring-projects/spring-security
ldap/src/main/java/org/springframework/security/ldap/userdetails/LdapUserDetailsMapper.java
LdapUserDetailsMapper.mapPassword
protected String mapPassword(Object passwordValue) { if (!(passwordValue instanceof String)) { // Assume it's binary passwordValue = new String((byte[]) passwordValue); } return (String) passwordValue; }
java
protected String mapPassword(Object passwordValue) { if (!(passwordValue instanceof String)) { // Assume it's binary passwordValue = new String((byte[]) passwordValue); } return (String) passwordValue; }
[ "protected", "String", "mapPassword", "(", "Object", "passwordValue", ")", "{", "if", "(", "!", "(", "passwordValue", "instanceof", "String", ")", ")", "{", "// Assume it's binary", "passwordValue", "=", "new", "String", "(", "(", "byte", "[", "]", ")", "pas...
Extension point to allow customized creation of the user's password from the attribute stored in the directory. @param passwordValue the value of the password attribute @return a String representation of the password.
[ "Extension", "point", "to", "allow", "customized", "creation", "of", "the", "user", "s", "password", "from", "the", "attribute", "stored", "in", "the", "directory", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/ldap/src/main/java/org/springframework/security/ldap/userdetails/LdapUserDetailsMapper.java#L125-L134
test
Map a password value to a String.
Of course, here is the Java code you requested: ```java protected String mapPassword(Object passwordValue) { if (!(passwordValue instanceof String)) { // Assume it's binary passwordValue = new String((byte[]) passwordValue); } return (String) passwordValue; } ``` Hope this helps!
Unidata/thredds
ldm/src/main/thredds/ldm/LuceneIndexer.java
LuceneIndexer.makeDocument
public Document makeDocument(File f) throws java.io.FileNotFoundException { // make a new, empty document Document doc = new Document(); // Add the path of the file as a field named "path". Use a field that is // indexed (i.e. searchable), but don't tokenize the field into words. doc.add(new Fie...
java
public Document makeDocument(File f) throws java.io.FileNotFoundException { // make a new, empty document Document doc = new Document(); // Add the path of the file as a field named "path". Use a field that is // indexed (i.e. searchable), but don't tokenize the field into words. doc.add(new Fie...
[ "public", "Document", "makeDocument", "(", "File", "f", ")", "throws", "java", ".", "io", ".", "FileNotFoundException", "{", "// make a new, empty document", "Document", "doc", "=", "new", "Document", "(", ")", ";", "// Add the path of the file as a field named \"path\"...
Makes a document for a File. <p/> The document has three fields: <ul> <li><code>path</code>--containing the pathname of the file, as a stored, untokenized field; <li><code>modified</code>--containing the last modified date of the file as a field as created by <a href="lucene.document.DateTools.html">DateTools</a>; and ...
[ "Makes", "a", "document", "for", "a", "File", ".", "<p", "/", ">", "The", "document", "has", "three", "fields", ":", "<ul", ">", "<li", ">", "<code", ">", "path<", "/", "code", ">", "--", "containing", "the", "pathname", "of", "the", "file", "as", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ldm/src/main/thredds/ldm/LuceneIndexer.java#L44-L68
test
Create a Document from a File.
Of course, here is the Java code you requested: ```java public Document makeDocument(File f) throws java.io.FileNotFoundException { // make a new, empty document Document doc = new Document(); // Add the path of the file as a field named "path". Use a field that is // indexed (i.e. searchable), but...
jcodec/jcodec
src/main/java/org/jcodec/containers/mp4/QTTimeUtil.java
QTTimeUtil.getEditedDuration
public static long getEditedDuration(TrakBox track) { List<Edit> edits = track.getEdits(); if (edits == null) return track.getDuration(); long duration = 0; for (Edit edit : edits) { duration += edit.getDuration(); } return duration; }
java
public static long getEditedDuration(TrakBox track) { List<Edit> edits = track.getEdits(); if (edits == null) return track.getDuration(); long duration = 0; for (Edit edit : edits) { duration += edit.getDuration(); } return duration; }
[ "public", "static", "long", "getEditedDuration", "(", "TrakBox", "track", ")", "{", "List", "<", "Edit", ">", "edits", "=", "track", ".", "getEdits", "(", ")", ";", "if", "(", "edits", "==", "null", ")", "return", "track", ".", "getDuration", "(", ")",...
Calculates track duration considering edits @param track @return
[ "Calculates", "track", "duration", "considering", "edits" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/containers/mp4/QTTimeUtil.java#L33-L43
test
Get the duration of the edit in the trakbox
Of course, here is the Java code you requested: ```java public static long getEditedDuration(TrakBox track) { List<Edit> edits = track.getEdits(); if (edits == null) return track.getDuration(); long duration = 0; for (Edit edit : edits) { duration += edit.getDur...
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/WazTyp.java
WazTyp.setMonatsmiete
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setMonatsmiete(WazTyp.Monatsmiete value) { this.monatsmiete = value; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setMonatsmiete(WazTyp.Monatsmiete value) { this.monatsmiete = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:52:47+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setMonatsmiete", "(", "WazTyp", ".", "Monatsmiete", "value", ")", "{", "this"...
Sets the value of the monatsmiete property. @param value allowed object is {@link WazTyp.Monatsmiete }
[ "Sets", "the", "value", "of", "the", "monatsmiete", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/WazTyp.java#L267-L270
test
Sets the value of the monatsmiete property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setMonatsmiete(WazTyp.Monatsmiete value) { this.monatsmiete = value; } ``` Hope this helps!
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/client/WebSocketClient.java
WebSocketClient.connectBlocking
public boolean connectBlocking(long timeout, TimeUnit timeUnit) throws InterruptedException { connect(); return connectLatch.await(timeout, timeUnit) && engine.isOpen(); }
java
public boolean connectBlocking(long timeout, TimeUnit timeUnit) throws InterruptedException { connect(); return connectLatch.await(timeout, timeUnit) && engine.isOpen(); }
[ "public", "boolean", "connectBlocking", "(", "long", "timeout", ",", "TimeUnit", "timeUnit", ")", "throws", "InterruptedException", "{", "connect", "(", ")", ";", "return", "connectLatch", ".", "await", "(", "timeout", ",", "timeUnit", ")", "&&", "engine", "."...
Same as <code>connect</code> but blocks with a timeout until the websocket connected or failed to do so.<br> @param timeout The connect timeout @param timeUnit The timeout time unit @return Returns whether it succeeded or not. @throws InterruptedException Thrown when the threads get interrupted
[ "Same", "as", "<code", ">", "connect<", "/", "code", ">", "but", "blocks", "with", "a", "timeout", "until", "the", "websocket", "connected", "or", "failed", "to", "do", "so", ".", "<br", ">" ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/client/WebSocketClient.java#L354-L357
test
Connect blocking.
Of course, here is the Java code you requested: ```java public boolean connectBlocking(long timeout, TimeUnit timeUnit) throws InterruptedException { connect(); return connectLatch.await(timeout, timeUnit) && engine.isOpen(); } ``` Hope this helps!
stanfy/enroscar
net/src/main/java/com/stanfy/enroscar/rest/request/net/multipart/Part.java
Part.sendParts
public static void sendParts(final OutputStream out, final Part[] parts, final byte[] partBoundary) throws IOException { if (parts == null) { throw new IllegalArgumentException("Parts may not be null"); } if (partBoundary == null || partBoundary.length == 0) { throw new IllegalArgumentExcepti...
java
public static void sendParts(final OutputStream out, final Part[] parts, final byte[] partBoundary) throws IOException { if (parts == null) { throw new IllegalArgumentException("Parts may not be null"); } if (partBoundary == null || partBoundary.length == 0) { throw new IllegalArgumentExcepti...
[ "public", "static", "void", "sendParts", "(", "final", "OutputStream", "out", ",", "final", "Part", "[", "]", "parts", ",", "final", "byte", "[", "]", "partBoundary", ")", "throws", "IOException", "{", "if", "(", "parts", "==", "null", ")", "{", "throw",...
Write all parts and the last boundary to the specified output stream. @param out The stream to write to. @param parts The parts to write. @param partBoundary The ASCII bytes to use as the part boundary. @throws IOException If an I/O error occurs while writing the parts. @since 3.0
[ "Write", "all", "parts", "and", "the", "last", "boundary", "to", "the", "specified", "output", "stream", "." ]
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/net/src/main/java/com/stanfy/enroscar/rest/request/net/multipart/Part.java#L303-L321
test
Send the parts to the output stream.
Of course, here is the Java code you requested: ```java public static void sendParts(final OutputStream out, final Part[] parts, final byte[] partBoundary) throws IOException { if (parts == null) { throw new IllegalArgumentException("Parts may not be null"); } if (partBoundary == null || partBound...
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java
DSLTree.getChildren
public Node[] getChildren(String obj, String text) { Node thenode = this.rootCond.getChild(obj); if (thenode == null) { for (Node child: this.rootCond.getChildren()) { String tokenText = child.getToken(); if (tokenText != null) { int index ...
java
public Node[] getChildren(String obj, String text) { Node thenode = this.rootCond.getChild(obj); if (thenode == null) { for (Node child: this.rootCond.getChildren()) { String tokenText = child.getToken(); if (tokenText != null) { int index ...
[ "public", "Node", "[", "]", "getChildren", "(", "String", "obj", ",", "String", "text", ")", "{", "Node", "thenode", "=", "this", ".", "rootCond", ".", "getChild", "(", "obj", ")", ";", "if", "(", "thenode", "==", "null", ")", "{", "for", "(", "Nod...
the method expects the caller to pass the object @param obj @param text @return
[ "the", "method", "expects", "the", "caller", "to", "pass", "the", "object" ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java#L327-L367
test
Gets the children of the specified object.
Of course, here is the Java code you requested: ```java public Node[] getChildren(String obj, String text) { Node thenode = this.rootCond.getChild(obj); if (thenode == null) { for (Node child: this.rootCond.getChildren()) { String tokenText = child.getToken(); ...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java
StringUtils.removeChars
public static String removeChars(String s, String chars) { int i = s.length(); StringBuilder sb = new StringBuilder(i); for (int j = 0; j < i; j++) { char c = s.charAt(j); if (chars.indexOf(c) == -1) { sb.append(c); } } return s...
java
public static String removeChars(String s, String chars) { int i = s.length(); StringBuilder sb = new StringBuilder(i); for (int j = 0; j < i; j++) { char c = s.charAt(j); if (chars.indexOf(c) == -1) { sb.append(c); } } return s...
[ "public", "static", "String", "removeChars", "(", "String", "s", ",", "String", "chars", ")", "{", "int", "i", "=", "s", ".", "length", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "i", ")", ";", "for", "(", "int", "j", "...
Removes all characters contained in provided string. @param s source string @param chars string containing characters to remove
[ "Removes", "all", "characters", "contained", "in", "provided", "string", "." ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java#L1994-L2004
test
Removes chars from a String.
Of course, here is the Java code you requested: ```java public static String removeChars(String s, String chars) { int i = s.length(); StringBuilder sb = new StringBuilder(i); for (int j = 0; j < i; j++) { char c = s.charAt(j); if (chars.indexOf(c) == -1) { ...
Unidata/thredds
opendap/src/main/java/opendap/dap/BaseTypePrimitiveVector.java
BaseTypePrimitiveVector.externalize
public void externalize(DataOutputStream sink) throws IOException { for (int i = 0; i < vals.length; i++) { // LogStream.out.println("\t\t\tI AM THE WALRUS!"); ((ClientIO) vals[i]).externalize(sink); } }
java
public void externalize(DataOutputStream sink) throws IOException { for (int i = 0; i < vals.length; i++) { // LogStream.out.println("\t\t\tI AM THE WALRUS!"); ((ClientIO) vals[i]).externalize(sink); } }
[ "public", "void", "externalize", "(", "DataOutputStream", "sink", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vals", ".", "length", ";", "i", "++", ")", "{", "// LogStream.out.println(\"\\t\\t\\tI AM THE WALRUS!\");\r", ...
Writes data to a <code>DataOutputStream</code>. This method is used primarily by GUI clients which need to download OPeNDAP data, manipulate it, and then re-save it as a binary file. @param sink a <code>DataOutputStream</code> to write to. @throws IOException thrown on any <code>OutputStream</code> exception.
[ "Writes", "data", "to", "a", "<code", ">", "DataOutputStream<", "/", "code", ">", ".", "This", "method", "is", "used", "primarily", "by", "GUI", "clients", "which", "need", "to", "download", "OPeNDAP", "data", "manipulate", "it", "and", "then", "re", "-", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/BaseTypePrimitiveVector.java#L201-L206
test
Externalize the data in this object to a DataOutputStream.
Of course, here is the Java code you requested: ```java public void externalize(DataOutputStream sink) throws IOException { for (int i = 0; i < vals.length; i++) { // LogStream.out.println("\t\t\tI AM THE WALRUS!"); ((ClientIO) vals[i]).externalize(sink); } } ``` Hope ...
RestComm/jain-slee
container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitRepositoryImpl.java
DeployableUnitRepositoryImpl.getComponentByID
public ResourceAdaptorComponent getComponentByID(ResourceAdaptorID id) { // get from repository ResourceAdaptorComponent component = componentRepository.getComponentByID(id); if (component == null) { // not found in repository, get it from deployable unit component = deployableUnit.getResourceAdaptorCompone...
java
public ResourceAdaptorComponent getComponentByID(ResourceAdaptorID id) { // get from repository ResourceAdaptorComponent component = componentRepository.getComponentByID(id); if (component == null) { // not found in repository, get it from deployable unit component = deployableUnit.getResourceAdaptorCompone...
[ "public", "ResourceAdaptorComponent", "getComponentByID", "(", "ResourceAdaptorID", "id", ")", "{", "// get from repository", "ResourceAdaptorComponent", "component", "=", "componentRepository", ".", "getComponentByID", "(", "id", ")", ";", "if", "(", "component", "==", ...
/* (non-Javadoc) @see org.mobicents.slee.core.component.ComponentRepository#getComponentByID(javax.slee.resource.ResourceAdaptorID)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitRepositoryImpl.java#L117-L125
test
Get the resource adaptor component by ID.
Of course, here is the Java code you requested: ```java public ResourceAdaptorComponent getComponentByID(ResourceAdaptorID id) { // get from repository ResourceAdaptorComponent component = componentRepository.getComponentByID(id); if (component == null) { // not found in repository, get it from deployable uni...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/KeyMetadata.java
KeyMetadata.getParentRaw
private com.google.cloud.datastore.Key getParentRaw(P pojo) { if (parentMeta == null) return null; final Value<Object> value = parentMeta.getValue(pojo, new SaveContext(), Path.root()); return (value == null || value.getType() == ValueType.NULL) ? null : (com.google.cloud.datastore.Key)value.get(); }
java
private com.google.cloud.datastore.Key getParentRaw(P pojo) { if (parentMeta == null) return null; final Value<Object> value = parentMeta.getValue(pojo, new SaveContext(), Path.root()); return (value == null || value.getType() == ValueType.NULL) ? null : (com.google.cloud.datastore.Key)value.get(); }
[ "private", "com", ".", "google", ".", "cloud", ".", "datastore", ".", "Key", "getParentRaw", "(", "P", "pojo", ")", "{", "if", "(", "parentMeta", "==", "null", ")", "return", "null", ";", "final", "Value", "<", "Object", ">", "value", "=", "parentMeta"...
Get the contents of the @Parent field as a datastore key. @return null if there was no @Parent field, or the field is null.
[ "Get", "the", "contents", "of", "the" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/KeyMetadata.java#L265-L273
test
Gets the raw key of the parent.
Of course, here is the Java code you requested: ```java private com.google.cloud.datastore.Key getParentRaw(P pojo) { if (parentMeta == null) return null; final Value<Object> value = parentMeta.getValue(pojo, new SaveContext(), Path.root()); return (value == null || value.getType() == ValueType.NULL) ? n...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createDenkmalgeschuetzt
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "denkmalgeschuetzt") public JAXBElement<Boolean> createDenkmalgeschuetzt(Boolean value) { return new JAXBElement<Boolean>(_Denkmalgeschuetzt_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "denkmalgeschuetzt") public JAXBElement<Boolean> createDenkmalgeschuetzt(Boolean value) { return new JAXBElement<Boolean>(_Denkmalgeschuetzt_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"denkmalgeschuetzt\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createDenkmalgeschuetzt", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<"...
Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Boolean", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L2308-L2311
test
Create an instance of a Denkmalgeschuetzt element.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "denkmalgeschuetzt") public JAXBElement<Boolean> createDenkmalgeschuetzt(Boolean value) { return new JAXBElement<Boolean>(_Denkmalgeschuetzt_QNAME, Boolean.class, null, value); } ``` Hop...
rest-assured/rest-assured
modules/json-schema-validator/src/main/java/io/restassured/module/jsv/JsonSchemaValidator.java
JsonSchemaValidator.matchesJsonSchema
public static JsonSchemaValidator matchesJsonSchema(String schema) { return new JsonSchemaValidatorFactory<String>() { @Override JsonNode createSchemaInstance(String input) throws IOException { return JsonLoader.fromString(input); } }.create(schema); ...
java
public static JsonSchemaValidator matchesJsonSchema(String schema) { return new JsonSchemaValidatorFactory<String>() { @Override JsonNode createSchemaInstance(String input) throws IOException { return JsonLoader.fromString(input); } }.create(schema); ...
[ "public", "static", "JsonSchemaValidator", "matchesJsonSchema", "(", "String", "schema", ")", "{", "return", "new", "JsonSchemaValidatorFactory", "<", "String", ">", "(", ")", "{", "@", "Override", "JsonNode", "createSchemaInstance", "(", "String", "input", ")", "...
Creates a Hamcrest matcher that validates that a JSON document conforms to the JSON schema provided to this method. @param schema The string defining the JSON schema @return A Hamcrest matcher
[ "Creates", "a", "Hamcrest", "matcher", "that", "validates", "that", "a", "JSON", "document", "conforms", "to", "the", "JSON", "schema", "provided", "to", "this", "method", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/modules/json-schema-validator/src/main/java/io/restassured/module/jsv/JsonSchemaValidator.java#L101-L108
test
Creates a JsonSchemaValidator that matches the given schema.
Of course, here is the Java code you requested: ```java public static JsonSchemaValidator matchesJsonSchema(String schema) { return new JsonSchemaValidatorFactory<String>() { @Override JsonNode createSchemaInstance(String input) throws IOException { return JsonLoader.fro...
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/places/PlacesQuery.java
PlacesQuery.set
@Override public @NonNull PlacesQuery set(@NonNull String name, @Nullable Object value) { return (PlacesQuery) super.set(name, value); }
java
@Override public @NonNull PlacesQuery set(@NonNull String name, @Nullable Object value) { return (PlacesQuery) super.set(name, value); }
[ "@", "Override", "public", "@", "NonNull", "PlacesQuery", "set", "(", "@", "NonNull", "String", "name", ",", "@", "Nullable", "Object", "value", ")", "{", "return", "(", "PlacesQuery", ")", "super", ".", "set", "(", "name", ",", "value", ")", ";", "}" ...
Set a parameter in an untyped fashion. This low-level accessor is intended to access parameters that this client does not yet support. @param name The parameter's name. @param value The parameter's value, or null to remove it. It will first be converted to a String by the `toString()` method. @return This instance (u...
[ "Set", "a", "parameter", "in", "an", "untyped", "fashion", ".", "This", "low", "-", "level", "accessor", "is", "intended", "to", "access", "parameters", "that", "this", "client", "does", "not", "yet", "support", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/places/PlacesQuery.java#L335-L339
test
Override to set a CRS specification.
Of course, here is the Java code you requested: ```java @Override public @NonNull PlacesQuery set(@NonNull String name, @Nullable Object value) { return (PlacesQuery) super.set(name, value); } ``` Hope this helps!
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/SourceClausePrinter.java
SourceClausePrinter.leaveFunctor
protected void leaveFunctor(Functor functor) { String toAppend = indent; boolean addData = false; if (functor.isCompound()) { toAppend += ")"; addData = true; } if (!traverser.isInHead() && !traverser.isLastBodyFunctor() && traverser.isTopLev...
java
protected void leaveFunctor(Functor functor) { String toAppend = indent; boolean addData = false; if (functor.isCompound()) { toAppend += ")"; addData = true; } if (!traverser.isInHead() && !traverser.isLastBodyFunctor() && traverser.isTopLev...
[ "protected", "void", "leaveFunctor", "(", "Functor", "functor", ")", "{", "String", "toAppend", "=", "indent", ";", "boolean", "addData", "=", "false", ";", "if", "(", "functor", ".", "isCompound", "(", ")", ")", "{", "toAppend", "+=", "\")\"", ";", "add...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/SourceClausePrinter.java#L68-L98
test
Leave a functor.
Of course, here is the Java code you requested: ```java protected void leaveFunctor(Functor functor) { String toAppend = indent; boolean addData = false; if (functor.isCompound()) { toAppend += ")"; addData = true; } if (!traverser.isInHead(...
LukeDeighton/WheelView
WheelViewSample/src/main/java/com/lukedeighton/wheelsample/MainActivity.java
MainActivity.getContrastColor
private int getContrastColor(Map.Entry<String, Integer> entry) { String colorName = MaterialColor.getColorName(entry); return MaterialColor.getContrastColor(colorName); }
java
private int getContrastColor(Map.Entry<String, Integer> entry) { String colorName = MaterialColor.getColorName(entry); return MaterialColor.getContrastColor(colorName); }
[ "private", "int", "getContrastColor", "(", "Map", ".", "Entry", "<", "String", ",", "Integer", ">", "entry", ")", "{", "String", "colorName", "=", "MaterialColor", ".", "getColorName", "(", "entry", ")", ";", "return", "MaterialColor", ".", "getContrastColor",...
get the materials darker contrast
[ "get", "the", "materials", "darker", "contrast" ]
0949e04df02f7ad43e1c0384542fa4c9bebe5161
https://github.com/LukeDeighton/WheelView/blob/0949e04df02f7ad43e1c0384542fa4c9bebe5161/WheelViewSample/src/main/java/com/lukedeighton/wheelsample/MainActivity.java#L73-L76
test
Get contrast color from map entry.
Of course, here is the Java code you requested: ```java private int getContrastColor(Map.Entry<String, Integer> entry) { String colorName = MaterialColor.getColorName(entry); return MaterialColor.getContrastColor(colorName); } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/net/MediaType.java
MediaType.parse
public static MediaType parse(String input) { Parameters.checkNotNull(input); Matcher m = MEDIA_TYPE_PATTERN.matcher(input); Parameters.checkCondition(m.matches()); String type = m.group(1); String subtype = m.group(2); String params = m.group(3); ParametersParser parser = new ParametersParser(); retur...
java
public static MediaType parse(String input) { Parameters.checkNotNull(input); Matcher m = MEDIA_TYPE_PATTERN.matcher(input); Parameters.checkCondition(m.matches()); String type = m.group(1); String subtype = m.group(2); String params = m.group(3); ParametersParser parser = new ParametersParser(); retur...
[ "public", "static", "MediaType", "parse", "(", "String", "input", ")", "{", "Parameters", ".", "checkNotNull", "(", "input", ")", ";", "Matcher", "m", "=", "MEDIA_TYPE_PATTERN", ".", "matcher", "(", "input", ")", ";", "Parameters", ".", "checkCondition", "("...
Parses a {@code MediaType} from its {@code String} representation. @param input the input {@code String} to be parsed. @return the parsed {@code MediaType} instance. @throws NullPointerException if {@code input} is {@code null}. @throws IllegalArgumentException if {@code input} can't be parsed or if a wildcard is us...
[ "Parses", "a", "{", "@code", "MediaType", "}", "from", "its", "{", "@code", "String", "}", "representation", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/net/MediaType.java#L135-L145
test
Parses the given input string and returns a MediaType object.
Of course, here is the Java code you requested: ```java public static MediaType parse(String input) { Parameters.checkNotNull(input); Matcher m = MEDIA_TYPE_PATTERN.matcher(input); Parameters.checkCondition(m.matches()); String type = m.group(1); String subtype = m.group(2); String params = m.group(3); ...
rupertlssmith/lojix
lojix/interpreter/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionInterpreter.java
ResolutionInterpreter.evaluateQuery
private void evaluateQuery() { /*log.fine("Read query from input.");*/ // Create an iterator to generate all solutions on demand with. Iteration will stop if the request to // the parser for the more ';' token fails. Iterator<Set<Variable>> i = engine.iterator(); if (!i.has...
java
private void evaluateQuery() { /*log.fine("Read query from input.");*/ // Create an iterator to generate all solutions on demand with. Iteration will stop if the request to // the parser for the more ';' token fails. Iterator<Set<Variable>> i = engine.iterator(); if (!i.has...
[ "private", "void", "evaluateQuery", "(", ")", "{", "/*log.fine(\"Read query from input.\");*/", "// Create an iterator to generate all solutions on demand with. Iteration will stop if the request to", "// the parser for the more ';' token fails.", "Iterator", "<", "Set", "<", "Variable", ...
Evaluates a query. In the case of queries, the interner is used to recover textual names for the resulting variable bindings. The user is queried through the parser to if more than one solution is required.
[ "Evaluates", "a", "query", ".", "In", "the", "case", "of", "queries", "the", "interner", "is", "used", "to", "recover", "textual", "names", "for", "the", "resulting", "variable", "bindings", ".", "The", "user", "is", "queried", "through", "the", "parser", ...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/interpreter/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionInterpreter.java#L397-L466
test
Evaluate the query.
Of course, here is the Java code you requested: ```java private void evaluateQuery() { /*log.fine("Read query from input.");*/ // Create an iterator to generate all solutions on demand with. Iteration will stop if the request to // the parser for the more ';' token fails. Iterator<...
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/sqlgen/TemplateParser.java
TemplateParser.parse
public void parse(final DbSqlBuilder sqlBuilder, final String template) { int length = template.length(); int last = 0; while (true) { int mark = template.indexOf('$', last); if (mark == -1) { if (last < length) { sqlBuilder.appendRaw(template.substring(last)); } break; } int escapes...
java
public void parse(final DbSqlBuilder sqlBuilder, final String template) { int length = template.length(); int last = 0; while (true) { int mark = template.indexOf('$', last); if (mark == -1) { if (last < length) { sqlBuilder.appendRaw(template.substring(last)); } break; } int escapes...
[ "public", "void", "parse", "(", "final", "DbSqlBuilder", "sqlBuilder", ",", "final", "String", "template", ")", "{", "int", "length", "=", "template", ".", "length", "(", ")", ";", "int", "last", "=", "0", ";", "while", "(", "true", ")", "{", "int", ...
Parses template and returns generated sql builder.
[ "Parses", "template", "and", "returns", "generated", "sql", "builder", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/sqlgen/TemplateParser.java#L50-L108
test
Parses the given template.
Of course, here is the Java code you requested: ```java public void parse(final DbSqlBuilder sqlBuilder, final String template) { int length = template.length(); int last = 0; while (true) { int mark = template.indexOf('$', last); if (mark == -1) { if (last < length) { sqlBuilder.appendRaw(templat...
Unidata/thredds
cdm/src/main/java/ucar/nc2/geotiff/GeotiffWriter.java
GeotiffWriter.writeGrid
public void writeGrid(GeoReferencedArray array, boolean greyScale) throws IOException { CoverageCoordSys gcs = array.getCoordSysForData(); if (!gcs.isRegularSpatial()) throw new IllegalArgumentException("Must have 1D x and y axes for " + array.getCoverageName()); Projection proj = gcs.getProjection(...
java
public void writeGrid(GeoReferencedArray array, boolean greyScale) throws IOException { CoverageCoordSys gcs = array.getCoordSysForData(); if (!gcs.isRegularSpatial()) throw new IllegalArgumentException("Must have 1D x and y axes for " + array.getCoverageName()); Projection proj = gcs.getProjection(...
[ "public", "void", "writeGrid", "(", "GeoReferencedArray", "array", ",", "boolean", "greyScale", ")", "throws", "IOException", "{", "CoverageCoordSys", "gcs", "=", "array", ".", "getCoordSysForData", "(", ")", ";", "if", "(", "!", "gcs", ".", "isRegularSpatial", ...
Write GridCoverage data to the geotiff file. @param array GeoReferencedArray array in YX order @param greyScale if true, write greyScale image, else dataSample. @throws IOException on i/o error
[ "Write", "GridCoverage", "data", "to", "the", "geotiff", "file", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/geotiff/GeotiffWriter.java#L541-L595
test
Write a grid of data to the output stream.
Of course, here is the Java code you requested: ```java public void writeGrid(GeoReferencedArray array, boolean greyScale) throws IOException { CoverageCoordSys gcs = array.getCoordSysForData(); if (!gcs.isRegularSpatial()) throw new IllegalArgumentException("Must have 1D x and y axes for " + array.getC...
DDTH/ddth-cql-utils
src/main/java/com/github/ddth/cql/SessionManager.java
SessionManager.executeOneAsync
public void executeOneAsync(FutureCallback<Row> callback, Statement stm) throws ExceedMaxAsyncJobsException { executeOneAsync(callback, stm, null); }
java
public void executeOneAsync(FutureCallback<Row> callback, Statement stm) throws ExceedMaxAsyncJobsException { executeOneAsync(callback, stm, null); }
[ "public", "void", "executeOneAsync", "(", "FutureCallback", "<", "Row", ">", "callback", ",", "Statement", "stm", ")", "throws", "ExceedMaxAsyncJobsException", "{", "executeOneAsync", "(", "callback", ",", "stm", ",", "null", ")", ";", "}" ]
Async-execute a query. <p> The default session (obtained via {@link #getSession()} is used to execute the query. </p> @param callback {@link ExceedMaxAsyncJobsException} will be passed to {@link FutureCallback#onFailure(Throwable)} if number of async-jobs exceeds {@link #getMaxAsyncJobs()}. @param stm @throws ExceedM...
[ "Async", "-", "execute", "a", "query", "." ]
debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489
https://github.com/DDTH/ddth-cql-utils/blob/debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489/src/main/java/com/github/ddth/cql/SessionManager.java#L2507-L2510
test
Execute one async job.
Of course, here is the Java code you requested: ```java public void executeOneAsync(FutureCallback<Row> callback, Statement stm) throws ExceedMaxAsyncJobsException { executeOneAsync(callback, stm, null); } ``` Hope this helps!
tiefaces/TieFaces
src/org/tiefaces/components/websheet/configuration/FormCommand.java
FormCommand.addToWatchList
private void addToWatchList(final int addRow, final int lastStaticRow, final List<Integer> watchList) { if ((addRow > lastStaticRow) && !(watchList.contains(addRow))) { watchList.add(addRow); } }
java
private void addToWatchList(final int addRow, final int lastStaticRow, final List<Integer> watchList) { if ((addRow > lastStaticRow) && !(watchList.contains(addRow))) { watchList.add(addRow); } }
[ "private", "void", "addToWatchList", "(", "final", "int", "addRow", ",", "final", "int", "lastStaticRow", ",", "final", "List", "<", "Integer", ">", "watchList", ")", "{", "if", "(", "(", "addRow", ">", "lastStaticRow", ")", "&&", "!", "(", "watchList", ...
Only rows in dynamic area will be added to watch list. @param addRow row want to add. @param lastStaticRow last static row. @param watchList watch list.
[ "Only", "rows", "in", "dynamic", "area", "will", "be", "added", "to", "watch", "list", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/configuration/FormCommand.java#L340-L345
test
Adds a row to the watch list.
Of course, here is the Java code you requested: ```java private void addToWatchList(final int addRow, final int lastStaticRow, final List<Integer> watchList) { if ((addRow > lastStaticRow) && !(watchList.contains(addRow))) { watchList.add(addRow); } } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormContainerClient.java
FormContainerClient.executeCustomWebAction
public Form executeCustomWebAction( String customWebActionParam, boolean isTableRecordParam, Long formContainerTableRecordBelowsToParam, Form formParam) { if(formParam != null && this.serviceTicket != null) { formParam.setServiceTicket(this.se...
java
public Form executeCustomWebAction( String customWebActionParam, boolean isTableRecordParam, Long formContainerTableRecordBelowsToParam, Form formParam) { if(formParam != null && this.serviceTicket != null) { formParam.setServiceTicket(this.se...
[ "public", "Form", "executeCustomWebAction", "(", "String", "customWebActionParam", ",", "boolean", "isTableRecordParam", ",", "Long", "formContainerTableRecordBelowsToParam", ",", "Form", "formParam", ")", "{", "if", "(", "formParam", "!=", "null", "&&", "this", ".", ...
Execute the Custom Program with action alias {@code customWebActionParam}. This method may be used for Form and Table Records. @param customWebActionParam The custom web action name. Action identifier. @param isTableRecordParam Is the form a table record form. @param formContainerTableRecordBelowsToParam The parent fo...
[ "Execute", "the", "Custom", "Program", "with", "action", "alias", "{", "@code", "customWebActionParam", "}", ".", "This", "method", "may", "be", "used", "for", "Form", "and", "Table", "Records", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormContainerClient.java#L157-L183
test
Execute a custom web action.
Of course, here is the Java code you requested: ```java public Form executeCustomWebAction( String customWebActionParam, boolean isTableRecordParam, Long formContainerTableRecordBelowsToParam, Form formParam) { if(formParam != null && this.serviceTicket ...
ReactiveX/RxJava
src/main/java/io/reactivex/Notification.java
Notification.getError
@Nullable public Throwable getError() { Object o = value; if (NotificationLite.isError(o)) { return NotificationLite.getError(o); } return null; }
java
@Nullable public Throwable getError() { Object o = value; if (NotificationLite.isError(o)) { return NotificationLite.getError(o); } return null; }
[ "@", "Nullable", "public", "Throwable", "getError", "(", ")", "{", "Object", "o", "=", "value", ";", "if", "(", "NotificationLite", ".", "isError", "(", "o", ")", ")", "{", "return", "NotificationLite", ".", "getError", "(", "o", ")", ";", "}", "return...
Returns the container Throwable error if this notification is an onError signal, null otherwise. @return the Throwable error contained or null @see #isOnError()
[ "Returns", "the", "container", "Throwable", "error", "if", "this", "notification", "is", "an", "onError", "signal", "null", "otherwise", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Notification.java#L85-L92
test
Gets the error.
Of course, here is the Java code you requested: ```java @Nullable public Throwable getError() { Object o = value; if (NotificationLite.isError(o)) { return NotificationLite.getError(o); } return null; } ``` Hope this helps!
liveontologies/elk-reasoner
elk-util-parent/elk-util-collections/src/main/java/org/semanticweb/elk/util/collections/Operations.java
Operations.map
public static <I, O> Set<O> map(final Set<? extends I> input, final FunctorEx<I, O> functor) { return new AbstractSet<O>() { @Override public Iterator<O> iterator() { return new MapIterator<I, O>(input.iterator(), functor); } @Override public boolean contains(Object o) { I element = functo...
java
public static <I, O> Set<O> map(final Set<? extends I> input, final FunctorEx<I, O> functor) { return new AbstractSet<O>() { @Override public Iterator<O> iterator() { return new MapIterator<I, O>(input.iterator(), functor); } @Override public boolean contains(Object o) { I element = functo...
[ "public", "static", "<", "I", ",", "O", ">", "Set", "<", "O", ">", "map", "(", "final", "Set", "<", "?", "extends", "I", ">", "input", ",", "final", "FunctorEx", "<", "I", ",", "O", ">", "functor", ")", "{", "return", "new", "AbstractSet", "<", ...
A simple second-order map function for sets @param input @param functor @return a set which contains the results of applying the functor to the elements in the input set
[ "A", "simple", "second", "-", "order", "map", "function", "for", "sets" ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-util-parent/elk-util-collections/src/main/java/org/semanticweb/elk/util/collections/Operations.java#L781-L803
test
Returns a Set that contains all elements of the input set using the given Functor.
Of course, here is the Java code you requested: ```java public static <I, O> Set<O> map(final Set<? extends I> input, final FunctorEx<I, O> functor) { return new AbstractSet<O>() { @Override public Iterator<O> iterator() { return new MapIterator<I, O>(input.iterator(), functor); } @Override p...
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/vo/ABaseFluidElasticSearchJSONObject.java
ABaseFluidElasticSearchJSONObject.convertTo
@XmlTransient public List<Field> convertTo(List<SQLFormFieldUtil.FormFieldMapping> formFieldMappingsParam) { if(formFieldMappingsParam == null) { return null; } List<Field> returnVal = new ArrayList(); for(SQLFormFieldUtil.FormFieldMapping mappingToConvert :...
java
@XmlTransient public List<Field> convertTo(List<SQLFormFieldUtil.FormFieldMapping> formFieldMappingsParam) { if(formFieldMappingsParam == null) { return null; } List<Field> returnVal = new ArrayList(); for(SQLFormFieldUtil.FormFieldMapping mappingToConvert :...
[ "@", "XmlTransient", "public", "List", "<", "Field", ">", "convertTo", "(", "List", "<", "SQLFormFieldUtil", ".", "FormFieldMapping", ">", "formFieldMappingsParam", ")", "{", "if", "(", "formFieldMappingsParam", "==", "null", ")", "{", "return", "null", ";", "...
Convert the {@code SQLFormFieldUtil.FormFieldMapping} to {@code Field}. @param formFieldMappingsParam The {@code formFieldMappingsParam} to convert. @return The converted {@code Field}s.
[ "Convert", "the", "{", "@code", "SQLFormFieldUtil", ".", "FormFieldMapping", "}", "to", "{", "@code", "Field", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/ABaseFluidElasticSearchJSONObject.java#L106-L122
test
Converts the list of field mappings to a list of fields.
Of course, here is the Java code you requested: ```java @XmlTransient public List<Field> convertTo(List<SQLFormFieldUtil.FormFieldMapping> formFieldMappingsParam) { if(formFieldMappingsParam == null) { return null; } List<Field> returnVal = new ArrayList(); ...
GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
core/src/main/java/com/google/cloud/sql/core/CoreSocketFactory.java
CoreSocketFactory.getInstanceSslInfo
@VisibleForTesting synchronized InstanceSslInfo getInstanceSslInfo( String instanceConnectionString, CertificateCaching certificateCaching) { if (certificateCaching.equals(CertificateCaching.USE_CACHE)) { InstanceLookupResult lookupResult = cache.get(instanceConnectionString); if (lookupResult ...
java
@VisibleForTesting synchronized InstanceSslInfo getInstanceSslInfo( String instanceConnectionString, CertificateCaching certificateCaching) { if (certificateCaching.equals(CertificateCaching.USE_CACHE)) { InstanceLookupResult lookupResult = cache.get(instanceConnectionString); if (lookupResult ...
[ "@", "VisibleForTesting", "synchronized", "InstanceSslInfo", "getInstanceSslInfo", "(", "String", "instanceConnectionString", ",", "CertificateCaching", "certificateCaching", ")", "{", "if", "(", "certificateCaching", ".", "equals", "(", "CertificateCaching", ".", "USE_CACH...
TODO(berezv): synchronize per instance, instead of globally
[ "TODO", "(", "berezv", ")", ":", "synchronize", "per", "instance", "instead", "of", "globally" ]
f108b0d5c7332a86075d32b8a648fb1b98288852
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/f108b0d5c7332a86075d32b8a648fb1b98288852/core/src/main/java/com/google/cloud/sql/core/CoreSocketFactory.java#L315-L386
test
Get the InstanceSslInfo object from the cache.
Of course, here is the Java code you requested: ```java @VisibleForTesting synchronized InstanceSslInfo getInstanceSslInfo( String instanceConnectionString, CertificateCaching certificateCaching) { if (certificateCaching.equals(CertificateCaching.USE_CACHE)) { InstanceLookupResult lookupResult = cac...
robeio/robe
robe-admin/src/main/java/io/robe/admin/resources/TriggerResource.java
TriggerResource.create
@RobeService(group = "QuartzJob", description = "Create a HTriggerInfo resource.") @POST @UnitOfWork public HTriggerInfo create(@RobeAuth Credentials credentials, @Valid HTriggerInfo model) { //Save to the DB HJobInfo job = jobDao.findById(model.getJobOid()); if (job == null) { ...
java
@RobeService(group = "QuartzJob", description = "Create a HTriggerInfo resource.") @POST @UnitOfWork public HTriggerInfo create(@RobeAuth Credentials credentials, @Valid HTriggerInfo model) { //Save to the DB HJobInfo job = jobDao.findById(model.getJobOid()); if (job == null) { ...
[ "@", "RobeService", "(", "group", "=", "\"QuartzJob\"", ",", "description", "=", "\"Create a HTriggerInfo resource.\"", ")", "@", "POST", "@", "UnitOfWork", "public", "HTriggerInfo", "create", "(", "@", "RobeAuth", "Credentials", "credentials", ",", "@", "Valid", ...
Create a {@link HTriggerInfo} resource. @param credentials auto fill by @{@link RobeAuth} annotation for authentication. @param model This is the one model of {@link HTriggerInfo} @return create a {@link HTriggerInfo} resource.
[ "Create", "a", "{", "@link", "HTriggerInfo", "}", "resource", "." ]
a0a8c7cebd1f70f78cf24a66a002859e937badfe
https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-admin/src/main/java/io/robe/admin/resources/TriggerResource.java#L48-L62
test
Create a new HTriggerInfo resource.
Of course, here is the Java code you requested: ```java @RobeService(group = "QuartzJob", description = "Create a HTriggerInfo resource.") @POST @UnitOfWork public HTriggerInfo create(@RobeAuth Credentials credentials, @Valid HTriggerInfo model) { //Save to the DB HJobInfo job = jobDao.find...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/config/EncoderConfig.java
EncoderConfig.defaultCharsetForContentType
public EncoderConfig defaultCharsetForContentType(Charset charset, ContentType contentType) { notNull(charset, "Charset"); return defaultCharsetForContentType(charset.toString(), contentType); }
java
public EncoderConfig defaultCharsetForContentType(Charset charset, ContentType contentType) { notNull(charset, "Charset"); return defaultCharsetForContentType(charset.toString(), contentType); }
[ "public", "EncoderConfig", "defaultCharsetForContentType", "(", "Charset", "charset", ",", "ContentType", "contentType", ")", "{", "notNull", "(", "charset", ",", "\"Charset\"", ")", ";", "return", "defaultCharsetForContentType", "(", "charset", ".", "toString", "(", ...
Specify the default charset to use for the specific content-type if it's not specified in the content-type header explicitly @param charset The charset to use as default (unless specified explicitly) @param contentType The content-type @return A new instance of {@link EncoderConfig}
[ "Specify", "the", "default", "charset", "to", "use", "for", "the", "specific", "content", "-", "type", "if", "it", "s", "not", "specified", "in", "the", "content", "-", "type", "header", "explicitly" ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/config/EncoderConfig.java#L167-L170
test
Get the default encoder configuration for the charset for the given content type.
Of course, here is the Java code you requested: ```java public EncoderConfig defaultCharsetForContentType(Charset charset, ContentType contentType) { notNull(charset, "Charset"); return defaultCharsetForContentType(charset.toString(), contentType); } ``` Hope this helps!
amedia/meteo
meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java
ObjectFactory.createLocationTypePressure
@XmlElementDecl(namespace = "", name = "pressure", scope = LocationType.class) public JAXBElement<Pressure> createLocationTypePressure(Pressure value) { return new JAXBElement<Pressure>(_LocationTypePressure_QNAME, Pressure.class, LocationType.class, value); }
java
@XmlElementDecl(namespace = "", name = "pressure", scope = LocationType.class) public JAXBElement<Pressure> createLocationTypePressure(Pressure value) { return new JAXBElement<Pressure>(_LocationTypePressure_QNAME, Pressure.class, LocationType.class, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"pressure\"", ",", "scope", "=", "LocationType", ".", "class", ")", "public", "JAXBElement", "<", "Pressure", ">", "createLocationTypePressure", "(", "Pressure", "value", ")", "{", "retu...
Create an instance of {@link JAXBElement }{@code <}{@link Pressure }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Pressure", "}", "{", "@code", ">", "}}" ]
cbb59e1c2f889d15c24f3625d1769b543d4af595
https://github.com/amedia/meteo/blob/cbb59e1c2f889d15c24f3625d1769b543d4af595/meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java#L555-L558
test
Create an instance of the Pressure type in the LocationType.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "pressure", scope = LocationType.class) public JAXBElement<Pressure> createLocationTypePressure(Pressure value) { return new JAXBElement<Pressure>(_LocationTypePressure_QNAME, Pressure.class, LocationType.class, ...
rest-assured/rest-assured
xml-path/src/main/java/io/restassured/path/xml/config/XmlPathConfig.java
XmlPathConfig.defaultObjectDeserializer
public XmlPathConfig defaultObjectDeserializer(XmlPathObjectDeserializer defaultObjectDeserializer) { return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultObjectDeserializer, charset, features, declaredNamespaces, properties, validating, namespaceAware, allowDocTypeDeclara...
java
public XmlPathConfig defaultObjectDeserializer(XmlPathObjectDeserializer defaultObjectDeserializer) { return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultObjectDeserializer, charset, features, declaredNamespaces, properties, validating, namespaceAware, allowDocTypeDeclara...
[ "public", "XmlPathConfig", "defaultObjectDeserializer", "(", "XmlPathObjectDeserializer", "defaultObjectDeserializer", ")", "{", "return", "new", "XmlPathConfig", "(", "jaxbObjectMapperFactory", ",", "defaultParserType", ",", "defaultObjectDeserializer", ",", "charset", ",", ...
Creates an json path configuration that uses the specified object de-serializer as default. @param defaultObjectDeserializer The object de-serializer to use. If <code>null</code> then classpath scanning will be used.
[ "Creates", "an", "json", "path", "configuration", "that", "uses", "the", "specified", "object", "de", "-", "serializer", "as", "default", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/xml-path/src/main/java/io/restassured/path/xml/config/XmlPathConfig.java#L308-L311
test
Returns a new instance of this class with the default object deserializer.
Of course, here is the Java code you requested: ```java public XmlPathConfig defaultObjectDeserializer(XmlPathObjectDeserializer defaultObjectDeserializer) { return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultObjectDeserializer, charset, features, declaredNamespaces, pr...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
SameDiff.addOutgoingFor
public void addOutgoingFor(String[] varNames, DifferentialFunction function) { if (function.getOwnName() == null) throw new ND4JIllegalStateException("Instance id can not be null. Function not initialized properly"); if (outgoingArgsReverse.containsKey(function.getOwnName())) { ...
java
public void addOutgoingFor(String[] varNames, DifferentialFunction function) { if (function.getOwnName() == null) throw new ND4JIllegalStateException("Instance id can not be null. Function not initialized properly"); if (outgoingArgsReverse.containsKey(function.getOwnName())) { ...
[ "public", "void", "addOutgoingFor", "(", "String", "[", "]", "varNames", ",", "DifferentialFunction", "function", ")", "{", "if", "(", "function", ".", "getOwnName", "(", ")", "==", "null", ")", "throw", "new", "ND4JIllegalStateException", "(", "\"Instance id ca...
Adds outgoing arguments to the graph. Also checks for input arguments and updates the graph adding an appropriate edge when the full graph is declared. @param varNames @param function
[ "Adds", "outgoing", "arguments", "to", "the", "graph", ".", "Also", "checks", "for", "input", "arguments", "and", "updates", "the", "graph", "adding", "an", "appropriate", "edge", "when", "the", "full", "graph", "is", "declared", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1094-L1125
test
Add an outgoing DifferentialFunction to the result set.
Of course, here is the Java code you requested: ```java public void addOutgoingFor(String[] varNames, DifferentialFunction function) { if (function.getOwnName() == null) throw new ND4JIllegalStateException("Instance id can not be null. Function not initialized properly"); if (outgoingArgs...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/util/ThrowableAnalyzer.java
ThrowableAnalyzer.getFirstThrowableOfType
public final Throwable getFirstThrowableOfType( Class<? extends Throwable> throwableType, Throwable[] chain) { if (chain != null) { for (Throwable t : chain) { if ((t != null) && throwableType.isInstance(t)) { return t; } } } return null; }
java
public final Throwable getFirstThrowableOfType( Class<? extends Throwable> throwableType, Throwable[] chain) { if (chain != null) { for (Throwable t : chain) { if ((t != null) && throwableType.isInstance(t)) { return t; } } } return null; }
[ "public", "final", "Throwable", "getFirstThrowableOfType", "(", "Class", "<", "?", "extends", "Throwable", ">", "throwableType", ",", "Throwable", "[", "]", "chain", ")", "{", "if", "(", "chain", "!=", "null", ")", "{", "for", "(", "Throwable", "t", ":", ...
Returns the first throwable from the passed in array that is assignable to the provided type. A returned instance is safe to be cast to the specified type. <p> If the passed in array is null or empty this method returns <code>null</code>. @param throwableType the type to look for @param chain the array (will be proces...
[ "Returns", "the", "first", "throwable", "from", "the", "passed", "in", "array", "that", "is", "assignable", "to", "the", "provided", "type", ".", "A", "returned", "instance", "is", "safe", "to", "be", "cast", "to", "the", "specified", "type", ".", "<p", ...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/util/ThrowableAnalyzer.java#L220-L231
test
Gets the first Throwable of the specified type in the chain.
Of course, here is the Java code you requested: ```java public final Throwable getFirstThrowableOfType( Class<? extends Throwable> throwableType, Throwable[] chain) { if (chain != null) { for (Throwable t : chain) { if ((t != null) && throwableType.isInstance(t)) { return t; } } } return n...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilLine3D_F64.java
UtilLine3D_F64.computeT
public static double computeT( LineParametric3D_F64 line , Point3D_F64 pointOnLine ) { double dx = pointOnLine.x - line.p.x; double dy = pointOnLine.y - line.p.y; double dz = pointOnLine.z - line.p.z; double adx = Math.abs(dx); double ady = Math.abs(dy); double adz = Math.abs(dz); double t; if( adx ...
java
public static double computeT( LineParametric3D_F64 line , Point3D_F64 pointOnLine ) { double dx = pointOnLine.x - line.p.x; double dy = pointOnLine.y - line.p.y; double dz = pointOnLine.z - line.p.z; double adx = Math.abs(dx); double ady = Math.abs(dy); double adz = Math.abs(dz); double t; if( adx ...
[ "public", "static", "double", "computeT", "(", "LineParametric3D_F64", "line", ",", "Point3D_F64", "pointOnLine", ")", "{", "double", "dx", "=", "pointOnLine", ".", "x", "-", "line", ".", "p", ".", "x", ";", "double", "dy", "=", "pointOnLine", ".", "y", ...
Computes the value of T for a point on the parametric line @param line The line @param pointOnLine Point on a line @return Value of T for the point
[ "Computes", "the", "value", "of", "T", "for", "a", "point", "on", "the", "parametric", "line" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilLine3D_F64.java#L57-L81
test
Computes the t value of the line parameter
Of course, here is the Java code you requested: ```java public static double computeT( LineParametric3D_F64 line , Point3D_F64 pointOnLine ) { double dx = pointOnLine.x - line.p.x; double dy = pointOnLine.y - line.p.y; double dz = pointOnLine.z - line.p.z; double adx = Math.abs(dx); double ady = Math.abs(d...
Unidata/thredds
waterml/src/main/java/ucar/nc2/ogc/erddap/util/ErddapStringArray.java
ErddapStringArray.fromInputStream
public static ErddapStringArray fromInputStream(InputStream inputStream, String charset) throws IOException { if (charset == null || charset.isEmpty()) { charset = CDM.UTF8; } InputStreamReader isr = new InputStreamReader(inputStream, charset); BufferedReader bufferedReader =...
java
public static ErddapStringArray fromInputStream(InputStream inputStream, String charset) throws IOException { if (charset == null || charset.isEmpty()) { charset = CDM.UTF8; } InputStreamReader isr = new InputStreamReader(inputStream, charset); BufferedReader bufferedReader =...
[ "public", "static", "ErddapStringArray", "fromInputStream", "(", "InputStream", "inputStream", ",", "String", "charset", ")", "throws", "IOException", "{", "if", "(", "charset", "==", "null", "||", "charset", ".", "isEmpty", "(", ")", ")", "{", "charset", "=",...
Reads the contents of {@code inputStream} into a StringArray. Each line of input will result in an element in the array. <p/> The specified stream remains open after this method returns. @param inputStream a stream with line-based content. @param charset the name of a supported {@link java.nio.charset.Charset ch...
[ "Reads", "the", "contents", "of", "{", "@code", "inputStream", "}", "into", "a", "StringArray", ".", "Each", "line", "of", "input", "will", "result", "in", "an", "element", "in", "the", "array", ".", "<p", "/", ">", "The", "specified", "stream", "remains...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/erddap/util/ErddapStringArray.java#L54-L70
test
Creates an ErddapStringArray from an input stream.
Of course, here is the Java code you requested: ```java public static ErddapStringArray fromInputStream(InputStream inputStream, String charset) throws IOException { if (charset == null || charset.isEmpty()) { charset = CDM.UTF8; } InputStreamReader isr = new InputStreamReader(input...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/maps/SequentialCuckooFunction.java
SequentialCuckooFunction.containsKey
public boolean containsKey(K key) { int keyHashCode = key.hashCode(); int hash1 = hash1(keyHashCode); Entry<K> entry = hashTable[indexFor(hash1)]; if ((entry != null) && key.equals(entry.key)) { return true; } entry = hashTable[indexFor(hash2(ha...
java
public boolean containsKey(K key) { int keyHashCode = key.hashCode(); int hash1 = hash1(keyHashCode); Entry<K> entry = hashTable[indexFor(hash1)]; if ((entry != null) && key.equals(entry.key)) { return true; } entry = hashTable[indexFor(hash2(ha...
[ "public", "boolean", "containsKey", "(", "K", "key", ")", "{", "int", "keyHashCode", "=", "key", ".", "hashCode", "(", ")", ";", "int", "hash1", "=", "hash1", "(", "keyHashCode", ")", ";", "Entry", "<", "K", ">", "entry", "=", "hashTable", "[", "inde...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/maps/SequentialCuckooFunction.java#L82-L102
test
Checks if the key is in the cache.
Of course, here is the Java code you requested: ```java public boolean containsKey(K key) { int keyHashCode = key.hashCode(); int hash1 = hash1(keyHashCode); Entry<K> entry = hashTable[indexFor(hash1)]; if ((entry != null) && key.equals(entry.key)) { return tru...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java
ElementEditor.getQualifiedName
public static QualifiedName getQualifiedName(Element element) throws MalformedElementException { Assert.isNotNull(element); String nsName = getNSName(element); String nsLocalName = getNSLocalName(element); if (nsLocalName == null) throw new MalformedElementException(Policy.bi...
java
public static QualifiedName getQualifiedName(Element element) throws MalformedElementException { Assert.isNotNull(element); String nsName = getNSName(element); String nsLocalName = getNSLocalName(element); if (nsLocalName == null) throw new MalformedElementException(Policy.bi...
[ "public", "static", "QualifiedName", "getQualifiedName", "(", "Element", "element", ")", "throws", "MalformedElementException", "{", "Assert", ".", "isNotNull", "(", "element", ")", ";", "String", "nsName", "=", "getNSName", "(", "element", ")", ";", "String", "...
Returns a qualified name that is formed from the given element's namespace name and namespace local name. The qualified name's qualifier is the element's namespace name and the qualified name's local name is the element's local name. The element must not be <code>null</code>. @param element the element whose quali...
[ "Returns", "a", "qualified", "name", "that", "is", "formed", "from", "the", "given", "element", "s", "namespace", "name", "and", "namespace", "local", "name", ".", "The", "qualified", "name", "s", "qualifier", "is", "the", "element", "s", "namespace", "name"...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java#L1256-L1263
test
Get the qualified name of the given element.
Of course, here is the Java code you requested: ```java public static QualifiedName getQualifiedName(Element element) throws MalformedElementException { Assert.isNotNull(element); String nsName = getNSName(element); String nsLocalName = getNSLocalName(element); if (nsLocalName == null) ...
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/runner/PipeRunner.java
PipeRunner.onRecordErrorStopPipeline
public boolean onRecordErrorStopPipeline() { for(Pipe pipe : pipes) { StageContext stageContext = pipe.getStage().getContext(); if(stageContext.getOnErrorRecord() == OnRecordError.STOP_PIPELINE) { return true; } } return false; }
java
public boolean onRecordErrorStopPipeline() { for(Pipe pipe : pipes) { StageContext stageContext = pipe.getStage().getContext(); if(stageContext.getOnErrorRecord() == OnRecordError.STOP_PIPELINE) { return true; } } return false; }
[ "public", "boolean", "onRecordErrorStopPipeline", "(", ")", "{", "for", "(", "Pipe", "pipe", ":", "pipes", ")", "{", "StageContext", "stageContext", "=", "pipe", ".", "getStage", "(", ")", ".", "getContext", "(", ")", ";", "if", "(", "stageContext", ".", ...
Return true if at least one stage is configured with STOP_PIPELINE for OnRecordError policy.
[ "Return", "true", "if", "at", "least", "one", "stage", "is", "configured", "with", "STOP_PIPELINE", "for", "OnRecordError", "policy", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/runner/PipeRunner.java#L204-L213
test
OnRecordErrorStopPipeline is true if all pipes have been stopped
Of course, here is the Java code you requested: ```java public boolean onRecordErrorStopPipeline() { for(Pipe pipe : pipes) { StageContext stageContext = pipe.getStage().getContext(); if(stageContext.getOnErrorRecord() == OnRecordError.STOP_PIPELINE) { return true; } } return fal...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/net/server/ConcurrentServerRunner.java
ConcurrentServerRunner.addClient
private void addClient(T client) { clientsLock.lock(); try { clients.add(client); } finally { clientsLock.unlock(); } }
java
private void addClient(T client) { clientsLock.lock(); try { clients.add(client); } finally { clientsLock.unlock(); } }
[ "private", "void", "addClient", "(", "T", "client", ")", "{", "clientsLock", ".", "lock", "(", ")", ";", "try", "{", "clients", ".", "add", "(", "client", ")", ";", "}", "finally", "{", "clientsLock", ".", "unlock", "(", ")", ";", "}", "}" ]
Adds a client to the collection of those being tracked by the server. @param client the client to add
[ "Adds", "a", "client", "to", "the", "collection", "of", "those", "being", "tracked", "by", "the", "server", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/net/server/ConcurrentServerRunner.java#L179-L187
test
Add a client to the list of clients.
Of course, here is the Java code you requested: ```java private void addClient(T client) { clientsLock.lock(); try { clients.add(client); } finally { clientsLock.unlock(); } } ``` Hope this helps!
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/container/deployment/ClassUtils.java
ClassUtils.getConcreteMethodsNamesFromClass
public static Set getConcreteMethodsNamesFromClass(CtClass sbbClass) { Set concreteMethods = new HashSet(); CtMethod[] methods = sbbClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { int mods = methods[i].getModifiers(); if (!Modifier.isAbstract(mods) && !Modifier.isNat...
java
public static Set getConcreteMethodsNamesFromClass(CtClass sbbClass) { Set concreteMethods = new HashSet(); CtMethod[] methods = sbbClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { int mods = methods[i].getModifiers(); if (!Modifier.isAbstract(mods) && !Modifier.isNat...
[ "public", "static", "Set", "getConcreteMethodsNamesFromClass", "(", "CtClass", "sbbClass", ")", "{", "Set", "concreteMethods", "=", "new", "HashSet", "(", ")", ";", "CtMethod", "[", "]", "methods", "=", "sbbClass", ".", "getDeclaredMethods", "(", ")", ";", "fo...
Retrieve all concrete (non-abstract and non-native) methods names from a class @param sbbClass the class to extract the concrete methods from @return all concrete methods from a class
[ "Retrieve", "all", "concrete", "(", "non", "-", "abstract", "and", "non", "-", "native", ")", "methods", "names", "from", "a", "class" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/container/deployment/ClassUtils.java#L306-L316
test
Get the names of concrete methods from the given class.
Of course, here is the Java code you requested: ```java public static Set getConcreteMethodsNamesFromClass(CtClass sbbClass) { Set concreteMethods = new HashSet(); CtMethod[] methods = sbbClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { int mods = methods[i].getModifiers()...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.concatMapEager
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> concatMapEager(Function<? super T, ? extends Publisher<? extends R>> mapper, int maxConcurrency, int prefetch) { ObjectHelper.requireNonNull(ma...
java
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> concatMapEager(Function<? super T, ? extends Publisher<? extends R>> mapper, int maxConcurrency, int prefetch) { ObjectHelper.requireNonNull(ma...
[ "@", "CheckReturnValue", "@", "NonNull", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Flowable", "<", "R", ">", "concatMapEager", "...
Maps a sequence of values into Publishers and concatenates these Publishers eagerly into a single Publisher. <p> Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the source Publishers. The operator buffers the values emitted by these Publishers and then drains them in orde...
[ "Maps", "a", "sequence", "of", "values", "into", "Publishers", "and", "concatenates", "these", "Publishers", "eagerly", "into", "a", "single", "Publisher", ".", "<p", ">", "Eager", "concatenation", "means", "that", "once", "a", "subscriber", "subscribes", "this"...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L7522-L7532
test
Concatenates the source Publisher with a single mapping from a single source Publisher to a single source Publisher.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> concatMapEager(Function<? super T, ? extends Publisher<? extends R>> mapper, int maxConcurrenc...
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/util/UtilGlobal.java
UtilGlobal.encodeBase16
public static String encodeBase16(byte[] bytesParam) { if(bytesParam == null) { return null; } if(bytesParam.length == 0) { return UtilGlobal.EMPTY; } return DatatypeConverter.printHexBinary(bytesParam).toUpperCase(); }
java
public static String encodeBase16(byte[] bytesParam) { if(bytesParam == null) { return null; } if(bytesParam.length == 0) { return UtilGlobal.EMPTY; } return DatatypeConverter.printHexBinary(bytesParam).toUpperCase(); }
[ "public", "static", "String", "encodeBase16", "(", "byte", "[", "]", "bytesParam", ")", "{", "if", "(", "bytesParam", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "bytesParam", ".", "length", "==", "0", ")", "{", "return", "UtilGlobal...
Encodes the {@code bytesParam} as {@code java.lang.String}. @param bytesParam bytes to convert to Hex. @return Hex String in upper case.
[ "Encodes", "the", "{", "@code", "bytesParam", "}", "as", "{", "@code", "java", ".", "lang", ".", "String", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/UtilGlobal.java#L310-L323
test
Encode a byte array to Base16.
Of course, here is the Java code you requested: ```java public static String encodeBase16(byte[] bytesParam) { if(bytesParam == null) { return null; } if(bytesParam.length == 0) { return UtilGlobal.EMPTY; } return DatatypeConverter.printHexBinary(bytesParam).toUpperCase(); } ``` Hope this help...
RuedigerMoeller/fast-serialization
src/main/java/org/nustaq/serialization/FSTObjectOutput.java
FSTObjectOutput.writeCompatibleObjectFields
protected void writeCompatibleObjectFields(Object toWrite, Map fields, FSTClazzInfo.FSTFieldInfo[] fieldInfo) throws IOException { int booleanMask = 0; int boolcount = 0; for (int i = 0; i < fieldInfo.length; i++) { try { FSTClazzInfo.FSTFieldInfo subInfo = fieldInfo[...
java
protected void writeCompatibleObjectFields(Object toWrite, Map fields, FSTClazzInfo.FSTFieldInfo[] fieldInfo) throws IOException { int booleanMask = 0; int boolcount = 0; for (int i = 0; i < fieldInfo.length; i++) { try { FSTClazzInfo.FSTFieldInfo subInfo = fieldInfo[...
[ "protected", "void", "writeCompatibleObjectFields", "(", "Object", "toWrite", ",", "Map", "fields", ",", "FSTClazzInfo", ".", "FSTFieldInfo", "[", "]", "fieldInfo", ")", "throws", "IOException", "{", "int", "booleanMask", "=", "0", ";", "int", "boolcount", "=", ...
write identical to other version, but take field values from hashmap (because of annoying putField/getField feature)
[ "write", "identical", "to", "other", "version", "but", "take", "field", "values", "from", "hashmap", "(", "because", "of", "annoying", "putField", "/", "getField", "feature", ")" ]
59f8f800b79479d0b9c80901cf55903d9b027f26
https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/FSTObjectOutput.java#L677-L735
test
Write compatible object fields.
Of course, here is the Java code you requested: ```java protected void writeCompatibleObjectFields(Object toWrite, Map fields, FSTClazzInfo.FSTFieldInfo[] fieldInfo) throws IOException { int booleanMask = 0; int boolcount = 0; for (int i = 0; i < fieldInfo.length; i++) { try { ...
jboss/jboss-common-core
src/main/java/org/jboss/util/collection/CachedList.java
CachedList.add
public void add(final int index, final Object obj) { maintain(); SoftObject soft = SoftObject.create(obj, queue); list.add(index, soft); }
java
public void add(final int index, final Object obj) { maintain(); SoftObject soft = SoftObject.create(obj, queue); list.add(index, soft); }
[ "public", "void", "add", "(", "final", "int", "index", ",", "final", "Object", "obj", ")", "{", "maintain", "(", ")", ";", "SoftObject", "soft", "=", "SoftObject", ".", "create", "(", "obj", ",", "queue", ")", ";", "list", ".", "add", "(", "index", ...
Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). @param index Index at which the specified element is to be inserted. @param obj Element to be ins...
[ "Inserts", "the", "specified", "element", "at", "the", "specified", "position", "in", "this", "list", "(", "optional", "operation", ")", ".", "Shifts", "the", "element", "currently", "at", "that", "position", "(", "if", "any", ")", "and", "any", "subsequent"...
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/collection/CachedList.java#L120-L125
test
Add a SoftObject to the list.
Of course, here is the Java code you requested: ```java public void add(final int index, final Object obj) { maintain(); SoftObject soft = SoftObject.create(obj, queue); list.add(index, soft); } ``` Hope this helps!
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/EjbJndiBindingsDeploymentUnitProcessor.java
EjbJndiBindingsDeploymentUnitProcessor.setupJNDIBindings
private void setupJNDIBindings(EJBComponentDescription sessionBean, DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final Collection<ViewDescription> views = sessionBean.getViews(); if (views == null || views.isEmpty()) { EjbLogger.DEPLOYMENT_LOGGER.noJNDIBindingsFo...
java
private void setupJNDIBindings(EJBComponentDescription sessionBean, DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final Collection<ViewDescription> views = sessionBean.getViews(); if (views == null || views.isEmpty()) { EjbLogger.DEPLOYMENT_LOGGER.noJNDIBindingsFo...
[ "private", "void", "setupJNDIBindings", "(", "EJBComponentDescription", "sessionBean", ",", "DeploymentUnit", "deploymentUnit", ")", "throws", "DeploymentUnitProcessingException", "{", "final", "Collection", "<", "ViewDescription", ">", "views", "=", "sessionBean", ".", "...
Sets up jndi bindings for each of the views exposed by the passed <code>sessionBean</code> @param sessionBean The session bean @param deploymentUnit The deployment unit containing the session bean
[ "Sets", "up", "jndi", "bindings", "for", "each", "of", "the", "views", "exposed", "by", "the", "passed", "<code", ">", "sessionBean<", "/", "code", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/EjbJndiBindingsDeploymentUnitProcessor.java#L104-L198
test
Setup the JNDI bindings for the given EJBComponentDescription.
Of course, here is the Java code you requested: ```java private void setupJNDIBindings(EJBComponentDescription sessionBean, DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final Collection<ViewDescription> views = sessionBean.getViews(); if (views == null || views.isEmpty()) {...
apache/parquet-mr
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetInputSplit.java
ParquetInputSplit.readFields
@Override public void readFields(DataInput hin) throws IOException { byte[] bytes = readArray(hin); DataInputStream in = new DataInputStream(new GZIPInputStream(new ByteArrayInputStream(bytes))); super.readFields(in); this.end = in.readLong(); if (in.readBoolean()) { this.rowGroupOffsets = n...
java
@Override public void readFields(DataInput hin) throws IOException { byte[] bytes = readArray(hin); DataInputStream in = new DataInputStream(new GZIPInputStream(new ByteArrayInputStream(bytes))); super.readFields(in); this.end = in.readLong(); if (in.readBoolean()) { this.rowGroupOffsets = n...
[ "@", "Override", "public", "void", "readFields", "(", "DataInput", "hin", ")", "throws", "IOException", "{", "byte", "[", "]", "bytes", "=", "readArray", "(", "hin", ")", ";", "DataInputStream", "in", "=", "new", "DataInputStream", "(", "new", "GZIPInputStre...
{@inheritDoc}
[ "{" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetInputSplit.java#L248-L261
test
Override the fields of the CRASS header.
Of course, here is the Java code you requested: ```java @Override public void readFields(DataInput hin) throws IOException { byte[] bytes = readArray(hin); DataInputStream in = new DataInputStream(new GZIPInputStream(new ByteArrayInputStream(bytes))); super.readFields(in); this.end = in.readLong(); ...
lightcouch/LightCouch
src/main/java/org/lightcouch/CouchDbDesign.java
CouchDbDesign.getFromDesk
public DesignDocument getFromDesk(String id) { assertNotEmpty(id, "id"); final DesignDocument dd = new DesignDocument(); final String rootPath = format("%s/%s/", DESIGN_DOCS_DIR, id); final List<String> elements = listResources(rootPath); if(elements == null) { throw new IllegalArgumentException("Design do...
java
public DesignDocument getFromDesk(String id) { assertNotEmpty(id, "id"); final DesignDocument dd = new DesignDocument(); final String rootPath = format("%s/%s/", DESIGN_DOCS_DIR, id); final List<String> elements = listResources(rootPath); if(elements == null) { throw new IllegalArgumentException("Design do...
[ "public", "DesignDocument", "getFromDesk", "(", "String", "id", ")", "{", "assertNotEmpty", "(", "id", ",", "\"id\"", ")", ";", "final", "DesignDocument", "dd", "=", "new", "DesignDocument", "(", ")", ";", "final", "String", "rootPath", "=", "format", "(", ...
Gets a design document from desk. @param id The document id to get. @return {@link DesignDocument}
[ "Gets", "a", "design", "document", "from", "desk", "." ]
9646889503475e862fd2158487e1cdd805447f4a
https://github.com/lightcouch/LightCouch/blob/9646889503475e862fd2158487e1cdd805447f4a/src/main/java/org/lightcouch/CouchDbDesign.java#L160-L199
test
Gets a DesignDocument object from the Desk.
Of course, here is the Java code you requested: ```java public DesignDocument getFromDesk(String id) { assertNotEmpty(id, "id"); final DesignDocument dd = new DesignDocument(); final String rootPath = format("%s/%s/", DESIGN_DOCS_DIR, id); final List<String> elements = listResources(rootPath); if(elements ==...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.debounce
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) public final <U> Flowable<T> debounce(Function<? super T, ? extends Publisher<U>> debounceIndicator) { ObjectHelper.requireNonNull(debounceIndicator, "debounceIndicator is null"); ...
java
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) public final <U> Flowable<T> debounce(Function<? super T, ? extends Publisher<U>> debounceIndicator) { ObjectHelper.requireNonNull(debounceIndicator, "debounceIndicator is null"); ...
[ "@", "CheckReturnValue", "@", "NonNull", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "ERROR", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "U", ">", "Flowable", "<", "T", ">", "debounce", "(", ...
Returns a Flowable that mirrors the source Publisher, except that it drops items emitted by the source Publisher that are followed by another item within a computed debounce duration. <p> <img width="640" height="425" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/debounce.f.png" alt=""> <p> The ...
[ "Returns", "a", "Flowable", "that", "mirrors", "the", "source", "Publisher", "except", "that", "it", "drops", "items", "emitted", "by", "the", "source", "Publisher", "that", "are", "followed", "by", "another", "item", "within", "a", "computed", "debounce", "du...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L8216-L8223
test
Debounce the source Publisher with a function.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) public final <U> Flowable<T> debounce(Function<? super T, ? extends Publisher<U>> debounceIndicator) { ObjectHelper.requireNon...
real-logic/aeron
aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java
ClusterMember.addMember
public static ClusterMember[] addMember(final ClusterMember[] oldMembers, final ClusterMember newMember) { return ArrayUtil.add(oldMembers, newMember); }
java
public static ClusterMember[] addMember(final ClusterMember[] oldMembers, final ClusterMember newMember) { return ArrayUtil.add(oldMembers, newMember); }
[ "public", "static", "ClusterMember", "[", "]", "addMember", "(", "final", "ClusterMember", "[", "]", "oldMembers", ",", "final", "ClusterMember", "newMember", ")", "{", "return", "ArrayUtil", ".", "add", "(", "oldMembers", ",", "newMember", ")", ";", "}" ]
Add a new member to an array of {@link ClusterMember}s. @param oldMembers to add to. @param newMember to add. @return a new array containing the old members plus the new member.
[ "Add", "a", "new", "member", "to", "an", "array", "of", "{", "@link", "ClusterMember", "}", "s", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java#L1108-L1111
test
Add a member to an array of members.
Of course, here is the Java code you requested: ```java public static ClusterMember[] addMember(final ClusterMember[] oldMembers, final ClusterMember newMember) { return ArrayUtil.add(oldMembers, newMember); } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/Logger.java
Logger.debug
@Deprecated public static void debug(String message, Object... args) { logger.debug(message, args); }
java
@Deprecated public static void debug(String message, Object... args) { logger.debug(message, args); }
[ "@", "Deprecated", "public", "static", "void", "debug", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "logger", ".", "debug", "(", "message", ",", "args", ")", ";", "}" ]
Log a message with the DEBUG level. @param message message to log @param args The arguments to apply to the message String @deprecated Deprecated as of 2.7.0. Create an instance of {@link ALogger} via {@link #of(String)} / {@link #of(Class)} and use the same-named method. Or use SLF4J directly.
[ "Log", "a", "message", "with", "the", "DEBUG", "level", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/Logger.java#L239-L242
test
Debug method.
Of course, here is the Java code you requested: ```java @Deprecated public static void debug(String message, Object... args) { logger.debug(message, args); } ``` Hope this helps!
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasIdamax
public static int cublasIdamax(int n, Pointer x, int incx) { int result = cublasIdamaxNative(n, x, incx); checkResultBLAS(); return result; }
java
public static int cublasIdamax(int n, Pointer x, int incx) { int result = cublasIdamaxNative(n, x, incx); checkResultBLAS(); return result; }
[ "public", "static", "int", "cublasIdamax", "(", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ")", "{", "int", "result", "=", "cublasIdamaxNative", "(", "n", ",", "x", ",", "incx", ")", ";", "checkResultBLAS", "(", ")", ";", "return", "result", ...
<pre> int idamax (int n, const double *x, int incx) finds the smallest index of the maximum magnitude element of double- precision vector x; that is, the result is the first i, i = 0 to n - 1, that maximizes abs(x[1 + i * incx])). Input ----- n number of elements in input vector x double-precision vector wi...
[ "<pre", ">", "int", "idamax", "(", "int", "n", "const", "double", "*", "x", "int", "incx", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L7473-L7478
test
Cublas IDAMax for a Cublas tag.
Of course, here is the Java code you requested: ```java public static int cublasIdamax(int n, Pointer x, int incx) { int result = cublasIdamaxNative(n, x, incx); checkResultBLAS(); return result; } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ActiveLock.java
ActiveLock.setDepth
public void setDepth(String depth) { Assert.isNotNull(depth); Assert.isTrue(depth.equals(IContext.DEPTH_ZERO) || depth.equals(IContext.DEPTH_ONE) || depth.equals(IContext.DEPTH_INFINITY)); setChild(root, "depth", depth, childNames, false); //$NON-NLS-1$ }
java
public void setDepth(String depth) { Assert.isNotNull(depth); Assert.isTrue(depth.equals(IContext.DEPTH_ZERO) || depth.equals(IContext.DEPTH_ONE) || depth.equals(IContext.DEPTH_INFINITY)); setChild(root, "depth", depth, childNames, false); //$NON-NLS-1$ }
[ "public", "void", "setDepth", "(", "String", "depth", ")", "{", "Assert", ".", "isNotNull", "(", "depth", ")", ";", "Assert", ".", "isTrue", "(", "depth", ".", "equals", "(", "IContext", ".", "DEPTH_ZERO", ")", "||", "depth", ".", "equals", "(", "ICont...
Sets the depth of this activelock to the given depth. The depth must not be null and must be one of: <ul> <li><code>Context.DEPTH_ZERO</code> <li><code>Context.DEPTH_ONE</code> <li><code>Context.DEPTH_INFINITY</code> </ul> @param depth the depth for this activelock @see Context
[ "Sets", "the", "depth", "of", "this", "activelock", "to", "the", "given", "depth", ".", "The", "depth", "must", "not", "be", "null", "and", "must", "be", "one", "of", ":", "<ul", ">", "<li", ">", "<code", ">", "Context", ".", "DEPTH_ZERO<", "/", "cod...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ActiveLock.java#L191-L195
test
Sets the depth of the .
Of course, here is the Java code you requested: ```java public void setDepth(String depth) { Assert.isNotNull(depth); Assert.isTrue(depth.equals(IContext.DEPTH_ZERO) || depth.equals(IContext.DEPTH_ONE) || depth.equals(IContext.DEPTH_INFINITY)); setChild(root, "depth", depth, childNames, false);...
Unidata/thredds
dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java
DapNode.getGroupPath
public List<DapGroup> getGroupPath() { List<DapGroup> path = new ArrayList<DapGroup>(); DapNode current = this; for(; ; ) { if(current.getSort() == DapSort.GROUP || current.getSort() == DapSort.DATASET) path.add(0, (DapGroup) current); ...
java
public List<DapGroup> getGroupPath() { List<DapGroup> path = new ArrayList<DapGroup>(); DapNode current = this; for(; ; ) { if(current.getSort() == DapSort.GROUP || current.getSort() == DapSort.DATASET) path.add(0, (DapGroup) current); ...
[ "public", "List", "<", "DapGroup", ">", "getGroupPath", "(", ")", "{", "List", "<", "DapGroup", ">", "path", "=", "new", "ArrayList", "<", "DapGroup", ">", "(", ")", ";", "DapNode", "current", "=", "this", ";", "for", "(", ";", ";", ")", "{", "if",...
Get the transitive list of containing groups Possibly including this node @return list of group nodes
[ "Get", "the", "transitive", "list", "of", "containing", "groups", "Possibly", "including", "this", "node" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java#L455-L468
test
Get the path of this DapNode to the DapNode.
Of course, here is the Java code you requested: ```java public List<DapGroup> getGroupPath() { List<DapGroup> path = new ArrayList<DapGroup>(); DapNode current = this; for(; ; ) { if(current.getSort() == DapSort.GROUP || current.getSort() == DapSort.DATASET) ...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/UserClient.java
UserClient.getGravatarForUser
public byte[] getGravatarForUser(User userParam, int sizeParam) { if(userParam == null) { return null; } try { JSONObject gravatarJSONObj = this.postJson( userParam, WS.Path.User.Version1.getGravatarByUs...
java
public byte[] getGravatarForUser(User userParam, int sizeParam) { if(userParam == null) { return null; } try { JSONObject gravatarJSONObj = this.postJson( userParam, WS.Path.User.Version1.getGravatarByUs...
[ "public", "byte", "[", "]", "getGravatarForUser", "(", "User", "userParam", ",", "int", "sizeParam", ")", "{", "if", "(", "userParam", "==", "null", ")", "{", "return", "null", ";", "}", "try", "{", "JSONObject", "gravatarJSONObj", "=", "this", ".", "pos...
Retrieve the gravatar bytes for Fluid user. @param userParam The user to get the gravatar for. @param sizeParam The pixel dimension for the image. @return JPEG image bytes.
[ "Retrieve", "the", "gravatar", "bytes", "for", "Fluid", "user", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/UserClient.java#L584-L609
test
Get a Gravatar for a user
Of course, here is the Java code you requested: ```java public byte[] getGravatarForUser(User userParam, int sizeParam) { if(userParam == null) { return null; } try { JSONObject gravatarJSONObj = this.postJson( userParam, ...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/Codec.java
Codec.getInstalledCodecs
public static java.util.Collection<Codec> getInstalledCodecs() { java.util.Collection<Codec> retval = new java.util.HashSet<Codec>(); int count = getNumInstalledCodecs(); for(int i=0;i<count;i++) { Codec codec = getInstalledCodec(i); if (codec != null) retval.add(codec); } ...
java
public static java.util.Collection<Codec> getInstalledCodecs() { java.util.Collection<Codec> retval = new java.util.HashSet<Codec>(); int count = getNumInstalledCodecs(); for(int i=0;i<count;i++) { Codec codec = getInstalledCodec(i); if (codec != null) retval.add(codec); } ...
[ "public", "static", "java", ".", "util", ".", "Collection", "<", "Codec", ">", "getInstalledCodecs", "(", ")", "{", "java", ".", "util", ".", "Collection", "<", "Codec", ">", "retval", "=", "new", "java", ".", "util", ".", "HashSet", "<", "Codec", ">",...
Gets a collection of ALL codecs installed on this system. @return A collection of all installed codecs.
[ "Gets", "a", "collection", "of", "ALL", "codecs", "installed", "on", "this", "system", "." ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Codec.java#L140-L152
test
Gets the installed codecs.
Of course, here is the Java code you requested: ```java public static java.util.Collection<Codec> getInstalledCodecs() { java.util.Collection<Codec> retval = new java.util.HashSet<Codec>(); int count = getNumInstalledCodecs(); for(int i=0;i<count;i++) { Codec codec = getInstalledCodec(i); ...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/joran/spi/InterpretationContext.java
InterpretationContext.getProperty
public String getProperty(String key) { String v = propertiesMap.get(key); if (v != null) { return v; } else { return context.getProperty(key); } }
java
public String getProperty(String key) { String v = propertiesMap.get(key); if (v != null) { return v; } else { return context.getProperty(key); } }
[ "public", "String", "getProperty", "(", "String", "key", ")", "{", "String", "v", "=", "propertiesMap", ".", "get", "(", "key", ")", ";", "if", "(", "v", "!=", "null", ")", "{", "return", "v", ";", "}", "else", "{", "return", "context", ".", "getPr...
If a key is found in propertiesMap then return it. Otherwise, delegate to the context.
[ "If", "a", "key", "is", "found", "in", "propertiesMap", "then", "return", "it", ".", "Otherwise", "delegate", "to", "the", "context", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/joran/spi/InterpretationContext.java#L151-L158
test
Get the value of a property.
Of course, here is the Java code you requested: ```java public String getProperty(String key) { String v = propertiesMap.get(key); if (v != null) { return v; } else { return context.getProperty(key); } } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java
Nidsheader.read_proddesc
Pinfo read_proddesc( ByteBuffer buf, int offset ){ byte[] b2 = new byte[2]; byte[] b4 = new byte[4]; int off = offset; Short tShort; Integer tInt; //Double tDouble = null; /* thredds global att */ ncfile.addAttribute(null, new Attribute("title",...
java
Pinfo read_proddesc( ByteBuffer buf, int offset ){ byte[] b2 = new byte[2]; byte[] b4 = new byte[4]; int off = offset; Short tShort; Integer tInt; //Double tDouble = null; /* thredds global att */ ncfile.addAttribute(null, new Attribute("title",...
[ "Pinfo", "read_proddesc", "(", "ByteBuffer", "buf", ",", "int", "offset", ")", "{", "byte", "[", "]", "b2", "=", "new", "byte", "[", "2", "]", ";", "byte", "[", "]", "b4", "=", "new", "byte", "[", "4", "]", ";", "int", "off", "=", "offset", ";"...
/* * Name: read_proddesc * * Purpose: Read product description header from NEXRAD Level III product * *
[ "/", "*", "*", "Name", ":", "read_proddesc", "*", "*", "Purpose", ":", "Read", "product", "description", "header", "from", "NEXRAD", "Level", "III", "product", "*", "*" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java#L3126-L3321
test
Reads the Nexrad Level 3 data from the specified buffer.
Of course, here is the Java code you requested: ```java Pinfo read_proddesc( ByteBuffer buf, int offset ){ byte[] b2 = new byte[2]; byte[] b4 = new byte[4]; int off = offset; Short tShort; Integer tInt; //Double tDouble = null; /* thredds global att */ ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft2/simpgeometry/SimpleGeometryReader.java
SimpleGeometryReader.readPolygon
public Polygon readPolygon(String name, int index) { Variable polyvar = ds.findVariable(name); if(polyvar == null) return null; Polygon poly = null; // CFConvention if(ds.findGlobalAttribute(CF.CONVENTIONS) != null) if(ucar.nc2.dataset.conv.CF1Convention.getVersion(ds.findGlobalAttribute(...
java
public Polygon readPolygon(String name, int index) { Variable polyvar = ds.findVariable(name); if(polyvar == null) return null; Polygon poly = null; // CFConvention if(ds.findGlobalAttribute(CF.CONVENTIONS) != null) if(ucar.nc2.dataset.conv.CF1Convention.getVersion(ds.findGlobalAttribute(...
[ "public", "Polygon", "readPolygon", "(", "String", "name", ",", "int", "index", ")", "{", "Variable", "polyvar", "=", "ds", ".", "findVariable", "(", "name", ")", ";", "if", "(", "polyvar", "==", "null", ")", "return", "null", ";", "Polygon", "poly", "...
Returns a Polygon given a variable name and the geometric index. If the Polygon is not found it will return null. If the Polygon is a part of the Multi-Polygon, it will return the head (the first Polygon in the series which constitutes the Multi-Polygon). @param name of the variable which holds the Polygon @param inde...
[ "Returns", "a", "Polygon", "given", "a", "variable", "name", "and", "the", "geometric", "index", ".", "If", "the", "Polygon", "is", "not", "found", "it", "will", "return", "null", ".", "If", "the", "Polygon", "is", "a", "part", "of", "the", "Multi", "-...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/simpgeometry/SimpleGeometryReader.java#L26-L40
test
Reads a polygon from the file.
Of course, here is the Java code you requested: ```java public Polygon readPolygon(String name, int index) { Variable polyvar = ds.findVariable(name); if(polyvar == null) return null; Polygon poly = null; // CFConvention if(ds.findGlobalAttribute(CF.CONVENTIONS) != null) if(ucar.nc2.data...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasZsyr2k
public static void cublasZsyr2k(char uplo, char trans, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuDoubleComplex beta, Pointer C, int ldc) { cublasZsyr2kNative(uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc); checkResultBLAS(); }
java
public static void cublasZsyr2k(char uplo, char trans, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuDoubleComplex beta, Pointer C, int ldc) { cublasZsyr2kNative(uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc); checkResultBLAS(); }
[ "public", "static", "void", "cublasZsyr2k", "(", "char", "uplo", ",", "char", "trans", ",", "int", "n", ",", "int", "k", ",", "cuDoubleComplex", "alpha", ",", "Pointer", "A", ",", "int", "lda", ",", "Pointer", "B", ",", "int", "ldb", ",", "cuDoubleComp...
<pre> void cublasZsyr2k (char uplo, char trans, int n, int k, cuDoubleComplex alpha, const cuDoubleComplex *A, int lda, const cuDoubleComplex *B, int ldb, cuDoubleComplex beta, cuDoubleComplex *C, int ldc) performs one of the symmetric rank 2k operations C = alpha * A * transpose(B) + alpha * B * transpose(A) + beta ...
[ "<pre", ">", "void", "cublasZsyr2k", "(", "char", "uplo", "char", "trans", "int", "n", "int", "k", "cuDoubleComplex", "alpha", "const", "cuDoubleComplex", "*", "A", "int", "lda", "const", "cuDoubleComplex", "*", "B", "int", "ldb", "cuDoubleComplex", "beta", ...
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L9400-L9404
test
Cublas zsyr2k.
Of course, here is the Java code you requested: ```java public static void cublasZsyr2k(char uplo, char trans, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuDoubleComplex beta, Pointer C, int ldc) { cublasZsyr2kNative(uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/deployment/EjbSecurityDeployer.java
EjbSecurityDeployer.createService
@Override protected JaccService<AttachmentList<EjbJaccConfig>> createService(String contextId, AttachmentList<EjbJaccConfig> metaData, Boolean standalone) { return new EjbJaccService(contextId, metaData, standalone); }
java
@Override protected JaccService<AttachmentList<EjbJaccConfig>> createService(String contextId, AttachmentList<EjbJaccConfig> metaData, Boolean standalone) { return new EjbJaccService(contextId, metaData, standalone); }
[ "@", "Override", "protected", "JaccService", "<", "AttachmentList", "<", "EjbJaccConfig", ">", ">", "createService", "(", "String", "contextId", ",", "AttachmentList", "<", "EjbJaccConfig", ">", "metaData", ",", "Boolean", "standalone", ")", "{", "return", "new", ...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/deployment/EjbSecurityDeployer.java#L50-L53
test
Create a new instance of the EjbJaccService class.
Of course, here is the Java code you requested: ```java @Override protected JaccService<AttachmentList<EjbJaccConfig>> createService(String contextId, AttachmentList<EjbJaccConfig> metaData, Boolean standalone) { return new EjbJaccService(contextId, metaData, standalone); } ``` Hope this helps!
abmargb/jamppa
src/main/java/org/jivesoftware/smack/keepalive/KeepAliveManager.java
KeepAliveManager.schedulePingServerTask
private synchronized void schedulePingServerTask() { enableExecutorService(); stopPingServerTask(); if (pingInterval > 0) { periodicPingTask = periodicPingExecutorService.schedule( new Runnable() { @Override public ...
java
private synchronized void schedulePingServerTask() { enableExecutorService(); stopPingServerTask(); if (pingInterval > 0) { periodicPingTask = periodicPingExecutorService.schedule( new Runnable() { @Override public ...
[ "private", "synchronized", "void", "schedulePingServerTask", "(", ")", "{", "enableExecutorService", "(", ")", ";", "stopPingServerTask", "(", ")", ";", "if", "(", "pingInterval", ">", "0", ")", "{", "periodicPingTask", "=", "periodicPingExecutorService", ".", "sc...
Cancels any existing periodic ping task if there is one and schedules a new ping task if pingInterval is greater then zero. This is designed so only one executor is used for scheduling all pings on all connections. This results in only 1 thread used for pinging.
[ "Cancels", "any", "existing", "periodic", "ping", "task", "if", "there", "is", "one", "and", "schedules", "a", "new", "ping", "task", "if", "pingInterval", "is", "greater", "then", "zero", "." ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/keepalive/KeepAliveManager.java#L281-L329
test
Schedule a ping server task.
Of course, here is the Java code you requested: ```java private synchronized void schedulePingServerTask() { enableExecutorService(); stopPingServerTask(); if (pingInterval > 0) { periodicPingTask = periodicPingExecutorService.schedule( new Runnable() { ...
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/ConstantDefImpl.java
ConstantDefImpl.describe
public Description describe() { String defined_in_id = "IR"; if (defined_in instanceof ContainedOperations) defined_in_id = ((ContainedOperations) defined_in).id(); ConstantDescription d = new ConstantDescription(name, id, defined_in_id, version, ...
java
public Description describe() { String defined_in_id = "IR"; if (defined_in instanceof ContainedOperations) defined_in_id = ((ContainedOperations) defined_in).id(); ConstantDescription d = new ConstantDescription(name, id, defined_in_id, version, ...
[ "public", "Description", "describe", "(", ")", "{", "String", "defined_in_id", "=", "\"IR\"", ";", "if", "(", "defined_in", "instanceof", "ContainedOperations", ")", "defined_in_id", "=", "(", "(", "ContainedOperations", ")", "defined_in", ")", ".", "id", "(", ...
ContainedImpl implementation ----------------------------------
[ "ContainedImpl", "implementation", "----------------------------------" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/ConstantDefImpl.java#L98-L113
test
This method is used to describe the resource.
Of course, here is the Java code you requested: ```java public Description describe() { String defined_in_id = "IR"; if (defined_in instanceof ContainedOperations) defined_in_id = ((ContainedOperations) defined_in).id(); ConstantDescription d = new ConstantDescript...
wro4j/wro4j
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/script/RhinoScriptBuilder.java
RhinoScriptBuilder.evaluate
public Object evaluate(final Reader reader, final String sourceName) throws IOException { notNull(reader); try { return evaluate(IOUtils.toString(reader), sourceName); } finally { reader.close(); } }
java
public Object evaluate(final Reader reader, final String sourceName) throws IOException { notNull(reader); try { return evaluate(IOUtils.toString(reader), sourceName); } finally { reader.close(); } }
[ "public", "Object", "evaluate", "(", "final", "Reader", "reader", ",", "final", "String", "sourceName", ")", "throws", "IOException", "{", "notNull", "(", "reader", ")", ";", "try", "{", "return", "evaluate", "(", "IOUtils", ".", "toString", "(", "reader", ...
Evaluates a script from a reader. @param reader {@link Reader} of the script to evaluate. @param sourceName the name of the evaluated script. @return evaluated object. @throws IOException if the script couldn't be retrieved.
[ "Evaluates", "a", "script", "from", "a", "reader", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/script/RhinoScriptBuilder.java#L180-L188
test
Evaluates the specified reader with a single specification.
Of course, here is the Java code you requested: ```java public Object evaluate(final Reader reader, final String sourceName) throws IOException { notNull(reader); try { return evaluate(IOUtils.toString(reader), sourceName); } finally { reader.close(); } } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/BitReader.java
BitReader.bits2SInt
public long bits2SInt(int nb) throws IOException { long result = bits2UInt(nb); // check if we're negative if (getBit(result, nb)) { // it's negative! reset leading bit result = setBit(result, nb, false); // build 2's-complement result = ~result & LONG_BITMASK; resu...
java
public long bits2SInt(int nb) throws IOException { long result = bits2UInt(nb); // check if we're negative if (getBit(result, nb)) { // it's negative! reset leading bit result = setBit(result, nb, false); // build 2's-complement result = ~result & LONG_BITMASK; resu...
[ "public", "long", "bits2SInt", "(", "int", "nb", ")", "throws", "IOException", "{", "long", "result", "=", "bits2UInt", "(", "nb", ")", ";", "// check if we're negative\r", "if", "(", "getBit", "(", "result", ",", "nb", ")", ")", "{", "// it's negative! rese...
Read the next nb bits and return an Signed Long . @param nb the number of bits to convert to int, must be <= 64. @return result @throws java.io.IOException on read error
[ "Read", "the", "next", "nb", "bits", "and", "return", "an", "Signed", "Long", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/BitReader.java#L143-L158
test
Bits to SInt.
Of course, here is the Java code you requested: ```java public long bits2SInt(int nb) throws IOException { long result = bits2UInt(nb); // check if we're negative if (getBit(result, nb)) { // it's negative! reset leading bit result = setBit(result, nb, false); // build 2's-compl...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilPolygons2D_F64.java
UtilPolygons2D_F64.convert
public static void convert( Rectangle2D_F64 input , Quadrilateral_F64 output ) { output.a.x = input.p0.x; output.a.y = input.p0.y; output.b.x = input.p1.x; output.b.y = input.p0.y; output.c.x = input.p1.x; output.c.y = input.p1.y; output.d.x = input.p0.x; output.d.y = input.p1.y; }
java
public static void convert( Rectangle2D_F64 input , Quadrilateral_F64 output ) { output.a.x = input.p0.x; output.a.y = input.p0.y; output.b.x = input.p1.x; output.b.y = input.p0.y; output.c.x = input.p1.x; output.c.y = input.p1.y; output.d.x = input.p0.x; output.d.y = input.p1.y; }
[ "public", "static", "void", "convert", "(", "Rectangle2D_F64", "input", ",", "Quadrilateral_F64", "output", ")", "{", "output", ".", "a", ".", "x", "=", "input", ".", "p0", ".", "x", ";", "output", ".", "a", ".", "y", "=", "input", ".", "p0", ".", ...
Converts a rectangle into a quadrilateral @param input Rectangle. @param output Quadrilateral. Modified.
[ "Converts", "a", "rectangle", "into", "a", "quadrilateral" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPolygons2D_F64.java#L80-L92
test
Converts a rectangle into a quadrilateral image.
Of course, here is the Java code you requested: ```java public static void convert( Rectangle2D_F64 input , Quadrilateral_F64 output ) { output.a.x = input.p0.x; output.a.y = input.p0.y; output.b.x = input.p1.x; output.b.y = input.p0.y; output.c.x = input.p1.x; output.c.y = input.p1.y; output.d.x = in...
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/projection/AlbersEqualArea.java
AlbersEqualArea.computeRho
private double computeRho(double lat) { return earth_radius * Math.sqrt(C - 2 * n * Math.sin(lat)) / n; }
java
private double computeRho(double lat) { return earth_radius * Math.sqrt(C - 2 * n * Math.sin(lat)) / n; }
[ "private", "double", "computeRho", "(", "double", "lat", ")", "{", "return", "earth_radius", "*", "Math", ".", "sqrt", "(", "C", "-", "2", "*", "n", "*", "Math", ".", "sin", "(", "lat", ")", ")", "/", "n", ";", "}" ]
Compute the RHO parameter @param lat latitude @return the rho parameter
[ "Compute", "the", "RHO", "parameter" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/AlbersEqualArea.java#L161-L163
test
Computes the Rho of a given location.
Of course, here is the Java code you requested: ```java private double computeRho(double lat) { return earth_radius * Math.sqrt(C - 2 * n * Math.sin(lat)) / n; } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java
RequestSpecBuilder.addFormParam
public RequestSpecBuilder addFormParam(String parameterName, Collection<?> parameterValues) { spec.formParam(parameterName, parameterValues); return this; }
java
public RequestSpecBuilder addFormParam(String parameterName, Collection<?> parameterValues) { spec.formParam(parameterName, parameterValues); return this; }
[ "public", "RequestSpecBuilder", "addFormParam", "(", "String", "parameterName", ",", "Collection", "<", "?", ">", "parameterValues", ")", "{", "spec", ".", "formParam", "(", "parameterName", ",", "parameterValues", ")", ";", "return", "this", ";", "}" ]
Add a form parameter to be sent with the request. This method is the same as {@link #addParam(String, java.util.Collection)} for all HTTP methods except PUT where this method can be used to differentiate between form and query params. @param parameterName The parameter key @param parameterValues The parameter values...
[ "Add", "a", "form", "parameter", "to", "be", "sent", "with", "the", "request", ".", "This", "method", "is", "the", "same", "as", "{", "@link", "#addParam", "(", "String", "java", ".", "util", ".", "Collection", ")", "}", "for", "all", "HTTP", "methods"...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java#L350-L353
test
Add a form parameter to the request.
Of course, here is the Java code you requested: ```java public RequestSpecBuilder addFormParam(String parameterName, Collection<?> parameterValues) { spec.formParam(parameterName, parameterValues); return this; } ``` Hope this helps!
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
PacketParserUtils.parseStreamError
public static StreamError parseStreamError(Element el) throws IOException, XmlPullParserException { String code = null; Element condEl = (Element) el.elements().iterator().next(); if (condEl.getNamespace().getURI().equals(StreamError.NAMESPACE)) { code = condEl.getName();...
java
public static StreamError parseStreamError(Element el) throws IOException, XmlPullParserException { String code = null; Element condEl = (Element) el.elements().iterator().next(); if (condEl.getNamespace().getURI().equals(StreamError.NAMESPACE)) { code = condEl.getName();...
[ "public", "static", "StreamError", "parseStreamError", "(", "Element", "el", ")", "throws", "IOException", ",", "XmlPullParserException", "{", "String", "code", "=", "null", ";", "Element", "condEl", "=", "(", "Element", ")", "el", ".", "elements", "(", ")", ...
Parses stream error packets. @param doc the XML parser. @return an stream error packet. @throws Exception if an exception occurs while parsing the packet.
[ "Parses", "stream", "error", "packets", "." ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java#L59-L68
test
Parse a StreamError XML element.
Of course, here is the Java code you requested: ```java public static StreamError parseStreamError(Element el) throws IOException, XmlPullParserException { String code = null; Element condEl = (Element) el.elements().iterator().next(); if (condEl.getNamespace().getURI().equals(Strea...
Unidata/thredds
tds/src/main/java/thredds/server/wfs/WFSGetFeatureWriter.java
WFSGetFeatureWriter.writeHeadersAndBB
private void writeHeadersAndBB() { fileOutput += "<wfs:FeatureCollection xsi:schemaLocation=" + WFSXMLHelper.encQuotes("http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd " + namespace + " " + server + "?request=DescribeFeatureType" + WFSXMLHelper.AMPERSAND + "service=wfs" + WFSXMLHelper...
java
private void writeHeadersAndBB() { fileOutput += "<wfs:FeatureCollection xsi:schemaLocation=" + WFSXMLHelper.encQuotes("http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd " + namespace + " " + server + "?request=DescribeFeatureType" + WFSXMLHelper.AMPERSAND + "service=wfs" + WFSXMLHelper...
[ "private", "void", "writeHeadersAndBB", "(", ")", "{", "fileOutput", "+=", "\"<wfs:FeatureCollection xsi:schemaLocation=\"", "+", "WFSXMLHelper", ".", "encQuotes", "(", "\"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd \"", "+", "namespace", "+", "\" \"...
Writes headers and bounding box
[ "Writes", "headers", "and", "bounding", "box" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/wfs/WFSGetFeatureWriter.java#L28-L82
test
Write the headers and BBB file.
Of course, here is the Java code you requested: ```java private void writeHeadersAndBB() { fileOutput += "<wfs:FeatureCollection xsi:schemaLocation=" + WFSXMLHelper.encQuotes("http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd " + namespace + " " + server + "?request=DescribeFeatureType...
apache/parquet-mr
parquet-column/src/main/java/org/apache/parquet/io/RecordConsumerLoggingWrapper.java
RecordConsumerLoggingWrapper.startField
@Override public void startField(String field, int index) { logOpen(field); delegate.startField(field, index); }
java
@Override public void startField(String field, int index) { logOpen(field); delegate.startField(field, index); }
[ "@", "Override", "public", "void", "startField", "(", "String", "field", ",", "int", "index", ")", "{", "logOpen", "(", "field", ")", ";", "delegate", ".", "startField", "(", "field", ",", "index", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/io/RecordConsumerLoggingWrapper.java#L49-L53
test
Override the method to log the start of a sequence of tokens.
Of course, here is the Java code you requested: ```java @Override public void startField(String field, int index) { logOpen(field); delegate.startField(field, index); } ``` Hope this helps!
apache/parquet-mr
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
ParquetFileReader.readFooter
@Deprecated public static final ParquetMetadata readFooter(InputFile file, MetadataFilter filter) throws IOException { ParquetReadOptions options; if (file instanceof HadoopInputFile) { options = HadoopReadOptions.builder(((HadoopInputFile) file).getConfiguration()) .withMetadataFilter(filter)...
java
@Deprecated public static final ParquetMetadata readFooter(InputFile file, MetadataFilter filter) throws IOException { ParquetReadOptions options; if (file instanceof HadoopInputFile) { options = HadoopReadOptions.builder(((HadoopInputFile) file).getConfiguration()) .withMetadataFilter(filter)...
[ "@", "Deprecated", "public", "static", "final", "ParquetMetadata", "readFooter", "(", "InputFile", "file", ",", "MetadataFilter", "filter", ")", "throws", "IOException", "{", "ParquetReadOptions", "options", ";", "if", "(", "file", "instanceof", "HadoopInputFile", "...
Reads the meta data block in the footer of the file using provided input stream @param file a {@link InputFile} to read @param filter the filter to apply to row groups @return the metadata blocks in the footer @throws IOException if an error occurs while reading the file @deprecated will be removed in 2.0.0; use {@link...
[ "Reads", "the", "meta", "data", "block", "in", "the", "footer", "of", "the", "file", "using", "provided", "input", "stream" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java#L498-L511
test
Read a single segment of a Parquet file.
Of course, here is the Java code you requested: ```java @Deprecated public static final ParquetMetadata readFooter(InputFile file, MetadataFilter filter) throws IOException { ParquetReadOptions options; if (file instanceof HadoopInputFile) { options = HadoopReadOptions.builder(((HadoopInputFile) file)....
AndrewReitz/shillelagh
shillelagh-processor/src/main/java/shillelagh/internal/TableObject.java
TableObject.emitInsert
private void emitInsert(JavaWriter javaWriter) throws IOException { logger.d("emitInsert"); String tableName = getTableName(); javaWriter.beginMethod("void", $$INSERT_OBJECT_FUNCTION, EnumSet.of(PUBLIC, STATIC), getTargetClass(), "element", "SQLiteDatabase", "db") .emitStatement("ContentValu...
java
private void emitInsert(JavaWriter javaWriter) throws IOException { logger.d("emitInsert"); String tableName = getTableName(); javaWriter.beginMethod("void", $$INSERT_OBJECT_FUNCTION, EnumSet.of(PUBLIC, STATIC), getTargetClass(), "element", "SQLiteDatabase", "db") .emitStatement("ContentValu...
[ "private", "void", "emitInsert", "(", "JavaWriter", "javaWriter", ")", "throws", "IOException", "{", "logger", ".", "d", "(", "\"emitInsert\"", ")", ";", "String", "tableName", "=", "getTableName", "(", ")", ";", "javaWriter", ".", "beginMethod", "(", "\"void\...
Creates the function for inserting a new value into the database
[ "Creates", "the", "function", "for", "inserting", "a", "new", "value", "into", "the", "database" ]
d016971487bf8993686eb7d03146110f658e0f18
https://github.com/AndrewReitz/shillelagh/blob/d016971487bf8993686eb7d03146110f658e0f18/shillelagh-processor/src/main/java/shillelagh/internal/TableObject.java#L212-L251
test
Emits the insert statements.
Of course, here is the Java code you requested: ```java private void emitInsert(JavaWriter javaWriter) throws IOException { logger.d("emitInsert"); String tableName = getTableName(); javaWriter.beginMethod("void", $$INSERT_OBJECT_FUNCTION, EnumSet.of(PUBLIC, STATIC), getTargetClass(), "element", "S...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java
RouteFieldClient.updateFieldParagraphTextPlain
public Field updateFieldParagraphTextPlain(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.ParagraphText); routeFieldParam.setTypeMetaData(F...
java
public Field updateFieldParagraphTextPlain(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.ParagraphText); routeFieldParam.setTypeMetaData(F...
[ "public", "Field", "updateFieldParagraphTextPlain", "(", "Field", "routeFieldParam", ")", "{", "if", "(", "routeFieldParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "routeFieldParam", ".", "setServiceTicket", "(", "this", ".", "...
Update an existing Paragraph Text field. @param routeFieldParam Field to Update. @return Updated Field.
[ "Update", "an", "existing", "Paragraph", "Text", "field", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java#L306-L318
test
Update the ParagraphText plain field.
Of course, here is the Java code you requested: ```java public Field updateFieldParagraphTextPlain(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field....
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java
StringUtils.removeStartIgnoreCase
public static String removeStartIgnoreCase(final String s, final String remove) { if (isEmpty(s) || isEmpty(remove)) { return s; } if (startsWithIgnoreCase(s, remove)) { return s.substring(remove.length()); } return s; }
java
public static String removeStartIgnoreCase(final String s, final String remove) { if (isEmpty(s) || isEmpty(remove)) { return s; } if (startsWithIgnoreCase(s, remove)) { return s.substring(remove.length()); } return s; }
[ "public", "static", "String", "removeStartIgnoreCase", "(", "final", "String", "s", ",", "final", "String", "remove", ")", "{", "if", "(", "isEmpty", "(", "s", ")", "||", "isEmpty", "(", "remove", ")", ")", "{", "return", "s", ";", "}", "if", "(", "s...
<p> Case insensitive removal of a substring if it is at the beginning of a source string, otherwise returns the source string. </p> <p> A {@code null} source string will return {@code null}. An empty ("") source string will return the empty string. A {@code null} search string will return the source string. </p> <pre...
[ "<p", ">", "Case", "insensitive", "removal", "of", "a", "substring", "if", "it", "is", "at", "the", "beginning", "of", "a", "source", "string", "otherwise", "returns", "the", "source", "string", ".", "<", "/", "p", ">" ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java#L1853-L1861
test
Removes the first occurrence of a string from a string ignoring case.
Of course, here is the Java code you requested: ```java public static String removeStartIgnoreCase(final String s, final String remove) { if (isEmpty(s) || isEmpty(remove)) { return s; } if (startsWithIgnoreCase(s, remove)) { return s.substring(remove.length()); ...
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/compiler/PositionalTermTraverserImpl.java
PositionalTermTraverserImpl.createClauseOperator
protected StackableOperator createClauseOperator(Clause bodyClause, int pos, Clause[] body, Predicate predicate) { return new PositionalContextOperator(bodyClause, pos, false, false, false, null, contextStack.peek()); }
java
protected StackableOperator createClauseOperator(Clause bodyClause, int pos, Clause[] body, Predicate predicate) { return new PositionalContextOperator(bodyClause, pos, false, false, false, null, contextStack.peek()); }
[ "protected", "StackableOperator", "createClauseOperator", "(", "Clause", "bodyClause", ",", "int", "pos", ",", "Clause", "[", "]", "body", ",", "Predicate", "predicate", ")", "{", "return", "new", "PositionalContextOperator", "(", "bodyClause", ",", "pos", ",", ...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/compiler/PositionalTermTraverserImpl.java#L208-L211
test
Create a clause operator.
Of course, here is the Java code you requested: ```java protected StackableOperator createClauseOperator(Clause bodyClause, int pos, Clause[] body, Predicate predicate) { return new PositionalContextOperator(bodyClause, pos, false, false, false, null, contextStack.peek()); } ``` Hope this helps!
jcodec/jcodec
src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java
BlockInterpolator.getLuma12
void getLuma12(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) { int tmpW = blkW + 7; getLuma02NoRound(pic, picW, tmp1, 0, tmpW, x - 2, y, tmpW, blkH); getLuma20NoRoundInt(tmp1, tmpW, tmp2, blkOff, blkStride, 2, 0, blkW, blkH); int off = ...
java
void getLuma12(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) { int tmpW = blkW + 7; getLuma02NoRound(pic, picW, tmp1, 0, tmpW, x - 2, y, tmpW, blkH); getLuma20NoRoundInt(tmp1, tmpW, tmp2, blkOff, blkStride, 2, 0, blkW, blkH); int off = ...
[ "void", "getLuma12", "(", "byte", "[", "]", "pic", ",", "int", "picW", ",", "byte", "[", "]", "blk", ",", "int", "blkOff", ",", "int", "blkStride", ",", "int", "x", ",", "int", "y", ",", "int", "blkW", ",", "int", "blkH", ")", "{", "int", "tmpW...
Qpel horizontal, Hpel vertical (1, 2)
[ "Qpel", "horizontal", "Hpel", "vertical", "(", "1", "2", ")" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java#L579-L596
test
getLuma12 - Method to get the Luma 12 code from the image
Of course, here is the Java code you requested: ```java void getLuma12(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) { int tmpW = blkW + 7; getLuma02NoRound(pic, picW, tmp1, 0, tmpW, x - 2, y, tmpW, blkH); getLuma20NoRoundInt(tmp1, tmpW, tmp2, ...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/gempak/GempakStation.java
GempakStation.getWmoId
public String getWmoId() { String wmoID = ""; if (!(stnm == GempakConstants.IMISSD)) { wmoID = String.valueOf((int) (stnm / 10)); } return wmoID; }
java
public String getWmoId() { String wmoID = ""; if (!(stnm == GempakConstants.IMISSD)) { wmoID = String.valueOf((int) (stnm / 10)); } return wmoID; }
[ "public", "String", "getWmoId", "(", ")", "{", "String", "wmoID", "=", "\"\"", ";", "if", "(", "!", "(", "stnm", "==", "GempakConstants", ".", "IMISSD", ")", ")", "{", "wmoID", "=", "String", ".", "valueOf", "(", "(", "int", ")", "(", "stnm", "/", ...
Get the WMO Station ID as a string @return the WMO id
[ "Get", "the", "WMO", "Station", "ID", "as", "a", "string" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakStation.java#L449-L455
test
Gets the WmoID.
Of course, here is the Java code you requested: ```java public String getWmoId() { String wmoID = ""; if (!(stnm == GempakConstants.IMISSD)) { wmoID = String.valueOf((int) (stnm / 10)); } return wmoID; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/NetcdfFile.java
NetcdfFile.registerIOProvider
static public void registerIOProvider(String className) throws IllegalAccessException, InstantiationException, ClassNotFoundException { Class ioClass = NetcdfFile.class.getClassLoader().loadClass(className); registerIOProvider(ioClass); }
java
static public void registerIOProvider(String className) throws IllegalAccessException, InstantiationException, ClassNotFoundException { Class ioClass = NetcdfFile.class.getClassLoader().loadClass(className); registerIOProvider(ioClass); }
[ "static", "public", "void", "registerIOProvider", "(", "String", "className", ")", "throws", "IllegalAccessException", ",", "InstantiationException", ",", "ClassNotFoundException", "{", "Class", "ioClass", "=", "NetcdfFile", ".", "class", ".", "getClassLoader", "(", "...
Register an IOServiceProvider, using its class string name. @param className Class that implements IOServiceProvider. @throws IllegalAccessException if class is not accessible. @throws InstantiationException if class doesnt have a no-arg constructor. @throws ClassNotFoundException if class not found.
[ "Register", "an", "IOServiceProvider", "using", "its", "class", "string", "name", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L305-L308
test
Register an IOProvider class
Of course, here is the Java code you requested: ```java static public void registerIOProvider(String className) throws IllegalAccessException, InstantiationException, ClassNotFoundException { Class ioClass = NetcdfFile.class.getClassLoader().loadClass(className); registerIOProvider(ioClass); } ``` Hope this...
Unidata/thredds
cdm/src/main/java/ucar/ma2/Range.java
Range.element
public int element(int i) throws InvalidRangeException { if (i < 0) throw new InvalidRangeException("i must be >= 0"); if (i >= length) throw new InvalidRangeException("i must be < length"); return first + i * stride; }
java
public int element(int i) throws InvalidRangeException { if (i < 0) throw new InvalidRangeException("i must be >= 0"); if (i >= length) throw new InvalidRangeException("i must be < length"); return first + i * stride; }
[ "public", "int", "element", "(", "int", "i", ")", "throws", "InvalidRangeException", "{", "if", "(", "i", "<", "0", ")", "throw", "new", "InvalidRangeException", "(", "\"i must be >= 0\"", ")", ";", "if", "(", "i", ">=", "length", ")", "throw", "new", "I...
Get ith element @param i index of the element @return the i-th element of a range. @throws InvalidRangeException i must be: 0 <= i < length
[ "Get", "ith", "element" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/Range.java#L279-L286
test
Gets the element of the array.
Of course, here is the Java code you requested: ```java public int element(int i) throws InvalidRangeException { if (i < 0) throw new InvalidRangeException("i must be >= 0"); if (i >= length) throw new InvalidRangeException("i must be < length"); return first + i * stride; } ``` Hope this h...
arnohaase/a-foundation
a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java
ACollectionHelper.flattenSet
public static <T> Set<T> flattenSet(Iterable<? extends Iterable<T>> coll) { final Set<T> result = new HashSet<>(); for(Iterable<T> o: coll) { for(T el: o) { result.add(el); } } return result; }
java
public static <T> Set<T> flattenSet(Iterable<? extends Iterable<T>> coll) { final Set<T> result = new HashSet<>(); for(Iterable<T> o: coll) { for(T el: o) { result.add(el); } } return result; }
[ "public", "static", "<", "T", ">", "Set", "<", "T", ">", "flattenSet", "(", "Iterable", "<", "?", "extends", "Iterable", "<", "T", ">", ">", "coll", ")", "{", "final", "Set", "<", "T", ">", "result", "=", "new", "HashSet", "<>", "(", ")", ";", ...
Takes a collection of collections and creates a new collection from the elements, leaving out the innermost level of collection.
[ "Takes", "a", "collection", "of", "collections", "and", "creates", "a", "new", "collection", "from", "the", "elements", "leaving", "out", "the", "innermost", "level", "of", "collection", "." ]
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java#L273-L281
test
Flattens a set of Iterable into a Set.
Of course, here is the Java code you requested: ```java public static <T> Set<T> flattenSet(Iterable<? extends Iterable<T>> coll) { final Set<T> result = new HashSet<>(); for(Iterable<T> o: coll) { for(T el: o) { result.add(el); } } return result;...
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/runtime/facilities/TracerStorage.java
TracerStorage.getRequestedTracerNames
public String[] getRequestedTracerNames() { Set<String> names = new HashSet<String>(); for (TracerImpl t : this.tracers.values()) { if (t.isRequestedBySource()) names.add(t.getTracerName()); } if(names.isEmpty()) return new String[0]; return names.toArray(new String[names.size()]); }
java
public String[] getRequestedTracerNames() { Set<String> names = new HashSet<String>(); for (TracerImpl t : this.tracers.values()) { if (t.isRequestedBySource()) names.add(t.getTracerName()); } if(names.isEmpty()) return new String[0]; return names.toArray(new String[names.size()]); }
[ "public", "String", "[", "]", "getRequestedTracerNames", "(", ")", "{", "Set", "<", "String", ">", "names", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "for", "(", "TracerImpl", "t", ":", "this", ".", "tracers", ".", "values", "(", ")",...
This method raturns tracer names of tracers that have been requested directly from NotificationSource (like through SbbContext, RAContext, etc) @return
[ "This", "method", "raturns", "tracer", "names", "of", "tracers", "that", "have", "been", "requested", "directly", "from", "NotificationSource", "(", "like", "through", "SbbContext", "RAContext", "etc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/runtime/facilities/TracerStorage.java#L110-L119
test
Returns the names of all the requested tracers.
Of course, here is the Java code you requested: ```java public String[] getRequestedTracerNames() { Set<String> names = new HashSet<String>(); for (TracerImpl t : this.tracers.values()) { if (t.isRequestedBySource()) names.add(t.getTracerName()); } if(names.isEmpty()) return new String[0]; return n...
wro4j/wro4j
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/css/CssLintProcessor.java
CssLintProcessor.onCssLintException
protected void onCssLintException(final CssLintException e, final Resource resource) { final String uri = resource == null ? StringUtils.EMPTY : resource.getUri(); LOG.error("The following resource: " + uri + " has " + e.getErrors().size() + " errors."); for (final CssLintError x : e.getError...
java
protected void onCssLintException(final CssLintException e, final Resource resource) { final String uri = resource == null ? StringUtils.EMPTY : resource.getUri(); LOG.error("The following resource: " + uri + " has " + e.getErrors().size() + " errors."); for (final CssLintError x : e.getError...
[ "protected", "void", "onCssLintException", "(", "final", "CssLintException", "e", ",", "final", "Resource", "resource", ")", "{", "final", "String", "uri", "=", "resource", "==", "null", "?", "StringUtils", ".", "EMPTY", ":", "resource", ".", "getUri", "(", ...
Called when {@link CssLintException} is thrown. Allows subclasses to re-throw this exception as a {@link RuntimeException} or handle it differently. @param e {@link CssLintException} which has occurred. @param resource the processed resource which caused the exception.
[ "Called", "when", "{", "@link", "CssLintException", "}", "is", "thrown", ".", "Allows", "subclasses", "to", "re", "-", "throw", "this", "exception", "as", "a", "{", "@link", "RuntimeException", "}", "or", "handle", "it", "differently", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/css/CssLintProcessor.java#L105-L112
test
On css lint exception.
Of course, here is the Java code you requested: ```java protected void onCssLintException(final CssLintException e, final Resource resource) { final String uri = resource == null ? StringUtils.EMPTY : resource.getUri(); LOG.error("The following resource: " + uri + " has " + e.getErrors().size() + " e...
RestComm/jain-slee
api/jar/src/main/java/javax/slee/facilities/TraceLevel.java
TraceLevel.isHigherLevel
public boolean isHigherLevel(TraceLevel other) throws NullPointerException { if (other == null) throw new NullPointerException("other is null"); return this.level < other.level; }
java
public boolean isHigherLevel(TraceLevel other) throws NullPointerException { if (other == null) throw new NullPointerException("other is null"); return this.level < other.level; }
[ "public", "boolean", "isHigherLevel", "(", "TraceLevel", "other", ")", "throws", "NullPointerException", "{", "if", "(", "other", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"other is null\"", ")", ";", "return", "this", ".", "level", "<", ...
Determine if this TraceLevel object represents a level that is higher than some other TraceLevel object. For the purposes of the comparison OFF is considered a higher level than SEVERE, and FINEST is the lowest level. @param other the <code>TraceLevel</code> object to compare this with. @return <code>true</code> if th...
[ "Determine", "if", "this", "TraceLevel", "object", "represents", "a", "level", "that", "is", "higher", "than", "some", "other", "TraceLevel", "object", ".", "For", "the", "purposes", "of", "the", "comparison", "OFF", "is", "considered", "a", "higher", "level",...
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/facilities/TraceLevel.java#L368-L372
test
Checks if this is the higher level of the other.
Of course, here is the Java code you requested: ```java public boolean isHigherLevel(TraceLevel other) throws NullPointerException { if (other == null) throw new NullPointerException("other is null"); return this.level < other.level; } ``` Hope this helps!
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/Index.java
Index.getObjectsAsync
public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable final RequestOptions requestOptions, @Nullable CompletionHandler completionHandler) { return getClient().new AsyncTaskRequest(completionHandler) { @NonNull @Override protected JSONObject run() throws Al...
java
public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable final RequestOptions requestOptions, @Nullable CompletionHandler completionHandler) { return getClient().new AsyncTaskRequest(completionHandler) { @NonNull @Override protected JSONObject run() throws Al...
[ "public", "Request", "getObjectsAsync", "(", "final", "@", "NonNull", "Collection", "<", "String", ">", "objectIDs", ",", "@", "Nullable", "final", "RequestOptions", "requestOptions", ",", "@", "Nullable", "CompletionHandler", "completionHandler", ")", "{", "return"...
Gets several objects from this index (asynchronously), optionally restricting the retrieved content (asynchronously). @param objectIDs Identifiers of objects to retrieve. @param requestOptions Request-specific options. @param completionHandler The listener that will be notified of the request's out...
[ "Gets", "several", "objects", "from", "this", "index", "(", "asynchronously", ")", "optionally", "restricting", "the", "retrieved", "content", "(", "asynchronously", ")", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L633-L640
test
Asynchronously get a list of objects from the server.
Of course, here is the Java code you requested: ```java public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable final RequestOptions requestOptions, @Nullable CompletionHandler completionHandler) { return getClient().new AsyncTaskRequest(completionHandler) { @NonNull ...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/AnnotationWriter.java
AnnotationWriter.computeAnnotationsSize
int computeAnnotationsSize(final String attributeName) { if (attributeName != null) { symbolTable.addConstantUtf8(attributeName); } // The attribute_name_index, attribute_length and num_annotations fields use 8 bytes. int attributeSize = 8; AnnotationWriter annotationWriter = this; while (...
java
int computeAnnotationsSize(final String attributeName) { if (attributeName != null) { symbolTable.addConstantUtf8(attributeName); } // The attribute_name_index, attribute_length and num_annotations fields use 8 bytes. int attributeSize = 8; AnnotationWriter annotationWriter = this; while (...
[ "int", "computeAnnotationsSize", "(", "final", "String", "attributeName", ")", "{", "if", "(", "attributeName", "!=", "null", ")", "{", "symbolTable", ".", "addConstantUtf8", "(", "attributeName", ")", ";", "}", "// The attribute_name_index, attribute_length and num_ann...
Returns the size of a Runtime[In]Visible[Type]Annotations attribute containing this annotation and all its <i>predecessors</i> (see {@link #previousAnnotation}. Also adds the attribute name to the constant pool of the class (if not null). @param attributeName one of "Runtime[In]Visible[Type]Annotations", or null. @ret...
[ "Returns", "the", "size", "of", "a", "Runtime", "[", "In", "]", "Visible", "[", "Type", "]", "Annotations", "attribute", "containing", "this", "annotation", "and", "all", "its", "<i", ">", "predecessors<", "/", "i", ">", "(", "see", "{", "@link", "#previ...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/AnnotationWriter.java#L292-L304
test
Compute the size of the annotation table.
Of course, here is the Java code you requested: ```java int computeAnnotationsSize(final String attributeName) { if (attributeName != null) { symbolTable.addConstantUtf8(attributeName); } // The attribute_name_index, attribute_length and num_annotations fields use 8 bytes. int attributeSize = 8; ...
rupertlssmith/lojix
lojix/state/src/main/com/thesett/aima/state/impl/TypeHelper.java
TypeHelper.getTypeFromObject
public static Type getTypeFromObject(Object o) { // Check if the object is null, in which case its type cannot be derived. if (o == null) { return new UnknownType(); } // Check if the object is an attribute a and get its type that way if possible. if (o i...
java
public static Type getTypeFromObject(Object o) { // Check if the object is null, in which case its type cannot be derived. if (o == null) { return new UnknownType(); } // Check if the object is an attribute a and get its type that way if possible. if (o i...
[ "public", "static", "Type", "getTypeFromObject", "(", "Object", "o", ")", "{", "// Check if the object is null, in which case its type cannot be derived.", "if", "(", "o", "==", "null", ")", "{", "return", "new", "UnknownType", "(", ")", ";", "}", "// Check if the obj...
Gets the type of a specified object. @param o The object to get the type of. @return The type of the object.
[ "Gets", "the", "type", "of", "a", "specified", "object", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/state/src/main/com/thesett/aima/state/impl/TypeHelper.java#L40-L56
test
Get the type of the object.
Of course, here is the Java code you requested: ```java public static Type getTypeFromObject(Object o) { // Check if the object is null, in which case its type cannot be derived. if (o == null) { return new UnknownType(); } // Check if the object is an attribute...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/wildcard/JarWildcardStreamLocator.java
JarWildcardStreamLocator.open
JarFile open(final File jarFile) throws IOException { isTrue(jarFile.exists(), "The JAR file must exists."); return new JarFile(jarFile); }
java
JarFile open(final File jarFile) throws IOException { isTrue(jarFile.exists(), "The JAR file must exists."); return new JarFile(jarFile); }
[ "JarFile", "open", "(", "final", "File", "jarFile", ")", "throws", "IOException", "{", "isTrue", "(", "jarFile", ".", "exists", "(", ")", ",", "\"The JAR file must exists.\"", ")", ";", "return", "new", "JarFile", "(", "jarFile", ")", ";", "}" ]
Opens the specified JAR file and returns a valid handle. @param jarFile Location of the valid JAR file to read. It cannot be null. @return A valid {@link JarFile} to read resources. @throws IllegalArgumentException If the file cannot be opened because an {@link IOException}. @VisibleForTestOnly
[ "Opens", "the", "specified", "JAR", "file", "and", "returns", "a", "valid", "handle", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/wildcard/JarWildcardStreamLocator.java#L119-L122
test
Open a JAR file.
Of course, here is the Java code you requested: ```java JarFile open(final File jarFile) throws IOException { isTrue(jarFile.exists(), "The JAR file must exists."); return new JarFile(jarFile); } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
SameDiff.getFunctionById
public DifferentialFunction getFunctionById(String id) { if (!functionInstancesById.containsKey(id)) { throw new ND4JIllegalStateException("No function with id " + id + " found!"); } return functionInstancesById.get(id); }
java
public DifferentialFunction getFunctionById(String id) { if (!functionInstancesById.containsKey(id)) { throw new ND4JIllegalStateException("No function with id " + id + " found!"); } return functionInstancesById.get(id); }
[ "public", "DifferentialFunction", "getFunctionById", "(", "String", "id", ")", "{", "if", "(", "!", "functionInstancesById", ".", "containsKey", "(", "id", ")", ")", "{", "throw", "new", "ND4JIllegalStateException", "(", "\"No function with id \"", "+", "id", "+",...
Get the function by the {@link DifferentialFunction#getOwnName()} @param id the id of the function @return the function for the given id if it exists
[ "Get", "the", "function", "by", "the", "{", "@link", "DifferentialFunction#getOwnName", "()", "}" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L438-L443
test
Get the DifferentialFunction object by its id.
Of course, here is the Java code you requested: ```java public DifferentialFunction getFunctionById(String id) { if (!functionInstancesById.containsKey(id)) { throw new ND4JIllegalStateException("No function with id " + id + " found!"); } return functionInstancesById.get(id); } ...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/TypeConverter.java
TypeConverter.getMultiTypeData
public static MultiTypeData getMultiTypeData(long l) { // Convert the value to a String and return the set of types that that String can be converted to. MultiTypeData result = getMultiTypeData(Long.toString(l)); result.nativeType = LONG; return result; }
java
public static MultiTypeData getMultiTypeData(long l) { // Convert the value to a String and return the set of types that that String can be converted to. MultiTypeData result = getMultiTypeData(Long.toString(l)); result.nativeType = LONG; return result; }
[ "public", "static", "MultiTypeData", "getMultiTypeData", "(", "long", "l", ")", "{", "// Convert the value to a String and return the set of types that that String can be converted to.", "MultiTypeData", "result", "=", "getMultiTypeData", "(", "Long", ".", "toString", "(", "l",...
Converts a long into a multi type data object. @param l The long to convert. @return A multi type data object holding all the types that the long can be converted into.
[ "Converts", "a", "long", "into", "a", "multi", "type", "data", "object", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/TypeConverter.java#L196-L203
test
Get the MultiTypeData for a long value.
Of course, here is the Java code you requested: ```java public static MultiTypeData getMultiTypeData(long l) { // Convert the value to a String and return the set of types that that String can be converted to. MultiTypeData result = getMultiTypeData(Long.toString(l)); result.nativeType = LO...
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/CorbaNamingContext.java
CorbaNamingContext.init
public static void init(org.omg.CORBA.ORB orb, org.omg.PortableServer.POA rootPoa) { CorbaNamingContext.orb = orb; CorbaNamingContext.rootPoa = rootPoa; }
java
public static void init(org.omg.CORBA.ORB orb, org.omg.PortableServer.POA rootPoa) { CorbaNamingContext.orb = orb; CorbaNamingContext.rootPoa = rootPoa; }
[ "public", "static", "void", "init", "(", "org", ".", "omg", ".", "CORBA", ".", "ORB", "orb", ",", "org", ".", "omg", ".", "PortableServer", ".", "POA", "rootPoa", ")", "{", "CorbaNamingContext", ".", "orb", "=", "orb", ";", "CorbaNamingContext", ".", "...
<p> This method needs to be called once to initialize the static fields orb and rootPoa. </p> @param orb a reference to the running {@code ORB} instance. @param rootPoa a reference to the root {@code POA}.
[ "<p", ">", "This", "method", "needs", "to", "be", "called", "once", "to", "initialize", "the", "static", "fields", "orb", "and", "rootPoa", ".", "<", "/", "p", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/CorbaNamingContext.java#L117-L122
test
Initialize the CorbaNamingContext.
Of course, here is the Java code you requested: ```java public static void init(org.omg.CORBA.ORB orb, org.omg.PortableServer.POA rootPoa) { CorbaNamingContext.orb = orb; CorbaNamingContext.rootPoa = rootPoa; } ``` Hope this helps!
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java
ClassReader.readElementValue
private int readElementValue( final AnnotationVisitor annotationVisitor, final int elementValueOffset, final String elementName, final char[] charBuffer) { int currentOffset = elementValueOffset; if (annotationVisitor == null) { switch (b[currentOffset] & 0xFF) { case 'e': ...
java
private int readElementValue( final AnnotationVisitor annotationVisitor, final int elementValueOffset, final String elementName, final char[] charBuffer) { int currentOffset = elementValueOffset; if (annotationVisitor == null) { switch (b[currentOffset] & 0xFF) { case 'e': ...
[ "private", "int", "readElementValue", "(", "final", "AnnotationVisitor", "annotationVisitor", ",", "final", "int", "elementValueOffset", ",", "final", "String", "elementName", ",", "final", "char", "[", "]", "charBuffer", ")", "{", "int", "currentOffset", "=", "el...
Reads a JVMS 'element_value' structure and makes the given visitor visit it. @param annotationVisitor the visitor that must visit the element_value structure. @param elementValueOffset the start offset in {@link #b} of the element_value structure to be read. @param elementName the name of the element_value structure t...
[ "Reads", "a", "JVMS", "element_value", "structure", "and", "makes", "the", "given", "visitor", "visit", "it", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java#L2779-L2946
test
Read an element value.
Of course, here is the Java code you requested: ```java private int readElementValue( final AnnotationVisitor annotationVisitor, final int elementValueOffset, final String elementName, final char[] charBuffer) { int currentOffset = elementValueOffset; if (annotationVisitor == null) { ...
Unidata/thredds
dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArraySequence.java
CDMArraySequence.add
void add(long recno, int fieldno, Array field) { //Make sure all the space is allocated if(records.length <= recno) { FieldSet[] newrecs = new FieldSet[(int) recno + 1]; System.arraycopy(records, 0, newrecs, 0, records.length); records = newrecs; } ...
java
void add(long recno, int fieldno, Array field) { //Make sure all the space is allocated if(records.length <= recno) { FieldSet[] newrecs = new FieldSet[(int) recno + 1]; System.arraycopy(records, 0, newrecs, 0, records.length); records = newrecs; } ...
[ "void", "add", "(", "long", "recno", ",", "int", "fieldno", ",", "Array", "field", ")", "{", "//Make sure all the space is allocated", "if", "(", "records", ".", "length", "<=", "recno", ")", "{", "FieldSet", "[", "]", "newrecs", "=", "new", "FieldSet", "[...
/*package
[ "/", "*", "package" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArraySequence.java#L167-L181
test
Add a single coding formula to the CIS record.
Of course, here is the Java code you requested: ```java void add(long recno, int fieldno, Array field) { //Make sure all the space is allocated if(records.length <= recno) { FieldSet[] newrecs = new FieldSet[(int) recno + 1]; System.arraycopy(records, 0, newrecs, 0, reco...