repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/core/TaskService.java
TaskService.take
public Task take(String taskId, String operator) { Task task = access().getTask(taskId); AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在"); if(!isAllowed(task, operator)) { throw new SnakerException("当前参与者[" + operator + "]不允许提取任务[taskId=" + taskId + "]"); } task.setOperator(operator); task.setFi...
java
public Task take(String taskId, String operator) { Task task = access().getTask(taskId); AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在"); if(!isAllowed(task, operator)) { throw new SnakerException("当前参与者[" + operator + "]不允许提取任务[taskId=" + taskId + "]"); } task.setOperator(operator); task.setFi...
[ "public", "Task", "take", "(", "String", "taskId", ",", "String", "operator", ")", "{", "Task", "task", "=", "access", "(", ")", ".", "getTask", "(", "taskId", ")", ";", "AssertHelper", ".", "notNull", "(", "task", ",", "\"指定的任务[id=\" + taskId ", " ", "]...
提取指定任务,设置完成时间及操作人,状态不改变
[ "提取指定任务,设置完成时间及操作人,状态不改变" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/core/TaskService.java#L126-L136
test
Take task.
Of course, here is the Java code you requested: ```java public Task take(String taskId, String operator) { Task task = access().getTask(taskId); AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在"); if(!isAllowed(task, operator)) { throw new SnakerException("当前参与者[" + operator + "]不允许提取任务[taskId=" + task...
Yubico/yubico-java-client
jaas/src/main/java/com/yubico/jaas/impl/YubikeyToUserLDAPMap.java
YubikeyToUserLDAPMap.setOptions
public final void setOptions(Map<String, ?> options) { /* Is verification of YubiKey owners enabled? */ this.verify_yubikey_owner = true; if (options.get(OPTION_YUBICO_VERIFY_YK_OWNER) != null) { if ("false".equals(options.get(OPTION_YUBICO_VERIFY_YK_OWNER).toString())) { ...
java
public final void setOptions(Map<String, ?> options) { /* Is verification of YubiKey owners enabled? */ this.verify_yubikey_owner = true; if (options.get(OPTION_YUBICO_VERIFY_YK_OWNER) != null) { if ("false".equals(options.get(OPTION_YUBICO_VERIFY_YK_OWNER).toString())) { ...
[ "public", "final", "void", "setOptions", "(", "Map", "<", "String", ",", "?", ">", "options", ")", "{", "/* Is verification of YubiKey owners enabled? */", "this", ".", "verify_yubikey_owner", "=", "true", ";", "if", "(", "options", ".", "get", "(", "OPTION_YUBI...
{@inheritDoc}
[ "{" ]
263b09c6ab0ee54b0dc7d70516989abab981796f
https://github.com/Yubico/yubico-java-client/blob/263b09c6ab0ee54b0dc7d70516989abab981796f/jaas/src/main/java/com/yubico/jaas/impl/YubikeyToUserLDAPMap.java#L120-L150
test
Sets the options.
Of course, here is the Java code you requested: ```java public final void setOptions(Map<String, ?> options) { /* Is verification of YubiKey owners enabled? */ this.verify_yubikey_owner = true; if (options.get(OPTION_YUBICO_VERIFY_YK_OWNER) != null) { if ("false".equals(options.get(...
medcl/elasticsearch-analysis-ik
src/main/java/org/wltea/analyzer/dic/Dictionary.java
Dictionary.initial
public static synchronized void initial(Configuration cfg) { if (singleton == null) { synchronized (Dictionary.class) { if (singleton == null) { singleton = new Dictionary(cfg); singleton.loadMainDict(); singleton.loadSurnameDict(); singleton.loadQuantifierDict(); singleton.l...
java
public static synchronized void initial(Configuration cfg) { if (singleton == null) { synchronized (Dictionary.class) { if (singleton == null) { singleton = new Dictionary(cfg); singleton.loadMainDict(); singleton.loadSurnameDict(); singleton.loadQuantifierDict(); singleton.l...
[ "public", "static", "synchronized", "void", "initial", "(", "Configuration", "cfg", ")", "{", "if", "(", "singleton", "==", "null", ")", "{", "synchronized", "(", "Dictionary", ".", "class", ")", "{", "if", "(", "singleton", "==", "null", ")", "{", "sing...
词典初始化 由于IK Analyzer的词典采用Dictionary类的静态方法进行词典初始化 只有当Dictionary类被实际调用时,才会开始载入词典, 这将延长首次分词操作的时间 该方法提供了一个在应用加载阶段就初始化字典的手段 @return Dictionary
[ "词典初始化", "由于IK", "Analyzer的词典采用Dictionary类的静态方法进行词典初始化", "只有当Dictionary类被实际调用时,才会开始载入词典,", "这将延长首次分词操作的时间", "该方法提供了一个在应用加载阶段就初始化字典的手段" ]
a1d6ba8ca206d750e68bbf3e53a25284100174bd
https://github.com/medcl/elasticsearch-analysis-ik/blob/a1d6ba8ca206d750e68bbf3e53a25284100174bd/src/main/java/org/wltea/analyzer/dic/Dictionary.java#L145-L172
test
Initializes the Dictionary.
Of course, here is the Java code you requested: ```java public static synchronized void initial(Configuration cfg) { if (singleton == null) { synchronized (Dictionary.class) { if (singleton == null) { singleton = new Dictionary(cfg); singleton.loadMainDict(); singleton.loadSurnameDict()...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/JspWriterImpl.java
JspWriterImpl.flush
public void flush() throws IOException { flushBuffer(); if (out != null) { out.flush(); } // START 6426898 else { // Set the default character encoding if there isn't any present, // see CR 6699416 response.setCharacterEncoding(res...
java
public void flush() throws IOException { flushBuffer(); if (out != null) { out.flush(); } // START 6426898 else { // Set the default character encoding if there isn't any present, // see CR 6699416 response.setCharacterEncoding(res...
[ "public", "void", "flush", "(", ")", "throws", "IOException", "{", "flushBuffer", "(", ")", ";", "if", "(", "out", "!=", "null", ")", "{", "out", ".", "flush", "(", ")", ";", "}", "// START 6426898", "else", "{", "// Set the default character encoding if the...
Flush the stream.
[ "Flush", "the", "stream", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/JspWriterImpl.java#L244-L259
test
Flush the output stream.
Of course, here is the Java code you requested: ```java public void flush() throws IOException { flushBuffer(); if (out != null) { out.flush(); } // START 6426898 else { // Set the default character encoding if there isn't any present, // see...
Unidata/thredds
tds/src/main/java/thredds/core/TdsRequestedDataset.java
TdsRequestedDataset.getPointDataset
public static FeatureDatasetPoint getPointDataset(HttpServletRequest request, HttpServletResponse response, String path) throws IOException { TdsRequestedDataset trd = new TdsRequestedDataset(request, null); if (path != null) trd.path = path; return trd.openAsPointDataset(request, response); }
java
public static FeatureDatasetPoint getPointDataset(HttpServletRequest request, HttpServletResponse response, String path) throws IOException { TdsRequestedDataset trd = new TdsRequestedDataset(request, null); if (path != null) trd.path = path; return trd.openAsPointDataset(request, response); }
[ "public", "static", "FeatureDatasetPoint", "getPointDataset", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "String", "path", ")", "throws", "IOException", "{", "TdsRequestedDataset", "trd", "=", "new", "TdsRequestedDataset", "(", "r...
return null means request has been handled, and calling routine should exit without further processing
[ "return", "null", "means", "request", "has", "been", "handled", "and", "calling", "routine", "should", "exit", "without", "further", "processing" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/core/TdsRequestedDataset.java#L49-L53
test
Get a point dataset from the request
Of course, here is the Java code you requested: ```java public static FeatureDatasetPoint getPointDataset(HttpServletRequest request, HttpServletResponse response, String path) throws IOException { TdsRequestedDataset trd = new TdsRequestedDataset(request, null); if (path != null) trd.path = path; return t...
GlenKPeterson/Paguro
src/main/java/org/organicdesign/fp/collections/PersistentVector.java
PersistentVector.get
@Override public E get(int i) { E[] node = leafNodeArrayFor(i); return node[i & LOW_BITS]; }
java
@Override public E get(int i) { E[] node = leafNodeArrayFor(i); return node[i & LOW_BITS]; }
[ "@", "Override", "public", "E", "get", "(", "int", "i", ")", "{", "E", "[", "]", "node", "=", "leafNodeArrayFor", "(", "i", ")", ";", "return", "node", "[", "i", "&", "LOW_BITS", "]", ";", "}" ]
Returns the item specified by the given index.
[ "Returns", "the", "item", "specified", "by", "the", "given", "index", "." ]
eac0d64b2eb9496967334f635cdb270cffb2197b
https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/PersistentVector.java#L228-L231
test
Returns the value of the i th entry in the cache.
Of course, here is the Java code you requested: ```java @Override public E get(int i) { E[] node = leafNodeArrayFor(i); return node[i & LOW_BITS]; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createWgGeeignet
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "wg_geeignet") public JAXBElement<Boolean> createWgGeeignet(Boolean value) { return new JAXBElement<Boolean>(_WgGeeignet_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "wg_geeignet") public JAXBElement<Boolean> createWgGeeignet(Boolean value) { return new JAXBElement<Boolean>(_WgGeeignet_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"wg_geeignet\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createWgGeeignet", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<", "Boolean"...
Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Boolean", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L1804-L1807
test
Create an instance of a WgGeeignet value.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "wg_geeignet") public JAXBElement<Boolean> createWgGeeignet(Boolean value) { return new JAXBElement<Boolean>(_WgGeeignet_QNAME, Boolean.class, null, value); } ``` Hope this helps!
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.checkResultBLAS
private static void checkResultBLAS() { if (exceptionsEnabled) { lastResult = cublasGetErrorNative(); if (lastResult != cublasStatus.CUBLAS_STATUS_SUCCESS) { throw new CudaException(cublasStatus.stringFor(lastResult)); } ...
java
private static void checkResultBLAS() { if (exceptionsEnabled) { lastResult = cublasGetErrorNative(); if (lastResult != cublasStatus.CUBLAS_STATUS_SUCCESS) { throw new CudaException(cublasStatus.stringFor(lastResult)); } ...
[ "private", "static", "void", "checkResultBLAS", "(", ")", "{", "if", "(", "exceptionsEnabled", ")", "{", "lastResult", "=", "cublasGetErrorNative", "(", ")", ";", "if", "(", "lastResult", "!=", "cublasStatus", ".", "CUBLAS_STATUS_SUCCESS", ")", "{", "throw", "...
Obtain the current CUBLAS status by calling cublasGetErrorNative, and store the result as the lastResult. If the obtained result code is not cublasStatus.CUBLAS_STATUS_SUCCESS and exceptions have been enabled, an CudaException will be thrown.
[ "Obtain", "the", "current", "CUBLAS", "status", "by", "calling", "cublasGetErrorNative", "and", "store", "the", "result", "as", "the", "lastResult", ".", "If", "the", "obtained", "result", "code", "is", "not", "cublasStatus", ".", "CUBLAS_STATUS_SUCCESS", "and", ...
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L164-L174
test
Check the BLAS error status for .
Of course, here is the Java code you requested: ```java private static void checkResultBLAS() { if (exceptionsEnabled) { lastResult = cublasGetErrorNative(); if (lastResult != cublasStatus.CUBLAS_STATUS_SUCCESS) { throw new CudaException(cu...
Unidata/thredds
bufr/src/main/java/ucar/nc2/iosp/bufr/writer/BufrSplitter2.java
BufrSplitter2.execute
public void execute(String filename) throws IOException { try (RandomAccessFile mraf = new RandomAccessFile(filename, "r")) { MessageScanner scanner = new MessageScanner(mraf); while (scanner.hasNext()) { Message m = scanner.next(); if (m == null) continue; total_msg...
java
public void execute(String filename) throws IOException { try (RandomAccessFile mraf = new RandomAccessFile(filename, "r")) { MessageScanner scanner = new MessageScanner(mraf); while (scanner.hasNext()) { Message m = scanner.next(); if (m == null) continue; total_msg...
[ "public", "void", "execute", "(", "String", "filename", ")", "throws", "IOException", "{", "try", "(", "RandomAccessFile", "mraf", "=", "new", "RandomAccessFile", "(", "filename", ",", "\"r\"", ")", ")", "{", "MessageScanner", "scanner", "=", "new", "MessageSc...
LOOK - needs to be a directory, or maybe an MFILE collection
[ "LOOK", "-", "needs", "to", "be", "a", "directory", "or", "maybe", "an", "MFILE", "collection" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/bufr/src/main/java/ucar/nc2/iosp/bufr/writer/BufrSplitter2.java#L41-L61
test
Execute the MR file
Of course, here is the Java code you requested: ```java public void execute(String filename) throws IOException { try (RandomAccessFile mraf = new RandomAccessFile(filename, "r")) { MessageScanner scanner = new MessageScanner(mraf); while (scanner.hasNext()) { Message m = scanner.next(...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientElement.java
OrientElement.getRecord
@Override public ODocument getRecord() { if (rawElement == null) return null; if (rawElement instanceof ODocument) return (ODocument) rawElement; final ODocument doc = rawElement.getRecord(); if (doc == null) return null; // CHANGE THE RID -> DOCUMENT rawElement = doc; r...
java
@Override public ODocument getRecord() { if (rawElement == null) return null; if (rawElement instanceof ODocument) return (ODocument) rawElement; final ODocument doc = rawElement.getRecord(); if (doc == null) return null; // CHANGE THE RID -> DOCUMENT rawElement = doc; r...
[ "@", "Override", "public", "ODocument", "getRecord", "(", ")", "{", "if", "(", "rawElement", "==", "null", ")", "return", "null", ";", "if", "(", "rawElement", "instanceof", "ODocument", ")", "return", "(", "ODocument", ")", "rawElement", ";", "final", "OD...
(Blueprints Extension) Returns the underlying record.
[ "(", "Blueprints", "Extension", ")", "Returns", "the", "underlying", "record", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientElement.java#L413-L427
test
Get the record from the raw element.
Of course, here is the Java code you requested: ```java @Override public ODocument getRecord() { if (rawElement == null) return null; if (rawElement instanceof ODocument) return (ODocument) rawElement; final ODocument doc = rawElement.getRecord(); if (doc == null) return null; ...
DigitalPebble/storm-crawler
core/src/main/java/com/digitalpebble/stormcrawler/persistence/AbstractStatusUpdaterBolt.java
AbstractStatusUpdaterBolt.ack
protected final void ack(Tuple t, String url) { // keep the URL in the cache if (useCache) { cache.put(url, ""); } _collector.ack(t); }
java
protected final void ack(Tuple t, String url) { // keep the URL in the cache if (useCache) { cache.put(url, ""); } _collector.ack(t); }
[ "protected", "final", "void", "ack", "(", "Tuple", "t", ",", "String", "url", ")", "{", "// keep the URL in the cache", "if", "(", "useCache", ")", "{", "cache", ".", "put", "(", "url", ",", "\"\"", ")", ";", "}", "_collector", ".", "ack", "(", "t", ...
Must be called by extending classes to store and collect in one go
[ "Must", "be", "called", "by", "extending", "classes", "to", "store", "and", "collect", "in", "one", "go" ]
5d0465192ab8fbd89a90db32cb20960a282411ea
https://github.com/DigitalPebble/storm-crawler/blob/5d0465192ab8fbd89a90db32cb20960a282411ea/core/src/main/java/com/digitalpebble/stormcrawler/persistence/AbstractStatusUpdaterBolt.java#L258-L265
test
Acknowledges a tuple.
Of course, here is the Java code you requested: ```java protected final void ack(Tuple t, String url) { // keep the URL in the cache if (useCache) { cache.put(url, ""); } _collector.ack(t); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createDreizeiler
@XmlElementDecl(namespace = "", name = "dreizeiler") public JAXBElement<String> createDreizeiler(String value) { return new JAXBElement<String>(_Dreizeiler_QNAME, String.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "dreizeiler") public JAXBElement<String> createDreizeiler(String value) { return new JAXBElement<String>(_Dreizeiler_QNAME, String.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"dreizeiler\"", ")", "public", "JAXBElement", "<", "String", ">", "createDreizeiler", "(", "String", "value", ")", "{", "return", "new", "JAXBElement", "<", "String", ">", "(", "_Dreiz...
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "String", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L3022-L3025
test
Create an instance of the Dreizeiler JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "dreizeiler") public JAXBElement<String> createDreizeiler(String value) { return new JAXBElement<String>(_Dreizeiler_QNAME, String.class, null, value); } ``` Hope this helps!
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasSrotm
public static void cublasSrotm(int n, Pointer x, int incx, Pointer y, int incy, float sparam[]) { cublasSrotmNative(n, x, incx, y, incy, sparam); checkResultBLAS(); }
java
public static void cublasSrotm(int n, Pointer x, int incx, Pointer y, int incy, float sparam[]) { cublasSrotmNative(n, x, incx, y, incy, sparam); checkResultBLAS(); }
[ "public", "static", "void", "cublasSrotm", "(", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "y", ",", "int", "incy", ",", "float", "sparam", "[", "]", ")", "{", "cublasSrotmNative", "(", "n", ",", "x", ",", "incx", ",", "y"...
Wrapper for CUBLAS function. <pre> void cublasSrotm (int n, float *x, int incx, float *y, int incy, const float* sparam) applies the modified Givens transformation, h, to the 2 x n matrix ( transpose(x) ) ( transpose(y) ) The elements of x are in x[lx + i * incx], i = 0 to n-1, where lx = 1 if incx >= 0, else lx = 1...
[ "Wrapper", "for", "CUBLAS", "function", ".", "<pre", ">", "void", "cublasSrotm", "(", "int", "n", "float", "*", "x", "int", "incx", "float", "*", "y", "int", "incy", "const", "float", "*", "sparam", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L924-L928
test
CUBLAS rotation matrix.
Of course, here is the Java code you requested: ```java public static void cublasSrotm(int n, Pointer x, int incx, Pointer y, int incy, float sparam[]) { cublasSrotmNative(n, x, incx, y, incy, sparam); checkResultBLAS(); } ``` Hope this helps!
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java
OrientVertex.getEdges
public Iterable<Edge> getEdges(final OrientVertex iDestination, final Direction iDirection, final String... iLabels) { setCurrentGraphInThreadLocal(); final ODocument doc = getRecord(); OrientBaseGraph.getEdgeClassNames(getGraph(), iLabels); OrientBaseGraph.encodeClassNames(iLabels); final OMult...
java
public Iterable<Edge> getEdges(final OrientVertex iDestination, final Direction iDirection, final String... iLabels) { setCurrentGraphInThreadLocal(); final ODocument doc = getRecord(); OrientBaseGraph.getEdgeClassNames(getGraph(), iLabels); OrientBaseGraph.encodeClassNames(iLabels); final OMult...
[ "public", "Iterable", "<", "Edge", ">", "getEdges", "(", "final", "OrientVertex", "iDestination", ",", "final", "Direction", "iDirection", ",", "final", "String", "...", "iLabels", ")", "{", "setCurrentGraphInThreadLocal", "(", ")", ";", "final", "ODocument", "d...
(Blueprints Extension) Returns all the edges from the current Vertex to another one. @param iDestination The target vertex @param iDirection The direction between OUT, IN or BOTH @param iLabels Optional labels as Strings to consider @return
[ "(", "Blueprints", "Extension", ")", "Returns", "all", "the", "edges", "from", "the", "current", "Vertex", "to", "another", "one", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java#L835-L887
test
Get the edges of the given destination vertex.
Of course, here is the Java code you requested: ```java public Iterable<Edge> getEdges(final OrientVertex iDestination, final Direction iDirection, final String... iLabels) { setCurrentGraphInThreadLocal(); final ODocument doc = getRecord(); OrientBaseGraph.getEdgeClassNames(getGraph(), iLabels); Or...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/ElementType.java
ElementType.setAttribute
public void setAttribute(AttributesImpl atts, String name, String type, String value) { if (name.equals("xmlns") || name.startsWith("xmlns:")) { return; } ; String namespace = namespace(name, true); String localName = localName(name); ...
java
public void setAttribute(AttributesImpl atts, String name, String type, String value) { if (name.equals("xmlns") || name.startsWith("xmlns:")) { return; } ; String namespace = namespace(name, true); String localName = localName(name); ...
[ "public", "void", "setAttribute", "(", "AttributesImpl", "atts", ",", "String", "name", ",", "String", "type", ",", "String", "value", ")", "{", "if", "(", "name", ".", "equals", "(", "\"xmlns\"", ")", "||", "name", ".", "startsWith", "(", "\"xmlns:\"", ...
Sets an attribute and its value into an AttributesImpl object. Attempts to set a namespace declaration are ignored. @param atts The AttributesImpl object @param name The name (Qname) of the attribute @param type The type of the attribute @param value The value of the attribute
[ "Sets", "an", "attribute", "and", "its", "value", "into", "an", "AttributesImpl", "object", ".", "Attempts", "to", "set", "a", "namespace", "declaration", "are", "ignored", "." ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/ElementType.java#L215-L238
test
Method setAttribute.
Of course, here is the Java code you requested: ```java public void setAttribute(AttributesImpl atts, String name, String type, String value) { if (name.equals("xmlns") || name.startsWith("xmlns:")) { return; } ; String namespace = namespace(name...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/music/player/Playlist.java
Playlist.shuffle
public Playlist shuffle() { int position = getPosition(); long seed = System.nanoTime(); if (position >= 0 && position < queue.size()) { List<TrackInfo> trackInfos = queue.subList(0, position); List<TrackInfo> notPlayed = queue.subList(position, queue.size()); ...
java
public Playlist shuffle() { int position = getPosition(); long seed = System.nanoTime(); if (position >= 0 && position < queue.size()) { List<TrackInfo> trackInfos = queue.subList(0, position); List<TrackInfo> notPlayed = queue.subList(position, queue.size()); ...
[ "public", "Playlist", "shuffle", "(", ")", "{", "int", "position", "=", "getPosition", "(", ")", ";", "long", "seed", "=", "System", ".", "nanoTime", "(", ")", ";", "if", "(", "position", ">=", "0", "&&", "position", "<", "queue", ".", "size", "(", ...
Shuffles the playlist and returns the shuffled playlist, so the original stays intact. Only the part of the playlist after the current position is shuffled. @return a shuffled copy of this playlist
[ "Shuffles", "the", "playlist", "and", "returns", "the", "shuffled", "playlist", "so", "the", "original", "stays", "intact", ".", "Only", "the", "part", "of", "the", "playlist", "after", "the", "current", "position", "is", "shuffled", "." ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/player/Playlist.java#L170-L187
test
Shuffles the queue of tracks.
Of course, here is the Java code you requested: ```java public Playlist shuffle() { int position = getPosition(); long seed = System.nanoTime(); if (position >= 0 && position < queue.size()) { List<TrackInfo> trackInfos = queue.subList(0, position); List<TrackInfo> notP...
eclipse/packagedrone
bundles/org.eclipse.packagedrone.repo.adapter.maven/src/org/eclipse/packagedrone/repo/adapter/maven/upload/Coordinates.java
Coordinates.makeUnclassified
public Coordinates makeUnclassified () { if ( this.classifier == null ) { return this; } return new Coordinates ( this.groupId, this.artifactId, this.version, this.qualifiedVersion, null, this.extension ); }
java
public Coordinates makeUnclassified () { if ( this.classifier == null ) { return this; } return new Coordinates ( this.groupId, this.artifactId, this.version, this.qualifiedVersion, null, this.extension ); }
[ "public", "Coordinates", "makeUnclassified", "(", ")", "{", "if", "(", "this", ".", "classifier", "==", "null", ")", "{", "return", "this", ";", "}", "return", "new", "Coordinates", "(", "this", ".", "groupId", ",", "this", ".", "artifactId", ",", "this"...
Create an unclassified version of ourself @return either a new instance without a classifier, or the same instance if it already is without a classifier
[ "Create", "an", "unclassified", "version", "of", "ourself" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.eclipse.packagedrone.repo.adapter.maven/src/org/eclipse/packagedrone/repo/adapter/maven/upload/Coordinates.java#L315-L323
test
Make this coordinates unclassified.
Of course, here is the Java code you requested: ```java public Coordinates makeUnclassified () { if ( this.classifier == null ) { return this; } return new Coordinates ( this.groupId, this.artifactId, this.version, this.qualifiedVersion, null, this.extension ); } ``...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/beans/ClassLoaderUtils.java
ClassLoaderUtils.getResourceAsStream
public static InputStream getResourceAsStream(String name, ClassLoader classLoader) throws IOException { URL url = getResource(name, classLoader); if (url != null) { return url.openStream(); } return null; }
java
public static InputStream getResourceAsStream(String name, ClassLoader classLoader) throws IOException { URL url = getResource(name, classLoader); if (url != null) { return url.openStream(); } return null; }
[ "public", "static", "InputStream", "getResourceAsStream", "(", "String", "name", ",", "ClassLoader", "classLoader", ")", "throws", "IOException", "{", "URL", "url", "=", "getResource", "(", "name", ",", "classLoader", ")", ";", "if", "(", "url", "!=", "null", ...
Returns an input stream for reading the specified resource.
[ "Returns", "an", "input", "stream", "for", "reading", "the", "specified", "resource", "." ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/beans/ClassLoaderUtils.java#L196-L202
test
Get the resource as an InputStream.
Of course, here is the Java code you requested: ```java public static InputStream getResourceAsStream(String name, ClassLoader classLoader) throws IOException { URL url = getResource(name, classLoader); if (url != null) { return url.openStream(); } return null; } ``` Ho...
marklogic/marklogic-jena
marklogic-jena/src/main/java/com/marklogic/semantics/jena/MarkLogicDatasetGraph.java
MarkLogicDatasetGraph.addToDftGraph
@Override protected void addToDftGraph(Node s, Node p, Node o) { checkIsOpen(); Node s1 = skolemize(s); Node p1 = skolemize(p); Node o1 = skolemize(o); client.sinkQuad(null, s1, p1, o1); }
java
@Override protected void addToDftGraph(Node s, Node p, Node o) { checkIsOpen(); Node s1 = skolemize(s); Node p1 = skolemize(p); Node o1 = skolemize(o); client.sinkQuad(null, s1, p1, o1); }
[ "@", "Override", "protected", "void", "addToDftGraph", "(", "Node", "s", ",", "Node", "p", ",", "Node", "o", ")", "{", "checkIsOpen", "(", ")", ";", "Node", "s1", "=", "skolemize", "(", "s", ")", ";", "Node", "p1", "=", "skolemize", "(", "p", ")", ...
/* @see org.apache.jena.sparql.core.DatasetGraphTriplesQuads Internally uses a write cache to hold batches of quad updates. @see sync()
[ "/", "*" ]
c083f5c45e55036f5b0985aabe75e9206ba0cf9e
https://github.com/marklogic/marklogic-jena/blob/c083f5c45e55036f5b0985aabe75e9206ba0cf9e/marklogic-jena/src/main/java/com/marklogic/semantics/jena/MarkLogicDatasetGraph.java#L184-L191
test
Add a subject to a DFT graph.
Of course, here is the Java code you requested: ```java @Override protected void addToDftGraph(Node s, Node p, Node o) { checkIsOpen(); Node s1 = skolemize(s); Node p1 = skolemize(p); Node o1 = skolemize(o); client.sinkQuad(null, s1, p1, o1); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/io/FileUtil.java
FileUtil.detectEncoding
private static String detectEncoding(final UnicodeInputStream in) { String encoding = in.getDetectedEncoding(); if (encoding == null) { encoding = StringPool.UTF_8; } return encoding; }
java
private static String detectEncoding(final UnicodeInputStream in) { String encoding = in.getDetectedEncoding(); if (encoding == null) { encoding = StringPool.UTF_8; } return encoding; }
[ "private", "static", "String", "detectEncoding", "(", "final", "UnicodeInputStream", "in", ")", "{", "String", "encoding", "=", "in", ".", "getDetectedEncoding", "(", ")", ";", "if", "(", "encoding", "==", "null", ")", "{", "encoding", "=", "StringPool", "."...
Detect encoding on {@link UnicodeInputStream} by using {@link UnicodeInputStream#getDetectedEncoding()}. @param in {@link UnicodeInputStream} @return UTF encoding as a String. If encoding could not be detected, defaults to {@link StringPool#UTF_8}. @see UnicodeInputStream#getDetectedEncoding()
[ "Detect", "encoding", "on", "{", "@link", "UnicodeInputStream", "}", "by", "using", "{", "@link", "UnicodeInputStream#getDetectedEncoding", "()", "}", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L1533-L1539
test
Detect encoding.
Of course, here is the Java code you requested: ```java private static String detectEncoding(final UnicodeInputStream in) { String encoding = in.getDetectedEncoding(); if (encoding == null) { encoding = StringPool.UTF_8; } return encoding; } ``` Hope this helps!
google/guice
core/src/com/google/inject/internal/ProviderInternalFactory.java
ProviderInternalFactory.provision
protected T provision( Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) throws InternalProvisionException { T t = provider.get(); if (t == null && !dependency.isNullable()) { InternalProvisionException.onNullInjectedIntoNonNullab...
java
protected T provision( Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) throws InternalProvisionException { T t = provider.get(); if (t == null && !dependency.isNullable()) { InternalProvisionException.onNullInjectedIntoNonNullab...
[ "protected", "T", "provision", "(", "Provider", "<", "?", "extends", "T", ">", "provider", ",", "Dependency", "<", "?", ">", "dependency", ",", "ConstructionContext", "<", "T", ">", "constructionContext", ")", "throws", "InternalProvisionException", "{", "T", ...
Provisions a new instance. Subclasses should override this to catch exceptions & rethrow as ErrorsExceptions.
[ "Provisions", "a", "new", "instance", ".", "Subclasses", "should", "override", "this", "to", "catch", "exceptions", "&", "rethrow", "as", "ErrorsExceptions", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/ProviderInternalFactory.java#L80-L91
test
This method is called by the provider to provision the object.
Of course, here is the Java code you requested: ```java protected T provision( Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) throws InternalProvisionException { T t = provider.get(); if (t == null && !dependency.isNullable()) { ...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/utils/io/IOUtils.java
IOUtils.readLines
public static List<String> readLines(InputStream input, Charset encoding) throws IOException { InputStreamReader reader = new InputStreamReader(input, Charsets.toCharset(encoding)); return readLines(reader); }
java
public static List<String> readLines(InputStream input, Charset encoding) throws IOException { InputStreamReader reader = new InputStreamReader(input, Charsets.toCharset(encoding)); return readLines(reader); }
[ "public", "static", "List", "<", "String", ">", "readLines", "(", "InputStream", "input", ",", "Charset", "encoding", ")", "throws", "IOException", "{", "InputStreamReader", "reader", "=", "new", "InputStreamReader", "(", "input", ",", "Charsets", ".", "toCharse...
Get the contents of an <code>InputStream</code> as a list of Strings, one entry per line, using the specified character encoding. <p/> This method buffers the input internally, so there is no need to use a <code>BufferedInputStream</code>. @param input the <code>InputStream</code> to read from, not null @param enco...
[ "Get", "the", "contents", "of", "an", "<code", ">", "InputStream<", "/", "code", ">", "as", "a", "list", "of", "Strings", "one", "entry", "per", "line", "using", "the", "specified", "character", "encoding", ".", "<p", "/", ">", "This", "method", "buffers...
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/utils/io/IOUtils.java#L967-L970
test
Read lines from the input stream.
Of course, here is the Java code you requested: ```java public static List<String> readLines(InputStream input, Charset encoding) throws IOException { InputStreamReader reader = new InputStreamReader(input, Charsets.toCharset(encoding)); return readLines(reader); } ``` Hope this helps!
alipay/sofa-bolt
src/main/java/com/alipay/remoting/rpc/RpcClient.java
RpcClient.disableConnHeartbeat
public void disableConnHeartbeat(String addr) { Url url = this.addressParser.parse(addr); this.disableConnHeartbeat(url); }
java
public void disableConnHeartbeat(String addr) { Url url = this.addressParser.parse(addr); this.disableConnHeartbeat(url); }
[ "public", "void", "disableConnHeartbeat", "(", "String", "addr", ")", "{", "Url", "url", "=", "this", ".", "addressParser", ".", "parse", "(", "addr", ")", ";", "this", ".", "disableConnHeartbeat", "(", "url", ")", ";", "}" ]
Disable heart beat for a certain connection. If this addr not connected, then do nothing. <p> Notice: this method takes no effect on a stand alone connection. @param addr
[ "Disable", "heart", "beat", "for", "a", "certain", "connection", ".", "If", "this", "addr", "not", "connected", "then", "do", "nothing", ".", "<p", ">", "Notice", ":", "this", "method", "takes", "no", "effect", "on", "a", "stand", "alone", "connection", ...
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcClient.java#L859-L862
test
Disable the connection heartbeat for the specified address.
Of course, here is the Java code you requested: ```java public void disableConnHeartbeat(String addr) { Url url = this.addressParser.parse(addr); this.disableConnHeartbeat(url); } ``` Hope this helps!
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMRCompiler.java
Nc4DMRCompiler.getGroups
int[] getGroups(int gid) throws DapException { int ret, n; IntByReference ip = new IntByReference(); errcheck(ret = nc4.nc_inq_grps(gid, ip, null)); n = ip.getValue(); int[] grpids = null; if(n > 0) { grpids = new int[n]; errche...
java
int[] getGroups(int gid) throws DapException { int ret, n; IntByReference ip = new IntByReference(); errcheck(ret = nc4.nc_inq_grps(gid, ip, null)); n = ip.getValue(); int[] grpids = null; if(n > 0) { grpids = new int[n]; errche...
[ "int", "[", "]", "getGroups", "(", "int", "gid", ")", "throws", "DapException", "{", "int", "ret", ",", "n", ";", "IntByReference", "ip", "=", "new", "IntByReference", "(", ")", ";", "errcheck", "(", "ret", "=", "nc4", ".", "nc_inq_grps", "(", "gid", ...
////////////////////////////////////////////////
[ "////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMRCompiler.java#L472-L487
test
Get the Groups array.
Of course, here is the Java code you requested: ```java int[] getGroups(int gid) throws DapException { int ret, n; IntByReference ip = new IntByReference(); errcheck(ret = nc4.nc_inq_grps(gid, ip, null)); n = ip.getValue(); int[] grpids = null; if(n >...
deeplearning4j/nd4j
nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java
ArrowSerde.typeFromTensorType
public static DataBuffer.Type typeFromTensorType(byte type,int elementSize) { if(type == Type.Decimal || type == Type.FloatingPoint) { if(elementSize == 4) { return DataBuffer.Type.FLOAT; } else if(elementSize == 8) { return DataBuffer.Type.DOU...
java
public static DataBuffer.Type typeFromTensorType(byte type,int elementSize) { if(type == Type.Decimal || type == Type.FloatingPoint) { if(elementSize == 4) { return DataBuffer.Type.FLOAT; } else if(elementSize == 8) { return DataBuffer.Type.DOU...
[ "public", "static", "DataBuffer", ".", "Type", "typeFromTensorType", "(", "byte", "type", ",", "int", "elementSize", ")", "{", "if", "(", "type", "==", "Type", ".", "Decimal", "||", "type", "==", "Type", ".", "FloatingPoint", ")", "{", "if", "(", "elemen...
Create thee databuffer type frm the given type, relative to the bytes in arrow in class: {@link Type} @param type the type to create the nd4j {@link DataBuffer.Type} from @param elementSize the element size @return the data buffer type
[ "Create", "thee", "databuffer", "type", "frm", "the", "given", "type", "relative", "to", "the", "bytes", "in", "arrow", "in", "class", ":", "{" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java#L156-L178
test
Returns the data type from the tensor type.
Of course, here is the Java code you requested: ```java public static DataBuffer.Type typeFromTensorType(byte type,int elementSize) { if(type == Type.Decimal || type == Type.FloatingPoint) { if(elementSize == 4) { return DataBuffer.Type.FLOAT; } else if(eleme...
boonproject/boon
etcd/etcd-client/src/main/java/org/boon/etcd/EtcdClient.java
EtcdClient.sendHttpRequest
private void sendHttpRequest(final Request request, final org.boon.core.Handler<Response> responseHandler) { final HttpClientRequest httpClientRequest = httpClient.request(request.getMethod(), request.uri(), handleResponse(request, responseHandler)); final Runnable runnable = new Runn...
java
private void sendHttpRequest(final Request request, final org.boon.core.Handler<Response> responseHandler) { final HttpClientRequest httpClientRequest = httpClient.request(request.getMethod(), request.uri(), handleResponse(request, responseHandler)); final Runnable runnable = new Runn...
[ "private", "void", "sendHttpRequest", "(", "final", "Request", "request", ",", "final", "org", ".", "boon", ".", "core", ".", "Handler", "<", "Response", ">", "responseHandler", ")", "{", "final", "HttpClientRequest", "httpClientRequest", "=", "httpClient", ".",...
This actually sends the request. @param request request @param responseHandler handler
[ "This", "actually", "sends", "the", "request", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/etcd/etcd-client/src/main/java/org/boon/etcd/EtcdClient.java#L356-L412
test
Send HTTP request.
Of course, here is the Java code you requested: ```java private void sendHttpRequest(final Request request, final org.boon.core.Handler<Response> responseHandler) { final HttpClientRequest httpClientRequest = httpClient.request(request.getMethod(), request.uri(), handleResponse(request, respon...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilPoint3D_F64.java
UtilPoint3D_F64.mean
public static Point3D_F64 mean( List<Point3D_F64> points , Point3D_F64 mean ) { if( mean == null ) mean = new Point3D_F64(); double x = 0, y = 0, z = 0; for( Point3D_F64 p : points ) { x += p.x; y += p.y; z += p.z; } mean.x = x / points.size(); mean.y = y / points.size(); mean.z =...
java
public static Point3D_F64 mean( List<Point3D_F64> points , Point3D_F64 mean ) { if( mean == null ) mean = new Point3D_F64(); double x = 0, y = 0, z = 0; for( Point3D_F64 p : points ) { x += p.x; y += p.y; z += p.z; } mean.x = x / points.size(); mean.y = y / points.size(); mean.z =...
[ "public", "static", "Point3D_F64", "mean", "(", "List", "<", "Point3D_F64", ">", "points", ",", "Point3D_F64", "mean", ")", "{", "if", "(", "mean", "==", "null", ")", "mean", "=", "new", "Point3D_F64", "(", ")", ";", "double", "x", "=", "0", ",", "y"...
Computes the mean of the list of points. @param points List of points @param mean (Optional) storage for the mean. Can be null @return Mean
[ "Computes", "the", "mean", "of", "the", "list", "of", "points", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPoint3D_F64.java#L221-L238
test
Computes the mean of the points in the list
Of course, here is the Java code you requested: ```java public static Point3D_F64 mean( List<Point3D_F64> points , Point3D_F64 mean ) { if( mean == null ) mean = new Point3D_F64(); double x = 0, y = 0, z = 0; for( Point3D_F64 p : points ) { x += p.x; y += p.y; z += p.z; } mean.x = x ...
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java
src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java
StdDraw.ellipse
public static void ellipse(double x, double y, double semiMajorAxis, double semiMinorAxis) { if (!(semiMajorAxis >= 0)) throw new IllegalArgumentException("ellipse semimajor axis must be nonnegative"); if (!(semiMinorAxis >= 0)) throw new IllegalArgumentException("ellipse semiminor axis must be no...
java
public static void ellipse(double x, double y, double semiMajorAxis, double semiMinorAxis) { if (!(semiMajorAxis >= 0)) throw new IllegalArgumentException("ellipse semimajor axis must be nonnegative"); if (!(semiMinorAxis >= 0)) throw new IllegalArgumentException("ellipse semiminor axis must be no...
[ "public", "static", "void", "ellipse", "(", "double", "x", ",", "double", "y", ",", "double", "semiMajorAxis", ",", "double", "semiMinorAxis", ")", "{", "if", "(", "!", "(", "semiMajorAxis", ">=", "0", ")", ")", "throw", "new", "IllegalArgumentException", ...
Draws an ellipse with the specified semimajor and semiminor axes, centered at (<em>x</em>, <em>y</em>). @param x the <em>x</em>-coordinate of the center of the ellipse @param y the <em>y</em>-coordinate of the center of the ellipse @param semiMajorAxis is the semimajor axis of the ellipse @param semiMinorAxis is t...
[ "Draws", "an", "ellipse", "with", "the", "specified", "semimajor", "and", "semiminor", "axes", "centered", "at", "(", "<em", ">", "x<", "/", "em", ">", "<em", ">", "y<", "/", "em", ">", ")", "." ]
516fee15e537ecdb3f4dcbe3695c5cfde7e930da
https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java#L397-L412
test
Draw an ellipse on the image.
Of course, here is the Java code you requested: ```java public static void ellipse(double x, double y, double semiMajorAxis, double semiMinorAxis) { if (!(semiMajorAxis >= 0)) throw new IllegalArgumentException("ellipse semimajor axis must be nonnegative"); if (!(semiMinorAxis >= 0)) throw new Il...
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/BasicComponentInstance.java
BasicComponentInstance.getInstance
public Object getInstance() { ManagedReference managedReference = (ManagedReference) getInstanceData(INSTANCE_KEY); if(managedReference == null) { //can happen if around construct chain returns null return null; } return managedReference.getInstance(); }
java
public Object getInstance() { ManagedReference managedReference = (ManagedReference) getInstanceData(INSTANCE_KEY); if(managedReference == null) { //can happen if around construct chain returns null return null; } return managedReference.getInstance(); }
[ "public", "Object", "getInstance", "(", ")", "{", "ManagedReference", "managedReference", "=", "(", "ManagedReference", ")", "getInstanceData", "(", "INSTANCE_KEY", ")", ";", "if", "(", "managedReference", "==", "null", ")", "{", "//can happen if around construct chai...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/BasicComponentInstance.java#L87-L94
test
Gets the instance of the class.
Of course, here is the Java code you requested: ```java public Object getInstance() { ManagedReference managedReference = (ManagedReference) getInstanceData(INSTANCE_KEY); if(managedReference == null) { //can happen if around construct chain returns null return null; } ...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/util/Transformers.java
Transformers.extensionTransformer
public static Transformer<String> extensionTransformer(final String newExtension) { return new Transformer<String>() { public String transform(final String input) { return FilenameUtils.getBaseName(input) + "." + newExtension; } }; }
java
public static Transformer<String> extensionTransformer(final String newExtension) { return new Transformer<String>() { public String transform(final String input) { return FilenameUtils.getBaseName(input) + "." + newExtension; } }; }
[ "public", "static", "Transformer", "<", "String", ">", "extensionTransformer", "(", "final", "String", "newExtension", ")", "{", "return", "new", "Transformer", "<", "String", ">", "(", ")", "{", "public", "String", "transform", "(", "final", "String", "input"...
Creates a {@link Transformer} which replace a original filename extension with a new extension. @param newExtension extension to use for the returned value. @return original filename but with the new extension.
[ "Creates", "a", "{" ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/util/Transformers.java#L20-L26
test
Transformer that converts a file extension to a file name.
Of course, here is the Java code you requested: ```java public static Transformer<String> extensionTransformer(final String newExtension) { return new Transformer<String>() { public String transform(final String input) { return FilenameUtils.getBaseName(input) + "." + newExtension; } }...
oblac/jodd
jodd-petite/src/main/java/jodd/petite/resolver/ReferencesResolver.java
ReferencesResolver.convertRefToReferences
private BeanReferences[] convertRefToReferences(final String[] references) { if (references == null) { return null; } BeanReferences[] ref = new BeanReferences[references.length]; for (int i = 0; i < references.length; i++) { ref[i] = BeanReferences.of(references[i]); } return ref; }
java
private BeanReferences[] convertRefToReferences(final String[] references) { if (references == null) { return null; } BeanReferences[] ref = new BeanReferences[references.length]; for (int i = 0; i < references.length; i++) { ref[i] = BeanReferences.of(references[i]); } return ref; }
[ "private", "BeanReferences", "[", "]", "convertRefToReferences", "(", "final", "String", "[", "]", "references", ")", "{", "if", "(", "references", "==", "null", ")", "{", "return", "null", ";", "}", "BeanReferences", "[", "]", "ref", "=", "new", "BeanRefe...
Converts single string array to an array of bean references.
[ "Converts", "single", "string", "array", "to", "an", "array", "of", "bean", "references", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/resolver/ReferencesResolver.java#L340-L350
test
Converts a list of references to a list of BeanReferences.
Of course, here is the Java code you requested: ```java private BeanReferences[] convertRefToReferences(final String[] references) { if (references == null) { return null; } BeanReferences[] ref = new BeanReferences[references.length]; for (int i = 0; i < references.length; i++) { ref[i] = BeanReference...
vdmeer/execs
src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java
Gen_ExecJarScripts.writeFile
public boolean writeFile(File file, List<String> lines){ if(file.exists()){ file.delete(); } try { FileWriter out = new FileWriter(file); for(String s : lines){ out.write(s); out.write(System.getProperty("line.separator")); } out.close(); file.setExecutable(true); } catc...
java
public boolean writeFile(File file, List<String> lines){ if(file.exists()){ file.delete(); } try { FileWriter out = new FileWriter(file); for(String s : lines){ out.write(s); out.write(System.getProperty("line.separator")); } out.close(); file.setExecutable(true); } catc...
[ "public", "boolean", "writeFile", "(", "File", "file", ",", "List", "<", "String", ">", "lines", ")", "{", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "file", ".", "delete", "(", ")", ";", "}", "try", "{", "FileWriter", "out", "=", "new...
Writes the given lines to the given file, if possible. @param file file to write to @param lines lines to write to the file @return true if lines where written to the file, false otherwise with errors printed
[ "Writes", "the", "given", "lines", "to", "the", "given", "file", "if", "possible", "." ]
ac73170bfd449de1f460248d56ece57ff3b0c761
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java#L153-L171
test
Write the lines to the file.
Of course, here is the Java code you requested: ```java public boolean writeFile(File file, List<String> lines){ if(file.exists()){ file.delete(); } try { FileWriter out = new FileWriter(file); for(String s : lines){ out.write(s); out.write(System.getProperty("line.separator")); } ...
Unidata/thredds
cdm/src/main/java/ucar/unidata/util/StringUtil2.java
StringUtil2.remove
static public String remove(String s, int c) { if (0 > s.indexOf(c)) { // none return s; } StringBuilder buff = new StringBuilder(s); int i = 0; while (i < buff.length()) { if (buff.charAt(i) == c) { buff.deleteCharAt(i); } else { i++; } } ...
java
static public String remove(String s, int c) { if (0 > s.indexOf(c)) { // none return s; } StringBuilder buff = new StringBuilder(s); int i = 0; while (i < buff.length()) { if (buff.charAt(i) == c) { buff.deleteCharAt(i); } else { i++; } } ...
[ "static", "public", "String", "remove", "(", "String", "s", ",", "int", "c", ")", "{", "if", "(", "0", ">", "s", ".", "indexOf", "(", "c", ")", ")", "{", "// none\r", "return", "s", ";", "}", "StringBuilder", "buff", "=", "new", "StringBuilder", "(...
Remove all occurrences of the character c in the string s. @param s operate on this string @param c remove all occurrences of this character. @return result with any character c removed
[ "Remove", "all", "occurrences", "of", "the", "character", "c", "in", "the", "string", "s", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/util/StringUtil2.java#L297-L312
test
Remove the first occurrence of c from the string s.
Of course, here is the Java code you requested: ```java static public String remove(String s, int c) { if (0 > s.indexOf(c)) { // none return s; } StringBuilder buff = new StringBuilder(s); int i = 0; while (i < buff.length()) { if (buff.charAt(i) == c) { buff.deleteC...
Unidata/thredds
dap4/d4core/src/main/java/dap4/core/ce/parser/CELexer.java
CELexer.yyerror
public void yyerror(String s) { System.err.println("CEParserImpl.yyerror: " + s + "; parse failed at char: " + charno + "; near: "); String context = getInput(); int show = (context.length() < CONTEXTLEN ? context.length() : CONTEXTLEN); System.err.println(context.substring(context.l...
java
public void yyerror(String s) { System.err.println("CEParserImpl.yyerror: " + s + "; parse failed at char: " + charno + "; near: "); String context = getInput(); int show = (context.length() < CONTEXTLEN ? context.length() : CONTEXTLEN); System.err.println(context.substring(context.l...
[ "public", "void", "yyerror", "(", "String", "s", ")", "{", "System", ".", "err", ".", "println", "(", "\"CEParserImpl.yyerror: \"", "+", "s", "+", "\"; parse failed at char: \"", "+", "charno", "+", "\"; near: \"", ")", ";", "String", "context", "=", "getInput...
Entry point for error reporting. Emits an error in a user-defined way. Part of Lexer interface. @param s The string for the error message.
[ "Entry", "point", "for", "error", "reporting", ".", "Emits", "an", "error", "in", "a", "user", "-", "defined", "way", ".", "Part", "of", "Lexer", "interface", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/ce/parser/CELexer.java#L349-L356
test
Called when the yyerror method is called.
Of course, here is the Java code you requested: ```java public void yyerror(String s) { System.err.println("CEParserImpl.yyerror: " + s + "; parse failed at char: " + charno + "; near: "); String context = getInput(); int show = (context.length() < CONTEXTLEN ? context.length() : CONTEXTLEN...
ReactiveX/RxJava
src/main/java/io/reactivex/parallel/ParallelFlowable.java
ParallelFlowable.map
@CheckReturnValue @NonNull public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(mapper, "mapper"); ObjectHelper.requireNonNull(errorHandler, "errorHandler is null"); return ...
java
@CheckReturnValue @NonNull public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(mapper, "mapper"); ObjectHelper.requireNonNull(errorHandler, "errorHandler is null"); return ...
[ "@", "CheckReturnValue", "@", "NonNull", "public", "final", "<", "R", ">", "ParallelFlowable", "<", "R", ">", "map", "(", "@", "NonNull", "Function", "<", "?", "super", "T", ",", "?", "extends", "R", ">", "mapper", ",", "@", "NonNull", "ParallelFailureHa...
Maps the source values on each 'rail' to another value and handles errors based on the given {@link ParallelFailureHandling} enumeration value. <p> Note that the same mapper function may be called from multiple threads concurrently. <p>History: 2.0.8 - experimental @param <R> the output value type @param mapper the map...
[ "Maps", "the", "source", "values", "on", "each", "rail", "to", "another", "value", "and", "handles", "errors", "based", "on", "the", "given", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L169-L175
test
Creates a parallel flowable from this sequence using the specified mapping function.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(mapper, "mapper"); ObjectHelper.requireNonNu...
spring-projects/spring-security
samples/xml/contacts/src/main/java/sample/contact/AdminPermissionController.java
AdminPermissionController.addPermission
@RequestMapping(value = "/secure/addPermission.htm", method = RequestMethod.POST) public String addPermission(AddPermission addPermission, BindingResult result, ModelMap model) { addPermissionValidator.validate(addPermission, result); if (result.hasErrors()) { model.put("recipients", listRecipients()); m...
java
@RequestMapping(value = "/secure/addPermission.htm", method = RequestMethod.POST) public String addPermission(AddPermission addPermission, BindingResult result, ModelMap model) { addPermissionValidator.validate(addPermission, result); if (result.hasErrors()) { model.put("recipients", listRecipients()); m...
[ "@", "RequestMapping", "(", "value", "=", "\"/secure/addPermission.htm\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "String", "addPermission", "(", "AddPermission", "addPermission", ",", "BindingResult", "result", ",", "ModelMap", "model", ")...
Handles submission of the "add permission" form.
[ "Handles", "submission", "of", "the", "add", "permission", "form", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/samples/xml/contacts/src/main/java/sample/contact/AdminPermissionController.java#L108-L138
test
Add a permission to a contact.
Of course, here is the Java code you requested: ```java @RequestMapping(value = "/secure/addPermission.htm", method = RequestMethod.POST) public String addPermission(AddPermission addPermission, BindingResult result, ModelMap model) { addPermissionValidator.validate(addPermission, result); if (result.hasError...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/point/standard/Table.java
Table.replaceDataVars
protected void replaceDataVars(StructureMembers sm) { for (StructureMembers.Member m : sm.getMembers()) { VariableSimpleIF org = this.cols.get(m.getName()); int rank = org.getRank(); List<Dimension> orgDims = org.getDimensions(); // only keep the last n int n = m.getShape().lengt...
java
protected void replaceDataVars(StructureMembers sm) { for (StructureMembers.Member m : sm.getMembers()) { VariableSimpleIF org = this.cols.get(m.getName()); int rank = org.getRank(); List<Dimension> orgDims = org.getDimensions(); // only keep the last n int n = m.getShape().lengt...
[ "protected", "void", "replaceDataVars", "(", "StructureMembers", "sm", ")", "{", "for", "(", "StructureMembers", ".", "Member", "m", ":", "sm", ".", "getMembers", "(", ")", ")", "{", "VariableSimpleIF", "org", "=", "this", ".", "cols", ".", "get", "(", "...
change shape of the data variables
[ "change", "shape", "of", "the", "data", "variables" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/Table.java#L185-L197
test
Replace data variables in the structure members.
Of course, here is the Java code you requested: ```java protected void replaceDataVars(StructureMembers sm) { for (StructureMembers.Member m : sm.getMembers()) { VariableSimpleIF org = this.cols.get(m.getName()); int rank = org.getRank(); List<Dimension> orgDims = org.getDimensions(); ...
lessthanoptimal/GeoRegression
main/src/georegression/metric/Distance2D_F64.java
Distance2D_F64.distance
public static double distance( Quadrilateral_F64 quad , Point2D_F64 p ) { return Math.sqrt(distanceSq(quad,p)); }
java
public static double distance( Quadrilateral_F64 quad , Point2D_F64 p ) { return Math.sqrt(distanceSq(quad,p)); }
[ "public", "static", "double", "distance", "(", "Quadrilateral_F64", "quad", ",", "Point2D_F64", "p", ")", "{", "return", "Math", ".", "sqrt", "(", "distanceSq", "(", "quad", ",", "p", ")", ")", ";", "}" ]
Returns the Euclidean distance of the closest point on the quadrilateral to the provided point. @param quad Quadrilateral @param p Point @return Distance apart
[ "Returns", "the", "Euclidean", "distance", "of", "the", "closest", "point", "on", "the", "quadrilateral", "to", "the", "provided", "point", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Distance2D_F64.java#L255-L257
test
Computes the Euclidean distance between two points.
Of course, here is the Java code you requested: ```java public static double distance( Quadrilateral_F64 quad , Point2D_F64 p ) { return Math.sqrt(distanceSq(quad,p)); } ``` Hope this helps!
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java
HttpSessionEventPublisher.sessionCreated
public void sessionCreated(HttpSessionEvent event) { HttpSessionCreatedEvent e = new HttpSessionCreatedEvent(event.getSession()); Log log = LogFactory.getLog(LOGGER_NAME); if (log.isDebugEnabled()) { log.debug("Publishing event: " + e); } getContext(event.getSession().getServletContext()).publishEvent(e)...
java
public void sessionCreated(HttpSessionEvent event) { HttpSessionCreatedEvent e = new HttpSessionCreatedEvent(event.getSession()); Log log = LogFactory.getLog(LOGGER_NAME); if (log.isDebugEnabled()) { log.debug("Publishing event: " + e); } getContext(event.getSession().getServletContext()).publishEvent(e)...
[ "public", "void", "sessionCreated", "(", "HttpSessionEvent", "event", ")", "{", "HttpSessionCreatedEvent", "e", "=", "new", "HttpSessionCreatedEvent", "(", "event", ".", "getSession", "(", ")", ")", ";", "Log", "log", "=", "LogFactory", ".", "getLog", "(", "LO...
Handles the HttpSessionEvent by publishing a {@link HttpSessionCreatedEvent} to the application appContext. @param event HttpSessionEvent passed in by the container
[ "Handles", "the", "HttpSessionEvent", "by", "publishing", "a", "{", "@link", "HttpSessionCreatedEvent", "}", "to", "the", "application", "appContext", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java#L66-L75
test
Publish a HttpSessionCreatedEvent to the application.
Of course, here is the Java code you requested: ```java public void sessionCreated(HttpSessionEvent event) { HttpSessionCreatedEvent e = new HttpSessionCreatedEvent(event.getSession()); Log log = LogFactory.getLog(LOGGER_NAME); if (log.isDebugEnabled()) { log.debug("Publishing event: " + e); } getContex...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasSgemm
public static void cublasSgemm(char transa, char transb, int m, int n, int k, float alpha, Pointer A, int lda, Pointer B, int ldb, float beta, Pointer C, int ldc) { cublasSgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc); checkResultBLAS(); }
java
public static void cublasSgemm(char transa, char transb, int m, int n, int k, float alpha, Pointer A, int lda, Pointer B, int ldb, float beta, Pointer C, int ldc) { cublasSgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc); checkResultBLAS(); }
[ "public", "static", "void", "cublasSgemm", "(", "char", "transa", ",", "char", "transb", ",", "int", "m", ",", "int", "n", ",", "int", "k", ",", "float", "alpha", ",", "Pointer", "A", ",", "int", "lda", ",", "Pointer", "B", ",", "int", "ldb", ",", ...
<pre> void cublasSgemm (char transa, char transb, int m, int n, int k, float alpha, const float *A, int lda, const float *B, int ldb, float beta, float *C, int ldc) computes the product of matrix A and matrix B, multiplies the result by a scalar alpha, and adds the sum to the product of matrix C and scalar beta. sgemm...
[ "<pre", ">", "void", "cublasSgemm", "(", "char", "transa", "char", "transb", "int", "m", "int", "n", "int", "k", "float", "alpha", "const", "float", "*", "A", "int", "lda", "const", "float", "*", "B", "int", "ldb", "float", "beta", "float", "*", "C",...
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L5750-L5754
test
Cublas S GEM m operation
Of course, here is the Java code you requested: ```java public static void cublasSgemm(char transa, char transb, int m, int n, int k, float alpha, Pointer A, int lda, Pointer B, int ldb, float beta, Pointer C, int ldc) { cublasSgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc); ...
jcodec/jcodec
src/main/java/org/jcodec/common/AudioUtil.java
AudioUtil.fromFloat
public static void fromFloat(FloatBuffer floatBuf, AudioFormat format, ByteBuffer buf) { if (!format.isSigned()) throw new NotSupportedException("Unsigned PCM is not supported ( yet? )."); if (format.getSampleSizeInBits() != 16 && format.getSampleSizeInBits() != 24) throw new No...
java
public static void fromFloat(FloatBuffer floatBuf, AudioFormat format, ByteBuffer buf) { if (!format.isSigned()) throw new NotSupportedException("Unsigned PCM is not supported ( yet? )."); if (format.getSampleSizeInBits() != 16 && format.getSampleSizeInBits() != 24) throw new No...
[ "public", "static", "void", "fromFloat", "(", "FloatBuffer", "floatBuf", ",", "AudioFormat", "format", ",", "ByteBuffer", "buf", ")", "{", "if", "(", "!", "format", ".", "isSigned", "(", ")", ")", "throw", "new", "NotSupportedException", "(", "\"Unsigned PCM i...
Converts float PCM samples stored in floatBuf to integer representation according to format and stores them in buf @param format Supported formats - *_*_S16_LE, *_*_S24_LE, *_*_S16_BE, *_*_S24_LE @param buf @param floatBuf @return Total number of samples written to the buffer
[ "Converts", "float", "PCM", "samples", "stored", "in", "floatBuf", "to", "integer", "representation", "according", "to", "format", "and", "stores", "them", "in", "buf" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/common/AudioUtil.java#L67-L87
test
This method is used to convert a float buffer to a single AAC file.
Of course, here is the Java code you requested: ```java public static void fromFloat(FloatBuffer floatBuf, AudioFormat format, ByteBuffer buf) { if (!format.isSigned()) throw new NotSupportedException("Unsigned PCM is not supported ( yet? )."); if (format.getSampleSizeInBits() != 16 && for...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilEllipse_F64.java
UtilEllipse_F64.convert
public static EllipseQuadratic_F64 convert( EllipseRotated_F64 input , EllipseQuadratic_F64 output ) { if( output == null ) output = new EllipseQuadratic_F64(); double x0 = input.center.x; double y0 = input.center.y; double a = input.a; double b = input.b; double phi = input.phi; double cphi = Math.c...
java
public static EllipseQuadratic_F64 convert( EllipseRotated_F64 input , EllipseQuadratic_F64 output ) { if( output == null ) output = new EllipseQuadratic_F64(); double x0 = input.center.x; double y0 = input.center.y; double a = input.a; double b = input.b; double phi = input.phi; double cphi = Math.c...
[ "public", "static", "EllipseQuadratic_F64", "convert", "(", "EllipseRotated_F64", "input", ",", "EllipseQuadratic_F64", "output", ")", "{", "if", "(", "output", "==", "null", ")", "output", "=", "new", "EllipseQuadratic_F64", "(", ")", ";", "double", "x0", "=", ...
Convert from rotated to quadratic. @param input Input rotated format. @param output (Optional) Storage for quadratic format. Can be null. @return Ellipse in quadratic format.
[ "Convert", "from", "rotated", "to", "quadratic", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilEllipse_F64.java#L105-L135
test
Converts an ellipse to a quadratic quadratic.
Of course, here is the Java code you requested: ```java public static EllipseQuadratic_F64 convert( EllipseRotated_F64 input , EllipseQuadratic_F64 output ) { if( output == null ) output = new EllipseQuadratic_F64(); double x0 = input.center.x; double y0 = input.center.y; double a = input.a; double b = i...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/FilterChainProxy.java
FilterChainProxy.getFilters
private List<Filter> getFilters(HttpServletRequest request) { for (SecurityFilterChain chain : filterChains) { if (chain.matches(request)) { return chain.getFilters(); } } return null; }
java
private List<Filter> getFilters(HttpServletRequest request) { for (SecurityFilterChain chain : filterChains) { if (chain.matches(request)) { return chain.getFilters(); } } return null; }
[ "private", "List", "<", "Filter", ">", "getFilters", "(", "HttpServletRequest", "request", ")", "{", "for", "(", "SecurityFilterChain", "chain", ":", "filterChains", ")", "{", "if", "(", "chain", ".", "matches", "(", "request", ")", ")", "{", "return", "ch...
Returns the first filter chain matching the supplied URL. @param request the request to match @return an ordered array of Filters defining the filter chain
[ "Returns", "the", "first", "filter", "chain", "matching", "the", "supplied", "URL", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/FilterChainProxy.java#L224-L232
test
Returns the filters that match the request.
Of course, here is the Java code you requested: ```java private List<Filter> getFilters(HttpServletRequest request) { for (SecurityFilterChain chain : filterChains) { if (chain.matches(request)) { return chain.getFilters(); } } return null; } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormUtil.java
SQLFormUtil.getFormAncestor
public Form getFormAncestor( Long electronicFormIdParam, boolean includeFieldDataParam, boolean includeTableFieldsParam ) { if(electronicFormIdParam == null) { return null; } Form returnVal = null; Map<Long,String> definitionAndTitle = this.formDefUtil.getFormDefinitionIdAndTitle(); Prepare...
java
public Form getFormAncestor( Long electronicFormIdParam, boolean includeFieldDataParam, boolean includeTableFieldsParam ) { if(electronicFormIdParam == null) { return null; } Form returnVal = null; Map<Long,String> definitionAndTitle = this.formDefUtil.getFormDefinitionIdAndTitle(); Prepare...
[ "public", "Form", "getFormAncestor", "(", "Long", "electronicFormIdParam", ",", "boolean", "includeFieldDataParam", ",", "boolean", "includeTableFieldsParam", ")", "{", "if", "(", "electronicFormIdParam", "==", "null", ")", "{", "return", "null", ";", "}", "Form", ...
Gets the ancestor for the {@code electronicFormIdParam} Form. @param electronicFormIdParam Identifier for the Form. @param includeFieldDataParam Whether to populate the return {@code Form} fields. @param includeTableFieldsParam Whether to populate the return {@code Form} table fields. @return {@code Form} descendants....
[ "Gets", "the", "ancestor", "for", "the", "{", "@code", "electronicFormIdParam", "}", "Form", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormUtil.java#L370-L419
test
Get the form ancestor for the given form id.
Of course, here is the Java code you requested: ```java public Form getFormAncestor( Long electronicFormIdParam, boolean includeFieldDataParam, boolean includeTableFieldsParam ) { if(electronicFormIdParam == null) { return null; } Form returnVal = null; Map<Long,String> definitionAndTitle = t...
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/stream/StreamUtil.java
StreamUtil.copy
public static int copy(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[ioBufferSize]; int count = 0; int read; while (true) { read = input.read(buffer, 0, ioBufferSize); if (read == -1) { break; } ...
java
public static int copy(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[ioBufferSize]; int count = 0; int read; while (true) { read = input.read(buffer, 0, ioBufferSize); if (read == -1) { break; } ...
[ "public", "static", "int", "copy", "(", "InputStream", "input", ",", "OutputStream", "output", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "ioBufferSize", "]", ";", "int", "count", "=", "0", ";", "int", "read",...
Copies input stream to output stream using buffer. Streams don't have to be wrapped to buffered, since copying is already optimized.
[ "Copies", "input", "stream", "to", "output", "stream", "using", "buffer", ".", "Streams", "don", "t", "have", "to", "be", "wrapped", "to", "buffered", "since", "copying", "is", "already", "optimized", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/stream/StreamUtil.java#L102-L115
test
Copy the content of an input stream to an output stream.
Of course, here is the Java code you requested: ```java public static int copy(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[ioBufferSize]; int count = 0; int read; while (true) { read = input.read(buffer, 0, ioBufferSize); ...
apache/parquet-mr
parquet-cli/src/main/java/org/apache/parquet/cli/BaseCommand.java
BaseCommand.open
public InputStream open(String filename) throws IOException { if (STDIN_AS_SOURCE.equals(filename)) { return System.in; } URI uri = qualifiedURI(filename); if (RESOURCE_URI_SCHEME.equals(uri.getScheme())) { return Resources.getResource(uri.getRawSchemeSpecificPart()).openStream(); } els...
java
public InputStream open(String filename) throws IOException { if (STDIN_AS_SOURCE.equals(filename)) { return System.in; } URI uri = qualifiedURI(filename); if (RESOURCE_URI_SCHEME.equals(uri.getScheme())) { return Resources.getResource(uri.getRawSchemeSpecificPart()).openStream(); } els...
[ "public", "InputStream", "open", "(", "String", "filename", ")", "throws", "IOException", "{", "if", "(", "STDIN_AS_SOURCE", ".", "equals", "(", "filename", ")", ")", "{", "return", "System", ".", "in", ";", "}", "URI", "uri", "=", "qualifiedURI", "(", "...
Opens an existing file or resource. If the file does not have a file system scheme, this uses the default FS. @param filename The filename to open. @return An open InputStream with the file contents @throws IOException if there is an error opening the file @throws IllegalArgumentException If the file does not exist
[ "Opens", "an", "existing", "file", "or", "resource", "." ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-cli/src/main/java/org/apache/parquet/cli/BaseCommand.java#L196-L210
test
Open an input stream for the specified file.
Of course, here is the Java code you requested: ```java public InputStream open(String filename) throws IOException { if (STDIN_AS_SOURCE.equals(filename)) { return System.in; } URI uri = qualifiedURI(filename); if (RESOURCE_URI_SCHEME.equals(uri.getScheme())) { return Resources.getResourc...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/InstanceTaxonomyState.java
InstanceTaxonomyState.getToRemove
Collection<IndexedIndividual> getToRemove() { if (taxonomy_ == null) {// TODO: Never set taxonomy_ to null !!! // no individuals are in taxonomy toRemove_.clear(); return Collections.emptyList(); } // else final int size = pruneToRemove(); /* * since getting the size of the queue is a linear opera...
java
Collection<IndexedIndividual> getToRemove() { if (taxonomy_ == null) {// TODO: Never set taxonomy_ to null !!! // no individuals are in taxonomy toRemove_.clear(); return Collections.emptyList(); } // else final int size = pruneToRemove(); /* * since getting the size of the queue is a linear opera...
[ "Collection", "<", "IndexedIndividual", ">", "getToRemove", "(", ")", "{", "if", "(", "taxonomy_", "==", "null", ")", "{", "// TODO: Never set taxonomy_ to null !!!", "// no individuals are in taxonomy", "toRemove_", ".", "clear", "(", ")", ";", "return", "Collections...
Returns collection that contains at least all individuals that are in taxonomy, but either are removed from ontology or their context became not saturated. @return collection that contains at least all individuals that are in taxonomy, but either are removed from ontology or their context became not saturated.
[ "Returns", "collection", "that", "contains", "at", "least", "all", "individuals", "that", "are", "in", "taxonomy", "but", "either", "are", "removed", "from", "ontology", "or", "their", "context", "became", "not", "saturated", "." ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/InstanceTaxonomyState.java#L282-L295
test
Returns the collection of individuals to be removed from the queue.
Of course, here is the Java code you requested: ```java Collection<IndexedIndividual> getToRemove() { if (taxonomy_ == null) {// TODO: Never set taxonomy_ to null !!! // no individuals are in taxonomy toRemove_.clear(); return Collections.emptyList(); } // else final int size = pruneToRemove(); /* ...
kocakosm/pitaya
src/org/kocakosm/pitaya/collection/Iterables.java
Iterables.toList
public static <T> List<T> toList(Iterable<? extends T> iterable) { List<T> list = new ArrayList<T>(); for (T e : iterable) { list.add(e); } return list; }
java
public static <T> List<T> toList(Iterable<? extends T> iterable) { List<T> list = new ArrayList<T>(); for (T e : iterable) { list.add(e); } return list; }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "toList", "(", "Iterable", "<", "?", "extends", "T", ">", "iterable", ")", "{", "List", "<", "T", ">", "list", "=", "new", "ArrayList", "<", "T", ">", "(", ")", ";", "for", "(", "T", "...
Returns a {@code List} containing all the given {@code Iterable}'s elements. @param <T> the type of the returned {@code List}'s elements. @param iterable the source {@code Iterable}. @return the {@code List} created from the given {@code Iterable}. @throws NullPointerException if {@code iterable} is {@code null}.
[ "Returns", "a", "{", "@code", "List", "}", "containing", "all", "the", "given", "{", "@code", "Iterable", "}", "s", "elements", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/collection/Iterables.java#L200-L207
test
Converts an iterable to a list of objects.
Of course, here is the Java code you requested: ```java public static <T> List<T> toList(Iterable<? extends T> iterable) { List<T> list = new ArrayList<T>(); for (T e : iterable) { list.add(e); } return list; } ``` Hope this helps!
blademainer/common_utils
commons-file/src/main/java/jargs/gnu/CmdLineParser.java
CmdLineParser.addStringOption
public final Option addStringOption( char shortForm, String longForm ) { return addOption(new Option.StringOption(shortForm, longForm)); }
java
public final Option addStringOption( char shortForm, String longForm ) { return addOption(new Option.StringOption(shortForm, longForm)); }
[ "public", "final", "Option", "addStringOption", "(", "char", "shortForm", ",", "String", "longForm", ")", "{", "return", "addOption", "(", "new", "Option", ".", "StringOption", "(", "shortForm", ",", "longForm", ")", ")", ";", "}" ]
Convenience method for adding a string option. @return the new Option
[ "Convenience", "method", "for", "adding", "a", "string", "option", "." ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/commons-file/src/main/java/jargs/gnu/CmdLineParser.java#L278-L280
test
Add a String option.
Of course, here is the Java code you requested: ```java public final Option addStringOption( char shortForm, String longForm ) { return addOption(new Option.StringOption(shortForm, longForm)); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.skipLast
@CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> skipLast(long time, TimeUnit unit, Scheduler scheduler) { return skipLast(time, unit, scheduler, false, bufferSize()); }
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> skipLast(long time, TimeUnit unit, Scheduler scheduler) { return skipLast(time, unit, scheduler, false, bufferSize()); }
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "UNBOUNDED_IN", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Flowable", "<", "T", ">", "skipLast", "(", "long", "time", ",", "Tim...
Returns a Flowable that drops items emitted by the source Publisher during a specified time window (defined on a specified scheduler) before the source completes. <p> <img width="640" height="340" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipLast.ts.png" alt=""> <p> Note: this action will c...
[ "Returns", "a", "Flowable", "that", "drops", "items", "emitted", "by", "the", "source", "Publisher", "during", "a", "specified", "time", "window", "(", "defined", "on", "a", "specified", "scheduler", ")", "before", "the", "source", "completes", ".", "<p", ">...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L14281-L14286
test
Skip the last sequence of tokens.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> skipLast(long time, TimeUnit unit, Scheduler scheduler) { return skipLast(time, unit, scheduler, false, b...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_4.java
OpenImmo_1_2_4.upgradeAnzahlBalkonTerrassenElements
protected void upgradeAnzahlBalkonTerrassenElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:flaechen/io:anzahl_balkon_terrassen", doc).selectNodes(doc); for (Object item : nodes) { Element...
java
protected void upgradeAnzahlBalkonTerrassenElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:flaechen/io:anzahl_balkon_terrassen", doc).selectNodes(doc); for (Object item : nodes) { Element...
[ "protected", "void", "upgradeAnzahlBalkonTerrassenElements", "(", "Document", "doc", ")", "throws", "JaxenException", "{", "List", "nodes", "=", "XmlUtils", ".", "newXPath", "(", "\"/io:openimmo/io:anbieter/io:immobilie/io:flaechen/io:anzahl_balkon_terrassen\"", ",", "doc", "...
Upgrade &lt;anzahl_balkon_terrassen&gt; elements to OpenImmo 1.2.4. <p> The &lt;anzahl_balkon_terrassen&gt; is not supported anymore in version 1.2.4. The element is replaced by &lt;anzahl_balkone&gt; and &lt;anzahl_terrassen&gt;. <p> Any &lt;anzahl_balkon_terrassen&gt; element is removed. Its content is copied into &l...
[ "Upgrade", "&lt", ";", "anzahl_balkon_terrassen&gt", ";", "elements", "to", "OpenImmo", "1", ".", "2", ".", "4", ".", "<p", ">", "The", "&lt", ";", "anzahl_balkon_terrassen&gt", ";", "is", "not", "supported", "anymore", "in", "version", "1", ".", "2", ".",...
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_4.java#L509-L530
test
Upgrade anzahl_balkon_terrassen elements to a new one.
Of course, here is the Java code you requested: ```java protected void upgradeAnzahlBalkonTerrassenElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:flaechen/io:anzahl_balkon_terrassen", doc).selectNodes(doc)...
alipay/sofa-bolt
src/main/java/com/alipay/remoting/rpc/RpcClient.java
RpcClient.oneway
public void oneway(final Connection conn, final Object request) throws RemotingException { this.rpcRemoting.oneway(conn, request, null); }
java
public void oneway(final Connection conn, final Object request) throws RemotingException { this.rpcRemoting.oneway(conn, request, null); }
[ "public", "void", "oneway", "(", "final", "Connection", "conn", ",", "final", "Object", "request", ")", "throws", "RemotingException", "{", "this", ".", "rpcRemoting", ".", "oneway", "(", "conn", ",", "request", ",", "null", ")", ";", "}" ]
One way invocation using a {@link Connection} <br> <p> Notice:<br> <b>DO NOT modify the request object concurrently when this method is called.</b> @param conn @param request @throws RemotingException
[ "One", "way", "invocation", "using", "a", "{", "@link", "Connection", "}", "<br", ">", "<p", ">", "Notice", ":", "<br", ">", "<b", ">", "DO", "NOT", "modify", "the", "request", "object", "concurrently", "when", "this", "method", "is", "called", ".", "<...
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcClient.java#L249-L251
test
Oneway method.
Of course, here is the Java code you requested: ```java public void oneway(final Connection conn, final Object request) throws RemotingException { this.rpcRemoting.oneway(conn, request, null); } ``` Hope this helps!
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/classic/spi/CallerData.java
CallerData.isInFrameworkSpaceList
private static boolean isInFrameworkSpaceList(String currentClass, List<String> frameworkPackageList) { if (frameworkPackageList == null) return false; for (String s : frameworkPackageList) { if (currentClass.startsWith(s)) return true; } return false; }
java
private static boolean isInFrameworkSpaceList(String currentClass, List<String> frameworkPackageList) { if (frameworkPackageList == null) return false; for (String s : frameworkPackageList) { if (currentClass.startsWith(s)) return true; } return false; }
[ "private", "static", "boolean", "isInFrameworkSpaceList", "(", "String", "currentClass", ",", "List", "<", "String", ">", "frameworkPackageList", ")", "{", "if", "(", "frameworkPackageList", "==", "null", ")", "return", "false", ";", "for", "(", "String", "s", ...
Is currentClass present in the list of packages considered part of the logging framework?
[ "Is", "currentClass", "present", "in", "the", "list", "of", "packages", "considered", "part", "of", "the", "logging", "framework?" ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/classic/spi/CallerData.java#L118-L127
test
Check if the currentClass is in the framework space list
Of course, here is the Java code you requested: ```java private static boolean isInFrameworkSpaceList(String currentClass, List<String> frameworkPackageList) { if (frameworkPackageList == null) return false; for (String s : frameworkPackageList) { if (currentClass.startsWith(s)) return tru...
retog/wymiwyg-commons-core
src/main/java/org/wymiwyg/commons/util/dirbrowser/ZipPathNode.java
ZipPathNode.getLastModified
public Date getLastModified() { try { long time = file.getEntry(entryName).getTime(); if (time > -1) { return new Date(time); } else { return null; } } catch (NullPointerException ex) { return null; } }
java
public Date getLastModified() { try { long time = file.getEntry(entryName).getTime(); if (time > -1) { return new Date(time); } else { return null; } } catch (NullPointerException ex) { return null; } }
[ "public", "Date", "getLastModified", "(", ")", "{", "try", "{", "long", "time", "=", "file", ".", "getEntry", "(", "entryName", ")", ".", "getTime", "(", ")", ";", "if", "(", "time", ">", "-", "1", ")", "{", "return", "new", "Date", "(", "time", ...
/* (non-Javadoc) @see org.wymiwyg.commons.util.dirbrowser.PathNode#getLastModified()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f64530a2690e2d9ee0184c5671214ee32572482d
https://github.com/retog/wymiwyg-commons-core/blob/f64530a2690e2d9ee0184c5671214ee32572482d/src/main/java/org/wymiwyg/commons/util/dirbrowser/ZipPathNode.java#L245-L256
test
Gets the last modified date of the entry.
Of course, here is the Java code you requested: ```java public Date getLastModified() { try { long time = file.getEntry(entryName).getTime(); if (time > -1) { return new Date(time); } else { return null; } } catch (NullPointerException ex) { return null; } } ``` Hope this helps!
RestComm/jain-slee
api/jar/src/main/java/javax/slee/AddressPresentation.java
AddressPresentation.fromInt
public static AddressPresentation fromInt(int value) throws IllegalArgumentException { switch (value) { case ADDRESS_PRESENTATION_UNDEFINED: return UNDEFINED; case ADDRESS_PRESENTATION_ALLOWED: return ALLOWED; case ADDRESS_PRESENTATION_RESTRICTED: return RESTRICTED; ...
java
public static AddressPresentation fromInt(int value) throws IllegalArgumentException { switch (value) { case ADDRESS_PRESENTATION_UNDEFINED: return UNDEFINED; case ADDRESS_PRESENTATION_ALLOWED: return ALLOWED; case ADDRESS_PRESENTATION_RESTRICTED: return RESTRICTED; ...
[ "public", "static", "AddressPresentation", "fromInt", "(", "int", "value", ")", "throws", "IllegalArgumentException", "{", "switch", "(", "value", ")", "{", "case", "ADDRESS_PRESENTATION_UNDEFINED", ":", "return", "UNDEFINED", ";", "case", "ADDRESS_PRESENTATION_ALLOWED"...
Get an <code>AddressPresentation</code> object from an integer value. @param value the address presentation value as an integer. @return an <code>AddressPresentation</code> object corresponding to <code>value</code>. @throws IllegalArgumentException if <code>value</code> is not a valid address presentation value.
[ "Get", "an", "<code", ">", "AddressPresentation<", "/", "code", ">", "object", "from", "an", "integer", "value", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/AddressPresentation.java#L93-L101
test
This method is called to convert an int value to an AddressPresentation object.
Of course, here is the Java code you requested: ```java public static AddressPresentation fromInt(int value) throws IllegalArgumentException { switch (value) { case ADDRESS_PRESENTATION_UNDEFINED: return UNDEFINED; case ADDRESS_PRESENTATION_ALLOWED: return ALLOWED; case ADDR...
oblac/jodd
jodd-htmlstapler/src/main/java/jodd/htmlstapler/HtmlStaplerTagAdapter.java
HtmlStaplerTagAdapter.script
@Override public void script(final Tag tag, final CharSequence body) { if (!insideConditionalComment) { String src = Util.toString(tag.getAttributeValue("src")); if (src == null) { super.script(tag, body); return; } if (jsBundleAction.acceptLink(src)) { String link = jsBundleAction.processL...
java
@Override public void script(final Tag tag, final CharSequence body) { if (!insideConditionalComment) { String src = Util.toString(tag.getAttributeValue("src")); if (src == null) { super.script(tag, body); return; } if (jsBundleAction.acceptLink(src)) { String link = jsBundleAction.processL...
[ "@", "Override", "public", "void", "script", "(", "final", "Tag", "tag", ",", "final", "CharSequence", "body", ")", "{", "if", "(", "!", "insideConditionalComment", ")", "{", "String", "src", "=", "Util", ".", "toString", "(", "tag", ".", "getAttributeValu...
---------------------------------------------------------------- javascripts
[ "----------------------------------------------------------------", "javascripts" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-htmlstapler/src/main/java/jodd/htmlstapler/HtmlStaplerTagAdapter.java#L60-L80
test
Override script.
Of course, here is the Java code you requested: ```java @Override public void script(final Tag tag, final CharSequence body) { if (!insideConditionalComment) { String src = Util.toString(tag.getAttributeValue("src")); if (src == null) { super.script(tag, body); return; } if (jsBundleAction.acc...
RestComm/jain-slee
api/jar/src/main/java/javax/slee/facilities/TimerPreserveMissed.java
TimerPreserveMissed.fromString
public static TimerPreserveMissed fromString(String option) throws NullPointerException, IllegalArgumentException { if (option == null) throw new NullPointerException("option is null"); if (option.equalsIgnoreCase(NONE_STRING)) return NONE; if (option.equalsIgnoreCase(ALL_STRING)) return ALL; ...
java
public static TimerPreserveMissed fromString(String option) throws NullPointerException, IllegalArgumentException { if (option == null) throw new NullPointerException("option is null"); if (option.equalsIgnoreCase(NONE_STRING)) return NONE; if (option.equalsIgnoreCase(ALL_STRING)) return ALL; ...
[ "public", "static", "TimerPreserveMissed", "fromString", "(", "String", "option", ")", "throws", "NullPointerException", ",", "IllegalArgumentException", "{", "if", "(", "option", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"option is null\"", ")...
Get a <code>TimerPreserveMissed</code> object from a string value. @param option the preserve-missed option as a string, for example as returned by the {@link #toString()} method (case insensitive). @return a <code>TimerPreserveMissed</code> object corresponding to <code>option</code>. @throws NullPointerException if <...
[ "Get", "a", "<code", ">", "TimerPreserveMissed<", "/", "code", ">", "object", "from", "a", "string", "value", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/facilities/TimerPreserveMissed.java#L98-L104
test
Returns the TimerPreserveMissed value from the given string.
Of course, here is the Java code you requested: ```java public static TimerPreserveMissed fromString(String option) throws NullPointerException, IllegalArgumentException { if (option == null) throw new NullPointerException("option is null"); if (option.equalsIgnoreCase(NONE_STRING)) return NONE; ...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.flatMap
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <U, R> Observable<R> flatMap(Function<? super T, ? extends ObservableSource<? extends U>> mapper, BiFunction<? super T, ? super U, ? extends R> resultSelector) { return flatMap(mapper, resultSelector, false, bufferSize()...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <U, R> Observable<R> flatMap(Function<? super T, ? extends ObservableSource<? extends U>> mapper, BiFunction<? super T, ? super U, ? extends R> resultSelector) { return flatMap(mapper, resultSelector, false, bufferSize()...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "U", ",", "R", ">", "Observable", "<", "R", ">", "flatMap", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "ObservableSource...
Returns an Observable that emits the results of a specified function to the pair of values emitted by the source ObservableSource and a specified collection ObservableSource. <p> <img width="640" height="390" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMap.r.png" alt=""> <dl> <dt><b>Sched...
[ "Returns", "an", "Observable", "that", "emits", "the", "results", "of", "a", "specified", "function", "to", "the", "pair", "of", "values", "emitted", "by", "the", "source", "ObservableSource", "and", "a", "specified", "collection", "ObservableSource", ".", "<p",...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L8749-L8754
test
Perform a flatMap operation on the source observable.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <U, R> Observable<R> flatMap(Function<? super T, ? extends ObservableSource<? extends U>> mapper, BiFunction<? super T, ? super U, ? extends R> resultSelector) { r...
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.mergeDelayError
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) public static Completable mergeDelayError(Publisher<? extends CompletableSource> sources) { return merge0(sources, Integer.MAX_VALUE, true); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) public static Completable mergeDelayError(Publisher<? extends CompletableSource> sources) { return merge0(sources, Integer.MAX_VALUE, true); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "UNBOUNDED_IN", ")", "public", "static", "Completable", "mergeDelayError", "(", "Publisher", "<", "?", "extends", "...
Returns a Completable that subscribes to all Completables in the source sequence and delays any error emitted by either the sources observable or any of the inner Completables until all of them terminate in a way or another. <p> <img width="640" height="466" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-o...
[ "Returns", "a", "Completable", "that", "subscribes", "to", "all", "Completables", "in", "the", "source", "sequence", "and", "delays", "any", "error", "emitted", "by", "either", "the", "sources", "observable", "or", "any", "of", "the", "inner", "Completables", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L854-L859
test
Merge delay error.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) public static Completable mergeDelayError(Publisher<? extends CompletableSource> sources) { return merge0(sources, Integer.MAX_VALUE...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientBaseGraph.java
OrientBaseGraph.getIndexedKeys
public <T extends Element> Set<String> getIndexedKeys(final Class<T> elementClass, final boolean includeClassNames) { makeActive(); if (elementClass == null) throw ExceptionFactory.classForElementCannotBeNull(); final OSchema schema = getRawGraph().getMetadata().getImmutableSchemaSnapshot(); fin...
java
public <T extends Element> Set<String> getIndexedKeys(final Class<T> elementClass, final boolean includeClassNames) { makeActive(); if (elementClass == null) throw ExceptionFactory.classForElementCannotBeNull(); final OSchema schema = getRawGraph().getMetadata().getImmutableSchemaSnapshot(); fin...
[ "public", "<", "T", "extends", "Element", ">", "Set", "<", "String", ">", "getIndexedKeys", "(", "final", "Class", "<", "T", ">", "elementClass", ",", "final", "boolean", "includeClassNames", ")", "{", "makeActive", "(", ")", ";", "if", "(", "elementClass"...
Returns the indexed properties. @param elementClass the element class that the index is for @param includeClassNames If true includes also the class name as prefix of fields @return Set of String containing the indexed properties
[ "Returns", "the", "indexed", "properties", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientBaseGraph.java#L1739-L1767
test
Returns the set of all the indexed keys of the given element class.
Of course, here is the Java code you requested: ```java public <T extends Element> Set<String> getIndexedKeys(final Class<T> elementClass, final boolean includeClassNames) { makeActive(); if (elementClass == null) throw ExceptionFactory.classForElementCannotBeNull(); final OSchema schema = getRawGr...
RuedigerMoeller/fast-serialization
src/main/java/org/nustaq/kson/KsonSerializer.java
KsonSerializer.writeClazzTag
protected void writeClazzTag(Class expectedClass, Object o) { if (expectedClass == o.getClass()) { out.writeString("{"); } else { String stringForType = mapper.getStringForType(o.getClass()); out.writeString(stringForType + " {"); } }
java
protected void writeClazzTag(Class expectedClass, Object o) { if (expectedClass == o.getClass()) { out.writeString("{"); } else { String stringForType = mapper.getStringForType(o.getClass()); out.writeString(stringForType + " {"); } }
[ "protected", "void", "writeClazzTag", "(", "Class", "expectedClass", ",", "Object", "o", ")", "{", "if", "(", "expectedClass", "==", "o", ".", "getClass", "(", ")", ")", "{", "out", ".", "writeString", "(", "\"{\"", ")", ";", "}", "else", "{", "String"...
determines classname tagging. Overrifing can enforce class tags always or (JSon) write as special attribute @param expectedClass @param o
[ "determines", "classname", "tagging", ".", "Overrifing", "can", "enforce", "class", "tags", "always", "or", "(", "JSon", ")", "write", "as", "special", "attribute" ]
59f8f800b79479d0b9c80901cf55903d9b027f26
https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/kson/KsonSerializer.java#L207-L214
test
Write class tag.
Of course, here is the Java code you requested: ```java protected void writeClazzTag(Class expectedClass, Object o) { if (expectedClass == o.getClass()) { out.writeString("{"); } else { String stringForType = mapper.getStringForType(o.getClass()); out.writeString(str...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/LockDiscovery.java
LockDiscovery.getActiveLocks
public Enumeration getActiveLocks() throws MalformedElementException { final Node firstActiveLock = getFirstChild(root, "activelock"); //$NON-NLS-1$ Enumeration e = new Enumeration() { Node currentActiveLock = firstActiveLock; public boolean hasMoreElements() { r...
java
public Enumeration getActiveLocks() throws MalformedElementException { final Node firstActiveLock = getFirstChild(root, "activelock"); //$NON-NLS-1$ Enumeration e = new Enumeration() { Node currentActiveLock = firstActiveLock; public boolean hasMoreElements() { r...
[ "public", "Enumeration", "getActiveLocks", "(", ")", "throws", "MalformedElementException", "{", "final", "Node", "firstActiveLock", "=", "getFirstChild", "(", "root", ",", "\"activelock\"", ")", ";", "//$NON-NLS-1$", "Enumeration", "e", "=", "new", "Enumeration", "...
Returns an <code>Enumeration</code> over this lockdiscovery's <code>ActiveLock</code>s. @return an <code>Enumeration</code> of <code>ActiveLock</code>s @throws MalformedElementException if there is reason to believe that this editor's underlying element is not well formed
[ "Returns", "an", "<code", ">", "Enumeration<", "/", "code", ">", "over", "this", "lockdiscovery", "s", "<code", ">", "ActiveLock<", "/", "code", ">", "s", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/LockDiscovery.java#L83-L106
test
Get an Enumeration of ActiveLocks.
Of course, here is the Java code you requested: ```java public Enumeration getActiveLocks() throws MalformedElementException { final Node firstActiveLock = getFirstChild(root, "activelock"); //$NON-NLS-1$ Enumeration e = new Enumeration() { Node currentActiveLock = firstActiveLock; ...
Unidata/thredds
opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java
DTSServlet.doGetDDX
public void doGetDDX(ReqState rs) throws Exception { if(Debug.isSet("showResponse")) { log.debug("doGetDDX for dataset: " + rs.getDataSet()); } GuardedDataset ds = null; try { ds = getDataset(rs); if(null == ds) return; rs...
java
public void doGetDDX(ReqState rs) throws Exception { if(Debug.isSet("showResponse")) { log.debug("doGetDDX for dataset: " + rs.getDataSet()); } GuardedDataset ds = null; try { ds = getDataset(rs); if(null == ds) return; rs...
[ "public", "void", "doGetDDX", "(", "ReqState", "rs", ")", "throws", "Exception", "{", "if", "(", "Debug", ".", "isSet", "(", "\"showResponse\"", ")", ")", "{", "log", ".", "debug", "(", "\"doGetDDX for dataset: \"", "+", "rs", ".", "getDataSet", "(", ")", ...
Handler for the client's DDX request. Requires the getDDX() method implemented by each server localization effort. <p> <p>Once the DDX has been parsed and constrained it is sent to the requesting client. @param rs The ReqState of this client request. Contains all kinds of important stuff. @see ReqState
[ "Handler", "for", "the", "client", "s", "DDX", "request", ".", "Requires", "the", "getDDX", "()", "method", "implemented", "by", "each", "server", "localization", "effort", ".", "<p", ">", "<p", ">", "Once", "the", "DDX", "has", "been", "parsed", "and", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java#L732-L794
test
Get the DDX for the specified request
Of course, here is the Java code you requested: ```java public void doGetDDX(ReqState rs) throws Exception { if(Debug.isSet("showResponse")) { log.debug("doGetDDX for dataset: " + rs.getDataSet()); } GuardedDataset ds = null; try { ds = getDatase...
Unidata/thredds
udunits/src/main/java/ucar/units/PrefixDBImpl.java
PrefixDBImpl.getPrefix
private static Prefix getPrefix(final String string, final Set<Prefix> set) { for (final Iterator<Prefix> iter = set.iterator(); iter.hasNext();) { final Prefix prefix = iter.next(); final int comp = prefix.compareTo(string); if (comp == 0) { return prefix; } if (comp > 0) { break; } } r...
java
private static Prefix getPrefix(final String string, final Set<Prefix> set) { for (final Iterator<Prefix> iter = set.iterator(); iter.hasNext();) { final Prefix prefix = iter.next(); final int comp = prefix.compareTo(string); if (comp == 0) { return prefix; } if (comp > 0) { break; } } r...
[ "private", "static", "Prefix", "getPrefix", "(", "final", "String", "string", ",", "final", "Set", "<", "Prefix", ">", "set", ")", "{", "for", "(", "final", "Iterator", "<", "Prefix", ">", "iter", "=", "set", ".", "iterator", "(", ")", ";", "iter", "...
Returns the prefix from the given set with the given identifier. @param string The prefix identifier. @param set The set to search.
[ "Returns", "the", "prefix", "from", "the", "given", "set", "with", "the", "given", "identifier", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/PrefixDBImpl.java#L131-L143
test
Gets the prefix.
Of course, here is the Java code you requested: ```java private static Prefix getPrefix(final String string, final Set<Prefix> set) { for (final Iterator<Prefix> iter = set.iterator(); iter.hasNext();) { final Prefix prefix = iter.next(); final int comp = prefix.compareTo(string); if (comp == 0) { retur...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/security/symmetrickey/OSymmetricKey.java
OSymmetricKey.encrypt
public String encrypt(final String value) { try { return encrypt(value.getBytes("UTF8")); } catch (Exception ex) { throw OException.wrapException(new OSecurityException("OSymmetricKey.encrypt() Exception: " + ex.getMessage()), ex); } }
java
public String encrypt(final String value) { try { return encrypt(value.getBytes("UTF8")); } catch (Exception ex) { throw OException.wrapException(new OSecurityException("OSymmetricKey.encrypt() Exception: " + ex.getMessage()), ex); } }
[ "public", "String", "encrypt", "(", "final", "String", "value", ")", "{", "try", "{", "return", "encrypt", "(", "value", ".", "getBytes", "(", "\"UTF8\"", ")", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "throw", "OException", ".", "wrapE...
This is a convenience method that takes a String argument, encodes it as Base64, then calls encrypt(byte[]). @param value The String to be encoded to Base64 then encrypted. @return A Base64-encoded JSON document.
[ "This", "is", "a", "convenience", "method", "that", "takes", "a", "String", "argument", "encodes", "it", "as", "Base64", "then", "calls", "encrypt", "(", "byte", "[]", ")", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/security/symmetrickey/OSymmetricKey.java#L396-L402
test
Encrypt a string.
Of course, here is the Java code you requested: ```java public String encrypt(final String value) { try { return encrypt(value.getBytes("UTF8")); } catch (Exception ex) { throw OException.wrapException(new OSecurityException("OSymmetricKey.encrypt() Exception: " + ex.getMessage()), ex); } } `...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java
RequestSpecBuilder.addRequestSpecification
public RequestSpecBuilder addRequestSpecification(RequestSpecification specification) { if (!(specification instanceof RequestSpecificationImpl)) { throw new IllegalArgumentException("Specification must be of type " + RequestSpecificationImpl.class.getClass() + "."); } RequestSpecif...
java
public RequestSpecBuilder addRequestSpecification(RequestSpecification specification) { if (!(specification instanceof RequestSpecificationImpl)) { throw new IllegalArgumentException("Specification must be of type " + RequestSpecificationImpl.class.getClass() + "."); } RequestSpecif...
[ "public", "RequestSpecBuilder", "addRequestSpecification", "(", "RequestSpecification", "specification", ")", "{", "if", "(", "!", "(", "specification", "instanceof", "RequestSpecificationImpl", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Specificat...
Merge this builder with settings from another specification. Note that the supplied specification can overwrite data in the current specification. The following settings are overwritten: <ul> <li>Port</li> <li>Authentication scheme</ <li>Content type</li> <li>Request body</li> </ul> The following settings are merged: <...
[ "Merge", "this", "builder", "with", "settings", "from", "another", "specification", ".", "Note", "that", "the", "supplied", "specification", "can", "overwrite", "data", "in", "the", "current", "specification", ".", "The", "following", "settings", "are", "overwritt...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java#L936-L944
test
Add a request specification to the request specification.
Of course, here is the Java code you requested: ```java public RequestSpecBuilder addRequestSpecification(RequestSpecification specification) { if (!(specification instanceof RequestSpecificationImpl)) { throw new IllegalArgumentException("Specification must be of type " + RequestSpecificationImpl....
Unidata/thredds
cdm/src/main/java/ucar/nc2/NetcdfFile.java
NetcdfFile.writeCDL
protected void writeCDL(Formatter f, Indent indent, boolean strict) { toStringStart(f, indent, strict); f.format("%s}%n", indent); }
java
protected void writeCDL(Formatter f, Indent indent, boolean strict) { toStringStart(f, indent, strict); f.format("%s}%n", indent); }
[ "protected", "void", "writeCDL", "(", "Formatter", "f", ",", "Indent", "indent", ",", "boolean", "strict", ")", "{", "toStringStart", "(", "f", ",", "indent", ",", "strict", ")", ";", "f", ".", "format", "(", "\"%s}%n\"", ",", "indent", ")", ";", "}" ]
the actual work is here
[ "the", "actual", "work", "is", "here" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L1445-L1448
test
Write the CDL.
Of course, here is the Java code you requested: ```java protected void writeCDL(Formatter f, Indent indent, boolean strict) { toStringStart(f, indent, strict); f.format("%s}%n", indent); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/processors/UnicastProcessor.java
UnicastProcessor.create
@CheckReturnValue @NonNull public static <T> UnicastProcessor<T> create(int capacityHint) { return new UnicastProcessor<T>(capacityHint); }
java
@CheckReturnValue @NonNull public static <T> UnicastProcessor<T> create(int capacityHint) { return new UnicastProcessor<T>(capacityHint); }
[ "@", "CheckReturnValue", "@", "NonNull", "public", "static", "<", "T", ">", "UnicastProcessor", "<", "T", ">", "create", "(", "int", "capacityHint", ")", "{", "return", "new", "UnicastProcessor", "<", "T", ">", "(", "capacityHint", ")", ";", "}" ]
Creates an UnicastProcessor with the given internal buffer capacity hint. @param <T> the value type @param capacityHint the hint to size the internal unbounded buffer @return an UnicastProcessor instance
[ "Creates", "an", "UnicastProcessor", "with", "the", "given", "internal", "buffer", "capacity", "hint", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/processors/UnicastProcessor.java#L192-L196
test
Create a new instance of the CRAS class with the given capacity hint.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull public static <T> UnicastProcessor<T> create(int capacityHint) { return new UnicastProcessor<T>(capacityHint); } ``` Hope this helps!
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib2/table/Grib2Tables.java
Grib2Tables.factory
public static Grib2Tables factory(int center, int subCenter, int masterVersion, int localVersion, int genProcessId) { Grib2TablesId id = new Grib2TablesId(center, subCenter, masterVersion, localVersion, genProcessId); Grib2Tables cust = tables.get(id); if (cust != null) return cust; // note that w...
java
public static Grib2Tables factory(int center, int subCenter, int masterVersion, int localVersion, int genProcessId) { Grib2TablesId id = new Grib2TablesId(center, subCenter, masterVersion, localVersion, genProcessId); Grib2Tables cust = tables.get(id); if (cust != null) return cust; // note that w...
[ "public", "static", "Grib2Tables", "factory", "(", "int", "center", ",", "int", "subCenter", ",", "int", "masterVersion", ",", "int", "localVersion", ",", "int", "genProcessId", ")", "{", "Grib2TablesId", "id", "=", "new", "Grib2TablesId", "(", "center", ",", ...
Lazy instantiation.
[ "Lazy", "instantiation", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib2/table/Grib2Tables.java#L48-L59
test
Creates a Grib2Tables object from the given parameters.
Of course, here is the Java code you requested: ```java public static Grib2Tables factory(int center, int subCenter, int masterVersion, int localVersion, int genProcessId) { Grib2TablesId id = new Grib2TablesId(center, subCenter, masterVersion, localVersion, genProcessId); Grib2Tables cust = tables.get(id); ...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java
TimerServiceImpl.createIntervalTimer
@Override public Timer createIntervalTimer(long initialDuration, long intervalDuration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException { assertTimerServiceState(); if (initialDuration < 0) { throw EJB3_TIMER_LOGGER.invalidInitial...
java
@Override public Timer createIntervalTimer(long initialDuration, long intervalDuration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException { assertTimerServiceState(); if (initialDuration < 0) { throw EJB3_TIMER_LOGGER.invalidInitial...
[ "@", "Override", "public", "Timer", "createIntervalTimer", "(", "long", "initialDuration", ",", "long", "intervalDuration", ",", "TimerConfig", "timerConfig", ")", "throws", "IllegalArgumentException", ",", "IllegalStateException", ",", "EJBException", "{", "assertTimerSe...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java#L278-L290
test
Create an interval timer.
Of course, here is the Java code you requested: ```java @Override public Timer createIntervalTimer(long initialDuration, long intervalDuration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException { assertTimerServiceState(); if (initialDuration ...
Netflix-Skunkworks/Numerus
numerus/src/main/java/com/netflix/numerus/NumerusRollingNumber.java
NumerusRollingNumber.increment
public void increment(NumerusRollingNumberEvent type, Boolean doNotBlock) { Bucket lastBucket = getCurrentBucket(doNotBlock); if (lastBucket == null) return; lastBucket.getAdder(type).increment(); }
java
public void increment(NumerusRollingNumberEvent type, Boolean doNotBlock) { Bucket lastBucket = getCurrentBucket(doNotBlock); if (lastBucket == null) return; lastBucket.getAdder(type).increment(); }
[ "public", "void", "increment", "(", "NumerusRollingNumberEvent", "type", ",", "Boolean", "doNotBlock", ")", "{", "Bucket", "lastBucket", "=", "getCurrentBucket", "(", "doNotBlock", ")", ";", "if", "(", "lastBucket", "==", "null", ")", "return", ";", "lastBucket"...
Increment the counter in the current bucket by one for the given {@link NumerusRollingNumberEvent} type. <p> The {@link NumerusRollingNumberEvent} must be a "counter" type <code>HystrixRollingNumberEvent.isCounter() == true</code>. @param type HystrixRollingNumberEvent defining which counter to increment Boolean doNot...
[ "Increment", "the", "counter", "in", "the", "current", "bucket", "by", "one", "for", "the", "given", "{", "@link", "NumerusRollingNumberEvent", "}", "type", ".", "<p", ">", "The", "{", "@link", "NumerusRollingNumberEvent", "}", "must", "be", "a", "counter", ...
08beb44403ddc2a045e7c2c71fc3f23f5d32723d
https://github.com/Netflix-Skunkworks/Numerus/blob/08beb44403ddc2a045e7c2c71fc3f23f5d32723d/numerus/src/main/java/com/netflix/numerus/NumerusRollingNumber.java#L88-L93
test
Increment the count of a number of rolling numbers.
Of course, here is the Java code you requested: ```java public void increment(NumerusRollingNumberEvent type, Boolean doNotBlock) { Bucket lastBucket = getCurrentBucket(doNotBlock); if (lastBucket == null) return; lastBucket.getAdder(type).increment(); } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/security/symmetrickey/OSymmetricKey.java
OSymmetricKey.decryptAsString
public String decryptAsString(final String encodedJSON) { try { byte[] decrypted = decrypt(encodedJSON); return new String(decrypted, "UTF8"); } catch (Exception ex) { throw OException.wrapException(new OSecurityException("OSymmetricKey.decryptAsString() Exception: " + ex.getMessage()), ex); ...
java
public String decryptAsString(final String encodedJSON) { try { byte[] decrypted = decrypt(encodedJSON); return new String(decrypted, "UTF8"); } catch (Exception ex) { throw OException.wrapException(new OSecurityException("OSymmetricKey.decryptAsString() Exception: " + ex.getMessage()), ex); ...
[ "public", "String", "decryptAsString", "(", "final", "String", "encodedJSON", ")", "{", "try", "{", "byte", "[", "]", "decrypted", "=", "decrypt", "(", "encodedJSON", ")", ";", "return", "new", "String", "(", "decrypted", ",", "\"UTF8\"", ")", ";", "}", ...
This method decrypts the Base64-encoded JSON document using the specified algorithm and cipher transformation. @param encodedJSON The Base64-encoded JSON document. @return The decrypted array of bytes as a UTF8 String or null if not successful.
[ "This", "method", "decrypts", "the", "Base64", "-", "encoded", "JSON", "document", "using", "the", "specified", "algorithm", "and", "cipher", "transformation", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/security/symmetrickey/OSymmetricKey.java#L516-L523
test
Decrypt a JSON string.
Of course, here is the Java code you requested: ```java public String decryptAsString(final String encodedJSON) { try { byte[] decrypted = decrypt(encodedJSON); return new String(decrypted, "UTF8"); } catch (Exception ex) { throw OException.wrapException(new OSecurityException("OSymmetricKey....
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/util/cache/CacheUtil.java
CacheUtil.invoke
private static Object invoke(Method methodParam, Object objParam) { try { return methodParam.invoke(objParam); } //Changed for Java 1.6 compatibility... catch (InvocationTargetException e) { throw new FluidCacheException( "Unable to invoke method '"+ methodParam.getName() +"'. "+e.getMessage...
java
private static Object invoke(Method methodParam, Object objParam) { try { return methodParam.invoke(objParam); } //Changed for Java 1.6 compatibility... catch (InvocationTargetException e) { throw new FluidCacheException( "Unable to invoke method '"+ methodParam.getName() +"'. "+e.getMessage...
[ "private", "static", "Object", "invoke", "(", "Method", "methodParam", ",", "Object", "objParam", ")", "{", "try", "{", "return", "methodParam", ".", "invoke", "(", "objParam", ")", ";", "}", "//Changed for Java 1.6 compatibility...", "catch", "(", "InvocationTarg...
Invokes the {@code methodParam} method on {@code objParam}. @param methodParam The method to invoke. @param objParam The object to invoke the method on. @return The result of the invoked object.
[ "Invokes", "the", "{", "@code", "methodParam", "}", "method", "on", "{", "@code", "objParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/cache/CacheUtil.java#L417-L439
test
Invoke the method param.
Of course, here is the Java code you requested: ```java private static Object invoke(Method methodParam, Object objParam) { try { return methodParam.invoke(objParam); } //Changed for Java 1.6 compatibility... catch (InvocationTargetException e) { throw new FluidCacheException( "Unable to invoke me...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/ConditionFactor.java
ConditionFactor.create
public static ConditionFactor create(StreamTokenizer tokenizer) throws WebDAVException { boolean not = false; ConditionFactor factor = null; try { int token = tokenizer.ttype; if (token == StreamTokenizer.TT_WORD) { if (tokenizer.sval.equalsIgnoreCase("Not...
java
public static ConditionFactor create(StreamTokenizer tokenizer) throws WebDAVException { boolean not = false; ConditionFactor factor = null; try { int token = tokenizer.ttype; if (token == StreamTokenizer.TT_WORD) { if (tokenizer.sval.equalsIgnoreCase("Not...
[ "public", "static", "ConditionFactor", "create", "(", "StreamTokenizer", "tokenizer", ")", "throws", "WebDAVException", "{", "boolean", "not", "=", "false", ";", "ConditionFactor", "factor", "=", "null", ";", "try", "{", "int", "token", "=", "tokenizer", ".", ...
Create a ConditionFactor (either a StateToken or EntityTag) by parsing the tokenizer contining an If header value. @param tokenizer a StreamTokenizer containing the contents of a state token or entity tag from a WebDAV If header @return the parsed ConditionFactor @exception WebDAVException thrown if there is a syntax ...
[ "Create", "a", "ConditionFactor", "(", "either", "a", "StateToken", "or", "EntityTag", ")", "by", "parsing", "the", "tokenizer", "contining", "an", "If", "header", "value", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/ConditionFactor.java#L45-L73
test
Create a new instance of the class based on the tokenizer.
Of course, here is the Java code you requested: ```java public static ConditionFactor create(StreamTokenizer tokenizer) throws WebDAVException { boolean not = false; ConditionFactor factor = null; try { int token = tokenizer.ttype; if (token == StreamTokenizer.TT_WORD) {...
Unidata/thredds
dap4/d4core/src/main/java/dap4/core/dmr/DapDataset.java
DapDataset.sort
public void sort() { List<DapNode> sorted = new ArrayList<DapNode>(); sortR(this, sorted); // Assign indices for(int i = 0; i < sorted.size(); i++) { sorted.get(i).setIndex(i); } this.nodelist = sorted; }
java
public void sort() { List<DapNode> sorted = new ArrayList<DapNode>(); sortR(this, sorted); // Assign indices for(int i = 0; i < sorted.size(); i++) { sorted.get(i).setIndex(i); } this.nodelist = sorted; }
[ "public", "void", "sort", "(", ")", "{", "List", "<", "DapNode", ">", "sorted", "=", "new", "ArrayList", "<", "DapNode", ">", "(", ")", ";", "sortR", "(", "this", ",", "sorted", ")", ";", "// Assign indices", "for", "(", "int", "i", "=", "0", ";", ...
Sort the nodelist into prefix left to right order
[ "Sort", "the", "nodelist", "into", "prefix", "left", "to", "right", "order" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/dmr/DapDataset.java#L337-L347
test
Sort the list of nodes in the resultant list.
Of course, here is the Java code you requested: ```java public void sort() { List<DapNode> sorted = new ArrayList<DapNode>(); sortR(this, sorted); // Assign indices for(int i = 0; i < sorted.size(); i++) { sorted.get(i).setIndex(i); } this.nodelist = ...
OpenEstate/OpenEstate-IO
DaftIE/src/main/jaxb/org/openestate/io/daft_ie/xml/OverseasSaleAdType.java
OverseasSaleAdType.setPriceType
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setPriceType(OverseasSaleAdType.PriceType value) { this.priceType = value; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setPriceType(OverseasSaleAdType.PriceType value) { this.priceType = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:41:42+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setPriceType", "(", "OverseasSaleAdType", ".", "PriceType", "value", ")", "{", ...
Sets the value of the priceType property. @param value allowed object is {@link OverseasSaleAdType.PriceType }
[ "Sets", "the", "value", "of", "the", "priceType", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/DaftIE/src/main/jaxb/org/openestate/io/daft_ie/xml/OverseasSaleAdType.java#L504-L507
test
Sets the value of the priceType property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setPriceType(OverseasSaleAdType.PriceType value) { this.priceType = value; } ``` Hope this helps!
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib2/Grib2DataReader.java
Grib2DataReader.getData40raw
@Nullable private int[] getData40raw(RandomAccessFile raf, Grib2Drs.Type40 gdrs) throws IOException { int nb = gdrs.numberOfBits; if (nb == 0) { return null; } int missing_value = (2 << nb - 1) - 1; // all ones - reserved for missing value Grib2JpegDecoder g2j; g2j = new Grib2Jpeg...
java
@Nullable private int[] getData40raw(RandomAccessFile raf, Grib2Drs.Type40 gdrs) throws IOException { int nb = gdrs.numberOfBits; if (nb == 0) { return null; } int missing_value = (2 << nb - 1) - 1; // all ones - reserved for missing value Grib2JpegDecoder g2j; g2j = new Grib2Jpeg...
[ "@", "Nullable", "private", "int", "[", "]", "getData40raw", "(", "RandomAccessFile", "raf", ",", "Grib2Drs", ".", "Type40", "gdrs", ")", "throws", "IOException", "{", "int", "nb", "=", "gdrs", ".", "numberOfBits", ";", "if", "(", "nb", "==", "0", ")", ...
Grid point data - JPEG 2000 code stream format
[ "Grid", "point", "data", "-", "JPEG", "2000", "code", "stream", "format" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib2/Grib2DataReader.java#L812-L856
test
Get the raw data of a type 40 image from a file.
Of course, here is the Java code you requested: ```java @Nullable private int[] getData40raw(RandomAccessFile raf, Grib2Drs.Type40 gdrs) throws IOException { int nb = gdrs.numberOfBits; if (nb == 0) { return null; } int missing_value = (2 << nb - 1) - 1; // all ones - reserved for missing...
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/RuleCompletionProcessor.java
RuleCompletionProcessor.mvelifyProposals
public static Collection<ICompletionProposal> mvelifyProposals(List<ICompletionProposal> list, boolean settersOnly) { final Collection<ICompletionProposal> set = new HashSet<ICompletionProposal>(); for (ICompletionProposal o : list) { if (o instanceof JavaMethodCompletionProposal) { ...
java
public static Collection<ICompletionProposal> mvelifyProposals(List<ICompletionProposal> list, boolean settersOnly) { final Collection<ICompletionProposal> set = new HashSet<ICompletionProposal>(); for (ICompletionProposal o : list) { if (o instanceof JavaMethodCompletionProposal) { ...
[ "public", "static", "Collection", "<", "ICompletionProposal", ">", "mvelifyProposals", "(", "List", "<", "ICompletionProposal", ">", "list", ",", "boolean", "settersOnly", ")", "{", "final", "Collection", "<", "ICompletionProposal", ">", "set", "=", "new", "HashSe...
/* Filters accessor method proposals to replace them with their mvel expression equivalent For instance a completion for getStatus() would be replaced by a completion for status when asking for stters only, then only setters or writable fields will be returned
[ "/", "*", "Filters", "accessor", "method", "proposals", "to", "replace", "them", "with", "their", "mvel", "expression", "equivalent", "For", "instance", "a", "completion", "for", "getStatus", "()", "would", "be", "replaced", "by", "a", "completion", "for", "st...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/RuleCompletionProcessor.java#L1398-L1413
test
Mvelify proposals.
Of course, here is the Java code you requested: ```java public static Collection<ICompletionProposal> mvelifyProposals(List<ICompletionProposal> list, boolean settersOnly) { final Collection<ICompletionProposal> set = new HashSet<ICompletionProposal>(); for (ICompletionProposal o : list) { ...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java
SecurityConfigurerAdapter.postProcess
@SuppressWarnings("unchecked") protected <T> T postProcess(T object) { return (T) this.objectPostProcessor.postProcess(object); }
java
@SuppressWarnings("unchecked") protected <T> T postProcess(T object) { return (T) this.objectPostProcessor.postProcess(object); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "<", "T", ">", "T", "postProcess", "(", "T", "object", ")", "{", "return", "(", "T", ")", "this", ".", "objectPostProcessor", ".", "postProcess", "(", "object", ")", ";", "}" ]
Performs post processing of an object. The default is to delegate to the {@link ObjectPostProcessor}. @param object the Object to post process @return the possibly modified Object to use
[ "Performs", "post", "processing", "of", "an", "object", ".", "The", "default", "is", "to", "delegate", "to", "the", "{", "@link", "ObjectPostProcessor", "}", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java#L80-L83
test
Post - process the object.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") protected <T> T postProcess(T object) { return (T) this.objectPostProcessor.postProcess(object); } ``` Hope this helps!
RestComm/jain-slee
container/build/as7/extension/src/main/java/org/restcomm/slee/container/build/as7/deployment/SleeDeployerEntityResolver.java
SleeDeployerEntityResolver.resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { URL resourceURL = resources.get(publicId); if(resourceURL != null) { InputStream resourceStream = resourceURL.openStream(); InputSource is = new InputSource(resourceSt...
java
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { URL resourceURL = resources.get(publicId); if(resourceURL != null) { InputStream resourceStream = resourceURL.openStream(); InputSource is = new InputSource(resourceSt...
[ "public", "InputSource", "resolveEntity", "(", "String", "publicId", ",", "String", "systemId", ")", "throws", "SAXException", ",", "IOException", "{", "URL", "resourceURL", "=", "resources", ".", "get", "(", "publicId", ")", ";", "if", "(", "resourceURL", "!=...
Creates an InputSource with a SystemID corresponding to a local dtd file. @param publicId The public identifier of the external entity being referenced, or null if none was supplied. @param systemId The system identifier of the external entity being referenced (This is a dummy parameter and is overridden by the resour...
[ "Creates", "an", "InputSource", "with", "a", "SystemID", "corresponding", "to", "a", "local", "dtd", "file", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/build/as7/extension/src/main/java/org/restcomm/slee/container/build/as7/deployment/SleeDeployerEntityResolver.java#L102-L115
test
Resolves a single entity.
Of course, here is the Java code you requested: ```java public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { URL resourceURL = resources.get(publicId); if(resourceURL != null) { InputStream resourceStream = resourceURL.openStream();...
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/DynamicOperatorParser.java
DynamicOperatorParser.getOperatorsMatchingNameByFixity
public EnumMap<OpSymbol.Fixity, OpSymbol> getOperatorsMatchingNameByFixity(String name) { return operators.get(name); }
java
public EnumMap<OpSymbol.Fixity, OpSymbol> getOperatorsMatchingNameByFixity(String name) { return operators.get(name); }
[ "public", "EnumMap", "<", "OpSymbol", ".", "Fixity", ",", "OpSymbol", ">", "getOperatorsMatchingNameByFixity", "(", "String", "name", ")", "{", "return", "operators", ".", "get", "(", "name", ")", ";", "}" ]
Checks the operator table for all possible operators matching a given name. @param name The interned name of the operator to find. @return An array of matching operators, or <tt>null</tt> if none can be found.
[ "Checks", "the", "operator", "table", "for", "all", "possible", "operators", "matching", "a", "given", "name", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/DynamicOperatorParser.java#L436-L439
test
Get the operators matching the name by fixity.
Of course, here is the Java code you requested: ```java public EnumMap<OpSymbol.Fixity, OpSymbol> getOperatorsMatchingNameByFixity(String name) { return operators.get(name); } ``` Hope this helps!
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasZsyrk
public static void cublasZsyrk(char uplo, char trans, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, cuDoubleComplex beta, Pointer C, int ldc) { cublasZsyrkNative(uplo, trans, n, k, alpha, A, lda, beta, C, ldc); checkResultBLAS(); }
java
public static void cublasZsyrk(char uplo, char trans, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, cuDoubleComplex beta, Pointer C, int ldc) { cublasZsyrkNative(uplo, trans, n, k, alpha, A, lda, beta, C, ldc); checkResultBLAS(); }
[ "public", "static", "void", "cublasZsyrk", "(", "char", "uplo", ",", "char", "trans", ",", "int", "n", ",", "int", "k", ",", "cuDoubleComplex", "alpha", ",", "Pointer", "A", ",", "int", "lda", ",", "cuDoubleComplex", "beta", ",", "Pointer", "C", ",", "...
<pre> void cublasZsyrk (char uplo, char trans, int n, int k, cuDoubleComplex alpha, const cuDoubleComplex *A, int lda, cuDoubleComplex beta, cuDoubleComplex *C, int ldc) performs one of the symmetric rank k operations C = alpha * A * transpose(A) + beta * C, or C = alpha * transpose(A) * A + beta * C. Alpha and beta...
[ "<pre", ">", "void", "cublasZsyrk", "(", "char", "uplo", "char", "trans", "int", "n", "int", "k", "cuDoubleComplex", "alpha", "const", "cuDoubleComplex", "*", "A", "int", "lda", "cuDoubleComplex", "beta", "cuDoubleComplex", "*", "C", "int", "ldc", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L9304-L9308
test
ublas Zsyrk.
Of course, here is the Java code you requested: ```java public static void cublasZsyrk(char uplo, char trans, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, cuDoubleComplex beta, Pointer C, int ldc) { cublasZsyrkNative(uplo, trans, n, k, alpha, A, lda, beta, C, ldc); checkResultBLAS();...
Unidata/thredds
cdm/src/main/java/ucar/nc2/util/cache/FileCacheARC.java
FileCacheARC.acquire
@Override public FileCacheable acquire(FileFactory factory, Object hashKey, DatasetUrl location, int buffer_size, CancelTask cancelTask, Object spiObject) throws IOException { if (null == hashKey) hashKey = location.trueurl; if (null == hashKey) throw new IllegalArgumentExcepti...
java
@Override public FileCacheable acquire(FileFactory factory, Object hashKey, DatasetUrl location, int buffer_size, CancelTask cancelTask, Object spiObject) throws IOException { if (null == hashKey) hashKey = location.trueurl; if (null == hashKey) throw new IllegalArgumentExcepti...
[ "@", "Override", "public", "FileCacheable", "acquire", "(", "FileFactory", "factory", ",", "Object", "hashKey", ",", "DatasetUrl", "location", ",", "int", "buffer_size", ",", "CancelTask", "cancelTask", ",", "Object", "spiObject", ")", "throws", "IOException", "{"...
Acquire a FileCacheable from the cache, and lock it so no one else can use it. If not already in cache, open it with FileFactory, and put in cache. <p/> Call FileCacheable.close() when done, (rather than FileCacheIF.release() directly) and the file is then released instead of closed. <p/> If cache size goes over maxEle...
[ "Acquire", "a", "FileCacheable", "from", "the", "cache", "and", "lock", "it", "so", "no", "one", "else", "can", "use", "it", ".", "If", "not", "already", "in", "cache", "open", "it", "with", "FileFactory", "and", "put", "in", "cache", ".", "<p", "/", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/cache/FileCacheARC.java#L129-L169
test
This method is used to acquire a single file from the cache.
Of course, here is the Java code you requested: ```java @Override public FileCacheable acquire(FileFactory factory, Object hashKey, DatasetUrl location, int buffer_size, CancelTask cancelTask, Object spiObject) throws IOException { if (null == hashKey) hashKey = location.trueurl; ...
oblac/jodd
jodd-petite/src/main/java/jodd/petite/scope/SessionScope.java
SessionScope.getSessionMap
@SuppressWarnings("unchecked") protected Map<String, BeanData> getSessionMap(final HttpSession session) { SessionBeans sessionBeans = (SessionBeans) session.getAttribute(SESSION_BEANS_NAME); if (sessionBeans == null) { return null; } return sessionBeans.getBeanMap(); }
java
@SuppressWarnings("unchecked") protected Map<String, BeanData> getSessionMap(final HttpSession session) { SessionBeans sessionBeans = (SessionBeans) session.getAttribute(SESSION_BEANS_NAME); if (sessionBeans == null) { return null; } return sessionBeans.getBeanMap(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "Map", "<", "String", ",", "BeanData", ">", "getSessionMap", "(", "final", "HttpSession", "session", ")", "{", "SessionBeans", "sessionBeans", "=", "(", "SessionBeans", ")", "session", ".", "getAtt...
Returns instance map from http session.
[ "Returns", "instance", "map", "from", "http", "session", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/scope/SessionScope.java#L73-L80
test
Gets the session map.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") protected Map<String, BeanData> getSessionMap(final HttpSession session) { SessionBeans sessionBeans = (SessionBeans) session.getAttribute(SESSION_BEANS_NAME); if (sessionBeans == null) { return null; } return sessionBea...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft2/coverage/adapter/DtCoverageCS.java
DtCoverageCS.getBoundingBox
public ProjectionRect getBoundingBox() { if (mapArea == null) { CoordinateAxis horizXaxis = getXHorizAxis(); CoordinateAxis horizYaxis = getYHorizAxis(); if ((horizXaxis == null) || !horizXaxis.isNumeric() || (horizYaxis == null) || !horizYaxis.isNumeric()) return null; // impossible ...
java
public ProjectionRect getBoundingBox() { if (mapArea == null) { CoordinateAxis horizXaxis = getXHorizAxis(); CoordinateAxis horizYaxis = getYHorizAxis(); if ((horizXaxis == null) || !horizXaxis.isNumeric() || (horizYaxis == null) || !horizYaxis.isNumeric()) return null; // impossible ...
[ "public", "ProjectionRect", "getBoundingBox", "(", ")", "{", "if", "(", "mapArea", "==", "null", ")", "{", "CoordinateAxis", "horizXaxis", "=", "getXHorizAxis", "(", ")", ";", "CoordinateAxis", "horizYaxis", "=", "getYHorizAxis", "(", ")", ";", "if", "(", "(...
Get the x,y bounding box in projection coordinates.
[ "Get", "the", "x", "y", "bounding", "box", "in", "projection", "coordinates", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/adapter/DtCoverageCS.java#L174-L216
test
Get the bounding box of the map.
Of course, here is the Java code you requested: ```java public ProjectionRect getBoundingBox() { if (mapArea == null) { CoordinateAxis horizXaxis = getXHorizAxis(); CoordinateAxis horizYaxis = getYHorizAxis(); if ((horizXaxis == null) || !horizXaxis.isNumeric() || (horizYaxis == null) || !horizY...
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/vo/flow/Flow.java
Flow.toJsonObject
@Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = super.toJsonObject(); //Name... if(this.getName() != null) { returnVal.put(JSONMapping.NAME,this.getName()); } //Description... if(this.getDescription() ...
java
@Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = super.toJsonObject(); //Name... if(this.getName() != null) { returnVal.put(JSONMapping.NAME,this.getName()); } //Description... if(this.getDescription() ...
[ "@", "Override", "public", "JSONObject", "toJsonObject", "(", ")", "throws", "JSONException", "{", "JSONObject", "returnVal", "=", "super", ".", "toJsonObject", "(", ")", ";", "//Name...", "if", "(", "this", ".", "getName", "(", ")", "!=", "null", ")", "{"...
Conversion to {@code JSONObject} from Java Object. @return {@code JSONObject} representation of {@code Flow} @throws JSONException If there is a problem with the JSON Body. @see ABaseFluidJSONObject#toJsonObject()
[ "Conversion", "to", "{", "@code", "JSONObject", "}", "from", "Java", "Object", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/flow/Flow.java#L231-L276
test
Override toJsonObject to return a JSONObject with all the properties of this object.
Of course, here is the Java code you requested: ```java @Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = super.toJsonObject(); //Name... if(this.getName() != null) { returnVal.put(JSONMapping.NAME,this.getName()); } ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
NetcdfDataset.enhanceNeeded
public boolean enhanceNeeded(Set<Enhance> want) throws IOException { if (want == null) return false; for (Enhance mode : want) { if (!this.enhanceMode.contains(mode)) return true; } return false; }
java
public boolean enhanceNeeded(Set<Enhance> want) throws IOException { if (want == null) return false; for (Enhance mode : want) { if (!this.enhanceMode.contains(mode)) return true; } return false; }
[ "public", "boolean", "enhanceNeeded", "(", "Set", "<", "Enhance", ">", "want", ")", "throws", "IOException", "{", "if", "(", "want", "==", "null", ")", "return", "false", ";", "for", "(", "Enhance", "mode", ":", "want", ")", "{", "if", "(", "!", "thi...
is this enhancement already done ? @param want enhancements wanted @return true if wanted enhancement is not done @throws java.io.IOException on error
[ "is", "this", "enhancement", "already", "done", "?" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java#L1403-L1409
test
Check if the enhancement mode is needed
Of course, here is the Java code you requested: ```java public boolean enhanceNeeded(Set<Enhance> want) throws IOException { if (want == null) return false; for (Enhance mode : want) { if (!this.enhanceMode.contains(mode)) return true; } return false; } ``` Hope this helps!
RestComm/jain-slee
container/components/components/src/main/java/org/mobicents/slee/container/component/EventTypeComponentImpl.java
EventTypeComponentImpl.getSpecsDescriptor
public javax.slee.management.EventTypeDescriptor getSpecsDescriptor() { if (specsDescriptor == null) { specsDescriptor = new javax.slee.management.EventTypeDescriptor(getEventTypeID(),getDeployableUnit().getDeployableUnitID(),getDeploymentUnitSource(),descriptor.getLibraryRefs().toArray(new LibraryID[descriptor....
java
public javax.slee.management.EventTypeDescriptor getSpecsDescriptor() { if (specsDescriptor == null) { specsDescriptor = new javax.slee.management.EventTypeDescriptor(getEventTypeID(),getDeployableUnit().getDeployableUnitID(),getDeploymentUnitSource(),descriptor.getLibraryRefs().toArray(new LibraryID[descriptor....
[ "public", "javax", ".", "slee", ".", "management", ".", "EventTypeDescriptor", "getSpecsDescriptor", "(", ")", "{", "if", "(", "specsDescriptor", "==", "null", ")", "{", "specsDescriptor", "=", "new", "javax", ".", "slee", ".", "management", ".", "EventTypeDes...
Retrieves the JAIN SLEE specs event type descriptor @return
[ "Retrieves", "the", "JAIN", "SLEE", "specs", "event", "type", "descriptor" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/EventTypeComponentImpl.java#L167-L172
test
Gets the event type descriptor.
Of course, here is the Java code you requested: ```java public javax.slee.management.EventTypeDescriptor getSpecsDescriptor() { if (specsDescriptor == null) { specsDescriptor = new javax.slee.management.EventTypeDescriptor(getEventTypeID(),getDeployableUnit().getDeployableUnitID(),getDeploymentUnitSource(),desc...
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/creation/PipelineBeanCreator.java
PipelineBeanCreator.createInterceptor
public InterceptorBean createInterceptor( StageLibraryTask stageLib, InterceptorDefinition definition, StageConfiguration stageConfiguration, StageDefinition stageDefinition, InterceptorCreatorContextBuilder contextBuilder, InterceptorCreator.InterceptorType interceptorType, List<Issue> issu...
java
public InterceptorBean createInterceptor( StageLibraryTask stageLib, InterceptorDefinition definition, StageConfiguration stageConfiguration, StageDefinition stageDefinition, InterceptorCreatorContextBuilder contextBuilder, InterceptorCreator.InterceptorType interceptorType, List<Issue> issu...
[ "public", "InterceptorBean", "createInterceptor", "(", "StageLibraryTask", "stageLib", ",", "InterceptorDefinition", "definition", ",", "StageConfiguration", "stageConfiguration", ",", "StageDefinition", "stageDefinition", ",", "InterceptorCreatorContextBuilder", "contextBuilder", ...
Create a default interceptor for given InterceptorDefinition. This method might return null as the underlying interface for default creation allows it as well - in such case no interceptor is needed.
[ "Create", "a", "default", "interceptor", "for", "given", "InterceptorDefinition", ".", "This", "method", "might", "return", "null", "as", "the", "underlying", "interface", "for", "default", "creation", "allows", "it", "as", "well", "-", "in", "such", "case", "...
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/creation/PipelineBeanCreator.java#L722-L765
test
Create an interceptor.
Of course, here is the Java code you requested: ```java public InterceptorBean createInterceptor( StageLibraryTask stageLib, InterceptorDefinition definition, StageConfiguration stageConfiguration, StageDefinition stageDefinition, InterceptorCreatorContextBuilder contextBuilder, InterceptorCrea...
wildfly/wildfly
undertow/src/main/java/org/wildfly/extension/undertow/security/SecurityActions.java
SecurityActions.setRunAsIdentity
static RunAs setRunAsIdentity(final RunAs principal, final SecurityContext sc) { if (WildFlySecurityManager.isChecking()) { return WildFlySecurityManager.doUnchecked(new PrivilegedAction<RunAs>() { @Override public RunAs run() { if (sc == null) { ...
java
static RunAs setRunAsIdentity(final RunAs principal, final SecurityContext sc) { if (WildFlySecurityManager.isChecking()) { return WildFlySecurityManager.doUnchecked(new PrivilegedAction<RunAs>() { @Override public RunAs run() { if (sc == null) { ...
[ "static", "RunAs", "setRunAsIdentity", "(", "final", "RunAs", "principal", ",", "final", "SecurityContext", "sc", ")", "{", "if", "(", "WildFlySecurityManager", ".", "isChecking", "(", ")", ")", "{", "return", "WildFlySecurityManager", ".", "doUnchecked", "(", "...
Sets the run as identity @param principal the identity
[ "Sets", "the", "run", "as", "identity" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/undertow/src/main/java/org/wildfly/extension/undertow/security/SecurityActions.java#L150-L172
test
Set the RunAs identity.
Of course, here is the Java code you requested: ```java static RunAs setRunAsIdentity(final RunAs principal, final SecurityContext sc) { if (WildFlySecurityManager.isChecking()) { return WildFlySecurityManager.doUnchecked(new PrivilegedAction<RunAs>() { @Override pu...
oblac/jodd
jodd-petite/src/main/java/jodd/petite/BeanData.java
BeanData.callDestroyMethods
public void callDestroyMethods() { for (final DestroyMethodPoint destroyMethodPoint : beanDefinition.destroyMethodPoints()) { try { destroyMethodPoint.method.invoke(bean); } catch (Exception ex) { throw new PetiteException("Invalid destroy method: " + destroyMethodPoint.method, ex); } } }
java
public void callDestroyMethods() { for (final DestroyMethodPoint destroyMethodPoint : beanDefinition.destroyMethodPoints()) { try { destroyMethodPoint.method.invoke(bean); } catch (Exception ex) { throw new PetiteException("Invalid destroy method: " + destroyMethodPoint.method, ex); } } }
[ "public", "void", "callDestroyMethods", "(", ")", "{", "for", "(", "final", "DestroyMethodPoint", "destroyMethodPoint", ":", "beanDefinition", ".", "destroyMethodPoints", "(", ")", ")", "{", "try", "{", "destroyMethodPoint", ".", "method", ".", "invoke", "(", "b...
Calls destroy methods on given BeanData. Destroy methods are called without any order.
[ "Calls", "destroy", "methods", "on", "given", "BeanData", ".", "Destroy", "methods", "are", "called", "without", "any", "order", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/BeanData.java#L110-L118
test
Call destroy methods.
Of course, here is the Java code you requested: ```java public void callDestroyMethods() { for (final DestroyMethodPoint destroyMethodPoint : beanDefinition.destroyMethodPoints()) { try { destroyMethodPoint.method.invoke(bean); } catch (Exception ex) { throw new PetiteException("Invalid destroy method:...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java
GridCoordSys.makeGridCoordSys
public static GridCoordSys makeGridCoordSys(Formatter sbuff, CoordinateSystem cs, VariableEnhanced v) { if (sbuff != null) { sbuff.format(" "); v.getNameAndDimensions(sbuff, false, true); sbuff.format(" check CS %s: ", cs.getName()); } if (isGridCoordSys(sbuff, cs, v)) { Gri...
java
public static GridCoordSys makeGridCoordSys(Formatter sbuff, CoordinateSystem cs, VariableEnhanced v) { if (sbuff != null) { sbuff.format(" "); v.getNameAndDimensions(sbuff, false, true); sbuff.format(" check CS %s: ", cs.getName()); } if (isGridCoordSys(sbuff, cs, v)) { Gri...
[ "public", "static", "GridCoordSys", "makeGridCoordSys", "(", "Formatter", "sbuff", ",", "CoordinateSystem", "cs", ",", "VariableEnhanced", "v", ")", "{", "if", "(", "sbuff", "!=", "null", ")", "{", "sbuff", ".", "format", "(", "\" \"", ")", ";", "v", ".", ...
Determine if the CoordinateSystem cs can be made into a GridCoordSys for the Variable v. @param sbuff put debug information into this StringBuffer; may be null. @param cs CoordinateSystem to check. @param v Variable to check. @return the GridCoordSys made from cs, else null.
[ "Determine", "if", "the", "CoordinateSystem", "cs", "can", "be", "made", "into", "a", "GridCoordSys", "for", "the", "Variable", "v", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java#L224-L238
test
Make a GridCoordSys object from the given CoordinateSystem and VariableEnhanced objects.
Of course, here is the Java code you requested: ```java public static GridCoordSys makeGridCoordSys(Formatter sbuff, CoordinateSystem cs, VariableEnhanced v) { if (sbuff != null) { sbuff.format(" "); v.getNameAndDimensions(sbuff, false, true); sbuff.format(" check CS %s: ", cs.getName()); ...
Unidata/thredds
legacy/src/main/java/thredds/catalog/ThreddsMetadata.java
ThreddsMetadata.add
public void add(ThreddsMetadata tmd, boolean includeInherited) { creators.addAll(tmd.getCreators()); contributors.addAll(tmd.getContributors()); dates.addAll(tmd.getDates()); docs.addAll(tmd.getDocumentation()); keywords.addAll(tmd.getKeywords()); projects.addAll(tmd.getProjects()); properti...
java
public void add(ThreddsMetadata tmd, boolean includeInherited) { creators.addAll(tmd.getCreators()); contributors.addAll(tmd.getContributors()); dates.addAll(tmd.getDates()); docs.addAll(tmd.getDocumentation()); keywords.addAll(tmd.getKeywords()); projects.addAll(tmd.getProjects()); properti...
[ "public", "void", "add", "(", "ThreddsMetadata", "tmd", ",", "boolean", "includeInherited", ")", "{", "creators", ".", "addAll", "(", "tmd", ".", "getCreators", "(", ")", ")", ";", "contributors", ".", "addAll", "(", "tmd", ".", "getContributors", "(", ")"...
Add all the content from another ThreddsMetadata @param tmd get content from here @param includeInherited if false, dont add inherited InvMetadata
[ "Add", "all", "the", "content", "from", "another", "ThreddsMetadata" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/ThreddsMetadata.java#L78-L107
test
Add the ThreddsMetadata object to this object.
Of course, here is the Java code you requested: ```java public void add(ThreddsMetadata tmd, boolean includeInherited) { creators.addAll(tmd.getCreators()); contributors.addAll(tmd.getContributors()); dates.addAll(tmd.getDates()); docs.addAll(tmd.getDocumentation()); keywords.addAll(tmd.getKeywords...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java
GridCoordSys.getCalendarDates
@Override public List<CalendarDate> getCalendarDates() { if (timeTaxis != null) return timeTaxis.getCalendarDates(); else if (getRunTimeAxis() != null) return makeCalendarDates2D(); else return new ArrayList<>(); }
java
@Override public List<CalendarDate> getCalendarDates() { if (timeTaxis != null) return timeTaxis.getCalendarDates(); else if (getRunTimeAxis() != null) return makeCalendarDates2D(); else return new ArrayList<>(); }
[ "@", "Override", "public", "List", "<", "CalendarDate", ">", "getCalendarDates", "(", ")", "{", "if", "(", "timeTaxis", "!=", "null", ")", "return", "timeTaxis", ".", "getCalendarDates", "(", ")", ";", "else", "if", "(", "getRunTimeAxis", "(", ")", "!=", ...
///////////////////////////////////////////////////////////////
[ "///////////////////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java#L1349-L1359
test
Returns a copy of the calendar dates contained in this time axis.
Of course, here is the Java code you requested: ```java @Override public List<CalendarDate> getCalendarDates() { if (timeTaxis != null) return timeTaxis.getCalendarDates(); else if (getRunTimeAxis() != null) return makeCalendarDates2D(); else return new ArrayList<>(); } ``...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMatchStatement.java
OMatchStatement.rebindFilters
private void rebindFilters(Map<String, OWhereClause> aliasFilters) { for (OMatchExpression expression : matchExpressions) { OWhereClause newFilter = aliasFilters.get(expression.origin.getAlias()); expression.origin.setFilter(newFilter); for (OMatchPathItem item : expression.items) { newFi...
java
private void rebindFilters(Map<String, OWhereClause> aliasFilters) { for (OMatchExpression expression : matchExpressions) { OWhereClause newFilter = aliasFilters.get(expression.origin.getAlias()); expression.origin.setFilter(newFilter); for (OMatchPathItem item : expression.items) { newFi...
[ "private", "void", "rebindFilters", "(", "Map", "<", "String", ",", "OWhereClause", ">", "aliasFilters", ")", "{", "for", "(", "OMatchExpression", "expression", ":", "matchExpressions", ")", "{", "OWhereClause", "newFilter", "=", "aliasFilters", ".", "get", "(",...
rebinds filter (where) conditions to alias nodes after optimization @param aliasFilters
[ "rebinds", "filter", "(", "where", ")", "conditions", "to", "alias", "nodes", "after", "optimization" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMatchStatement.java#L277-L287
test
Rebind the filters for the match expressions.
Of course, here is the Java code you requested: ```java private void rebindFilters(Map<String, OWhereClause> aliasFilters) { for (OMatchExpression expression : matchExpressions) { OWhereClause newFilter = aliasFilters.get(expression.origin.getAlias()); expression.origin.setFilter(newFilter); for...
Unidata/thredds
bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java
DataDescriptorTreeConstructor.grabCompoundNames
private void grabCompoundNames(List<DataDescriptor> tree) { for (int i=0; i<tree.size(); i++) { DataDescriptor key = tree.get(i); if (key.bad) continue; if ((key.f == 3) && (key.subKeys != null)) { grabCompoundNames(key.subKeys); } else if (key.f == 1 && key.x == 1 && i <...
java
private void grabCompoundNames(List<DataDescriptor> tree) { for (int i=0; i<tree.size(); i++) { DataDescriptor key = tree.get(i); if (key.bad) continue; if ((key.f == 3) && (key.subKeys != null)) { grabCompoundNames(key.subKeys); } else if (key.f == 1 && key.x == 1 && i <...
[ "private", "void", "grabCompoundNames", "(", "List", "<", "DataDescriptor", ">", "tree", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tree", ".", "size", "(", ")", ";", "i", "++", ")", "{", "DataDescriptor", "key", "=", "tree", ".", ...
/* try to grab names of compounds (structs) if f=1 is followed by f=3, eg: 0-40-20 : GQisFlagQualDetailed - Quality flag for the system 1-01-010: replication 3-40-2 : (IASI Level 1c band description) 0-25-140: Start channel 0-25-141: End channel 0-25-142: Channel scale factor 1-01-087: replication 3-40-3 : (IASI Leve...
[ "/", "*", "try", "to", "grab", "names", "of", "compounds", "(", "structs", ")", "if", "f", "=", "1", "is", "followed", "by", "f", "=", "3", "eg", ":", "0", "-", "40", "-", "20", ":", "GQisFlagQualDetailed", "-", "Quality", "flag", "for", "the", "...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java#L301-L324
test
Grab the compound names from the list of data descriptors.
Of course, here is the Java code you requested: ```java private void grabCompoundNames(List<DataDescriptor> tree) { for (int i=0; i<tree.size(); i++) { DataDescriptor key = tree.get(i); if (key.bad) continue; if ((key.f == 3) && (key.subKeys != null)) { grabCompoundNames(key.subK...
js-lib-com/tiny-container
src/main/java/js/net/HttpRmiServlet.java
HttpRmiServlet.getManagedClass
private static ManagedClassSPI getManagedClass(ContainerSPI container, String interfaceName, String requestURI) throws ClassNotFoundException { Class<?> interfaceClass = Classes.forOptionalName(interfaceName); if (interfaceClass == null) { log.error("HTTP-RMI request for not existing class |%s|.", interfaceNa...
java
private static ManagedClassSPI getManagedClass(ContainerSPI container, String interfaceName, String requestURI) throws ClassNotFoundException { Class<?> interfaceClass = Classes.forOptionalName(interfaceName); if (interfaceClass == null) { log.error("HTTP-RMI request for not existing class |%s|.", interfaceNa...
[ "private", "static", "ManagedClassSPI", "getManagedClass", "(", "ContainerSPI", "container", ",", "String", "interfaceName", ",", "String", "requestURI", ")", "throws", "ClassNotFoundException", "{", "Class", "<", "?", ">", "interfaceClass", "=", "Classes", ".", "fo...
Get remotely accessible managed class registered to a certain interface class. @param container parent container, @param interfaceName name of the interface class identifying requested managed class, @param requestURI request URI for logging. @return managed class, never null. @throws ClassNotFoundException if interfa...
[ "Get", "remotely", "accessible", "managed", "class", "registered", "to", "a", "certain", "interface", "class", "." ]
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/net/HttpRmiServlet.java#L203-L219
test
Gets the managed class from the given container.
Of course, here is the Java code you requested: ```java private static ManagedClassSPI getManagedClass(ContainerSPI container, String interfaceName, String requestURI) throws ClassNotFoundException { Class<?> interfaceClass = Classes.forOptionalName(interfaceName); if (interfaceClass == null) { log.error("HT...
kocakosm/pitaya
src/org/kocakosm/pitaya/io/TextFiles.java
TextFiles.newWriter
public static BufferedWriter newWriter(File f, WriteOption... options) throws IOException { return newWriter(f, Charsets.DEFAULT, options); }
java
public static BufferedWriter newWriter(File f, WriteOption... options) throws IOException { return newWriter(f, Charsets.DEFAULT, options); }
[ "public", "static", "BufferedWriter", "newWriter", "(", "File", "f", ",", "WriteOption", "...", "options", ")", "throws", "IOException", "{", "return", "newWriter", "(", "f", ",", "Charsets", ".", "DEFAULT", ",", "options", ")", ";", "}" ]
Returns a new {@code BufferedWriter} to write to the given {@code File} using the system's default charset. @param f the file to write to. @param options the write options. @return a {@code BufferedWriter} to write to the given {@code File}. @throws NullPointerException if one of the arguments is {@code null}. @thro...
[ "Returns", "a", "new", "{", "@code", "BufferedWriter", "}", "to", "write", "to", "the", "given", "{", "@code", "File", "}", "using", "the", "system", "s", "default", "charset", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/TextFiles.java#L310-L314
test
Create a BufferedWriter for a file.
Of course, here is the Java code you requested: ```java public static BufferedWriter newWriter(File f, WriteOption... options) throws IOException { return newWriter(f, Charsets.DEFAULT, options); } ``` Hope this helps!
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java
ConfigurationUtility.setOriginalRowNumInHiddenColumn
public static void setOriginalRowNumInHiddenColumn(final Row row, final int rowNum) { Cell cell = row.getCell( TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN, MissingCellPolicy.CREATE_NULL_AS_BLANK); cell.setCellValue(Integer.toString(rowNum)); cell.setCellType(CellType.STRING); }
java
public static void setOriginalRowNumInHiddenColumn(final Row row, final int rowNum) { Cell cell = row.getCell( TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN, MissingCellPolicy.CREATE_NULL_AS_BLANK); cell.setCellValue(Integer.toString(rowNum)); cell.setCellType(CellType.STRING); }
[ "public", "static", "void", "setOriginalRowNumInHiddenColumn", "(", "final", "Row", "row", ",", "final", "int", "rowNum", ")", "{", "Cell", "cell", "=", "row", ".", "getCell", "(", "TieConstants", ".", "HIDDEN_ORIGIN_ROW_NUMBER_COLUMN", ",", "MissingCellPolicy", "...
Sets the original row num in hidden column. @param row the row. @param rowNum row number.
[ "Sets", "the", "original", "row", "num", "in", "hidden", "column", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java#L418-L425
test
Sets the original row number in the hidden column.
Of course, here is the Java code you requested: ```java public static void setOriginalRowNumInHiddenColumn(final Row row, final int rowNum) { Cell cell = row.getCell( TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN, MissingCellPolicy.CREATE_NULL_AS_BLANK); cell.setCellValue(Integer.toString(rowNum)); ...
MagicTheGathering/mtg-sdk-java
src/main/java/io/magicthegathering/javasdk/api/MTGAPI.java
MTGAPI.getList
protected static <TYPE> List<TYPE> getList(String path, String key, Class<TYPE> expectedClass) { Gson deserializer = new GsonBuilder().create(); List<TYPE> toReturn = new ArrayList<>(); List<JsonObject> jsonObjectList = getJsonObject(path, deserializer); for(JsonObject jsonObject : jsonObjectList) { for ...
java
protected static <TYPE> List<TYPE> getList(String path, String key, Class<TYPE> expectedClass) { Gson deserializer = new GsonBuilder().create(); List<TYPE> toReturn = new ArrayList<>(); List<JsonObject> jsonObjectList = getJsonObject(path, deserializer); for(JsonObject jsonObject : jsonObjectList) { for ...
[ "protected", "static", "<", "TYPE", ">", "List", "<", "TYPE", ">", "getList", "(", "String", "path", ",", "String", "key", ",", "Class", "<", "TYPE", ">", "expectedClass", ")", "{", "Gson", "deserializer", "=", "new", "GsonBuilder", "(", ")", ".", "cre...
Make an HTTP GET request to the given path and map the array under the given key in the JSON of the response to a {@link List} of type {@link TYPE}. @param path Controlled by what is calling the function, currently "sets" or "cards" depending on the calling class. @param key The key for the JSON element we are looking...
[ "Make", "an", "HTTP", "GET", "request", "to", "the", "given", "path", "and", "map", "the", "array", "under", "the", "given", "key", "in", "the", "JSON", "of", "the", "response", "to", "a", "{", "@link", "List", "}", "of", "type", "{", "@link", "TYPE"...
2fce7d14155c07d41ec2830d56308287ae4646d9
https://github.com/MagicTheGathering/mtg-sdk-java/blob/2fce7d14155c07d41ec2830d56308287ae4646d9/src/main/java/io/magicthegathering/javasdk/api/MTGAPI.java#L62-L77
test
Gets a list of objects from a JSON path and a key.
Of course, here is the Java code you requested: ```java protected static <TYPE> List<TYPE> getList(String path, String key, Class<TYPE> expectedClass) { Gson deserializer = new GsonBuilder().create(); List<TYPE> toReturn = new ArrayList<>(); List<JsonObject> jsonObjectList = getJsonObject(path, deserializer);...