repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
jboss/jboss-jsf-api_spec
src/main/java/javax/faces/component/AttachedObjectListHolder.java
AttachedObjectListHolder.saveState
public Object saveState(FacesContext context) { if (context == null) { throw new NullPointerException(); } if (attachedObjects == null) { return null; } if (initialState) { Object[] attachedObjects = new Object[this.attachedObjects.size()]; ...
java
public Object saveState(FacesContext context) { if (context == null) { throw new NullPointerException(); } if (attachedObjects == null) { return null; } if (initialState) { Object[] attachedObjects = new Object[this.attachedObjects.size()]; ...
[ "public", "Object", "saveState", "(", "FacesContext", "context", ")", "{", "if", "(", "context", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "if", "(", "attachedObjects", "==", "null", ")", "{", "return", "null", "...
-------------------------------------------- Methods from StateHolder
[ "--------------------------------------------", "Methods", "from", "StateHolder" ]
cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3
https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/AttachedObjectListHolder.java#L103-L136
train
Save the state of this component.
Of course, here is the Java code you requested: ```java public Object saveState(FacesContext context) { if (context == null) { throw new NullPointerException(); } if (attachedObjects == null) { return null; } if (initialState) { Object[] atta...
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/geospatial/GeoPoint.java
GeoPoint.toSpatial4j
@Override public com.spatial4j.core.shape.Shape toSpatial4j(SpatialContext spatialContext) { return spatialContext.makePoint(longitude, latitude); }
java
@Override public com.spatial4j.core.shape.Shape toSpatial4j(SpatialContext spatialContext) { return spatialContext.makePoint(longitude, latitude); }
[ "@", "Override", "public", "com", ".", "spatial4j", ".", "core", ".", "shape", ".", "Shape", "toSpatial4j", "(", "SpatialContext", "spatialContext", ")", "{", "return", "spatialContext", ".", "makePoint", "(", "longitude", ",", "latitude", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/geospatial/GeoPoint.java#L49-L52
train
Convert this object to a spatial 4j shape.
Of course, here is the Java code you requested: ```java @Override public com.spatial4j.core.shape.Shape toSpatial4j(SpatialContext spatialContext) { return spatialContext.makePoint(longitude, latitude); } ``` Hope this helps!
prestodb/presto
presto-main/src/main/java/com/facebook/presto/operator/scalar/ColorFunctions.java
ColorFunctions.toAnsi
private static int toAnsi(int red, int green, int blue) { // rescale to 0-5 range red = red * 6 / 256; green = green * 6 / 256; blue = blue * 6 / 256; return 16 + red * 36 + green * 6 + blue; }
java
private static int toAnsi(int red, int green, int blue) { // rescale to 0-5 range red = red * 6 / 256; green = green * 6 / 256; blue = blue * 6 / 256; return 16 + red * 36 + green * 6 + blue; }
[ "private", "static", "int", "toAnsi", "(", "int", "red", ",", "int", "green", ",", "int", "blue", ")", "{", "// rescale to 0-5 range", "red", "=", "red", "*", "6", "/", "256", ";", "green", "=", "green", "*", "6", "/", "256", ";", "blue", "=", "blu...
Convert the given color (rgb or system) to an ansi-compatible index (for use with ESC[38;5;<value>m)
[ "Convert", "the", "given", "color", "(", "rgb", "or", "system", ")", "to", "an", "ansi", "-", "compatible", "index", "(", "for", "use", "with", "ESC", "[", "38", ";", "5", ";", "<value", ">", "m", ")" ]
89de5e379d8f85e139d292b0add8c537a2a01a88
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/operator/scalar/ColorFunctions.java#L249-L257
train
Converts the RGB values to an ANSI value.
Of course, here is the Java code you requested: ```java private static int toAnsi(int red, int green, int blue) { // rescale to 0-5 range red = red * 6 / 256; green = green * 6 / 256; blue = blue * 6 / 256; return 16 + red * 36 + green * 6 + blue; } ``` Hope this helps...
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundLink.java
HttpOutboundLink.getInterface
private HttpOutboundServiceContextImpl getInterface(VirtualConnection inVC) { if (null == this.myInterface) { this.myInterface = new HttpOutboundServiceContextImpl((TCPConnectionContext) getDeviceLink().getChannelAccessor(), this, inVC, this.myChannel.getHttpConfig()); } return this...
java
private HttpOutboundServiceContextImpl getInterface(VirtualConnection inVC) { if (null == this.myInterface) { this.myInterface = new HttpOutboundServiceContextImpl((TCPConnectionContext) getDeviceLink().getChannelAccessor(), this, inVC, this.myChannel.getHttpConfig()); } return this...
[ "private", "HttpOutboundServiceContextImpl", "getInterface", "(", "VirtualConnection", "inVC", ")", "{", "if", "(", "null", "==", "this", ".", "myInterface", ")", "{", "this", ".", "myInterface", "=", "new", "HttpOutboundServiceContextImpl", "(", "(", "TCPConnection...
Get access to the outbound service context for this connection. If it does not exist yet, then create it. @return HttpOutboundServiceContextImpl
[ "Get", "access", "to", "the", "outbound", "service", "context", "for", "this", "connection", ".", "If", "it", "does", "not", "exist", "yet", "then", "create", "it", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundLink.java#L126-L132
train
Gets the HttpOutboundServiceContextImpl.
Of course, here is the Java code you requested: ```java private HttpOutboundServiceContextImpl getInterface(VirtualConnection inVC) { if (null == this.myInterface) { this.myInterface = new HttpOutboundServiceContextImpl((TCPConnectionContext) getDeviceLink().getChannelAccessor(), this, inVC, this....
overturetool/overture
ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java
CharOperation.lastIndexOf
public static final int lastIndexOf(char toBeFound, char[] array, int startIndex, int endIndex) { for (int i = endIndex; --i >= startIndex;) { if (toBeFound == array[i]) { return i; } } return -1; }
java
public static final int lastIndexOf(char toBeFound, char[] array, int startIndex, int endIndex) { for (int i = endIndex; --i >= startIndex;) { if (toBeFound == array[i]) { return i; } } return -1; }
[ "public", "static", "final", "int", "lastIndexOf", "(", "char", "toBeFound", ",", "char", "[", "]", "array", ",", "int", "startIndex", ",", "int", "endIndex", ")", "{", "for", "(", "int", "i", "=", "endIndex", ";", "--", "i", ">=", "startIndex", ";", ...
Answers the last index in the array for which the corresponding character is equal to toBeFound starting from endIndex to startIndex. Answers -1 if no occurrence of this character is found. <br> <br> For example: <ol> <li> <pre> toBeFound = 'c' array = { ' a', 'b', 'c', 'd' } startIndex = 2 endIndex = 2 result =&gt; 2...
[ "Answers", "the", "last", "index", "in", "the", "array", "for", "which", "the", "corresponding", "character", "is", "equal", "to", "toBeFound", "starting", "from", "endIndex", "to", "startIndex", ".", "Answers", "-", "1", "if", "no", "occurrence", "of", "thi...
83175dc6c24fa171cde4fcf61ecb648eba3bdbc1
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java#L2551-L2562
train
Gets the last index of toBeFound in the specified char array.
Of course, here is the Java code you requested: ```java public static final int lastIndexOf(char toBeFound, char[] array, int startIndex, int endIndex) { for (int i = endIndex; --i >= startIndex;) { if (toBeFound == array[i]) { return i; } } return -1; } ``` Hope this helps!
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/LuceneIndex.java
LuceneIndex.upsert
public void upsert(Term term, Document document) { Log.debug("Updating document %s with term %s", document, term); try { indexWriter.updateDocument(term, document); } catch (IOException e) { Log.error(e, "Error while updating document %s with term %s", document, term); ...
java
public void upsert(Term term, Document document) { Log.debug("Updating document %s with term %s", document, term); try { indexWriter.updateDocument(term, document); } catch (IOException e) { Log.error(e, "Error while updating document %s with term %s", document, term); ...
[ "public", "void", "upsert", "(", "Term", "term", ",", "Document", "document", ")", "{", "Log", ".", "debug", "(", "\"Updating document %s with term %s\"", ",", "document", ",", "term", ")", ";", "try", "{", "indexWriter", ".", "updateDocument", "(", "term", ...
Updates the specified {@link Document} by first deleting the documents containing {@code Term} and then adding the new document. The delete and then add are atomic as seen by a reader on the same index (flush may happen only after the add). @param term The {@link Term} to identify the document(s) to be deleted. @p...
[ "Updates", "the", "specified", "{", "@link", "Document", "}", "by", "first", "deleting", "the", "documents", "containing", "{", "@code", "Term", "}", "and", "then", "adding", "the", "new", "document", ".", "The", "delete", "and", "then", "add", "are", "ato...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/LuceneIndex.java#L147-L155
train
Update a document in the cache.
Of course, here is the Java code you requested: ```java public void upsert(Term term, Document document) { Log.debug("Updating document %s with term %s", document, term); try { indexWriter.updateDocument(term, document); } catch (IOException e) { Log.error(e, "Error whil...
neokree/MaterialNavigationDrawer
MaterialNavigationDrawerModule/src/main/java/it/neokree/materialnavigationdrawer/MaterialNavigationDrawer.java
MaterialNavigationDrawer.getAccountAtCurrentPosition
public MaterialAccount getAccountAtCurrentPosition(int position) { if (position < 0 || position >= accountManager.size()) throw new RuntimeException("Account Index Overflow"); return findAccountNumber(position); }
java
public MaterialAccount getAccountAtCurrentPosition(int position) { if (position < 0 || position >= accountManager.size()) throw new RuntimeException("Account Index Overflow"); return findAccountNumber(position); }
[ "public", "MaterialAccount", "getAccountAtCurrentPosition", "(", "int", "position", ")", "{", "if", "(", "position", "<", "0", "||", "position", ">=", "accountManager", ".", "size", "(", ")", ")", "throw", "new", "RuntimeException", "(", "\"Account Index Overflow\...
Get the account knowing his position @param position the position of the account (it can change at runtime!) @return the account
[ "Get", "the", "account", "knowing", "his", "position" ]
86e355f6190dcb7255c6b9c28c1e54cf96f46358
https://github.com/neokree/MaterialNavigationDrawer/blob/86e355f6190dcb7255c6b9c28c1e54cf96f46358/MaterialNavigationDrawerModule/src/main/java/it/neokree/materialnavigationdrawer/MaterialNavigationDrawer.java#L2019-L2025
train
Get the account at the current position.
Of course, here is the Java code you requested: ```java public MaterialAccount getAccountAtCurrentPosition(int position) { if (position < 0 || position >= accountManager.size()) throw new RuntimeException("Account Index Overflow"); return findAccountNumber(position); } ``` Hope thi...
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/skins/BarGaugeTileSkin.java
BarGaugeTileSkin.resizeDynamicText
@Override protected void resizeDynamicText() { double maxWidth = unitText.isVisible() ? width - size * 0.275 : width - size * 0.1; double fontSize = size * 0.24; valueText.setFont(Fonts.latoRegular(fontSize)); if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize...
java
@Override protected void resizeDynamicText() { double maxWidth = unitText.isVisible() ? width - size * 0.275 : width - size * 0.1; double fontSize = size * 0.24; valueText.setFont(Fonts.latoRegular(fontSize)); if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize...
[ "@", "Override", "protected", "void", "resizeDynamicText", "(", ")", "{", "double", "maxWidth", "=", "unitText", ".", "isVisible", "(", ")", "?", "width", "-", "size", "*", "0.275", ":", "width", "-", "size", "*", "0.1", ";", "double", "fontSize", "=", ...
******************** Resizing ******************************************
[ "********************", "Resizing", "******************************************" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/skins/BarGaugeTileSkin.java#L197-L202
train
Resize the dynamic text.
Of course, here is the Java code you requested: ```java @Override protected void resizeDynamicText() { double maxWidth = unitText.isVisible() ? width - size * 0.275 : width - size * 0.1; double fontSize = size * 0.24; valueText.setFont(Fonts.latoRegular(fontSize)); if (valueText.getLayo...
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/logging/Redwood.java
Redwood.startTrack
public static void startTrack(final Object... args){ if(isClosed){ return; } //--Create Record final int len = args.length == 0 ? 0 : args.length-1; final Object content = args.length == 0 ? "" : args[len]; final Object[] tags = new Object[len]; final StackTraceElement ste = getStackTrace(...
java
public static void startTrack(final Object... args){ if(isClosed){ return; } //--Create Record final int len = args.length == 0 ? 0 : args.length-1; final Object content = args.length == 0 ? "" : args[len]; final Object[] tags = new Object[len]; final StackTraceElement ste = getStackTrace(...
[ "public", "static", "void", "startTrack", "(", "final", "Object", "...", "args", ")", "{", "if", "(", "isClosed", ")", "{", "return", ";", "}", "//--Create Record\r", "final", "int", "len", "=", "args", ".", "length", "==", "0", "?", "0", ":", "args", ...
Begin a "track;" that is, begin logging at one level deeper. Channels other than the FORCE channel are ignored. @param args The title of the track to begin, with an optional FORCE flag.
[ "Begin", "a", "track", ";", "that", "is", "begin", "logging", "at", "one", "level", "deeper", ".", "Channels", "other", "than", "the", "FORCE", "channel", "are", "ignored", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/logging/Redwood.java#L468-L498
train
Start a record in a thread.
Of course, here is the Java code you requested: ```java public static void startTrack(final Object... args){ if(isClosed){ return; } //--Create Record final int len = args.length == 0 ? 0 : args.length-1; final Object content = args.length == 0 ? "" : args[len]; final Object[] tags = new Objec...
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/rest/RESTRegistry.java
RESTRegistry.searchCommands
private RegisteredCommand searchCommands(String cmdOwner, HttpMethod method, String uri, String query, Map<String, String> variableMap) { Map<HttpMethod, SortedSet<RegisteredCommand>> evalMap = getCmdEvalMap(cmdOwner); if (evalMap == null) { r...
java
private RegisteredCommand searchCommands(String cmdOwner, HttpMethod method, String uri, String query, Map<String, String> variableMap) { Map<HttpMethod, SortedSet<RegisteredCommand>> evalMap = getCmdEvalMap(cmdOwner); if (evalMap == null) { r...
[ "private", "RegisteredCommand", "searchCommands", "(", "String", "cmdOwner", ",", "HttpMethod", "method", ",", "String", "uri", ",", "String", "query", ",", "Map", "<", "String", ",", "String", ">", "variableMap", ")", "{", "Map", "<", "HttpMethod", ",", "So...
Search the given command owner for a matching command.
[ "Search", "the", "given", "command", "owner", "for", "a", "matching", "command", "." ]
ad64d3c37922eefda68ec8869ef089c1ca604b70
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTRegistry.java#L268-L297
train
Search commands for a command that matches the query string.
Of course, here is the Java code you requested: ```java private RegisteredCommand searchCommands(String cmdOwner, HttpMethod method, String uri, String query, Map<String, String> variableMap) { Map<HttpMethod, SortedSet<RegisteredCommand>> evalMap = getCmdEvalMap(...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java
Ifc2x3tc1PackageImpl.getIfcControllerTypeEnum
public EEnum getIfcControllerTypeEnum() { if (ifcControllerTypeEnumEEnum == null) { ifcControllerTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(800); } return ifcControllerTypeEnumEEnum; }
java
public EEnum getIfcControllerTypeEnum() { if (ifcControllerTypeEnumEEnum == null) { ifcControllerTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(800); } return ifcControllerTypeEnumEEnum; }
[ "public", "EEnum", "getIfcControllerTypeEnum", "(", ")", "{", "if", "(", "ifcControllerTypeEnumEEnum", "==", "null", ")", "{", "ifcControllerTypeEnumEEnum", "=", "(", "EEnum", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "Ifc2x3tc1Pa...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L36713-L36719
train
Get the EEnum for the ifcControllerTypeEnum attribute.
Of course, here is the Java code you requested: ```java public EEnum getIfcControllerTypeEnum() { if (ifcControllerTypeEnumEEnum == null) { ifcControllerTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(800); } return ifcControllerTypeEnu...
EsotericSoftware/yamlbeans
src/com/esotericsoftware/yamlbeans/YamlReader.java
YamlReader.readValue
protected Object readValue (Class type, Class elementType, Class defaultType) throws YamlException, ParserException, TokenizerException { String tag = null, anchor = null; Event event = parser.peekNextEvent(); switch (event.type) { case ALIAS: parser.getNextEvent(); anchor = ((AliasEvent)event)...
java
protected Object readValue (Class type, Class elementType, Class defaultType) throws YamlException, ParserException, TokenizerException { String tag = null, anchor = null; Event event = parser.peekNextEvent(); switch (event.type) { case ALIAS: parser.getNextEvent(); anchor = ((AliasEvent)event)...
[ "protected", "Object", "readValue", "(", "Class", "type", ",", "Class", "elementType", ",", "Class", "defaultType", ")", "throws", "YamlException", ",", "ParserException", ",", "TokenizerException", "{", "String", "tag", "=", "null", ",", "anchor", "=", "null", ...
Reads an object from the YAML. Can be overidden to take some action for any of the objects returned.
[ "Reads", "an", "object", "from", "the", "YAML", ".", "Can", "be", "overidden", "to", "take", "some", "action", "for", "any", "of", "the", "objects", "returned", "." ]
f5610997edbc5534fc7e9f0a91654d14742345ca
https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlReader.java#L114-L139
train
Reads a object from the YAML.
Of course, here is the Java code you requested: ```java protected Object readValue (Class type, Class elementType, Class defaultType) throws YamlException, ParserException, TokenizerException { String tag = null, anchor = null; Event event = parser.peekNextEvent(); switch (event.type) { case ALIAS: ...
optimaize/language-detector
src/main/java/com/optimaize/langdetect/frma/LangProfileWriter.java
LangProfileWriter.write
public void write(LangProfile langProfile, OutputStream outputStream) throws IOException { try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream, Charset.forName("utf-8")))) { writer.write("{\"freq\":{"); boolean first = true; for (Map.Entry<String, In...
java
public void write(LangProfile langProfile, OutputStream outputStream) throws IOException { try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream, Charset.forName("utf-8")))) { writer.write("{\"freq\":{"); boolean first = true; for (Map.Entry<String, In...
[ "public", "void", "write", "(", "LangProfile", "langProfile", ",", "OutputStream", "outputStream", ")", "throws", "IOException", "{", "try", "(", "BufferedWriter", "writer", "=", "new", "BufferedWriter", "(", "new", "OutputStreamWriter", "(", "outputStream", ",", ...
Writes a {@link LangProfile} to an OutputStream in UTF-8. @throws IOException
[ "Writes", "a", "{", "@link", "LangProfile", "}", "to", "an", "OutputStream", "in", "UTF", "-", "8", "." ]
1a322c462f977b29eca8d3142b816b7111d3fa19
https://github.com/optimaize/language-detector/blob/1a322c462f977b29eca8d3142b816b7111d3fa19/src/main/java/com/optimaize/langdetect/frma/LangProfileWriter.java#L38-L66
train
Write the language profile to the output stream.
Of course, here is the Java code you requested: ```java public void write(LangProfile langProfile, OutputStream outputStream) throws IOException { try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream, Charset.forName("utf-8")))) { writer.write("{\"freq\":{"); bo...
ops4j/org.ops4j.pax.web
pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/ServletContextHelperTracker.java
ServletContextHelperTracker.create
public final ServiceTracker<T, ServletContextHelperElement> create(final Class<? extends T> trackedClass) { return new ServiceTracker<>(bundleContext, createFilter(bundleContext, trackedClass), this); }
java
public final ServiceTracker<T, ServletContextHelperElement> create(final Class<? extends T> trackedClass) { return new ServiceTracker<>(bundleContext, createFilter(bundleContext, trackedClass), this); }
[ "public", "final", "ServiceTracker", "<", "T", ",", "ServletContextHelperElement", ">", "create", "(", "final", "Class", "<", "?", "extends", "T", ">", "trackedClass", ")", "{", "return", "new", "ServiceTracker", "<>", "(", "bundleContext", ",", "createFilter", ...
static <T extends Servlet> ServiceTracker<T, ServletWebElement>
[ "static", "<T", "extends", "Servlet", ">", "ServiceTracker<T", "ServletWebElement", ">" ]
9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2
https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/ServletContextHelperTracker.java#L81-L83
train
Create a new service tracker for the specified class.
Of course, here is the Java code you requested: ```java public final ServiceTracker<T, ServletContextHelperElement> create(final Class<? extends T> trackedClass) { return new ServiceTracker<>(bundleContext, createFilter(bundleContext, trackedClass), this); } ``` Hope this helps!
nakamura5akihito/six-util
src/main/java/jp/go/aist/six/util/core/xml/spring327/CastorMarshaller.java
CastorMarshaller.convertCastorException
protected XmlMappingException convertCastorException(XMLException ex, boolean marshalling) { if (ex instanceof ValidationException) { return new ValidationFailureException("Castor validation exception", ex); } else if (ex instanceof MarshalException) { if (marshalling) { return new MarshallingFailureExc...
java
protected XmlMappingException convertCastorException(XMLException ex, boolean marshalling) { if (ex instanceof ValidationException) { return new ValidationFailureException("Castor validation exception", ex); } else if (ex instanceof MarshalException) { if (marshalling) { return new MarshallingFailureExc...
[ "protected", "XmlMappingException", "convertCastorException", "(", "XMLException", "ex", ",", "boolean", "marshalling", ")", "{", "if", "(", "ex", "instanceof", "ValidationException", ")", "{", "return", "new", "ValidationFailureException", "(", "\"Castor validation excep...
Convert the given {@code XMLException} to an appropriate exception from the {@code org.springframework.oxm} hierarchy. <p>A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since Castor itself does not make this distinction in its exception hierarchy. @param ex Castor ...
[ "Convert", "the", "given", "{" ]
a6db388a345e220cea2b1fa6324d15c80c6278b6
https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/core/xml/spring327/CastorMarshaller.java#L699-L715
train
Convert a Castor exception to an XMLMappingException.
Of course, here is the Java code you requested: ```java protected XmlMappingException convertCastorException(XMLException ex, boolean marshalling) { if (ex instanceof ValidationException) { return new ValidationFailureException("Castor validation exception", ex); } else if (ex instanceof MarshalException) { ...
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/similarity/PolynomialKernel.java
PolynomialKernel.sim
public double sim(DoubleVector v1, DoubleVector v2) { double dotProduct = VectorMath.dotProduct(v1, v2); return Math.pow(dotProduct + 1, degree); }
java
public double sim(DoubleVector v1, DoubleVector v2) { double dotProduct = VectorMath.dotProduct(v1, v2); return Math.pow(dotProduct + 1, degree); }
[ "public", "double", "sim", "(", "DoubleVector", "v1", ",", "DoubleVector", "v2", ")", "{", "double", "dotProduct", "=", "VectorMath", ".", "dotProduct", "(", "v1", ",", "v2", ")", ";", "return", "Math", ".", "pow", "(", "dotProduct", "+", "1", ",", "de...
{@inheritDoc}
[ "{" ]
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/similarity/PolynomialKernel.java#L61-L64
train
Compute the sim of two vectors.
Of course, here is the Java code you requested: ```java public double sim(DoubleVector v1, DoubleVector v2) { double dotProduct = VectorMath.dotProduct(v1, v2); return Math.pow(dotProduct + 1, degree); } ``` Hope this helps!
CloudSlang/cs-actions
cs-vmware/src/main/java/io/cloudslang/content/vmware/actions/guest/CustomizeLinuxGuest.java
CustomizeLinuxGuest.customizeLinuxGuest
@Action(name = "Customize Linux Guest", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field = Outp...
java
@Action(name = "Customize Linux Guest", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field = Outp...
[ "@", "Action", "(", "name", "=", "\"Customize Linux Guest\"", ",", "outputs", "=", "{", "@", "Output", "(", "Outputs", ".", "RETURN_CODE", ")", ",", "@", "Output", "(", "Outputs", ".", "RETURN_RESULT", ")", ",", "@", "Output", "(", "Outputs", ".", "EXCEP...
Connects to specified data center and customize an existing linux OS based virtual machine identified by the inputs provided. @param host VMware host or IP - Example: "vc6.subdomain.example.com" @param port optional - the port to connect through - Examples: "443", "80" - Default: "443" @par...
[ "Connects", "to", "specified", "data", "center", "and", "customize", "an", "existing", "linux", "OS", "based", "virtual", "machine", "identified", "by", "the", "inputs", "provided", "." ]
9a1be1e99ad88286a6c153d5f2275df6ae1a57a1
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/actions/guest/CustomizeLinuxGuest.java#L66-L126
train
Customize Linux Guest.
Of course, here is the Java code you requested: ```java @Action(name = "Customize Linux Guest", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { ...
duracloud/duracloud
common-queue/src/main/java/org/duracloud/common/queue/task/Task.java
Task.getAttempts
public int getAttempts() { String attempts = this.properties.get("attempts"); if (attempts == null) { attempts = "0"; } return Integer.parseInt(attempts); }
java
public int getAttempts() { String attempts = this.properties.get("attempts"); if (attempts == null) { attempts = "0"; } return Integer.parseInt(attempts); }
[ "public", "int", "getAttempts", "(", ")", "{", "String", "attempts", "=", "this", ".", "properties", ".", "get", "(", "\"attempts\"", ")", ";", "if", "(", "attempts", "==", "null", ")", "{", "attempts", "=", "\"0\"", ";", "}", "return", "Integer", ".",...
The number of completed attempts to process this task. @return
[ "The", "number", "of", "completed", "attempts", "to", "process", "this", "task", "." ]
dc4f3a1716d43543cc3b2e1880605f9389849b66
https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-queue/src/main/java/org/duracloud/common/queue/task/Task.java#L72-L79
train
Gets the value of the attempts property.
Of course, here is the Java code you requested: ```java public int getAttempts() { String attempts = this.properties.get("attempts"); if (attempts == null) { attempts = "0"; } return Integer.parseInt(attempts); } ``` Hope this helps!
mozilla/rhino
src/org/mozilla/javascript/UintMap.java
UintMap.ensureIndex
private int ensureIndex(int key, boolean intType) { int index = -1; int firstDeleted = -1; int[] keys = this.keys; if (keys != null) { int fraction = key * A; index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { r...
java
private int ensureIndex(int key, boolean intType) { int index = -1; int firstDeleted = -1; int[] keys = this.keys; if (keys != null) { int fraction = key * A; index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { r...
[ "private", "int", "ensureIndex", "(", "int", "key", ",", "boolean", "intType", ")", "{", "int", "index", "=", "-", "1", ";", "int", "firstDeleted", "=", "-", "1", ";", "int", "[", "]", "keys", "=", "this", ".", "keys", ";", "if", "(", "keys", "!=...
Ensure key index creating one if necessary
[ "Ensure", "key", "index", "creating", "one", "if", "necessary" ]
fa8a86df11d37623f5faa8d445a5876612bc47b0
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L287-L334
train
Ensures that the key is in the table.
Of course, here is the Java code you requested: ```java private int ensureIndex(int key, boolean intType) { int index = -1; int firstDeleted = -1; int[] keys = this.keys; if (keys != null) { int fraction = key * A; index = fraction >>> (32 - power); i...
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/types/StorageSize.java
StorageSize.compareTo
@Override public int compareTo(final StorageSize that) { if (that == null) throw new NullPointerException("Cannot compareTo a null value!"); return this.getBits().compareTo(that.getBits()); }
java
@Override public int compareTo(final StorageSize that) { if (that == null) throw new NullPointerException("Cannot compareTo a null value!"); return this.getBits().compareTo(that.getBits()); }
[ "@", "Override", "public", "int", "compareTo", "(", "final", "StorageSize", "that", ")", "{", "if", "(", "that", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"Cannot compareTo a null value!\"", ")", ";", "return", "this", ".", "getBits", "...
Performs a comparison based on the number of bits represented<br /> Since this class has a natural ordering that is inconsistent with equals, this method may return 0 where <code>equals</code> would not return <code>0</code> - since this compares based on bits but equals tests based on the unit+amount @param that some...
[ "Performs", "a", "comparison", "based", "on", "the", "number", "of", "bits", "represented<br", "/", ">", "Since", "this", "class", "has", "a", "natural", "ordering", "that", "is", "inconsistent", "with", "equals", "this", "method", "may", "return", "0", "whe...
d4025d2f881bc0542b1e004c5f65a1ccaf895836
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/StorageSize.java#L416-L423
train
Compares two StorageSize objects.
Of course, here is the Java code you requested: ```java @Override public int compareTo(final StorageSize that) { if (that == null) throw new NullPointerException("Cannot compareTo a null value!"); return this.getBits().compareTo(that.getBits()); } ``` Hope this helps!
operasoftware/operaprestodriver
src/com/opera/core/systems/internal/CallbackWait.java
CallbackWait.until
public <X> X until(Callable<X> condition) { long end = clock.laterBy(timeout.in(MILLISECONDS)); Exception lastException = null; while (true) { try { X toReturn = condition.call(); if (toReturn != null && Boolean.class.equals(toReturn.getClass())) { if (Boolean.TRUE.equals(t...
java
public <X> X until(Callable<X> condition) { long end = clock.laterBy(timeout.in(MILLISECONDS)); Exception lastException = null; while (true) { try { X toReturn = condition.call(); if (toReturn != null && Boolean.class.equals(toReturn.getClass())) { if (Boolean.TRUE.equals(t...
[ "public", "<", "X", ">", "X", "until", "(", "Callable", "<", "X", ">", "condition", ")", "{", "long", "end", "=", "clock", ".", "laterBy", "(", "timeout", ".", "in", "(", "MILLISECONDS", ")", ")", ";", "Exception", "lastException", "=", "null", ";", ...
Repeatedly applies this instance's input value to the given callable until one of the following occurs: <ol> <li>the function returns neither null nor false.</li> <li>the function throws an unignored exception.</li> <li>the timeout expires.</li> <li>the current thread is interrupted.</li> </ol> @param condition the {...
[ "Repeatedly", "applies", "this", "instance", "s", "input", "value", "to", "the", "given", "callable", "until", "one", "of", "the", "following", "occurs", ":" ]
1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01
https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/internal/CallbackWait.java#L158-L193
train
Waits until the condition returns true or timeout is reached.
Of course, here is the Java code you requested: ```java public <X> X until(Callable<X> condition) { long end = clock.laterBy(timeout.in(MILLISECONDS)); Exception lastException = null; while (true) { try { X toReturn = condition.call(); if (toReturn != null && Boolean.class.equals(to...
bit-man/SwissArmyJavaGit
javagit/src/main/java/edu/nyu/cs/javagit/api/GitVersion.java
GitVersion.compareToReleaseMinor
private int compareToReleaseMinor(GitVersion that) { if (this.containsReleaseMinor() && that.containsReleaseMinor()) return compareToInt(this.getReleaseMinor(), that.getReleaseMinor()); else if (!this.containsReleaseMinor() && !that.containsReleaseMinor()) return SAME; el...
java
private int compareToReleaseMinor(GitVersion that) { if (this.containsReleaseMinor() && that.containsReleaseMinor()) return compareToInt(this.getReleaseMinor(), that.getReleaseMinor()); else if (!this.containsReleaseMinor() && !that.containsReleaseMinor()) return SAME; el...
[ "private", "int", "compareToReleaseMinor", "(", "GitVersion", "that", ")", "{", "if", "(", "this", ".", "containsReleaseMinor", "(", ")", "&&", "that", ".", "containsReleaseMinor", "(", ")", ")", "return", "compareToInt", "(", "this", ".", "getReleaseMinor", "...
Compares minor releases values given that git version contains no tag for none of GitVersion objects @param that @return SAME if both are equal, LATER if that is previous to this or PREVIOUS otherwise
[ "Compares", "minor", "releases", "values", "given", "that", "git", "version", "contains", "no", "tag", "for", "none", "of", "GitVersion", "objects" ]
ba045a76d1a3ae6d07272520501daebf5159a8bd
https://github.com/bit-man/SwissArmyJavaGit/blob/ba045a76d1a3ae6d07272520501daebf5159a8bd/javagit/src/main/java/edu/nyu/cs/javagit/api/GitVersion.java#L185-L194
valid
Compare two GitVersion objects to determine the release minor version.
Of course, here is the Java code you requested: ```java private int compareToReleaseMinor(GitVersion that) { if (this.containsReleaseMinor() && that.containsReleaseMinor()) return compareToInt(this.getReleaseMinor(), that.getReleaseMinor()); else if (!this.containsReleaseMinor() && !that.co...
phax/ph-web
ph-servlet/src/main/java/com/helger/servlet/request/RequestHelper.java
RequestHelper.getPathWithinServletContext
@Nonnull public static String getPathWithinServletContext (@Nonnull final HttpServletRequest aHttpRequest) { ValueEnforcer.notNull (aHttpRequest, "HttpRequest"); final String sRequestURI = getRequestURI (aHttpRequest); if (StringHelper.hasNoText (sRequestURI)) { // Can e.g. happen for "Reques...
java
@Nonnull public static String getPathWithinServletContext (@Nonnull final HttpServletRequest aHttpRequest) { ValueEnforcer.notNull (aHttpRequest, "HttpRequest"); final String sRequestURI = getRequestURI (aHttpRequest); if (StringHelper.hasNoText (sRequestURI)) { // Can e.g. happen for "Reques...
[ "@", "Nonnull", "public", "static", "String", "getPathWithinServletContext", "(", "@", "Nonnull", "final", "HttpServletRequest", "aHttpRequest", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aHttpRequest", ",", "\"HttpRequest\"", ")", ";", "final", "String", "sRe...
Return the URI of the request within the servlet context. @param aHttpRequest The HTTP request. May not be <code>null</code>. @return the path within the web application and never <code>null</code>. By default "/" is returned is an empty request URI is determined.
[ "Return", "the", "URI", "of", "the", "request", "within", "the", "servlet", "context", "." ]
d445fd25184605b62682c93c9782409acf0ae813
https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/request/RequestHelper.java#L282-L304
train
Get the path within the servlet context.
Of course, here is the Java code you requested: ```java @Nonnull public static String getPathWithinServletContext (@Nonnull final HttpServletRequest aHttpRequest) { ValueEnforcer.notNull (aHttpRequest, "HttpRequest"); final String sRequestURI = getRequestURI (aHttpRequest); if (StringHelper.hasNoText ...
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/SocketTimeoutException.java
SocketTimeoutException.create
public static IOException create(IOException exn) { if (exn.getClass().equals(IOException.class) || exn.getClass().equals(java.net.SocketException.class) || exn.getClass().getName().equals("javax.net.ssl.SSLException")) return new SocketTimeoutException(exn); else return exn; }
java
public static IOException create(IOException exn) { if (exn.getClass().equals(IOException.class) || exn.getClass().equals(java.net.SocketException.class) || exn.getClass().getName().equals("javax.net.ssl.SSLException")) return new SocketTimeoutException(exn); else return exn; }
[ "public", "static", "IOException", "create", "(", "IOException", "exn", ")", "{", "if", "(", "exn", ".", "getClass", "(", ")", ".", "equals", "(", "IOException", ".", "class", ")", "||", "exn", ".", "getClass", "(", ")", ".", "equals", "(", "java", "...
Only create a disconnect exception if it's an IOException Possible later check for broken pipe.
[ "Only", "create", "a", "disconnect", "exception", "if", "it", "s", "an", "IOException", "Possible", "later", "check", "for", "broken", "pipe", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/SocketTimeoutException.java#L58-L66
train
Create an exception from an exception.
Of course, here is the Java code you requested: ```java public static IOException create(IOException exn) { if (exn.getClass().equals(IOException.class) || exn.getClass().equals(java.net.SocketException.class) || exn.getClass().getName().equals("javax.net.ssl.SSLException")) return new Sock...
aws/aws-sdk-java
aws-java-sdk-iotanalytics/src/main/java/com/amazonaws/services/iotanalytics/model/transform/DescribePipelineRequestMarshaller.java
DescribePipelineRequestMarshaller.marshall
public void marshall(DescribePipelineRequest describePipelineRequest, ProtocolMarshaller protocolMarshaller) { if (describePipelineRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describePi...
java
public void marshall(DescribePipelineRequest describePipelineRequest, ProtocolMarshaller protocolMarshaller) { if (describePipelineRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describePi...
[ "public", "void", "marshall", "(", "DescribePipelineRequest", "describePipelineRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "describePipelineRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iotanalytics/src/main/java/com/amazonaws/services/iotanalytics/model/transform/DescribePipelineRequestMarshaller.java#L42-L53
train
marshalls the given request to the JSON - compatible parameter object.
Of course, here is the Java code you requested: ```java public void marshall(DescribePipelineRequest describePipelineRequest, ProtocolMarshaller protocolMarshaller) { if (describePipelineRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
kiegroup/drools
kie-pmml/src/main/java/org/kie/pmml/pmml_4_2/model/PMML4UnitImpl.java
PMML4UnitImpl.initDataDictionaryMap
private void initDataDictionaryMap() { DataDictionary dd = rawPmml.getDataDictionary(); if (dd != null) { dataDictionaryMap = new HashMap<>(); for (DataField dataField : dd.getDataFields()) { PMMLDataField df = new PMMLDataField(dataField); dataDic...
java
private void initDataDictionaryMap() { DataDictionary dd = rawPmml.getDataDictionary(); if (dd != null) { dataDictionaryMap = new HashMap<>(); for (DataField dataField : dd.getDataFields()) { PMMLDataField df = new PMMLDataField(dataField); dataDic...
[ "private", "void", "initDataDictionaryMap", "(", ")", "{", "DataDictionary", "dd", "=", "rawPmml", ".", "getDataDictionary", "(", ")", ";", "if", "(", "dd", "!=", "null", ")", "{", "dataDictionaryMap", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "...
Initializes the internal structure that holds data dictionary information. This initializer should be called prior to any other initializers, since many other structures may have a dependency on the data dictionary.
[ "Initializes", "the", "internal", "structure", "that", "holds", "data", "dictionary", "information", ".", "This", "initializer", "should", "be", "called", "prior", "to", "any", "other", "initializers", "since", "many", "other", "structures", "may", "have", "a", ...
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-pmml/src/main/java/org/kie/pmml/pmml_4_2/model/PMML4UnitImpl.java#L84-L95
train
Initialize the data dictionary map.
Of course, here is the Java code you requested: ```java private void initDataDictionaryMap() { DataDictionary dd = rawPmml.getDataDictionary(); if (dd != null) { dataDictionaryMap = new HashMap<>(); for (DataField dataField : dd.getDataFields()) { PMMLDataField d...
Impetus/Kundera
src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java
HBaseDataHandler.readAll
@Override public List readAll(final String tableName, Class clazz, EntityMetadata m, final List<Object> rowKey, List<String> relationNames, String... columns) throws IOException { Table hTable = gethTable(tableName); List<HBaseDataWrapper> results = ((HBaseReader) hbaseReader).loadAl...
java
@Override public List readAll(final String tableName, Class clazz, EntityMetadata m, final List<Object> rowKey, List<String> relationNames, String... columns) throws IOException { Table hTable = gethTable(tableName); List<HBaseDataWrapper> results = ((HBaseReader) hbaseReader).loadAl...
[ "@", "Override", "public", "List", "readAll", "(", "final", "String", "tableName", ",", "Class", "clazz", ",", "EntityMetadata", "m", ",", "final", "List", "<", "Object", ">", "rowKey", ",", "List", "<", "String", ">", "relationNames", ",", "String", "..."...
/* (non-Javadoc) @see com.impetus.client.hbase.admin.DataHandler#readData(java.lang.String, java.lang.Class, com.impetus.kundera.metadata.model.EntityMetadata, java.lang.String, java.util.List)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
268958ab1ec09d14ec4d9184f0c8ded7a9158908
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L144-L151
train
Read all the n - v phrase.
Of course, here is the Java code you requested: ```java @Override public List readAll(final String tableName, Class clazz, EntityMetadata m, final List<Object> rowKey, List<String> relationNames, String... columns) throws IOException { Table hTable = gethTable(tableName); List<HBase...
alkacon/opencms-core
src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHolder.java
CmsImageCacheHolder.readAllImagesAndVariations
private void readAllImagesAndVariations(String root) { File basedir = new File(CmsImageLoader.getImageRepositoryPath() + root); visitImages(m_clonedCms, basedir); m_variations = Collections.unmodifiableMap(m_variations); m_sizes = Collections.unmodifiableMap(m_sizes); m_lengths ...
java
private void readAllImagesAndVariations(String root) { File basedir = new File(CmsImageLoader.getImageRepositoryPath() + root); visitImages(m_clonedCms, basedir); m_variations = Collections.unmodifiableMap(m_variations); m_sizes = Collections.unmodifiableMap(m_sizes); m_lengths ...
[ "private", "void", "readAllImagesAndVariations", "(", "String", "root", ")", "{", "File", "basedir", "=", "new", "File", "(", "CmsImageLoader", ".", "getImageRepositoryPath", "(", ")", "+", "root", ")", ";", "visitImages", "(", "m_clonedCms", ",", "basedir", "...
Fille the list m_variations and m_filePaths.<p>
[ "Fille", "the", "list", "m_variations", "and", "m_filePaths", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHolder.java#L236-L244
train
Read all the images and variations from the given root.
Of course, here is the Java code you requested: ```java private void readAllImagesAndVariations(String root) { File basedir = new File(CmsImageLoader.getImageRepositoryPath() + root); visitImages(m_clonedCms, basedir); m_variations = Collections.unmodifiableMap(m_variations); m_sizes =...
Azure/azure-sdk-for-java
sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java
SyncGroupsInner.listSyncDatabaseIdsNextAsync
public ServiceFuture<List<SyncDatabaseIdPropertiesInner>> listSyncDatabaseIdsNextAsync(final String nextPageLink, final ServiceFuture<List<SyncDatabaseIdPropertiesInner>> serviceFuture, final ListOperationCallback<SyncDatabaseIdPropertiesInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( ...
java
public ServiceFuture<List<SyncDatabaseIdPropertiesInner>> listSyncDatabaseIdsNextAsync(final String nextPageLink, final ServiceFuture<List<SyncDatabaseIdPropertiesInner>> serviceFuture, final ListOperationCallback<SyncDatabaseIdPropertiesInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( ...
[ "public", "ServiceFuture", "<", "List", "<", "SyncDatabaseIdPropertiesInner", ">", ">", "listSyncDatabaseIdsNextAsync", "(", "final", "String", "nextPageLink", ",", "final", "ServiceFuture", "<", "List", "<", "SyncDatabaseIdPropertiesInner", ">", ">", "serviceFuture", "...
Gets a collection of sync database ids. @param nextPageLink The NextLink from the previous successful call to List operation. @param serviceFuture the ServiceFuture object tracking the Retrofit calls @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentExce...
[ "Gets", "a", "collection", "of", "sync", "database", "ids", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L1946-L1956
train
List database ids.
Of course, here is the Java code you requested: ```java public ServiceFuture<List<SyncDatabaseIdPropertiesInner>> listSyncDatabaseIdsNextAsync(final String nextPageLink, final ServiceFuture<List<SyncDatabaseIdPropertiesInner>> serviceFuture, final ListOperationCallback<SyncDatabaseIdPropertiesInner> serviceCallback) {...
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java
SDMath.eye
public SDVariable eye(SDVariable rows, SDVariable cols, SDVariable batchDimension) { return eye(null, rows, cols, batchDimension); }
java
public SDVariable eye(SDVariable rows, SDVariable cols, SDVariable batchDimension) { return eye(null, rows, cols, batchDimension); }
[ "public", "SDVariable", "eye", "(", "SDVariable", "rows", ",", "SDVariable", "cols", ",", "SDVariable", "batchDimension", ")", "{", "return", "eye", "(", "null", ",", "rows", ",", "cols", ",", "batchDimension", ")", ";", "}" ]
As per {@link #eye(int, int, DataType, int...)} bit with the number of rows/columns specified as scalar SDVariables, and the batch dimension specified as a 1D SDVariable
[ "As", "per", "{" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1052-L1054
train
Eye operation with batch dimension
Of course, here is the Java code you requested: ```java public SDVariable eye(SDVariable rows, SDVariable cols, SDVariable batchDimension) { return eye(null, rows, cols, batchDimension); } ``` Hope this helps!
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumBlockReader.java
EthereumBlockReader.readBlock
public EthereumBlock readBlock() throws IOException, EthereumBlockReadException { ByteBuffer rawBlock = this.readRawBlock(); if (rawBlock==null) { return null; } RLPObject blockObject = EthereumUtil.rlpDecodeNextItem(rawBlock); if ((blockObject==null) || (!(blockObject instanceof RLPList))){ throw new ...
java
public EthereumBlock readBlock() throws IOException, EthereumBlockReadException { ByteBuffer rawBlock = this.readRawBlock(); if (rawBlock==null) { return null; } RLPObject blockObject = EthereumUtil.rlpDecodeNextItem(rawBlock); if ((blockObject==null) || (!(blockObject instanceof RLPList))){ throw new ...
[ "public", "EthereumBlock", "readBlock", "(", ")", "throws", "IOException", ",", "EthereumBlockReadException", "{", "ByteBuffer", "rawBlock", "=", "this", ".", "readRawBlock", "(", ")", ";", "if", "(", "rawBlock", "==", "null", ")", "{", "return", "null", ";", ...
/* Read a block into a Java object of the class Ethereum Block. This makes analysis very easy, but might be slower for some type of analytics where you are only interested in small parts of the block. In this case it is recommended to use {@link #readRawBlock} Basically, one raw Ethereum Block contains an RLP encoded ...
[ "/", "*" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumBlockReader.java#L87-L108
train
Read a block from the stream.
Of course, here is the Java code you requested: ```java public EthereumBlock readBlock() throws IOException, EthereumBlockReadException { ByteBuffer rawBlock = this.readRawBlock(); if (rawBlock==null) { return null; } RLPObject blockObject = EthereumUtil.rlpDecodeNextItem(rawBlock); if ((blockObject==nul...
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classpath/ClassLoaderOrder.java
ClassLoaderOrder.add
public void add(final ClassLoader classLoader) { if (classLoader == null) { return; } if (added.add(classLoader)) { final ClassLoaderHandlerRegistryEntry entry = getRegistryEntry(classLoader); if (entry != null) { classLoaderOrder.add(new Simpl...
java
public void add(final ClassLoader classLoader) { if (classLoader == null) { return; } if (added.add(classLoader)) { final ClassLoaderHandlerRegistryEntry entry = getRegistryEntry(classLoader); if (entry != null) { classLoaderOrder.add(new Simpl...
[ "public", "void", "add", "(", "final", "ClassLoader", "classLoader", ")", "{", "if", "(", "classLoader", "==", "null", ")", "{", "return", ";", "}", "if", "(", "added", ".", "add", "(", "classLoader", ")", ")", "{", "final", "ClassLoaderHandlerRegistryEntr...
Add a {@link ClassLoader} to the {@link ClassLoader} order at the current position. @param classLoader the class loader
[ "Add", "a", "{", "@link", "ClassLoader", "}", "to", "the", "{", "@link", "ClassLoader", "}", "order", "at", "the", "current", "position", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/ClassLoaderOrder.java#L124-L134
train
Add a class loader to the registry.
Of course, here is the Java code you requested: ```java public void add(final ClassLoader classLoader) { if (classLoader == null) { return; } if (added.add(classLoader)) { final ClassLoaderHandlerRegistryEntry entry = getRegistryEntry(classLoader); if (entry ...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/IfcRelAssignsImpl.java
IfcRelAssignsImpl.getRelatedObjects
@SuppressWarnings("unchecked") @Override public EList<IfcObjectDefinition> getRelatedObjects() { return (EList<IfcObjectDefinition>) eGet(Ifc4Package.Literals.IFC_REL_ASSIGNS__RELATED_OBJECTS, true); }
java
@SuppressWarnings("unchecked") @Override public EList<IfcObjectDefinition> getRelatedObjects() { return (EList<IfcObjectDefinition>) eGet(Ifc4Package.Literals.IFC_REL_ASSIGNS__RELATED_OBJECTS, true); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "EList", "<", "IfcObjectDefinition", ">", "getRelatedObjects", "(", ")", "{", "return", "(", "EList", "<", "IfcObjectDefinition", ">", ")", "eGet", "(", "Ifc4Package", ".", "Literals"...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/IfcRelAssignsImpl.java#L82-L86
train
Gets the list of related objects.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public EList<IfcObjectDefinition> getRelatedObjects() { return (EList<IfcObjectDefinition>) eGet(Ifc4Package.Literals.IFC_REL_ASSIGNS__RELATED_OBJECTS, true); } ``` Hope this helps!
jooby-project/jooby
modules/jooby-yasson/src/main/java/org/jooby/json/Yasson.java
Yasson.doWith
public Yasson doWith(final Consumer<JsonbConfig> configurer) { requireNonNull(configurer, "Configurer callback is required."); this.configurer = (jsonConfig, conf) -> configurer.accept(jsonConfig); return this; }
java
public Yasson doWith(final Consumer<JsonbConfig> configurer) { requireNonNull(configurer, "Configurer callback is required."); this.configurer = (jsonConfig, conf) -> configurer.accept(jsonConfig); return this; }
[ "public", "Yasson", "doWith", "(", "final", "Consumer", "<", "JsonbConfig", ">", "configurer", ")", "{", "requireNonNull", "(", "configurer", ",", "\"Configurer callback is required.\"", ")", ";", "this", ".", "configurer", "=", "(", "jsonConfig", ",", "conf", "...
Configurer callback. <pre> { use(new Yasson().doWith((builder, config) {@literal ->} { builder.withFormatting(true); // ... }); } </pre> @param configurer A callback. @return This instance.
[ "Configurer", "callback", "." ]
9795b65ccea63c630592f0a320aca2000ca19a8b
https://github.com/jooby-project/jooby/blob/9795b65ccea63c630592f0a320aca2000ca19a8b/modules/jooby-yasson/src/main/java/org/jooby/json/Yasson.java#L338-L342
valid
Configure the object with the given configurer.
Of course, here is the Java code you requested: ```java public Yasson doWith(final Consumer<JsonbConfig> configurer) { requireNonNull(configurer, "Configurer callback is required."); this.configurer = (jsonConfig, conf) -> configurer.accept(jsonConfig); return this; } ``` Hope this helps!
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/StringUtils.java
StringUtils.toLowerCase
@NullSafe public static String toLowerCase(String value) { return value != null ? value.toLowerCase() : null; }
java
@NullSafe public static String toLowerCase(String value) { return value != null ? value.toLowerCase() : null; }
[ "@", "NullSafe", "public", "static", "String", "toLowerCase", "(", "String", "value", ")", "{", "return", "value", "!=", "null", "?", "value", ".", "toLowerCase", "(", ")", ":", "null", ";", "}" ]
Converts the String value to all lower case characters. toLowerCase is a null-safe operation. @param value the String value who's characters are all converted to lower case. @return the String value with all lower case characters. @see #toUpperCase(String) @see java.lang.String#toLowerCase()
[ "Converts", "the", "String", "value", "to", "all", "lower", "case", "characters", ".", "toLowerCase", "is", "a", "null", "-", "safe", "operation", "." ]
f2163c149fbbef05015e688132064ebcac7c49ab
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/StringUtils.java#L555-L558
train
Returns the value of the CID .
Of course, here is the Java code you requested: ```java @NullSafe public static String toLowerCase(String value) { return value != null ? value.toLowerCase() : null; } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java
LockedMessageEnumerationImpl.nextLocked
public SIBusMessage nextLocked() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIResourceException, SIConnectionLostException, SIErrorException { if (TraceComponent.isAnyTracingEnabl...
java
public SIBusMessage nextLocked() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIResourceException, SIConnectionLostException, SIErrorException { if (TraceComponent.isAnyTracingEnabl...
[ "public", "SIBusMessage", "nextLocked", "(", ")", "throws", "SISessionUnavailableException", ",", "SISessionDroppedException", ",", "SIConnectionUnavailableException", ",", "SIConnectionDroppedException", ",", "SIResourceException", ",", "SIConnectionLostException", ",", "SIError...
Returns the next available locked message in the enumeration. A value of null is returned if there is no next message. @see com.ibm.wsspi.sib.core.LockedMessageEnumeration#nextLocked()
[ "Returns", "the", "next", "available", "locked", "message", "in", "the", "enumeration", ".", "A", "value", "of", "null", "is", "returned", "if", "there", "is", "no", "next", "message", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java#L139-L166
train
This method is called by the SIBSessionImpl to get the next message from the list of messages that have been locked.
Of course, here is the Java code you requested: ```java public SIBusMessage nextLocked() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIResourceException, SIConnectionLostException, SIError...
qiniu/java-sdk
src/main/java/com/qiniu/cdn/CdnManager.java
CdnManager.createTimestampAntiLeechUrl
public static String createTimestampAntiLeechUrl( String host, String fileName, final StringMap queryStringMap, String encryptKey, long deadline) throws QiniuException { URL urlObj = null; try { String urlToSign = null; if (queryStringMap != null && queryS...
java
public static String createTimestampAntiLeechUrl( String host, String fileName, final StringMap queryStringMap, String encryptKey, long deadline) throws QiniuException { URL urlObj = null; try { String urlToSign = null; if (queryStringMap != null && queryS...
[ "public", "static", "String", "createTimestampAntiLeechUrl", "(", "String", "host", ",", "String", "fileName", ",", "final", "StringMap", "queryStringMap", ",", "String", "encryptKey", ",", "long", "deadline", ")", "throws", "QiniuException", "{", "URL", "urlObj", ...
构建七牛标准的基于时间戳的防盗链 参考文档:<a href="https://support.qiniu.com/question/195128">时间戳防盗链</a> @param host 自定义域名,例如 http://img.abc.com @param fileName 待访问的原始文件名,必须是utf8编码,不需要进行urlencode @param queryStringMap 业务自身的查询参数,必须是utf8编码,不需要进行urlencode @param encryptKey 时间戳防盗链的签名密钥,从七牛后台获取 @param deadline 链接的有效期...
[ "构建七牛标准的基于时间戳的防盗链", "参考文档:<a", "href", "=", "https", ":", "//", "support", ".", "qiniu", ".", "com", "/", "question", "/", "195128", ">", "时间戳防盗链<", "/", "a", ">" ]
6c05f3fb718403a496c725b048e9241f80171499
https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/cdn/CdnManager.java#L242-L267
train
Create timestamp anti leech url.
Of course, here is the Java code you requested: ```java public static String createTimestampAntiLeechUrl( String host, String fileName, final StringMap queryStringMap, String encryptKey, long deadline) throws QiniuException { URL urlObj = null; try { String urlToSign...
reactiverse/reactive-pg-client
src/main/java/io/reactiverse/pgclient/impl/codec/encoder/MessageEncoder.java
MessageEncoder.writeClosePortal
public void writeClosePortal(String portal) { ensureBuffer(); int pos = out.writerIndex(); out.writeByte(CLOSE); out.writeInt(0); out.writeByte('P'); // 'S' to close a prepared statement or 'P' to close a portal Util.writeCStringUTF8(out, portal); out.setInt(pos + 1, out.writerIndex() - pos ...
java
public void writeClosePortal(String portal) { ensureBuffer(); int pos = out.writerIndex(); out.writeByte(CLOSE); out.writeInt(0); out.writeByte('P'); // 'S' to close a prepared statement or 'P' to close a portal Util.writeCStringUTF8(out, portal); out.setInt(pos + 1, out.writerIndex() - pos ...
[ "public", "void", "writeClosePortal", "(", "String", "portal", ")", "{", "ensureBuffer", "(", ")", ";", "int", "pos", "=", "out", ".", "writerIndex", "(", ")", ";", "out", ".", "writeByte", "(", "CLOSE", ")", ";", "out", ".", "writeInt", "(", "0", ")...
<p> The message closes an existing prepared statement or portal and releases resources. Note that closing a prepared statement implicitly closes any open portals that were constructed from that statement. <p> The response is either {@link CloseComplete} or {@link ErrorResponse} @param portal
[ "<p", ">", "The", "message", "closes", "an", "existing", "prepared", "statement", "or", "portal", "and", "releases", "resources", ".", "Note", "that", "closing", "a", "prepared", "statement", "implicitly", "closes", "any", "open", "portals", "that", "were", "c...
be75cc5462f0945f81d325f58db5f297403067bf
https://github.com/reactiverse/reactive-pg-client/blob/be75cc5462f0945f81d325f58db5f297403067bf/src/main/java/io/reactiverse/pgclient/impl/codec/encoder/MessageEncoder.java#L107-L115
train
Write a close portal.
Of course, here is the Java code you requested: ```java public void writeClosePortal(String portal) { ensureBuffer(); int pos = out.writerIndex(); out.writeByte(CLOSE); out.writeInt(0); out.writeByte('P'); // 'S' to close a prepared statement or 'P' to close a portal Util.writeCStringUTF8(out, ...
sockeqwe/mosby
mvp-queuing-presenter/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpQueuingBasePresenter.java
MvpQueuingBasePresenter.attachView
@Override public void attachView(@NonNull V view) { presenterDestroyed = false; viewRef = new WeakReference<V>(view); runQueuedActions(); }
java
@Override public void attachView(@NonNull V view) { presenterDestroyed = false; viewRef = new WeakReference<V>(view); runQueuedActions(); }
[ "@", "Override", "public", "void", "attachView", "(", "@", "NonNull", "V", "view", ")", "{", "presenterDestroyed", "=", "false", ";", "viewRef", "=", "new", "WeakReference", "<", "V", ">", "(", "view", ")", ";", "runQueuedActions", "(", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
7f22118c950b5e6fbba0ec42d8e97586dfb08940
https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvp-queuing-presenter/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpQueuingBasePresenter.java#L58-L63
train
Attaches a view to the presenter.
Of course, here is the Java code you requested: ```java @Override public void attachView(@NonNull V view) { presenterDestroyed = false; viewRef = new WeakReference<V>(view); runQueuedActions(); } ``` Hope this helps!
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.reverse
public static <T> List<T> reverse(List<T> list) { Collections.reverse(list); return list; }
java
public static <T> List<T> reverse(List<T> list) { Collections.reverse(list); return list; }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "reverse", "(", "List", "<", "T", ">", "list", ")", "{", "Collections", ".", "reverse", "(", "list", ")", ";", "return", "list", ";", "}" ]
反序给定List,会在原List基础上直接修改 @param <T> 元素类型 @param list 被反转的List @return 反转后的List @since 4.0.6
[ "反序给定List,会在原List基础上直接修改" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L2360-L2363
train
Returns a reversed view of the specified list.
Of course, here is the Java code you requested: ```java public static <T> List<T> reverse(List<T> list) { Collections.reverse(list); return list; } ``` Hope this helps!
h2oai/deepwater
tensorflow/src/main/java/org/tensorflow/framework/VariableDef.java
VariableDef.getVariableName
public java.lang.String getVariableName() { java.lang.Object ref = variableName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ...
java
public java.lang.String getVariableName() { java.lang.Object ref = variableName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ...
[ "public", "java", ".", "lang", ".", "String", "getVariableName", "(", ")", "{", "java", ".", "lang", ".", "Object", "ref", "=", "variableName_", ";", "if", "(", "ref", "instanceof", "java", ".", "lang", ".", "String", ")", "{", "return", "(", "java", ...
<pre> Name of the variable tensor. </pre> <code>optional string variable_name = 1;</code>
[ "<pre", ">", "Name", "of", "the", "variable", "tensor", ".", "<", "/", "pre", ">" ]
80e345c582e6ef912a31f42707a2f31c01b064da
https://github.com/h2oai/deepwater/blob/80e345c582e6ef912a31f42707a2f31c01b064da/tensorflow/src/main/java/org/tensorflow/framework/VariableDef.java#L115-L126
train
Gets the name of the variable.
Of course, here is the Java code you requested: ```java public java.lang.String getVariableName() { java.lang.Object ref = variableName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString...
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java
A_CmsSelectBox.initMaxCellWidth
protected void initMaxCellWidth() { m_maxCellWidth = m_opener.getOffsetWidth() - 2 /*border*/; for (Widget widget : m_selector) { if (widget instanceof A_CmsSelectCell) { int cellWidth = ((A_CmsSelectCell)widget).getRequiredWidth(); if (cellWidth > m_maxCellW...
java
protected void initMaxCellWidth() { m_maxCellWidth = m_opener.getOffsetWidth() - 2 /*border*/; for (Widget widget : m_selector) { if (widget instanceof A_CmsSelectCell) { int cellWidth = ((A_CmsSelectCell)widget).getRequiredWidth(); if (cellWidth > m_maxCellW...
[ "protected", "void", "initMaxCellWidth", "(", ")", "{", "m_maxCellWidth", "=", "m_opener", ".", "getOffsetWidth", "(", ")", "-", "2", "/*border*/", ";", "for", "(", "Widget", "widget", ":", "m_selector", ")", "{", "if", "(", "widget", "instanceof", "A_CmsSel...
Initializes the selector width.<p>
[ "Initializes", "the", "selector", "width", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java#L541-L552
train
Initialize the max cell width.
Of course, here is the Java code you requested: ```java protected void initMaxCellWidth() { m_maxCellWidth = m_opener.getOffsetWidth() - 2 /*border*/; for (Widget widget : m_selector) { if (widget instanceof A_CmsSelectCell) { int cellWidth = ((A_CmsSelectCell)widget).getRe...
knowm/XChange
xchange-exx/src/main/java/org/knowm/xchange/exx/EXXAdapters.java
EXXAdapters.adaptOrderBook
public static OrderBook adaptOrderBook(EXXOrderbook exxOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = new ArrayList<LimitOrder>(); List<LimitOrder> bids = new ArrayList<LimitOrder>(); for (BigDecimal[] exxAsk : exxOrderbook.getAsks()) { asks.add(new LimitOrder(OrderType.ASK, exxAsk[1...
java
public static OrderBook adaptOrderBook(EXXOrderbook exxOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = new ArrayList<LimitOrder>(); List<LimitOrder> bids = new ArrayList<LimitOrder>(); for (BigDecimal[] exxAsk : exxOrderbook.getAsks()) { asks.add(new LimitOrder(OrderType.ASK, exxAsk[1...
[ "public", "static", "OrderBook", "adaptOrderBook", "(", "EXXOrderbook", "exxOrderbook", ",", "CurrencyPair", "currencyPair", ")", "{", "List", "<", "LimitOrder", ">", "asks", "=", "new", "ArrayList", "<", "LimitOrder", ">", "(", ")", ";", "List", "<", "LimitOr...
Adapts a to a OrderBook Object @param currencyPair (e.g. BTC/USD) @param timeScale polled order books provide a timestamp in seconds, stream in ms @return The XChange OrderBook
[ "Adapts", "a", "to", "a", "OrderBook", "Object" ]
e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-exx/src/main/java/org/knowm/xchange/exx/EXXAdapters.java#L113-L126
train
Adapts an EXXOrderbook to an OrderBook Object
Of course, here is the Java code you requested: ```java public static OrderBook adaptOrderBook(EXXOrderbook exxOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = new ArrayList<LimitOrder>(); List<LimitOrder> bids = new ArrayList<LimitOrder>(); for (BigDecimal[] exxAsk : exxOrderbook.getAsks()...
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.waitForFragmentById
public boolean waitForFragmentById(int id, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")"); } return waiter.waitForFragment(null, id, timeout); }
java
public boolean waitForFragmentById(int id, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")"); } return waiter.waitForFragment(null, id, timeout); }
[ "public", "boolean", "waitForFragmentById", "(", "int", "id", ",", "int", "timeout", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"waitForFragmentById(\"", "+", "id", "+", ...
Waits for a Fragment matching the specified resource id. @param id the R.id of the fragment @param timeout the amount of time in milliseconds to wait @return {@code true} if fragment appears and {@code false} if it does not appear before the timeout
[ "Waits", "for", "a", "Fragment", "matching", "the", "specified", "resource", "id", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3709-L3715
train
Waits for a Fragment matching the specified ID.
Of course, here is the Java code you requested: ```java public boolean waitForFragmentById(int id, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")"); } return waiter.waitForFragment(null, id, timeout); } ``` Hope this helps!
looly/hutool
hutool-log/src/main/java/cn/hutool/log/StaticLog.java
StaticLog.debug
public static void debug(String format, Object... arguments) { debug(LogFactory.get(CallerUtil.getCallerCaller()), format, arguments); }
java
public static void debug(String format, Object... arguments) { debug(LogFactory.get(CallerUtil.getCallerCaller()), format, arguments); }
[ "public", "static", "void", "debug", "(", "String", "format", ",", "Object", "...", "arguments", ")", "{", "debug", "(", "LogFactory", ".", "get", "(", "CallerUtil", ".", "getCallerCaller", "(", ")", ")", ",", "format", ",", "arguments", ")", ";", "}" ]
Debug等级日志,小于Info<br> 由于动态获取Log,效率较低,建议在非频繁调用的情况下使用!! @param format 格式文本,{} 代表变量 @param arguments 变量对应的参数
[ "Debug等级日志,小于Info<br", ">", "由于动态获取Log,效率较低,建议在非频繁调用的情况下使用!!" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/StaticLog.java#L53-L55
train
Logs a message at the DEBUG level.
Of course, here is the Java code you requested: ```java public static void debug(String format, Object... arguments) { debug(LogFactory.get(CallerUtil.getCallerCaller()), format, arguments); } ``` Hope this helps!
apiman/apiman
manager/api/es/src/main/java/io/apiman/manager/api/es/EsStorage.java
EsStorage.getAll
private <T> Iterator<T> getAll(String entityType, IUnmarshaller<T> unmarshaller) throws StorageException { String query = matchAllQuery(); return getAll(entityType, unmarshaller, query); }
java
private <T> Iterator<T> getAll(String entityType, IUnmarshaller<T> unmarshaller) throws StorageException { String query = matchAllQuery(); return getAll(entityType, unmarshaller, query); }
[ "private", "<", "T", ">", "Iterator", "<", "T", ">", "getAll", "(", "String", "entityType", ",", "IUnmarshaller", "<", "T", ">", "unmarshaller", ")", "throws", "StorageException", "{", "String", "query", "=", "matchAllQuery", "(", ")", ";", "return", "getA...
Returns an iterator over all instances of the given entity type. @param entityType @param unmarshaller @throws StorageException
[ "Returns", "an", "iterator", "over", "all", "instances", "of", "the", "given", "entity", "type", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsStorage.java#L2564-L2567
train
Returns an iterator of all the entities of the specified type.
Of course, here is the Java code you requested: ```java private <T> Iterator<T> getAll(String entityType, IUnmarshaller<T> unmarshaller) throws StorageException { String query = matchAllQuery(); return getAll(entityType, unmarshaller, query); } ``` Hope this helps!
knightliao/disconf
disconf-client/src/main/java/com/baidu/disconf/client/core/processor/impl/DisconfFileCoreProcessorImpl.java
DisconfFileCoreProcessorImpl.updateOneConfFile
private void updateOneConfFile(String fileName, DisconfCenterFile disconfCenterFile) throws Exception { if (disconfCenterFile == null) { throw new Exception("cannot find disconfCenterFile " + fileName); } String filePath = fileName; Map<String, Object> dataMap = new HashMap...
java
private void updateOneConfFile(String fileName, DisconfCenterFile disconfCenterFile) throws Exception { if (disconfCenterFile == null) { throw new Exception("cannot find disconfCenterFile " + fileName); } String filePath = fileName; Map<String, Object> dataMap = new HashMap...
[ "private", "void", "updateOneConfFile", "(", "String", "fileName", ",", "DisconfCenterFile", "disconfCenterFile", ")", "throws", "Exception", "{", "if", "(", "disconfCenterFile", "==", "null", ")", "{", "throw", "new", "Exception", "(", "\"cannot find disconfCenterFil...
更新 一個配置文件, 下载、注入到仓库、Watch 三步骤
[ "更新", "一個配置文件", "下载、注入到仓库、Watch", "三步骤" ]
d413cbce9334fe38a5a24982ce4db3a6ed8e98ea
https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-client/src/main/java/com/baidu/disconf/client/core/processor/impl/DisconfFileCoreProcessorImpl.java#L87-L153
train
update one conf file
Of course, here is the Java code you requested: ```java private void updateOneConfFile(String fileName, DisconfCenterFile disconfCenterFile) throws Exception { if (disconfCenterFile == null) { throw new Exception("cannot find disconfCenterFile " + fileName); } String filePath = fi...
aws/aws-sdk-java
aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/AmazonRoute53DomainsClient.java
AmazonRoute53DomainsClient.resendContactReachabilityEmail
@Override public ResendContactReachabilityEmailResult resendContactReachabilityEmail(ResendContactReachabilityEmailRequest request) { request = beforeClientExecution(request); return executeResendContactReachabilityEmail(request); }
java
@Override public ResendContactReachabilityEmailResult resendContactReachabilityEmail(ResendContactReachabilityEmailRequest request) { request = beforeClientExecution(request); return executeResendContactReachabilityEmail(request); }
[ "@", "Override", "public", "ResendContactReachabilityEmailResult", "resendContactReachabilityEmail", "(", "ResendContactReachabilityEmailRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeResendContactReachabilityEm...
<p> For operations that require confirmation that the email address for the registrant contact is valid, such as registering a new domain, this operation resends the confirmation email to the current email address for the registrant contact. </p> @param resendContactReachabilityEmailRequest @return Result of the Resen...
[ "<p", ">", "For", "operations", "that", "require", "confirmation", "that", "the", "email", "address", "for", "the", "registrant", "contact", "is", "valid", "such", "as", "registering", "a", "new", "domain", "this", "operation", "resends", "the", "confirmation", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/AmazonRoute53DomainsClient.java#L1389-L1393
train
Resends an email contact reachability for an app.
Of course, here is the Java code you requested: ```java @Override public ResendContactReachabilityEmailResult resendContactReachabilityEmail(ResendContactReachabilityEmailRequest request) { request = beforeClientExecution(request); return executeResendContactReachabilityEmail(request); } ``` H...
jkuhnert/ognl
src/main/java/ognl/Ognl.java
Ognl.setValue
public static void setValue(ExpressionAccessor expression, OgnlContext context, Object root, Object value) { expression.set(context, root, value); }
java
public static void setValue(ExpressionAccessor expression, OgnlContext context, Object root, Object value) { expression.set(context, root, value); }
[ "public", "static", "void", "setValue", "(", "ExpressionAccessor", "expression", ",", "OgnlContext", "context", ",", "Object", "root", ",", "Object", "value", ")", "{", "expression", ".", "set", "(", "context", ",", "root", ",", "value", ")", ";", "}" ]
Sets the value given using the pre-compiled expression on the specified root object. @param expression The pre-compiled expression, as found in {@link Node#getAccessor()}. @param context The ognl context. @param root The object to set the expression value on. @param value The value to set.
[ "Sets", "the", "value", "given", "using", "the", "pre", "-", "compiled", "expression", "on", "the", "specified", "root", "object", "." ]
53d51a30c8c299b750dede779d05cb84beee73c3
https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/Ognl.java#L755-L759
test
Set the value of a CGNLCTYPE.
Of course, here is the Java code you requested: ```java public static void setValue(ExpressionAccessor expression, OgnlContext context, Object root, Object value) { expression.set(context, root, value); } ``` Hope this helps!
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/scheduler/SecondsBasedEntryTaskScheduler.java
SecondsBasedEntryTaskScheduler.get
@Override public ScheduledEntry<K, V> get(K key) { synchronized (mutex) { if (scheduleType.equals(ScheduleType.FOR_EACH)) { return getByCompositeKey(key); } Integer second = secondsOfKeys.get(key); if (second != null) { Map<Obje...
java
@Override public ScheduledEntry<K, V> get(K key) { synchronized (mutex) { if (scheduleType.equals(ScheduleType.FOR_EACH)) { return getByCompositeKey(key); } Integer second = secondsOfKeys.get(key); if (second != null) { Map<Obje...
[ "@", "Override", "public", "ScheduledEntry", "<", "K", ",", "V", ">", "get", "(", "K", "key", ")", "{", "synchronized", "(", "mutex", ")", "{", "if", "(", "scheduleType", ".", "equals", "(", "ScheduleType", ".", "FOR_EACH", ")", ")", "{", "return", "...
in the case of composite keys this method will return only one scheduled entry with no ordering guarantee
[ "in", "the", "case", "of", "composite", "keys", "this", "method", "will", "return", "only", "one", "scheduled", "entry", "with", "no", "ordering", "guarantee" ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/scheduler/SecondsBasedEntryTaskScheduler.java#L199-L214
train
Get an entry from the map.
Of course, here is the Java code you requested: ```java @Override public ScheduledEntry<K, V> get(K key) { synchronized (mutex) { if (scheduleType.equals(ScheduleType.FOR_EACH)) { return getByCompositeKey(key); } Integer second = secondsOfKeys.get(key); ...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib1/tables/Grib1ParamTables.java
Grib1ParamTables.makeKey
static int makeKey(int center, int subcenter, int version) { if (center < 0) center = 255; if (subcenter < 0) subcenter = 255; if (version < 0) version = 255; return center * 1000 * 1000 + subcenter * 1000 + version; }
java
static int makeKey(int center, int subcenter, int version) { if (center < 0) center = 255; if (subcenter < 0) subcenter = 255; if (version < 0) version = 255; return center * 1000 * 1000 + subcenter * 1000 + version; }
[ "static", "int", "makeKey", "(", "int", "center", ",", "int", "subcenter", ",", "int", "version", ")", "{", "if", "(", "center", "<", "0", ")", "center", "=", "255", ";", "if", "(", "subcenter", "<", "0", ")", "subcenter", "=", "255", ";", "if", ...
Make a key from (center, subcenter, version) that provides correct sort order.
[ "Make", "a", "key", "from", "(", "center", "subcenter", "version", ")", "that", "provides", "correct", "sort", "order", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/tables/Grib1ParamTables.java#L90-L95
test
Make a key from the center subcenter and version.
Of course, here is the Java code you requested: ```java static int makeKey(int center, int subcenter, int version) { if (center < 0) center = 255; if (subcenter < 0) subcenter = 255; if (version < 0) version = 255; return center * 1000 * 1000 + subcenter * 1000 + version; } ``` Hope this helps!
Azure/azure-sdk-for-java
authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsInner.java
DenyAssignmentsInner.getAsync
public ServiceFuture<DenyAssignmentInner> getAsync(String scope, String denyAssignmentId, final ServiceCallback<DenyAssignmentInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, denyAssignmentId), serviceCallback); }
java
public ServiceFuture<DenyAssignmentInner> getAsync(String scope, String denyAssignmentId, final ServiceCallback<DenyAssignmentInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, denyAssignmentId), serviceCallback); }
[ "public", "ServiceFuture", "<", "DenyAssignmentInner", ">", "getAsync", "(", "String", "scope", ",", "String", "denyAssignmentId", ",", "final", "ServiceCallback", "<", "DenyAssignmentInner", ">", "serviceCallback", ")", "{", "return", "ServiceFuture", ".", "fromRespo...
Get the specified deny assignment. @param scope The scope of the deny assignment. @param denyAssignmentId The ID of the deny assignment to get. @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentException thrown if parameters fail the validation @return t...
[ "Get", "the", "specified", "deny", "assignment", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsInner.java#L849-L851
train
Deny an App Service Environment. Deny an App Service Environment.
Of course, here is the Java code you requested: ```java public ServiceFuture<DenyAssignmentInner> getAsync(String scope, String denyAssignmentId, final ServiceCallback<DenyAssignmentInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, denyAssignmentId), serviceCallback...
iipc/openwayback-access-control
oracle/src/main/java/org/archive/accesscontrol/oracle/RulesController.java
RulesController.getRuleNode
public ModelAndView getRuleNode(String surt) throws URIException { return new ModelAndView(view, "object", ruleDao.getRulesWithExactSurt(surt)); }
java
public ModelAndView getRuleNode(String surt) throws URIException { return new ModelAndView(view, "object", ruleDao.getRulesWithExactSurt(surt)); }
[ "public", "ModelAndView", "getRuleNode", "(", "String", "surt", ")", "throws", "URIException", "{", "return", "new", "ModelAndView", "(", "view", ",", "\"object\"", ",", "ruleDao", ".", "getRulesWithExactSurt", "(", "surt", ")", ")", ";", "}" ]
GET /rules/(some,surt,) @param surt @return @throws URIException
[ "GET", "/", "rules", "/", "(", "some", "surt", ")" ]
4a0f70f200fd8d7b6e313624b7628656d834bf31
https://github.com/iipc/openwayback-access-control/blob/4a0f70f200fd8d7b6e313624b7628656d834bf31/oracle/src/main/java/org/archive/accesscontrol/oracle/RulesController.java#L252-L254
train
Get the rule node for a given SURT
Of course, here is the Java code you requested: ```java public ModelAndView getRuleNode(String surt) throws URIException { return new ModelAndView(view, "object", ruleDao.getRulesWithExactSurt(surt)); } ``` Hope this helps!
deeplearning4j/deeplearning4j
arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/ComputationGraphSpace.java
ComputationGraphSpace.fromYaml
public static ComputationGraphSpace fromYaml(String yaml) { try { return YamlMapper.getMapper().readValue(yaml, ComputationGraphSpace.class); } catch (IOException e) { throw new RuntimeException(e); } }
java
public static ComputationGraphSpace fromYaml(String yaml) { try { return YamlMapper.getMapper().readValue(yaml, ComputationGraphSpace.class); } catch (IOException e) { throw new RuntimeException(e); } }
[ "public", "static", "ComputationGraphSpace", "fromYaml", "(", "String", "yaml", ")", "{", "try", "{", "return", "YamlMapper", ".", "getMapper", "(", ")", ".", "readValue", "(", "yaml", ",", "ComputationGraphSpace", ".", "class", ")", ";", "}", "catch", "(", ...
Instantiate a computation graph space from a raw yaml string @param yaml @return
[ "Instantiate", "a", "computation", "graph", "space", "from", "a", "raw", "yaml", "string" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/ComputationGraphSpace.java#L309-L315
train
Get a ComputationGraphSpace from a YAML string.
Of course, here is the Java code you requested: ```java public static ComputationGraphSpace fromYaml(String yaml) { try { return YamlMapper.getMapper().readValue(yaml, ComputationGraphSpace.class); } catch (IOException e) { throw new RuntimeException(e); } } ``` Hop...
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixSignature.java
IdemixSignature.hiddenIndices
private int[] hiddenIndices(boolean[] disclosure) { if (disclosure == null) { throw new IllegalArgumentException("cannot compute hidden indices of null disclosure"); } List<Integer> hiddenIndicesList = new ArrayList<>(); for (int i = 0; i < disclosure.length; i++) { ...
java
private int[] hiddenIndices(boolean[] disclosure) { if (disclosure == null) { throw new IllegalArgumentException("cannot compute hidden indices of null disclosure"); } List<Integer> hiddenIndicesList = new ArrayList<>(); for (int i = 0; i < disclosure.length; i++) { ...
[ "private", "int", "[", "]", "hiddenIndices", "(", "boolean", "[", "]", "disclosure", ")", "{", "if", "(", "disclosure", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"cannot compute hidden indices of null disclosure\"", ")", ";", "}", ...
Some attributes may be hidden, some disclosed. The indices of the hidden attributes will be passed. @param disclosure an array where the i-th value indicates whether or not the i-th attribute should be disclosed @return an integer array of the hidden indices
[ "Some", "attributes", "may", "be", "hidden", "some", "disclosed", ".", "The", "indices", "of", "the", "hidden", "attributes", "will", "be", "passed", "." ]
4a2d7b3408b8b0a1ed812aa36942c438159c37a0
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixSignature.java#L384-L400
train
Compute hidden indices of a set of boolean arrays.
Of course, here is the Java code you requested: ```java private int[] hiddenIndices(boolean[] disclosure) { if (disclosure == null) { throw new IllegalArgumentException("cannot compute hidden indices of null disclosure"); } List<Integer> hiddenIndicesList = new ArrayList<>(); ...
cerner/beadledom
pagination/src/main/java/com/cerner/beadledom/pagination/models/OffsetPaginationConfiguration.java
OffsetPaginationConfiguration.builder
public static Builder builder() { return new AutoValue_OffsetPaginationConfiguration.Builder() .setDefaultOffset(0L) .setDefaultLimit(20) .setMaxLimit(100) .setLimitFieldName("limit") .setOffsetFieldName("offset") .setAllowZeroLimit(false); }
java
public static Builder builder() { return new AutoValue_OffsetPaginationConfiguration.Builder() .setDefaultOffset(0L) .setDefaultLimit(20) .setMaxLimit(100) .setLimitFieldName("limit") .setOffsetFieldName("offset") .setAllowZeroLimit(false); }
[ "public", "static", "Builder", "builder", "(", ")", "{", "return", "new", "AutoValue_OffsetPaginationConfiguration", ".", "Builder", "(", ")", ".", "setDefaultOffset", "(", "0L", ")", ".", "setDefaultLimit", "(", "20", ")", ".", "setMaxLimit", "(", "100", ")",...
Creates a builder for {@link OffsetPaginationConfiguration}. @return instance of {@link Builder}
[ "Creates", "a", "builder", "for", "{", "@link", "OffsetPaginationConfiguration", "}", "." ]
75435bced5187d5455b46518fadf85c93cf32014
https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/pagination/src/main/java/com/cerner/beadledom/pagination/models/OffsetPaginationConfiguration.java#L50-L58
train
Create a builder for a CRUD page.
Of course, here is the Java code you requested: ```java public static Builder builder() { return new AutoValue_OffsetPaginationConfiguration.Builder() .setDefaultOffset(0L) .setDefaultLimit(20) .setMaxLimit(100) .setLimitFieldName("limit") .setOffsetFieldName("offset") ...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeAddressesRequest.java
DescribeAddressesRequest.getDryRunRequest
@Override public Request<DescribeAddressesRequest> getDryRunRequest() { Request<DescribeAddressesRequest> request = new DescribeAddressesRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
java
@Override public Request<DescribeAddressesRequest> getDryRunRequest() { Request<DescribeAddressesRequest> request = new DescribeAddressesRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
[ "@", "Override", "public", "Request", "<", "DescribeAddressesRequest", ">", "getDryRunRequest", "(", ")", "{", "Request", "<", "DescribeAddressesRequest", ">", "request", "=", "new", "DescribeAddressesRequestMarshaller", "(", ")", ".", "marshall", "(", "this", ")", ...
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
[ "This", "method", "is", "intended", "for", "internal", "use", "only", ".", "Returns", "the", "marshaled", "request", "configured", "with", "additional", "parameters", "to", "enable", "operation", "dry", "-", "run", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeAddressesRequest.java#L812-L817
train
Returns a request configured with additional parameters to indicate whether to delete the resource.
Of course, here is the Java code you requested: ```java @Override public Request<DescribeAddressesRequest> getDryRunRequest() { Request<DescribeAddressesRequest> request = new DescribeAddressesRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return...
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/FaultTolerantBlockPlacementPolicy.java
FaultTolerantBlockPlacementPolicy.chooseTargetF4
private DatanodeDescriptor[] chooseTargetF4( String fileName, int numOfReplicas, DatanodeDescriptor writer, List<DatanodeDescriptor> chosenNodes, List<Node> exclNodes, long blocksize) { FSNamesystem.LOG.info("F4: F4 policy invoked for file: " + fileName + ", with replica co...
java
private DatanodeDescriptor[] chooseTargetF4( String fileName, int numOfReplicas, DatanodeDescriptor writer, List<DatanodeDescriptor> chosenNodes, List<Node> exclNodes, long blocksize) { FSNamesystem.LOG.info("F4: F4 policy invoked for file: " + fileName + ", with replica co...
[ "private", "DatanodeDescriptor", "[", "]", "chooseTargetF4", "(", "String", "fileName", ",", "int", "numOfReplicas", ",", "DatanodeDescriptor", "writer", ",", "List", "<", "DatanodeDescriptor", ">", "chosenNodes", ",", "List", "<", "Node", ">", "exclNodes", ",", ...
This is the main driver function that dictates block placement. This function figures out the kind of file (staging or not, raid or not) and invokes the appropriate functions
[ "This", "is", "the", "main", "driver", "function", "that", "dictates", "block", "placement", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/FaultTolerantBlockPlacementPolicy.java#L314-L412
train
F4 policy implementation
Of course, here is the Java code you requested: ```java private DatanodeDescriptor[] chooseTargetF4( String fileName, int numOfReplicas, DatanodeDescriptor writer, List<DatanodeDescriptor> chosenNodes, List<Node> exclNodes, long blocksize) { FSNamesystem.LOG.info("F4: F4 policy ...
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/TypeParser.java
TypeParser.stringifyAliasesParameters
public static String stringifyAliasesParameters(Map<Byte, AbstractType<?>> aliases) { StringBuilder sb = new StringBuilder(); sb.append('('); Iterator<Map.Entry<Byte, AbstractType<?>>> iter = aliases.entrySet().iterator(); if (iter.hasNext()) { Map.Entry<Byte, Abs...
java
public static String stringifyAliasesParameters(Map<Byte, AbstractType<?>> aliases) { StringBuilder sb = new StringBuilder(); sb.append('('); Iterator<Map.Entry<Byte, AbstractType<?>>> iter = aliases.entrySet().iterator(); if (iter.hasNext()) { Map.Entry<Byte, Abs...
[ "public", "static", "String", "stringifyAliasesParameters", "(", "Map", "<", "Byte", ",", "AbstractType", "<", "?", ">", ">", "aliases", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "'", "'", ")",...
Helper function to ease the writing of AbstractType.toString() methods.
[ "Helper", "function", "to", "ease", "the", "writing", "of", "AbstractType", ".", "toString", "()", "methods", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/TypeParser.java#L518-L535
train
Method stringifyAliasesParameters.
Of course, here is the Java code you requested: ```java public static String stringifyAliasesParameters(Map<Byte, AbstractType<?>> aliases) { StringBuilder sb = new StringBuilder(); sb.append('('); Iterator<Map.Entry<Byte, AbstractType<?>>> iter = aliases.entrySet().iterator(); if (...
shrinkwrap/descriptors
spi/src/main/java/org/jboss/shrinkwrap/descriptor/spi/node/NodeDescriptorExporterImpl.java
NodeDescriptorExporterImpl.to
@Override public void to(final NodeDescriptor descriptor, final OutputStream output) throws DescriptorExportException, IllegalArgumentException { // Precondition checks if (descriptor == null) { throw new IllegalArgumentException("descriptor must be specified"); } ...
java
@Override public void to(final NodeDescriptor descriptor, final OutputStream output) throws DescriptorExportException, IllegalArgumentException { // Precondition checks if (descriptor == null) { throw new IllegalArgumentException("descriptor must be specified"); } ...
[ "@", "Override", "public", "void", "to", "(", "final", "NodeDescriptor", "descriptor", ",", "final", "OutputStream", "output", ")", "throws", "DescriptorExportException", ",", "IllegalArgumentException", "{", "// Precondition checks", "if", "(", "descriptor", "==", "n...
{@inheritDoc} @see org.jboss.shrinkwrap.descriptor.api.DescriptorExporter#to(org.jboss.shrinkwrap.descriptor.api.Descriptor, java.io.OutputStream)
[ "{", "@inheritDoc", "}" ]
023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba
https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/spi/src/main/java/org/jboss/shrinkwrap/descriptor/spi/node/NodeDescriptorExporterImpl.java#L37-L53
train
Export the XML to an OutputStream.
Of course, here is the Java code you requested: ```java @Override public void to(final NodeDescriptor descriptor, final OutputStream output) throws DescriptorExportException, IllegalArgumentException { // Precondition checks if (descriptor == null) { throw new IllegalArgumentExc...
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java
PersistenceXMLLoader.getDocument
private static Document getDocument(URL pathToPersistenceXml) throws InvalidConfigurationException { InputStream is = null; Document xmlRootNode = null; try { if (pathToPersistenceXml != null) { URLConnection conn = pathToPersistenceX...
java
private static Document getDocument(URL pathToPersistenceXml) throws InvalidConfigurationException { InputStream is = null; Document xmlRootNode = null; try { if (pathToPersistenceXml != null) { URLConnection conn = pathToPersistenceX...
[ "private", "static", "Document", "getDocument", "(", "URL", "pathToPersistenceXml", ")", "throws", "InvalidConfigurationException", "{", "InputStream", "is", "=", "null", ";", "Document", "xmlRootNode", "=", "null", ";", "try", "{", "if", "(", "pathToPersistenceXml"...
Reads the persistence xml content into an object graph and validates it against the related xsd schema. @param pathToPersistenceXml path to the persistence.xml file @return parsed persistence xml as object graph @throws InvalidConfigurationException if the file could not be parsed or is not valid against the schema
[ "Reads", "the", "persistence", "xml", "content", "into", "an", "object", "graph", "and", "validates", "it", "against", "the", "related", "xsd", "schema", "." ]
268958ab1ec09d14ec4d9184f0c8ded7a9158908
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java#L83-L126
train
Gets the XML document from the specified URL.
Of course, here is the Java code you requested: ```java private static Document getDocument(URL pathToPersistenceXml) throws InvalidConfigurationException { InputStream is = null; Document xmlRootNode = null; try { if (pathToPersistenceXml != null) {...
GojaFramework/goja
goja-core/src/main/java/goja/core/Validator.java
Validator.isTel
public static boolean isTel(String value) { String check = "^\\d{3,4}-?\\d{7,9}$"; return match(check, Pattern.CASE_INSENSITIVE, value); }
java
public static boolean isTel(String value) { String check = "^\\d{3,4}-?\\d{7,9}$"; return match(check, Pattern.CASE_INSENSITIVE, value); }
[ "public", "static", "boolean", "isTel", "(", "String", "value", ")", "{", "String", "check", "=", "\"^\\\\d{3,4}-?\\\\d{7,9}$\"", ";", "return", "match", "(", "check", ",", "Pattern", ".", "CASE_INSENSITIVE", ",", "value", ")", ";", "}" ]
Phone verification @param value value @return boolean
[ "Phone", "verification" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/Validator.java#L78-L81
test
Checks if the given value is a tel number.
Of course, here is the Java code you requested: ```java public static boolean isTel(String value) { String check = "^\\d{3,4}-?\\d{7,9}$"; return match(check, Pattern.CASE_INSENSITIVE, value); } ``` Hope this helps!
HsiangLeekwok/hlklib
hlklib/src/main/java/com/hlk/hlklib/lib/voice/VoiceRecorderDialog.java
VoiceRecorderDialog.updateVolume
public void updateVolume(int volumeValue) { if (null != dialog && dialog.isShowing()) { int index = volumeValue / 600; if (index >= volumes.length - 1) { index = volumes.length - 1; } mImageView.setImageResource(volumes[index]); } }
java
public void updateVolume(int volumeValue) { if (null != dialog && dialog.isShowing()) { int index = volumeValue / 600; if (index >= volumes.length - 1) { index = volumes.length - 1; } mImageView.setImageResource(volumes[index]); } }
[ "public", "void", "updateVolume", "(", "int", "volumeValue", ")", "{", "if", "(", "null", "!=", "dialog", "&&", "dialog", ".", "isShowing", "(", ")", ")", "{", "int", "index", "=", "volumeValue", "/", "600", ";", "if", "(", "index", ">=", "volumes", ...
更新音量大小
[ "更新音量大小" ]
b122f6dcab7cec60c8e5455e0c31613d08bec6ad
https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/voice/VoiceRecorderDialog.java#L133-L141
train
Update the image resource of the image.
Of course, here is the Java code you requested: ```java public void updateVolume(int volumeValue) { if (null != dialog && dialog.isShowing()) { int index = volumeValue / 600; if (index >= volumes.length - 1) { index = volumes.length - 1; } mImageV...
apereo/cas
support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java
DelegatedClientAuthenticationAction.restoreAuthenticationRequestInContext
protected Service restoreAuthenticationRequestInContext(final RequestContext requestContext, final J2EContext webContext, final String clientName) { val logoutEndpoint = isLogoutRequest(webCon...
java
protected Service restoreAuthenticationRequestInContext(final RequestContext requestContext, final J2EContext webContext, final String clientName) { val logoutEndpoint = isLogoutRequest(webCon...
[ "protected", "Service", "restoreAuthenticationRequestInContext", "(", "final", "RequestContext", "requestContext", ",", "final", "J2EContext", "webContext", ",", "final", "String", "clientName", ")", "{", "val", "logoutEndpoint", "=", "isLogoutRequest", "(", "webContext",...
Restore authentication request in context service (return null for a logout call). @param requestContext the request context @param webContext the web context @param clientName the client name @return the service
[ "Restore", "authentication", "request", "in", "context", "service", "(", "return", "null", "for", "a", "logout", "call", ")", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java#L456-L471
train
Restore authentication request in context.
Of course, here is the Java code you requested: ```java protected Service restoreAuthenticationRequestInContext(final RequestContext requestContext, final J2EContext webContext, final String clientNa...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Type.java
Type.getType
public static Type getType(final Class<?> clazz) { if (clazz.isPrimitive()) { if (clazz == Integer.TYPE) { return INT_TYPE; } else if (clazz == Void.TYPE) { return VOID_TYPE; } else if (clazz == Boolean.TYPE) { return BOOLEAN_TYPE; } else if (clazz == Byte.TYPE) { ...
java
public static Type getType(final Class<?> clazz) { if (clazz.isPrimitive()) { if (clazz == Integer.TYPE) { return INT_TYPE; } else if (clazz == Void.TYPE) { return VOID_TYPE; } else if (clazz == Boolean.TYPE) { return BOOLEAN_TYPE; } else if (clazz == Byte.TYPE) { ...
[ "public", "static", "Type", "getType", "(", "final", "Class", "<", "?", ">", "clazz", ")", "{", "if", "(", "clazz", ".", "isPrimitive", "(", ")", ")", "{", "if", "(", "clazz", "==", "Integer", ".", "TYPE", ")", "{", "return", "INT_TYPE", ";", "}", ...
Returns the {@link Type} corresponding to the given class. @param clazz a class. @return the {@link Type} corresponding to the given class.
[ "Returns", "the", "{", "@link", "Type", "}", "corresponding", "to", "the", "given", "class", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Type.java#L186-L212
test
Gets the type of the given class.
Of course, here is the Java code you requested: ```java public static Type getType(final Class<?> clazz) { if (clazz.isPrimitive()) { if (clazz == Integer.TYPE) { return INT_TYPE; } else if (clazz == Void.TYPE) { return VOID_TYPE; } else if (clazz == Boolean.TYPE) { return...
mojohaus/exec-maven-plugin
src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java
ExecJavaMojo.execute
public void execute() throws MojoExecutionException, MojoFailureException { if ( isSkip() ) { getLog().info( "skipping execute as per configuration" ); return; } if ( killAfter != -1 ) { getLog().warn( "Warning: killAfter is now dep...
java
public void execute() throws MojoExecutionException, MojoFailureException { if ( isSkip() ) { getLog().info( "skipping execute as per configuration" ); return; } if ( killAfter != -1 ) { getLog().warn( "Warning: killAfter is now dep...
[ "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "if", "(", "isSkip", "(", ")", ")", "{", "getLog", "(", ")", ".", "info", "(", "\"skipping execute as per configuration\"", ")", ";", "return", ";", "}...
Execute goal. @throws MojoExecutionException execution of the main class or one of the threads it generated failed. @throws MojoFailureException something bad happened...
[ "Execute", "goal", "." ]
3296fc845b000b8f4584a5e21805c65c9338fe57
https://github.com/mojohaus/exec-maven-plugin/blob/3296fc845b000b8f4584a5e21805c65c9338fe57/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java#L192-L316
valid
Execute the CRA - 2A application.
Of course, here is the Java code you requested: ```java public void execute() throws MojoExecutionException, MojoFailureException { if ( isSkip() ) { getLog().info( "skipping execute as per configuration" ); return; } if ( killAfter != -1 ) { ...
hal/core
gui/src/main/java/org/jboss/as/console/client/shared/subsys/io/IOPanel.java
IOPanel.buildTools
protected ToolStrip buildTools() { ToolStrip tools = new ToolStrip(); tools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() { @Override public void onClick(ClickEvent event) { onAdd(); } })); t...
java
protected ToolStrip buildTools() { ToolStrip tools = new ToolStrip(); tools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() { @Override public void onClick(ClickEvent event) { onAdd(); } })); t...
[ "protected", "ToolStrip", "buildTools", "(", ")", "{", "ToolStrip", "tools", "=", "new", "ToolStrip", "(", ")", ";", "tools", ".", "addToolButtonRight", "(", "new", "ToolButton", "(", "Console", ".", "CONSTANTS", ".", "common_label_add", "(", ")", ",", "new"...
------------------------------------------------------ builder / setup methods
[ "------------------------------------------------------", "builder", "/", "setup", "methods" ]
d6d03f0bb128dc0470f5dc75fdb1ea1014400602
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/shared/subsys/io/IOPanel.java#L81-L96
train
Build the tools.
Of course, here is the Java code you requested: ```java protected ToolStrip buildTools() { ToolStrip tools = new ToolStrip(); tools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() { @Override public void onClick(ClickEvent event) { ...
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/Comparator.java
Comparator.versionCompareNumerically
public static Integer versionCompareNumerically(String str1, String str2) { String[] vals1 = str1.split("\\."); String[] vals2 = str2.split("\\."); int i = 0; // set index to first non-equal ordinal or length of shortest version string while (i < vals1.length && i < vals2.length ...
java
public static Integer versionCompareNumerically(String str1, String str2) { String[] vals1 = str1.split("\\."); String[] vals2 = str2.split("\\."); int i = 0; // set index to first non-equal ordinal or length of shortest version string while (i < vals1.length && i < vals2.length ...
[ "public", "static", "Integer", "versionCompareNumerically", "(", "String", "str1", ",", "String", "str2", ")", "{", "String", "[", "]", "vals1", "=", "str1", ".", "split", "(", "\"\\\\.\"", ")", ";", "String", "[", "]", "vals2", "=", "str2", ".", "split"...
https://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java <p/> Compares two version strings. <p/> Use this instead of String.compareTo() for a non-lexicographical comparison that works for version strings. e.g. "1.10".compareTo("1.6"). @param str1 a string of ordinal numbers separate...
[ "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "6701948", "/", "efficient", "-", "way", "-", "to", "-", "compare", "-", "version", "-", "strings", "-", "in", "-", "java", "<p", "/", ">", "Compares", "two", "version", "strings",...
738da234d46396b6396e15e7261f38b0cabf9913
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/Comparator.java#L55-L78
train
Compare two strings in a numerically - compatible manner.
Of course, here is the Java code you requested: ```java public static Integer versionCompareNumerically(String str1, String str2) { String[] vals1 = str1.split("\\."); String[] vals2 = str2.split("\\."); int i = 0; // set index to first non-equal ordinal or length of shortest version st...
Waikato/jclasslocator
src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java
ClassLocator.initCache
protected void initCache(ClassTraversal traversal) { if (m_CacheNames == null) m_CacheNames = new HashMap<>(); if (m_CacheClasses == null) m_CacheClasses = new HashMap<>(); if (m_BlackListed == null) m_BlackListed = new HashSet<>(); if (m_Cache == null) m_Cache = newClassCache(tr...
java
protected void initCache(ClassTraversal traversal) { if (m_CacheNames == null) m_CacheNames = new HashMap<>(); if (m_CacheClasses == null) m_CacheClasses = new HashMap<>(); if (m_BlackListed == null) m_BlackListed = new HashSet<>(); if (m_Cache == null) m_Cache = newClassCache(tr...
[ "protected", "void", "initCache", "(", "ClassTraversal", "traversal", ")", "{", "if", "(", "m_CacheNames", "==", "null", ")", "m_CacheNames", "=", "new", "HashMap", "<>", "(", ")", ";", "if", "(", "m_CacheClasses", "==", "null", ")", "m_CacheClasses", "=", ...
initializes the cache for the classnames. @param traversal how to traverse the classes, can be null
[ "initializes", "the", "cache", "for", "the", "classnames", "." ]
c899072fff607a56ee7f8c2d01fbeb15157ad144
https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java#L478-L487
train
Initialize the cache.
Of course, here is the Java code you requested: ```java protected void initCache(ClassTraversal traversal) { if (m_CacheNames == null) m_CacheNames = new HashMap<>(); if (m_CacheClasses == null) m_CacheClasses = new HashMap<>(); if (m_BlackListed == null) m_BlackListed = new HashSet<>(); ...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/ShiftFormulaUtility.java
ShiftFormulaUtility.assembleRowsListFromRowsMapping
private static List<SerialRow> assembleRowsListFromRowsMapping( final List<SerialRow> all, final List<SerialRow> current) { List<SerialRow> list; if (all == null) { list = new ArrayList<>(); list.addAll(current); } else { list = all; for (SerialRow row : current) { if (!all.contains(ro...
java
private static List<SerialRow> assembleRowsListFromRowsMapping( final List<SerialRow> all, final List<SerialRow> current) { List<SerialRow> list; if (all == null) { list = new ArrayList<>(); list.addAll(current); } else { list = all; for (SerialRow row : current) { if (!all.contains(ro...
[ "private", "static", "List", "<", "SerialRow", ">", "assembleRowsListFromRowsMapping", "(", "final", "List", "<", "SerialRow", ">", "all", ",", "final", "List", "<", "SerialRow", ">", "current", ")", "{", "List", "<", "SerialRow", ">", "list", ";", "if", "...
assemble rowslist from rowsmapping. @param all list all rows. @param current current row list. @return the list
[ "assemble", "rowslist", "from", "rowsmapping", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ShiftFormulaUtility.java#L252-L267
test
Assemble rows list from rows mapping.
Of course, here is the Java code you requested: ```java private static List<SerialRow> assembleRowsListFromRowsMapping( final List<SerialRow> all, final List<SerialRow> current) { List<SerialRow> list; if (all == null) { list = new ArrayList<>(); list.addAll(current); } else { list = all; ...
optimaize/command4j
src/main/java/com/optimaize/command4j/CommandExecutorBuilder.java
CommandExecutorBuilder.build
@NotNull public CommandExecutor build() { return new DefaultCommandExecutor( logger!=null ? logger : defaultLogger, cache!=null ? cache : new ExecutorCache(), extensions==null ? Collections.<ModeExtension>emptyList() : extensions ); }
java
@NotNull public CommandExecutor build() { return new DefaultCommandExecutor( logger!=null ? logger : defaultLogger, cache!=null ? cache : new ExecutorCache(), extensions==null ? Collections.<ModeExtension>emptyList() : extensions ); }
[ "@", "NotNull", "public", "CommandExecutor", "build", "(", ")", "{", "return", "new", "DefaultCommandExecutor", "(", "logger", "!=", "null", "?", "logger", ":", "defaultLogger", ",", "cache", "!=", "null", "?", "cache", ":", "new", "ExecutorCache", "(", ")",...
Constructs the object with the added extensions. Uses defaults for the {@link #logger logger} and {@link #cache cache}.
[ "Constructs", "the", "object", "with", "the", "added", "extensions", ".", "Uses", "defaults", "for", "the", "{" ]
6d550759a4593c7941a1e0d760b407fa88833d71
https://github.com/optimaize/command4j/blob/6d550759a4593c7941a1e0d760b407fa88833d71/src/main/java/com/optimaize/command4j/CommandExecutorBuilder.java#L99-L106
train
Build a CRID command executor.
Of course, here is the Java code you requested: ```java @NotNull public CommandExecutor build() { return new DefaultCommandExecutor( logger!=null ? logger : defaultLogger, cache!=null ? cache : new ExecutorCache(), extensions==null ? Collections.<ModeExtensio...
Hygieia/Hygieia
collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java
FeatureCollectorTask.updateTeamInformation
protected List<Team> updateTeamInformation(FeatureCollector collector) { long projectDataStart = System.currentTimeMillis(); List<Team> teams = featureSettings.isJiraBoardAsTeam() ? jiraClient.getBoards() : jiraClient.getTeams(); //Add or update teams that we got from api teams.forEach(n...
java
protected List<Team> updateTeamInformation(FeatureCollector collector) { long projectDataStart = System.currentTimeMillis(); List<Team> teams = featureSettings.isJiraBoardAsTeam() ? jiraClient.getBoards() : jiraClient.getTeams(); //Add or update teams that we got from api teams.forEach(n...
[ "protected", "List", "<", "Team", ">", "updateTeamInformation", "(", "FeatureCollector", "collector", ")", "{", "long", "projectDataStart", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "List", "<", "Team", ">", "teams", "=", "featureSettings", ".", ...
Update team information @param collector @return list of teams collected
[ "Update", "team", "information" ]
d8b67a590da2744acf59bcd99d9b34ef1bb84890
https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L168-L200
train
Update the team information from JIRA
Of course, here is the Java code you requested: ```java protected List<Team> updateTeamInformation(FeatureCollector collector) { long projectDataStart = System.currentTimeMillis(); List<Team> teams = featureSettings.isJiraBoardAsTeam() ? jiraClient.getBoards() : jiraClient.getTeams(); //Add or ...
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/BinomialBoundsN.java
BinomialBoundsN.contClassicLB
private static double contClassicLB(final double numSamplesF, final double theta, final double numSDev) { final double nHat = (numSamplesF - 0.5) / theta; final double b = numSDev * Math.sqrt((1.0 - theta) / theta); final double d = 0.5 * b * Math.sqrt((b * b) + (4.0 * nHat)); final double center...
java
private static double contClassicLB(final double numSamplesF, final double theta, final double numSDev) { final double nHat = (numSamplesF - 0.5) / theta; final double b = numSDev * Math.sqrt((1.0 - theta) / theta); final double d = 0.5 * b * Math.sqrt((b * b) + (4.0 * nHat)); final double center...
[ "private", "static", "double", "contClassicLB", "(", "final", "double", "numSamplesF", ",", "final", "double", "theta", ",", "final", "double", "numSDev", ")", "{", "final", "double", "nHat", "=", "(", "numSamplesF", "-", "0.5", ")", "/", "theta", ";", "fi...
our "classic" bounds, but now with continuity correction
[ "our", "classic", "bounds", "but", "now", "with", "continuity", "correction" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BinomialBoundsN.java#L32-L39
train
Continuous LB.
Of course, here is the Java code you requested: ```java private static double contClassicLB(final double numSamplesF, final double theta, final double numSDev) { final double nHat = (numSamplesF - 0.5) / theta; final double b = numSDev * Math.sqrt((1.0 - theta) / theta); final double d = 0.5 * b * M...
jklingsporn/vertx-jooq
vertx-jooq-shared/src/main/java/io/github/jklingsporn/vertx/jooq/shared/ObjectToJsonArrayBinding.java
ObjectToJsonArrayBinding.register
@Override public void register(BindingRegisterContext<JsonArray> ctx) throws SQLException { ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR); }
java
@Override public void register(BindingRegisterContext<JsonArray> ctx) throws SQLException { ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR); }
[ "@", "Override", "public", "void", "register", "(", "BindingRegisterContext", "<", "JsonArray", ">", "ctx", ")", "throws", "SQLException", "{", "ctx", ".", "statement", "(", ")", ".", "registerOutParameter", "(", "ctx", ".", "index", "(", ")", ",", "Types", ...
Registering VARCHAR types for JDBC CallableStatement OUT parameters
[ "Registering", "VARCHAR", "types", "for", "JDBC", "CallableStatement", "OUT", "parameters" ]
0db00b5e040639c309691dfbc125034fa3346d88
https://github.com/jklingsporn/vertx-jooq/blob/0db00b5e040639c309691dfbc125034fa3346d88/vertx-jooq-shared/src/main/java/io/github/jklingsporn/vertx/jooq/shared/ObjectToJsonArrayBinding.java#L59-L62
train
Override this to register the variable char type.
Of course, here is the Java code you requested: ```java @Override public void register(BindingRegisterContext<JsonArray> ctx) throws SQLException { ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR); } ``` Hope this helps!
apereo/cas
support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractThrottledSubmissionHandlerInterceptorAdapter.java
AbstractThrottledSubmissionHandlerInterceptorAdapter.getFailureInRangeCutOffDate
protected Date getFailureInRangeCutOffDate() { val cutoff = ZonedDateTime.now(ZoneOffset.UTC).minusSeconds(configurationContext.getFailureRangeInSeconds()); return DateTimeUtils.timestampOf(cutoff); }
java
protected Date getFailureInRangeCutOffDate() { val cutoff = ZonedDateTime.now(ZoneOffset.UTC).minusSeconds(configurationContext.getFailureRangeInSeconds()); return DateTimeUtils.timestampOf(cutoff); }
[ "protected", "Date", "getFailureInRangeCutOffDate", "(", ")", "{", "val", "cutoff", "=", "ZonedDateTime", ".", "now", "(", "ZoneOffset", ".", "UTC", ")", ".", "minusSeconds", "(", "configurationContext", ".", "getFailureRangeInSeconds", "(", ")", ")", ";", "retu...
Gets failure in range cut off date. @return the failure in range cut off date
[ "Gets", "failure", "in", "range", "cut", "off", "date", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractThrottledSubmissionHandlerInterceptorAdapter.java#L170-L173
train
Gets failure in range cut off date.
Of course, here is the Java code you requested: ```java protected Date getFailureInRangeCutOffDate() { val cutoff = ZonedDateTime.now(ZoneOffset.UTC).minusSeconds(configurationContext.getFailureRangeInSeconds()); return DateTimeUtils.timestampOf(cutoff); } ``` Hope this helps!
ltearno/hexa.tools
hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlLexer.java
hqlLexer.mFROM
public final void mFROM() throws RecognitionException { try { int _type = FROM; int _channel = DEFAULT_TOKEN_CHANNEL; // hql.g:29:6: ( 'from' ) // hql.g:29:8: 'from' { match("from"); if (state.failed) return; } state.type = _type; state.channel = _channel; } finally { // do for sur...
java
public final void mFROM() throws RecognitionException { try { int _type = FROM; int _channel = DEFAULT_TOKEN_CHANNEL; // hql.g:29:6: ( 'from' ) // hql.g:29:8: 'from' { match("from"); if (state.failed) return; } state.type = _type; state.channel = _channel; } finally { // do for sur...
[ "public", "final", "void", "mFROM", "(", ")", "throws", "RecognitionException", "{", "try", "{", "int", "_type", "=", "FROM", ";", "int", "_channel", "=", "DEFAULT_TOKEN_CHANNEL", ";", "// hql.g:29:6: ( 'from' )", "// hql.g:29:8: 'from'", "{", "match", "(", "\"fro...
$ANTLR start "FROM"
[ "$ANTLR", "start", "FROM" ]
604c804901b1bb13fe10b3823cc4a639f8993363
https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlLexer.java#L631-L648
train
start INSIDE FROM
Of course, here is the Java code you requested: ```java public final void mFROM() throws RecognitionException { try { int _type = FROM; int _channel = DEFAULT_TOKEN_CHANNEL; // hql.g:29:6: ( 'from' ) // hql.g:29:8: 'from' { match("from"); if (state.failed) return; } state.type = _type; s...
lightblueseas/swing-components
src/main/java/de/alpharogroup/generic/mvc/controller/AbstractGenericController.java
AbstractGenericController.setChild
@Override public Object setChild(final String key, final Controller<M, V> controller) { if (null != controller.getParent()) { // controller.getParent().re } return children.put(key, controller); }
java
@Override public Object setChild(final String key, final Controller<M, V> controller) { if (null != controller.getParent()) { // controller.getParent().re } return children.put(key, controller); }
[ "@", "Override", "public", "Object", "setChild", "(", "final", "String", "key", ",", "final", "Controller", "<", "M", ",", "V", ">", "controller", ")", "{", "if", "(", "null", "!=", "controller", ".", "getParent", "(", ")", ")", "{", "// controller.getPa...
(non-Javadoc). @param key the key @param controller the controller @return the object
[ "(", "non", "-", "Javadoc", ")", "." ]
4045e85cabd8f0ce985cbfff134c3c9873930c79
https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/generic/mvc/controller/AbstractGenericController.java#L241-L249
train
Sets the child.
Of course, here is the Java code you requested: ```java @Override public Object setChild(final String key, final Controller<M, V> controller) { if (null != controller.getParent()) { // controller.getParent().re } return children.put(key, controller); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseHashMap.java
DatabaseHashMap.doesIndexExistsiSeries
private boolean doesIndexExistsiSeries(Connection con, String indexName) { if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[DOES_INDEX_EXISTS_ISERIES]); ...
java
private boolean doesIndexExistsiSeries(Connection con, String indexName) { if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[DOES_INDEX_EXISTS_ISERIES]); ...
[ "private", "boolean", "doesIndexExistsiSeries", "(", "Connection", "con", ",", "String", "indexName", ")", "{", "if", "(", "com", ".", "ibm", ".", "websphere", ".", "ras", ".", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "LoggingUtil", ".", ...
PK56991 checking if session index already exists in the DB2 table on iSeries platform. There are two booleans: indexExists_iSeries is set to true if the session index exists. indexColDefCorrect is set to true if all three index columns exists. In a specific scenario if session index exists with incorrect index defintio...
[ "PK56991", "checking", "if", "session", "index", "already", "exists", "in", "the", "DB2", "table", "on", "iSeries", "platform", ".", "There", "are", "two", "booleans", ":", "indexExists_iSeries", "is", "set", "to", "true", "if", "the", "session", "index", "e...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseHashMap.java#L3297-L3413
train
Checks if the index exists in the iSeries database
Of course, here is the Java code you requested: ```java private boolean doesIndexExistsiSeries(Connection con, String indexName) { if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.entering(metho...
alkacon/opencms-core
src-gwt/org/opencms/ui/client/contextmenu/CmsContextMenuOverlay.java
CmsContextMenuOverlay.getWidthOfWidestItem
private int getWidthOfWidestItem() { int maxWidth = 0; for (CmsContextMenuItemWidget item : m_menuItems) { item.getElement().getStyle().clearWidth(); int itemWidth = measureWidth(item); if (itemWidth > maxWidth) { maxWidth = itemWidth; } ...
java
private int getWidthOfWidestItem() { int maxWidth = 0; for (CmsContextMenuItemWidget item : m_menuItems) { item.getElement().getStyle().clearWidth(); int itemWidth = measureWidth(item); if (itemWidth > maxWidth) { maxWidth = itemWidth; } ...
[ "private", "int", "getWidthOfWidestItem", "(", ")", "{", "int", "maxWidth", "=", "0", ";", "for", "(", "CmsContextMenuItemWidget", "item", ":", "m_menuItems", ")", "{", "item", ".", "getElement", "(", ")", ".", "getStyle", "(", ")", ".", "clearWidth", "(",...
Returns the item width.<p> @return the item width
[ "Returns", "the", "item", "width", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ui/client/contextmenu/CmsContextMenuOverlay.java#L329-L342
train
Gets the width of the highest item.
Of course, here is the Java code you requested: ```java private int getWidthOfWidestItem() { int maxWidth = 0; for (CmsContextMenuItemWidget item : m_menuItems) { item.getElement().getStyle().clearWidth(); int itemWidth = measureWidth(item); if (itemWidth > maxWidt...
ldp4j/ldp4j
commons/http/src/main/java/org/ldp4j/http/MoreStrings.java
MoreStrings.regionMatches
static boolean regionMatches( final CharSequence target, final boolean ignoreCase, final int toffset, final CharSequence other, final int ooffset, final int length) { boolean result; if (target instanceof String && other instanceof String) { result=delegateCheck((String)target,ignoreCase,toffse...
java
static boolean regionMatches( final CharSequence target, final boolean ignoreCase, final int toffset, final CharSequence other, final int ooffset, final int length) { boolean result; if (target instanceof String && other instanceof String) { result=delegateCheck((String)target,ignoreCase,toffse...
[ "static", "boolean", "regionMatches", "(", "final", "CharSequence", "target", ",", "final", "boolean", "ignoreCase", ",", "final", "int", "toffset", ",", "final", "CharSequence", "other", ",", "final", "int", "ooffset", ",", "final", "int", "length", ")", "{",...
Tests if two {@link CharSequence charsequence} regions are equal. <p> A region of the {@code target} charsequence is compared to a region of the {@code other} charsequence. The result is {@code true} if these regions represent character sequences that are the same, ignoring case if and only if {@code ignoreCase} is tru...
[ "Tests", "if", "two", "{", "@link", "CharSequence", "charsequence", "}", "regions", "are", "equal", ".", "<p", ">", "A", "region", "of", "the", "{", "@code", "target", "}", "charsequence", "is", "compared", "to", "a", "region", "of", "the", "{", "@code",...
4236dfb3a746be390155c1056bbb5a8d4dccc49f
https://github.com/ldp4j/ldp4j/blob/4236dfb3a746be390155c1056bbb5a8d4dccc49f/commons/http/src/main/java/org/ldp4j/http/MoreStrings.java#L172-L186
valid
Checks if two CharSequences are in the same region.
Of course, here is the Java code you requested: ```java static boolean regionMatches( final CharSequence target, final boolean ignoreCase, final int toffset, final CharSequence other, final int ooffset, final int length) { boolean result; if (target instanceof String && other instanceof String) {...
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/crf/CRFLogConditionalObjectiveFunction.java
CRFLogConditionalObjectiveFunction.valueAt
public double valueAt(double[] x, double xscale, int[] batch) { double prob = 0; // the log prob of the sequence given the model, which is the negation of value at this point double[] weights = x; int[][] wis = getWeightIndices(); int[] given = new int[window - 1]; int[][] docCliqueLabels = n...
java
public double valueAt(double[] x, double xscale, int[] batch) { double prob = 0; // the log prob of the sequence given the model, which is the negation of value at this point double[] weights = x; int[][] wis = getWeightIndices(); int[] given = new int[window - 1]; int[][] docCliqueLabels = n...
[ "public", "double", "valueAt", "(", "double", "[", "]", "x", ",", "double", "xscale", ",", "int", "[", "]", "batch", ")", "{", "double", "prob", "=", "0", ";", "// the log prob of the sequence given the model, which is the negation of value at this point\r", "double",...
Computes value of function for specified value of x (scaled by xscale) only over samples indexed by batch NOTE: This function does not do regularization (regularization is done by minimizer) @param x - unscaled weights @param xscale - how much to scale x by when performing calculations @param batch - indices of which s...
[ "Computes", "value", "of", "function", "for", "specified", "value", "of", "x", "(", "scaled", "by", "xscale", ")", "only", "over", "samples", "indexed", "by", "batch", "NOTE", ":", "This", "function", "does", "not", "do", "regularization", "(", "regularizati...
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFLogConditionalObjectiveFunction.java#L539-L591
train
Gets the value at the specified point in the sequence given the model with the parameters x.
Of course, here is the Java code you requested: ```java public double valueAt(double[] x, double xscale, int[] batch) { double prob = 0; // the log prob of the sequence given the model, which is the negation of value at this point double[] weights = x; int[][] wis = getWeightIndices(); int[] give...
jmeetsma/Iglu-Common
src/main/java/org/ijsberg/iglu/server/telnet/TelnetAdapter.java
TelnetAdapter.receive
public void receive(byte[] byteArray) throws IOException { //register the current application for this thread // in case a subsystem logs to the environment if (interpreter.isInSubProcessMode()) { if (!abortSubprocessModeIfNecessary(byteArray)) { /* case CTRLC: interpreter.abortSubprocessMode(); ...
java
public void receive(byte[] byteArray) throws IOException { //register the current application for this thread // in case a subsystem logs to the environment if (interpreter.isInSubProcessMode()) { if (!abortSubprocessModeIfNecessary(byteArray)) { /* case CTRLC: interpreter.abortSubprocessMode(); ...
[ "public", "void", "receive", "(", "byte", "[", "]", "byteArray", ")", "throws", "IOException", "{", "//register the current application for this thread", "// in case a subsystem logs to the environment", "if", "(", "interpreter", ".", "isInSubProcessMode", "(", ")", ")", ...
Contains the loop that processes incoming bytes.
[ "Contains", "the", "loop", "that", "processes", "incoming", "bytes", "." ]
0fb0885775b576209ff1b5a0f67e3c25a99a6420
https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/server/telnet/TelnetAdapter.java#L287-L304
train
This method is called when a byte array is received from the client.
Of course, here is the Java code you requested: ```java public void receive(byte[] byteArray) throws IOException { //register the current application for this thread // in case a subsystem logs to the environment if (interpreter.isInSubProcessMode()) { if (!abortSubprocessModeIfNecessary(byteArray)) { /* ...
defei/codelogger-utils
src/main/java/org/codelogger/utils/DateUtils.java
DateUtils.subSeconds
public static long subSeconds(final Date date1, final Date date2) { return subTime(date1, date2, DatePeriod.SECOND); }
java
public static long subSeconds(final Date date1, final Date date2) { return subTime(date1, date2, DatePeriod.SECOND); }
[ "public", "static", "long", "subSeconds", "(", "final", "Date", "date1", ",", "final", "Date", "date2", ")", "{", "return", "subTime", "(", "date1", ",", "date2", ",", "DatePeriod", ".", "SECOND", ")", ";", "}" ]
Get how many seconds between two date. @param date1 date to be tested. @param date2 date to be tested. @return how many seconds between two date.
[ "Get", "how", "many", "seconds", "between", "two", "date", "." ]
d906f5d217b783c7ae3e53442cd6fb87b20ecc0a
https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DateUtils.java#L411-L414
train
Get the sub - seconds.
Of course, here is the Java code you requested: ```java public static long subSeconds(final Date date1, final Date date2) { return subTime(date1, date2, DatePeriod.SECOND); } ``` Hope this helps!
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java
Text.implode
public static String implode(String[] arr, String delim) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < arr.length; i++) { if (i > 0) { buf.append(delim); } buf.append(arr[i]); } return buf.toString(); }
java
public static String implode(String[] arr, String delim) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < arr.length; i++) { if (i > 0) { buf.append(delim); } buf.append(arr[i]); } return buf.toString(); }
[ "public", "static", "String", "implode", "(", "String", "[", "]", "arr", ",", "String", "delim", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "arr", ".", "length", ";...
Concatenates all strings in the string array using the specified delimiter. @param arr @param delim @return the concatenated string
[ "Concatenates", "all", "strings", "in", "the", "string", "array", "using", "the", "specified", "delimiter", "." ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L206-L218
train
implode a String array into a String
Of course, here is the Java code you requested: ```java public static String implode(String[] arr, String delim) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < arr.length; i++) { if (i > 0) { buf.append(delim); } buf.append(arr[i]); ...
Netflix/governator
governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java
ConfigurationColumnWriter.output
public void output(Logger log) { Map<String, Entry> entries = config.getSortedEntries(); if ( entries.isEmpty() ) { return; } ColumnPrinter printer = build(entries); log.debug("Configuration Details"); for ( String line : printer.generat...
java
public void output(Logger log) { Map<String, Entry> entries = config.getSortedEntries(); if ( entries.isEmpty() ) { return; } ColumnPrinter printer = build(entries); log.debug("Configuration Details"); for ( String line : printer.generat...
[ "public", "void", "output", "(", "Logger", "log", ")", "{", "Map", "<", "String", ",", "Entry", ">", "entries", "=", "config", ".", "getSortedEntries", "(", ")", ";", "if", "(", "entries", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "Co...
Write the documentation table to a logger @param log
[ "Write", "the", "documentation", "table", "to", "a", "logger" ]
c1f4bb1518e759c61f2e9cad8a896ec6beba0294
https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java#L30-L46
train
Output the configuration.
Of course, here is the Java code you requested: ```java public void output(Logger log) { Map<String, Entry> entries = config.getSortedEntries(); if ( entries.isEmpty() ) { return; } ColumnPrinter printer = build(entries); log.debug("Configurati...
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java
AbstractSequenceClassifier.makeObjectBankFromReader
public ObjectBank<List<IN>> makeObjectBankFromReader(BufferedReader in, DocumentReaderAndWriter<IN> readerAndWriter) { if (flags.announceObjectBankEntries) { System.err.println("Reading data using " + readerAndWriter.getClass()); } // TODO ge...
java
public ObjectBank<List<IN>> makeObjectBankFromReader(BufferedReader in, DocumentReaderAndWriter<IN> readerAndWriter) { if (flags.announceObjectBankEntries) { System.err.println("Reading data using " + readerAndWriter.getClass()); } // TODO ge...
[ "public", "ObjectBank", "<", "List", "<", "IN", ">", ">", "makeObjectBankFromReader", "(", "BufferedReader", "in", ",", "DocumentReaderAndWriter", "<", "IN", ">", "readerAndWriter", ")", "{", "if", "(", "flags", ".", "announceObjectBankEntries", ")", "{", "Syste...
Set up an ObjectBank that will allow one to iterate over a collection of documents obtained from the passed in Reader. Each document will be represented as a list of IN. If the ObjectBank iterator() is called until hasNext() returns false, then the Reader will be read till end of file, but no reading is done at the tim...
[ "Set", "up", "an", "ObjectBank", "that", "will", "allow", "one", "to", "iterate", "over", "a", "collection", "of", "documents", "obtained", "from", "the", "passed", "in", "Reader", ".", "Each", "document", "will", "be", "represented", "as", "a", "list", "o...
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java#L906-L916
train
Create an ObjectBank from a buffered reader.
Of course, here is the Java code you requested: ```java public ObjectBank<List<IN>> makeObjectBankFromReader(BufferedReader in, DocumentReaderAndWriter<IN> readerAndWriter) { if (flags.announceObjectBankEntries) { System.err.println("Reading data usin...
nutzam/nutz
src/org/nutz/dao/util/Pojos.java
Pojos.createRun
public static Pojo createRun(PojoCallback callback) { return new NutPojo().setSqlType(SqlType.RUN).setAfter(callback); }
java
public static Pojo createRun(PojoCallback callback) { return new NutPojo().setSqlType(SqlType.RUN).setAfter(callback); }
[ "public", "static", "Pojo", "createRun", "(", "PojoCallback", "callback", ")", "{", "return", "new", "NutPojo", "(", ")", ".", "setSqlType", "(", "SqlType", ".", "RUN", ")", ".", "setAfter", "(", "callback", ")", ";", "}" ]
==========================================================
[ "==========================================================" ]
a38694d5cbda2692e7931ab093c168487a6a4bfe
https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/dao/util/Pojos.java#L193-L195
valid
Creates a run pojo.
Of course, here is the Java code you requested: ```java public static Pojo createRun(PojoCallback callback) { return new NutPojo().setSqlType(SqlType.RUN).setAfter(callback); } ``` Hope this helps!
hector-client/hector
core/src/main/java/me/prettyprint/cassandra/connection/client/HThriftClient.java
HThriftClient.open
public HThriftClient open() { if ( isOpen() ) { throw new IllegalStateException("Open called on already open connection. You should not have gotten here."); } if ( log.isDebugEnabled() ) { log.debug("Creating a new thrift connection to {}", cassandraHost); } TSocket socket; try ...
java
public HThriftClient open() { if ( isOpen() ) { throw new IllegalStateException("Open called on already open connection. You should not have gotten here."); } if ( log.isDebugEnabled() ) { log.debug("Creating a new thrift connection to {}", cassandraHost); } TSocket socket; try ...
[ "public", "HThriftClient", "open", "(", ")", "{", "if", "(", "isOpen", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Open called on already open connection. You should not have gotten here.\"", ")", ";", "}", "if", "(", "log", ".", "isDebugEna...
{@inheritDoc}
[ "{" ]
a302e68ca8d91b45d332e8c9afd7d98030b54de1
https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/cassandra/connection/client/HThriftClient.java#L147-L190
train
Open a new connection to the cassandra host.
Of course, here is the Java code you requested: ```java public HThriftClient open() { if ( isOpen() ) { throw new IllegalStateException("Open called on already open connection. You should not have gotten here."); } if ( log.isDebugEnabled() ) { log.debug("Creating a new thrift connection to {}"...
weblicht/wlfxb
src/main/java/eu/clarin/weblicht/wlfxb/tc/xb/TextCorpusStored.java
TextCorpusStored.compose
public static TextCorpusStored compose(String lang, TextCorpusLayerStoredAbstract... layers) { TextCorpusStored tc = new TextCorpusStored(lang); for (TextCorpusLayerStoredAbstract layer : layers) { tc.layersInOrder[TextCorpusLayerTag.getFromClass(layer.getClass()).ordinal()] = layer; ...
java
public static TextCorpusStored compose(String lang, TextCorpusLayerStoredAbstract... layers) { TextCorpusStored tc = new TextCorpusStored(lang); for (TextCorpusLayerStoredAbstract layer : layers) { tc.layersInOrder[TextCorpusLayerTag.getFromClass(layer.getClass()).ordinal()] = layer; ...
[ "public", "static", "TextCorpusStored", "compose", "(", "String", "lang", ",", "TextCorpusLayerStoredAbstract", "...", "layers", ")", "{", "TextCorpusStored", "tc", "=", "new", "TextCorpusStored", "(", "lang", ")", ";", "for", "(", "TextCorpusLayerStoredAbstract", "...
Composes the layers into one document. Normally, you should not use this method, unless you want to manually compose document from the layer pieces.The method composes correctly only in case referencing between layers (IDs <- IDREFs) is correct @param lang @param layers @return text corpus data composed of the provide...
[ "Composes", "the", "layers", "into", "one", "document", ".", "Normally", "you", "should", "not", "use", "this", "method", "unless", "you", "want", "to", "manually", "compose", "document", "from", "the", "layer", "pieces", ".", "The", "method", "composes", "c...
a50f3c31062a3d617ed9018aabcc1180a8ceb464
https://github.com/weblicht/wlfxb/blob/a50f3c31062a3d617ed9018aabcc1180a8ceb464/src/main/java/eu/clarin/weblicht/wlfxb/tc/xb/TextCorpusStored.java#L612-L619
train
Compose a set of text corpus layers into one.
Of course, here is the Java code you requested: ```java public static TextCorpusStored compose(String lang, TextCorpusLayerStoredAbstract... layers) { TextCorpusStored tc = new TextCorpusStored(lang); for (TextCorpusLayerStoredAbstract layer : layers) { tc.layersInOrder[TextCorpusLayerTag.g...
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java
ReidSolomonCodes.correct
public boolean correct(GrowQueue_I8 input , GrowQueue_I8 ecc ) { computeSyndromes(input,ecc,syndromes); findErrorLocatorPolynomialBM(syndromes,errorLocatorPoly); if( !findErrorLocations_BruteForce(errorLocatorPoly,input.size+ecc.size,errorLocations)) return false; correctErrors(input,input.size+ecc.size,sy...
java
public boolean correct(GrowQueue_I8 input , GrowQueue_I8 ecc ) { computeSyndromes(input,ecc,syndromes); findErrorLocatorPolynomialBM(syndromes,errorLocatorPoly); if( !findErrorLocations_BruteForce(errorLocatorPoly,input.size+ecc.size,errorLocations)) return false; correctErrors(input,input.size+ecc.size,sy...
[ "public", "boolean", "correct", "(", "GrowQueue_I8", "input", ",", "GrowQueue_I8", "ecc", ")", "{", "computeSyndromes", "(", "input", ",", "ecc", ",", "syndromes", ")", ";", "findErrorLocatorPolynomialBM", "(", "syndromes", ",", "errorLocatorPoly", ")", ";", "if...
Decodes the message and performs any necessary error correction @param input (Input) Corrupted Message (Output) corrected message @param ecc (Input) error correction code for the message @return true if it was successful or false if it failed
[ "Decodes", "the", "message", "and", "performs", "any", "necessary", "error", "correction" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L79-L88
train
Computes the syndromes and errors from the input and ecc.
Of course, here is the Java code you requested: ```java public boolean correct(GrowQueue_I8 input , GrowQueue_I8 ecc ) { computeSyndromes(input,ecc,syndromes); findErrorLocatorPolynomialBM(syndromes,errorLocatorPoly); if( !findErrorLocations_BruteForce(errorLocatorPoly,input.size+ecc.size,errorLocations)) re...
TheHortonMachine/hortonmachine
modules/src/main/java/org/hortonmachine/modules/Raster.java
Raster.valueAt
public double valueAt( int col, int row ) { if (isInRaster(col, row)) { double value = iter.getSampleDouble(col, row, 0); return value; } return HMConstants.doubleNovalue; }
java
public double valueAt( int col, int row ) { if (isInRaster(col, row)) { double value = iter.getSampleDouble(col, row, 0); return value; } return HMConstants.doubleNovalue; }
[ "public", "double", "valueAt", "(", "int", "col", ",", "int", "row", ")", "{", "if", "(", "isInRaster", "(", "col", ",", "row", ")", ")", "{", "double", "value", "=", "iter", ".", "getSampleDouble", "(", "col", ",", "row", ",", "0", ")", ";", "re...
Get the raster value at a given col/row. @param col @param row @return the value.
[ "Get", "the", "raster", "value", "at", "a", "given", "col", "/", "row", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/modules/src/main/java/org/hortonmachine/modules/Raster.java#L235-L241
train
Get the value at the specified column and row.
Of course, here is the Java code you requested: ```java public double valueAt( int col, int row ) { if (isInRaster(col, row)) { double value = iter.getSampleDouble(col, row, 0); return value; } return HMConstants.doubleNovalue; } ``` Hope this helps!
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Section.java
Section.setStart
public void setStart(final double START) { if (null == start) { _start = START; fireSectionEvent(UPDATE_EVENT); } else { start.set(START); } }
java
public void setStart(final double START) { if (null == start) { _start = START; fireSectionEvent(UPDATE_EVENT); } else { start.set(START); } }
[ "public", "void", "setStart", "(", "final", "double", "START", ")", "{", "if", "(", "null", "==", "start", ")", "{", "_start", "=", "START", ";", "fireSectionEvent", "(", "UPDATE_EVENT", ")", ";", "}", "else", "{", "start", ".", "set", "(", "START", ...
Defines the value where the section begins. @param START
[ "Defines", "the", "value", "where", "the", "section", "begins", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Section.java#L138-L145
train
Sets the start value of the calendar section.
Of course, here is the Java code you requested: ```java public void setStart(final double START) { if (null == start) { _start = START; fireSectionEvent(UPDATE_EVENT); } else { start.set(START); } } ``` Hope this helps!
srikalyc/Sql4D
Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/CoordinatorAccessor.java
CoordinatorAccessor.dataSources
public Either<String, List<String>> dataSources(Map<String, String> reqHeaders) { Either<String, Either<JSONArray, JSONObject>> resp = fireCommand("druid/coordinator/v1/metadata/datasources", null, reqHeaders); if (resp.isLeft()) { return new Left<>(resp.left().get()); } Eith...
java
public Either<String, List<String>> dataSources(Map<String, String> reqHeaders) { Either<String, Either<JSONArray, JSONObject>> resp = fireCommand("druid/coordinator/v1/metadata/datasources", null, reqHeaders); if (resp.isLeft()) { return new Left<>(resp.left().get()); } Eith...
[ "public", "Either", "<", "String", ",", "List", "<", "String", ">", ">", "dataSources", "(", "Map", "<", "String", ",", "String", ">", "reqHeaders", ")", "{", "Either", "<", "String", ",", "Either", "<", "JSONArray", ",", "JSONObject", ">", ">", "resp"...
Retrieve all the datasources provisioned in Druid. @param reqHeaders @return
[ "Retrieve", "all", "the", "datasources", "provisioned", "in", "Druid", "." ]
2c052fe60ead5a16277c798a3440de7d4f6f24f6
https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/CoordinatorAccessor.java#L82-L97
train
Get a list of data sources from the coordinator
Of course, here is the Java code you requested: ```java public Either<String, List<String>> dataSources(Map<String, String> reqHeaders) { Either<String, Either<JSONArray, JSONObject>> resp = fireCommand("druid/coordinator/v1/metadata/datasources", null, reqHeaders); if (resp.isLeft()) { ret...
raphw/byte-buddy
byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java
ElementMatchers.isGetter
public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter() { return takesArguments(0).and(not(returns(TypeDescription.VOID))).and(nameStartsWith("get").or(nameStartsWith("is").and(returnsGeneric(anyOf(boolean.class, Boolean.class))))); }
java
public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter() { return takesArguments(0).and(not(returns(TypeDescription.VOID))).and(nameStartsWith("get").or(nameStartsWith("is").and(returnsGeneric(anyOf(boolean.class, Boolean.class))))); }
[ "public", "static", "<", "T", "extends", "MethodDescription", ">", "ElementMatcher", ".", "Junction", "<", "T", ">", "isGetter", "(", ")", "{", "return", "takesArguments", "(", "0", ")", ".", "and", "(", "not", "(", "returns", "(", "TypeDescription", ".", ...
Matches any Java bean getter method. @param <T> The type of the matched object. @return A matcher that matches any getter method.
[ "Matches", "any", "Java", "bean", "getter", "method", "." ]
4d2dac80efb6bed89367567260f6811c2f712d12
https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java#L1737-L1739
train
Matches a method s signature to determine if it is a getter.
Of course, here is the Java code you requested: ```java public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter() { return takesArguments(0).and(not(returns(TypeDescription.VOID))).and(nameStartsWith("get").or(nameStartsWith("is").and(returnsGeneric(anyOf(boolean.class, Boolean.class)))...
subinkrishna/CircularImageView
circularimageview/src/main/java/com/subinkrishna/widget/CircularImageView.java
CircularImageView.setCheckedStateBackgroundColor
public final void setCheckedStateBackgroundColor(@ColorInt int backgroundColor) { if ((backgroundColor != mCheckedBackgroundColor) && (null != mCheckedBackgroundPaint)) { mCheckedBackgroundPaint.setColor(backgroundColor); if (isChecked()) { invalidate(); ...
java
public final void setCheckedStateBackgroundColor(@ColorInt int backgroundColor) { if ((backgroundColor != mCheckedBackgroundColor) && (null != mCheckedBackgroundPaint)) { mCheckedBackgroundPaint.setColor(backgroundColor); if (isChecked()) { invalidate(); ...
[ "public", "final", "void", "setCheckedStateBackgroundColor", "(", "@", "ColorInt", "int", "backgroundColor", ")", "{", "if", "(", "(", "backgroundColor", "!=", "mCheckedBackgroundColor", ")", "&&", "(", "null", "!=", "mCheckedBackgroundPaint", ")", ")", "{", "mChe...
Sets the check state background color. @param backgroundColor
[ "Sets", "the", "check", "state", "background", "color", "." ]
b3033a79f4f831c0a7c2567cc52f63b8410198a2
https://github.com/subinkrishna/CircularImageView/blob/b3033a79f4f831c0a7c2567cc52f63b8410198a2/circularimageview/src/main/java/com/subinkrishna/widget/CircularImageView.java#L363-L373
train
Sets the background color of the check area.
Of course, here is the Java code you requested: ```java public final void setCheckedStateBackgroundColor(@ColorInt int backgroundColor) { if ((backgroundColor != mCheckedBackgroundColor) && (null != mCheckedBackgroundPaint)) { mCheckedBackgroundPaint.setColor(backgroundColor); ...
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java
InternalDebugControl.debug
public static void debug(JShell state, PrintStream err, Exception ex, String where) { if (isDebugEnabled(state, 0xFFFFFFFF)) { err.printf("Fatal error: %s: %s\n", where, ex.getMessage()); ex.printStackTrace(err); } }
java
public static void debug(JShell state, PrintStream err, Exception ex, String where) { if (isDebugEnabled(state, 0xFFFFFFFF)) { err.printf("Fatal error: %s: %s\n", where, ex.getMessage()); ex.printStackTrace(err); } }
[ "public", "static", "void", "debug", "(", "JShell", "state", ",", "PrintStream", "err", ",", "Exception", "ex", ",", "String", "where", ")", "{", "if", "(", "isDebugEnabled", "(", "state", ",", "0xFFFFFFFF", ")", ")", "{", "err", ".", "printf", "(", "\...
Displays a fatal exception as debug info. @param state the current JShell instance @param err the {@code PrintStream} to report on @param ex the fatal Exception @param where additional context
[ "Displays", "a", "fatal", "exception", "as", "debug", "info", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java#L144-L149
train
Debug method.
Of course, here is the Java code you requested: ```java public static void debug(JShell state, PrintStream err, Exception ex, String where) { if (isDebugEnabled(state, 0xFFFFFFFF)) { err.printf("Fatal error: %s: %s\n", where, ex.getMessage()); ex.printStackTrace(err); } } ``...
eurekaclinical/protempa
protempa-framework/src/main/java/org/protempa/KnowledgeSourceImpl.java
KnowledgeSourceImpl.initializeIfNeeded
private void initializeIfNeeded() throws BackendInitializationException, BackendNewInstanceException { if (isClosed()) { throw new IllegalStateException("Knowledge source already closed!"); } if (this.inDataSourceGetter == null) { this.inDataSourceGetter ...
java
private void initializeIfNeeded() throws BackendInitializationException, BackendNewInstanceException { if (isClosed()) { throw new IllegalStateException("Knowledge source already closed!"); } if (this.inDataSourceGetter == null) { this.inDataSourceGetter ...
[ "private", "void", "initializeIfNeeded", "(", ")", "throws", "BackendInitializationException", ",", "BackendNewInstanceException", "{", "if", "(", "isClosed", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Knowledge source already closed!\"", ")", ...
Connect to the knowledge source backend(s).
[ "Connect", "to", "the", "knowledge", "source", "backend", "(", "s", ")", "." ]
5a620d1a407c7a5426d1cf17d47b97717cf71634
https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/KnowledgeSourceImpl.java#L71-L84
train
Initialize the Knowledge Source if necessary.
Of course, here is the Java code you requested: ```java private void initializeIfNeeded() throws BackendInitializationException, BackendNewInstanceException { if (isClosed()) { throw new IllegalStateException("Knowledge source already closed!"); } if (this.inDataSourceGe...
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractDatabase.java
AbstractDatabase.addDocumentChangeListener
private ListenerToken addDocumentChangeListener( Executor executor, DocumentChangeListener listener, String docID) { // NOTE: caller method is synchronized. DocumentChangeNotifier docNotifier = docChangeNotifiers.get(docID); if (docNotifier == null) { docNotif...
java
private ListenerToken addDocumentChangeListener( Executor executor, DocumentChangeListener listener, String docID) { // NOTE: caller method is synchronized. DocumentChangeNotifier docNotifier = docChangeNotifiers.get(docID); if (docNotifier == null) { docNotif...
[ "private", "ListenerToken", "addDocumentChangeListener", "(", "Executor", "executor", ",", "DocumentChangeListener", "listener", ",", "String", "docID", ")", "{", "// NOTE: caller method is synchronized.", "DocumentChangeNotifier", "docNotifier", "=", "docChangeNotifiers", ".",...
Document changes:
[ "Document", "changes", ":" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L1089-L1102
train
Add a DocumentChangeListener to the database.
Of course, here is the Java code you requested: ```java private ListenerToken addDocumentChangeListener( Executor executor, DocumentChangeListener listener, String docID) { // NOTE: caller method is synchronized. DocumentChangeNotifier docNotifier = docChangeNotifiers.get(docID)...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
NetcdfDataset.setValues
public void setValues(Variable v, List<String> values) throws IllegalArgumentException { Array data = Array.makeArray(v.getDataType(), values); if (data.getSize() != v.getSize()) throw new IllegalArgumentException("Incorrect number of values specified for the Variable " + v.getFullName() + ...
java
public void setValues(Variable v, List<String> values) throws IllegalArgumentException { Array data = Array.makeArray(v.getDataType(), values); if (data.getSize() != v.getSize()) throw new IllegalArgumentException("Incorrect number of values specified for the Variable " + v.getFullName() + ...
[ "public", "void", "setValues", "(", "Variable", "v", ",", "List", "<", "String", ">", "values", ")", "throws", "IllegalArgumentException", "{", "Array", "data", "=", "Array", ".", "makeArray", "(", "v", ".", "getDataType", "(", ")", ",", "values", ")", "...
Set the data values from a list of Strings. @param v for this variable @param values list of Strings @throws IllegalArgumentException if values array not correct size, or values wont parse to the correct type @deprecated use Variable.setValues()
[ "Set", "the", "data", "values", "from", "a", "list", "of", "Strings", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java#L1442-L1453
test
Sets the values for the variable.
Of course, here is the Java code you requested: ```java public void setValues(Variable v, List<String> values) throws IllegalArgumentException { Array data = Array.makeArray(v.getDataType(), values); if (data.getSize() != v.getSize()) throw new IllegalArgumentException("Incorrect number of values specif...
reactor/reactor-netty
src/main/java/reactor/netty/http/Cookies.java
Cookies.newServerRequestHolder
public static Cookies newServerRequestHolder(HttpHeaders headers, ServerCookieDecoder decoder) { return new Cookies(headers, HttpHeaderNames.COOKIE, false, decoder); }
java
public static Cookies newServerRequestHolder(HttpHeaders headers, ServerCookieDecoder decoder) { return new Cookies(headers, HttpHeaderNames.COOKIE, false, decoder); }
[ "public", "static", "Cookies", "newServerRequestHolder", "(", "HttpHeaders", "headers", ",", "ServerCookieDecoder", "decoder", ")", "{", "return", "new", "Cookies", "(", "headers", ",", "HttpHeaderNames", ".", "COOKIE", ",", "false", ",", "decoder", ")", ";", "}...
Return a new cookies holder from server request headers @param headers server request headers @return a new cookies holder from server request headers
[ "Return", "a", "new", "cookies", "holder", "from", "server", "request", "headers" ]
4ed14316e1d7fca3cecd18d6caa5f2251e159e49
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/Cookies.java#L55-L57
train
Creates a new CookieHolder instance from the given HTTP headers.
Of course, here is the Java code you requested: ```java public static Cookies newServerRequestHolder(HttpHeaders headers, ServerCookieDecoder decoder) { return new Cookies(headers, HttpHeaderNames.COOKIE, false, decoder); } ``` Hope this helps!