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
apache/parquet-mr
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
ParquetFileReader.readAllFootersInParallel
@Deprecated public static List<Footer> readAllFootersInParallel(Configuration configuration, FileStatus fileStatus, boolean skipRowGroups) throws IOException { List<FileStatus> statuses = listFiles(configuration, fileStatus); return readAllFootersInParallel(configuration, statuses, skipRowGroups); }
java
@Deprecated public static List<Footer> readAllFootersInParallel(Configuration configuration, FileStatus fileStatus, boolean skipRowGroups) throws IOException { List<FileStatus> statuses = listFiles(configuration, fileStatus); return readAllFootersInParallel(configuration, statuses, skipRowGroups); }
[ "@", "Deprecated", "public", "static", "List", "<", "Footer", ">", "readAllFootersInParallel", "(", "Configuration", "configuration", ",", "FileStatus", "fileStatus", ",", "boolean", "skipRowGroups", ")", "throws", "IOException", "{", "List", "<", "FileStatus", ">",...
Read the footers of all the files under that path (recursively) not using summary files. @param configuration a configuration @param fileStatus a file status to recursively list @param skipRowGroups whether to skip reading row group metadata @return a list of footers @throws IOException if an exception is thrown while...
[ "Read", "the", "footers", "of", "all", "the", "files", "under", "that", "path", "(", "recursively", ")", "not", "using", "summary", "files", "." ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java#L297-L301
test
Read all the footers in parallel.
Of course, here is the Java code you requested: ```java @Deprecated public static List<Footer> readAllFootersInParallel(Configuration configuration, FileStatus fileStatus, boolean skipRowGroups) throws IOException { List<FileStatus> statuses = listFiles(configuration, fileStatus); return readAllFootersInPara...
Unidata/thredds
cdm/src/main/java/ucar/unidata/util/StringUtil2.java
StringUtil2.replace
static public String replace(String x, char[] replaceChar, String[] replaceWith) { // common case no replacement boolean ok = true; for (char aReplaceChar : replaceChar) { int pos = x.indexOf(aReplaceChar); ok = (pos < 0); if (!ok) break; } if (ok) return x;...
java
static public String replace(String x, char[] replaceChar, String[] replaceWith) { // common case no replacement boolean ok = true; for (char aReplaceChar : replaceChar) { int pos = x.indexOf(aReplaceChar); ok = (pos < 0); if (!ok) break; } if (ok) return x;...
[ "static", "public", "String", "replace", "(", "String", "x", ",", "char", "[", "]", "replaceChar", ",", "String", "[", "]", "replaceWith", ")", "{", "// common case no replacement\r", "boolean", "ok", "=", "true", ";", "for", "(", "char", "aReplaceChar", ":"...
Replace all occurrences of any char in replaceChar with corresponding String in replaceWith @param x operate on this string @param replaceChar get rid of these @param replaceWith replace with these @return resulting string
[ "Replace", "all", "occurrences", "of", "any", "char", "in", "replaceChar", "with", "corresponding", "String", "in", "replaceWith" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/util/StringUtil2.java#L411-L433
test
Replaces all occurrences of the replaceChar in x with the replaceWith.
Of course, here is the Java code you requested: ```java static public String replace(String x, char[] replaceChar, String[] replaceWith) { // common case no replacement boolean ok = true; for (char aReplaceChar : replaceChar) { int pos = x.indexOf(aReplaceChar); ok = (pos < 0); if (...
ReactiveX/RxJava
src/main/java/io/reactivex/internal/queue/MpscLinkedQueue.java
MpscLinkedQueue.offer
@Override public boolean offer(final T e) { if (null == e) { throw new NullPointerException("Null is not a valid element"); } final LinkedQueueNode<T> nextNode = new LinkedQueueNode<T>(e); final LinkedQueueNode<T> prevProducerNode = xchgProducerNode(nextNode); // ...
java
@Override public boolean offer(final T e) { if (null == e) { throw new NullPointerException("Null is not a valid element"); } final LinkedQueueNode<T> nextNode = new LinkedQueueNode<T>(e); final LinkedQueueNode<T> prevProducerNode = xchgProducerNode(nextNode); // ...
[ "@", "Override", "public", "boolean", "offer", "(", "final", "T", "e", ")", "{", "if", "(", "null", "==", "e", ")", "{", "throw", "new", "NullPointerException", "(", "\"Null is not a valid element\"", ")", ";", "}", "final", "LinkedQueueNode", "<", "T", ">...
{@inheritDoc} <br> <p> IMPLEMENTATION NOTES:<br> Offer is allowed from multiple threads.<br> Offer allocates a new node and: <ol> <li>Swaps it atomically with current producer node (only one producer 'wins') <li>Sets the new node as the node following from the swapped producer node </ol> This works because each produce...
[ "{", "@inheritDoc", "}", "<br", ">", "<p", ">", "IMPLEMENTATION", "NOTES", ":", "<br", ">", "Offer", "is", "allowed", "from", "multiple", "threads", ".", "<br", ">", "Offer", "allocates", "a", "new", "node", "and", ":", "<ol", ">", "<li", ">", "Swaps",...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/queue/MpscLinkedQueue.java#L57-L68
test
Offer an element to the cache.
Of course, here is the Java code you requested: ```java @Override public boolean offer(final T e) { if (null == e) { throw new NullPointerException("Null is not a valid element"); } final LinkedQueueNode<T> nextNode = new LinkedQueueNode<T>(e); final LinkedQueueNode<T> p...
wro4j/wro4j
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/emberjs/EmberJs.java
EmberJs.getCompilerAsStream
@Override protected InputStream getCompilerAsStream() throws IOException { final Vector<InputStream> inputStreams = new Vector<InputStream>(); inputStreams.add(getWebjarLocator().locate(WebjarUriLocator.createUri("jquery.js"))); inputStreams.add(getWebjarLocator().locate(WebjarUriLocator.createUri("handle...
java
@Override protected InputStream getCompilerAsStream() throws IOException { final Vector<InputStream> inputStreams = new Vector<InputStream>(); inputStreams.add(getWebjarLocator().locate(WebjarUriLocator.createUri("jquery.js"))); inputStreams.add(getWebjarLocator().locate(WebjarUriLocator.createUri("handle...
[ "@", "Override", "protected", "InputStream", "getCompilerAsStream", "(", ")", "throws", "IOException", "{", "final", "Vector", "<", "InputStream", ">", "inputStreams", "=", "new", "Vector", "<", "InputStream", ">", "(", ")", ";", "inputStreams", ".", "add", "(...
{@inheritDoc}
[ "{" ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/emberjs/EmberJs.java#L48-L57
test
Get the compiler stream.
Of course, here is the Java code you requested: ```java @Override protected InputStream getCompilerAsStream() throws IOException { final Vector<InputStream> inputStreams = new Vector<InputStream>(); inputStreams.add(getWebjarLocator().locate(WebjarUriLocator.createUri("jquery.js"))); inputStreams.add(get...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/table/HidableTableColumnModel.java
HidableTableColumnModel.setColumnVisible
public void setColumnVisible(TableColumn column, boolean visible) { if (isColumnVisible(column) == visible) { return; // Visibility status did not change. } if (!visible) { super.removeColumn(column); } else { // find the visible index of the column:...
java
public void setColumnVisible(TableColumn column, boolean visible) { if (isColumnVisible(column) == visible) { return; // Visibility status did not change. } if (!visible) { super.removeColumn(column); } else { // find the visible index of the column:...
[ "public", "void", "setColumnVisible", "(", "TableColumn", "column", ",", "boolean", "visible", ")", "{", "if", "(", "isColumnVisible", "(", "column", ")", "==", "visible", ")", "{", "return", ";", "// Visibility status did not change.", "}", "if", "(", "!", "v...
listeners will receive columnAdded()/columnRemoved() event
[ "listeners", "will", "receive", "columnAdded", "()", "/", "columnRemoved", "()", "event" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/table/HidableTableColumnModel.java#L48-L80
test
Sets the visibility of the specified column.
Of course, here is the Java code you requested: ```java public void setColumnVisible(TableColumn column, boolean visible) { if (isColumnVisible(column) == visible) { return; // Visibility status did not change. } if (!visible) { super.removeColumn(column); } el...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.compose
@SuppressWarnings("unchecked") @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> compose(FlowableTransformer<? super T, ? extends R> composer) { return fromPublisher(((FlowableTransformer<T, R>) ObjectHelpe...
java
@SuppressWarnings("unchecked") @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> compose(FlowableTransformer<? super T, ? extends R> composer) { return fromPublisher(((FlowableTransformer<T, R>) ObjectHelpe...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "PASS_THROUGH", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Flowa...
Transform a Publisher by applying a particular Transformer function to it. <p> This method operates on the Publisher itself whereas {@link #lift} operates on the Publisher's Subscribers or Subscribers. <p> If the operator you are creating is designed to act on the individual items emitted by a source Publisher, use {@l...
[ "Transform", "a", "Publisher", "by", "applying", "a", "particular", "Transformer", "function", "to", "it", ".", "<p", ">", "This", "method", "operates", "on", "the", "Publisher", "itself", "whereas", "{", "@link", "#lift", "}", "operates", "on", "the", "Publ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L7151-L7157
test
Composes a single sequence of items from this source to a single sequence of items.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> compose(FlowableTransformer<? super T, ? extends R> composer) { retu...
chenlb/mmseg4j-from-googlecode
example/com/chenlb/mmseg4j/example/MergeDic.java
MergeDic.main
public static void main(String[] args) throws IOException { FileInputStream fis = new FileInputStream(new File("dic/word-with-attr.dic")); final Set<String> words = new TreeSet<String>(); final int[] num = {0}; FileLoading fl = new FileLoading() { public void row(String line, int n) { words.add(l...
java
public static void main(String[] args) throws IOException { FileInputStream fis = new FileInputStream(new File("dic/word-with-attr.dic")); final Set<String> words = new TreeSet<String>(); final int[] num = {0}; FileLoading fl = new FileLoading() { public void row(String line, int n) { words.add(l...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "IOException", "{", "FileInputStream", "fis", "=", "new", "FileInputStream", "(", "new", "File", "(", "\"dic/word-with-attr.dic\"", ")", ")", ";", "final", "Set", "<", "Strin...
尝试合并 sogou(去除了没有词性的) 与 rmmseg 的词库。 @throws IOException
[ "尝试合并", "sogou(去除了没有词性的)", "与", "rmmseg", "的词库。" ]
3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb
https://github.com/chenlb/mmseg4j-from-googlecode/blob/3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb/example/com/chenlb/mmseg4j/example/MergeDic.java#L19-L44
test
Main method that loads the dictionary.
Of course, here is the Java code you requested: ```java public static void main(String[] args) throws IOException { FileInputStream fis = new FileInputStream(new File("dic/word-with-attr.dic")); final Set<String> words = new TreeSet<String>(); final int[] num = {0}; FileLoading fl = new FileLoading() { ...
wildfly/wildfly
messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/deployment/injection/InjectedJMSContext.java
InjectedJMSContext.getTransactionSynchronizationRegistry
private TransactionSynchronizationRegistry getTransactionSynchronizationRegistry() { TransactionSynchronizationRegistry cachedTSR = transactionSynchronizationRegistry; if (cachedTSR == null) { cachedTSR = (TransactionSynchronizationRegistry) lookup(TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUP...
java
private TransactionSynchronizationRegistry getTransactionSynchronizationRegistry() { TransactionSynchronizationRegistry cachedTSR = transactionSynchronizationRegistry; if (cachedTSR == null) { cachedTSR = (TransactionSynchronizationRegistry) lookup(TRANSACTION_SYNCHRONIZATION_REGISTRY_LOOKUP...
[ "private", "TransactionSynchronizationRegistry", "getTransactionSynchronizationRegistry", "(", ")", "{", "TransactionSynchronizationRegistry", "cachedTSR", "=", "transactionSynchronizationRegistry", ";", "if", "(", "cachedTSR", "==", "null", ")", "{", "cachedTSR", "=", "(", ...
lookup the transactionSynchronizationRegistry and cache it.
[ "lookup", "the", "transactionSynchronizationRegistry", "and", "cache", "it", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/deployment/injection/InjectedJMSContext.java#L117-L124
test
Get the transaction synchronization registry.
Of course, here is the Java code you requested: ```java private TransactionSynchronizationRegistry getTransactionSynchronizationRegistry() { TransactionSynchronizationRegistry cachedTSR = transactionSynchronizationRegistry; if (cachedTSR == null) { cachedTSR = (TransactionSynchronizationReg...
eiichiro/bootleg
src/main/java/org/eiichiro/bootleg/AbstractRequest.java
AbstractRequest.convert
protected Object convert(Object object, Class<?> type) { try { return ConvertUtils.convert(object, type); } catch (Exception e) { logger.warn("Cannot convert [" + object + "] to [" + type + "]", e); return null; } }
java
protected Object convert(Object object, Class<?> type) { try { return ConvertUtils.convert(object, type); } catch (Exception e) { logger.warn("Cannot convert [" + object + "] to [" + type + "]", e); return null; } }
[ "protected", "Object", "convert", "(", "Object", "object", ",", "Class", "<", "?", ">", "type", ")", "{", "try", "{", "return", "ConvertUtils", ".", "convert", "(", "object", ",", "type", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "logg...
Converts the specified object to the specified type. This method is overridable. You can provide your own conversion to the parameter construction by overriding this method. @param object The object to be converted @param type The type to which the specified object be converted. @return The converted object.
[ "Converts", "the", "specified", "object", "to", "the", "specified", "type", ".", "This", "method", "is", "overridable", ".", "You", "can", "provide", "your", "own", "conversion", "to", "the", "parameter", "construction", "by", "overriding", "this", "method", "...
b98a108500597cb6185056be2eef7de5ba1963d2
https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/AbstractRequest.java#L445-L452
test
Convert the given object to the given type.
Of course, here is the Java code you requested: ```java protected Object convert(Object object, Class<?> type) { try { return ConvertUtils.convert(object, type); } catch (Exception e) { logger.warn("Cannot convert [" + object + "] to [" + type + "]", e); return null; } } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/thredds/inventory/filter/CompositeMFileFilter.java
CompositeMFileFilter.include
private boolean include(MFile mfile) { if (includeFilters == null) return true; for (MFileFilter filter : includeFilters) { if (filter.accept(mfile)) return true; } return false; }
java
private boolean include(MFile mfile) { if (includeFilters == null) return true; for (MFileFilter filter : includeFilters) { if (filter.accept(mfile)) return true; } return false; }
[ "private", "boolean", "include", "(", "MFile", "mfile", ")", "{", "if", "(", "includeFilters", "==", "null", ")", "return", "true", ";", "for", "(", "MFileFilter", "filter", ":", "includeFilters", ")", "{", "if", "(", "filter", ".", "accept", "(", "mfile...
inclusion is an OR
[ "inclusion", "is", "an", "OR" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/inventory/filter/CompositeMFileFilter.java#L61-L68
test
Returns true if the file is included in the include list.
Of course, here is the Java code you requested: ```java private boolean include(MFile mfile) { if (includeFilters == null) return true; for (MFileFilter filter : includeFilters) { if (filter.accept(mfile)) return true; } return false; } ``` Hope this helps!
jboss/jboss-common-core
src/main/java/org/jboss/util/graph/Graph.java
Graph.removeEdge
public boolean removeEdge(Vertex<T> from, Vertex<T> to) { Edge<T> e = from.findEdge(to); if (e == null) return false; else { from.remove(e); to.remove(e); edges.remove(e); return true; } }
java
public boolean removeEdge(Vertex<T> from, Vertex<T> to) { Edge<T> e = from.findEdge(to); if (e == null) return false; else { from.remove(e); to.remove(e); edges.remove(e); return true; } }
[ "public", "boolean", "removeEdge", "(", "Vertex", "<", "T", ">", "from", ",", "Vertex", "<", "T", ">", "to", ")", "{", "Edge", "<", "T", ">", "e", "=", "from", ".", "findEdge", "(", "to", ")", ";", "if", "(", "e", "==", "null", ")", "return", ...
Remove an Edge<T> from the graph @param from - the Edge<T> starting vertex @param to - the Edge<T> ending vertex @return true if the Edge<T> exists, false otherwise
[ "Remove", "an", "Edge<T", ">", "from", "the", "graph" ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/graph/Graph.java#L228-L240
test
Remove an edge from the graph.
Of course, here is the Java code you requested: ```java public boolean removeEdge(Vertex<T> from, Vertex<T> to) { Edge<T> e = from.findEdge(to); if (e == null) return false; else { from.remove(e); to.remove(e); edges.remove(e); return true; ...
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/AbstractClient.java
AbstractClient._request
private JSONObject _request(@NonNull Method m, @NonNull String url, @Nullable Map<String, String> urlParameters, @Nullable String json, @NonNull List<String> hostsArray, int connectTimeout, int readTimeout, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return _getJSONObjec...
java
private JSONObject _request(@NonNull Method m, @NonNull String url, @Nullable Map<String, String> urlParameters, @Nullable String json, @NonNull List<String> hostsArray, int connectTimeout, int readTimeout, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return _getJSONObjec...
[ "private", "JSONObject", "_request", "(", "@", "NonNull", "Method", "m", ",", "@", "NonNull", "String", "url", ",", "@", "Nullable", "Map", "<", "String", ",", "String", ">", "urlParameters", ",", "@", "Nullable", "String", "json", ",", "@", "NonNull", "...
Send the query according to parameters and returns its result as a JSONObject @param m HTTP Method to use @param url Endpoint URL, *without query string*. The query string is handled by `urlParameters`. @param urlParameters URL parameters @param json optional JSON Object to send @par...
[ "Send", "the", "query", "according", "to", "parameters", "and", "returns", "its", "result", "as", "a", "JSONObject" ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/AbstractClient.java#L502-L510
test
A request to a URL with parameters and JSON
Of course, here is the Java code you requested: ```java private JSONObject _request(@NonNull Method m, @NonNull String url, @Nullable Map<String, String> urlParameters, @Nullable String json, @NonNull List<String> hostsArray, int connectTimeout, int readTimeout, @Nullable RequestOptions requestOptions) throws AlgoliaE...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/preauth/AbstractPreAuthenticatedProcessingFilter.java
AbstractPreAuthenticatedProcessingFilter.principalChanged
protected boolean principalChanged(HttpServletRequest request, Authentication currentAuthentication) { Object principal = getPreAuthenticatedPrincipal(request); if ((principal instanceof String) && currentAuthentication.getName().equals(principal)) { return false; } if (principal != null && principal.equa...
java
protected boolean principalChanged(HttpServletRequest request, Authentication currentAuthentication) { Object principal = getPreAuthenticatedPrincipal(request); if ((principal instanceof String) && currentAuthentication.getName().equals(principal)) { return false; } if (principal != null && principal.equa...
[ "protected", "boolean", "principalChanged", "(", "HttpServletRequest", "request", ",", "Authentication", "currentAuthentication", ")", "{", "Object", "principal", "=", "getPreAuthenticatedPrincipal", "(", "request", ")", ";", "if", "(", "(", "principal", "instanceof", ...
Determines if the current principal has changed. The default implementation tries <ul> <li>If the {@link #getPreAuthenticatedPrincipal(HttpServletRequest)} is a String, the {@link Authentication#getName()} is compared against the pre authenticated principal</li> <li>Otherwise, the {@link #getPreAuthenticatedPrincipal(...
[ "Determines", "if", "the", "current", "principal", "has", "changed", ".", "The", "default", "implementation", "tries" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/preauth/AbstractPreAuthenticatedProcessingFilter.java#L140-L156
test
Checks if the pre - authenticated principal has changed to the current principal.
Of course, here is the Java code you requested: ```java protected boolean principalChanged(HttpServletRequest request, Authentication currentAuthentication) { Object principal = getPreAuthenticatedPrincipal(request); if ((principal instanceof String) && currentAuthentication.getName().equals(principal)) { ret...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/tools/diff/count/HollowFieldDiff.java
HollowFieldDiff.addResults
public void addResults(HollowFieldDiff otherFieldDiff) { for(int i=0;i<otherFieldDiff.getNumDiffs();i++) { addDiff(otherFieldDiff.getFromOrdinal(i), otherFieldDiff.getToOrdinal(i), otherFieldDiff.getPairScore(i)); } }
java
public void addResults(HollowFieldDiff otherFieldDiff) { for(int i=0;i<otherFieldDiff.getNumDiffs();i++) { addDiff(otherFieldDiff.getFromOrdinal(i), otherFieldDiff.getToOrdinal(i), otherFieldDiff.getPairScore(i)); } }
[ "public", "void", "addResults", "(", "HollowFieldDiff", "otherFieldDiff", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "otherFieldDiff", ".", "getNumDiffs", "(", ")", ";", "i", "++", ")", "{", "addDiff", "(", "otherFieldDiff", ".", "getFrom...
This should be called exclusively from the {@link HollowDiff}. Not for external consumption. @param otherFieldDiff the field diff to add
[ "This", "should", "be", "called", "exclusively", "from", "the", "{" ]
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/tools/diff/count/HollowFieldDiff.java#L118-L122
test
Add the results of the two HollowFieldDiff objects.
Of course, here is the Java code you requested: ```java public void addResults(HollowFieldDiff otherFieldDiff) { for(int i=0;i<otherFieldDiff.getNumDiffs();i++) { addDiff(otherFieldDiff.getFromOrdinal(i), otherFieldDiff.getToOrdinal(i), otherFieldDiff.getPairScore(i)); } } ``` Hope thi...
jcodec/jcodec
src/main/java/org/jcodec/codecs/h264/decode/aso/SliceGroupMapBuilder.java
SliceGroupMapBuilder.buildDispersedMap
public static int[] buildDispersedMap(int picWidthInMbs, int picHeightInMbs, int numSliceGroups) { int picSizeInMbs = picWidthInMbs * picHeightInMbs; int[] groups = new int[picSizeInMbs]; for (int i = 0; i < picSizeInMbs; i++) { int group = ((i % picWidthInMbs) + (((i / picWidthInM...
java
public static int[] buildDispersedMap(int picWidthInMbs, int picHeightInMbs, int numSliceGroups) { int picSizeInMbs = picWidthInMbs * picHeightInMbs; int[] groups = new int[picSizeInMbs]; for (int i = 0; i < picSizeInMbs; i++) { int group = ((i % picWidthInMbs) + (((i / picWidthInM...
[ "public", "static", "int", "[", "]", "buildDispersedMap", "(", "int", "picWidthInMbs", ",", "int", "picHeightInMbs", ",", "int", "numSliceGroups", ")", "{", "int", "picSizeInMbs", "=", "picWidthInMbs", "*", "picHeightInMbs", ";", "int", "[", "]", "groups", "="...
A dispersed map. Every odd line starts from the (N / 2)th group Example: 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1 0, 1, 2, 3, 0, 1, 2, 3 2, 3, 0, 1, 2, 3, 0, 1
[ "A", "dispersed", "map", ".", "Every", "odd", "line", "starts", "from", "the", "(", "N", "/", "2", ")", "th", "group" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/decode/aso/SliceGroupMapBuilder.java#L55-L66
test
Build a dispersed map of the image size in meters and the number of slice groups.
Of course, here is the Java code you requested: ```java public static int[] buildDispersedMap(int picWidthInMbs, int picHeightInMbs, int numSliceGroups) { int picSizeInMbs = picWidthInMbs * picHeightInMbs; int[] groups = new int[picSizeInMbs]; for (int i = 0; i < picSizeInMbs; i++) { ...
Unidata/thredds
ui/src/main/java/thredds/ui/catalog/CatalogChooser.java
CatalogChooser.save
public void save() { if (catListBox != null) catListBox.save(); if (prefs != null) { if (fileChooser != null) fileChooser.save(); if (catgenFileChooser != null) catgenFileChooser.save(); prefs.putInt(HDIVIDER, split.getDividerLocation()); } }
java
public void save() { if (catListBox != null) catListBox.save(); if (prefs != null) { if (fileChooser != null) fileChooser.save(); if (catgenFileChooser != null) catgenFileChooser.save(); prefs.putInt(HDIVIDER, split.getDividerLocation()); } }
[ "public", "void", "save", "(", ")", "{", "if", "(", "catListBox", "!=", "null", ")", "catListBox", ".", "save", "(", ")", ";", "if", "(", "prefs", "!=", "null", ")", "{", "if", "(", "fileChooser", "!=", "null", ")", "fileChooser", ".", "save", "(",...
Save persistent state.
[ "Save", "persistent", "state", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/thredds/ui/catalog/CatalogChooser.java#L311-L321
test
Save the content of the CatCTYPE
Of course, here is the Java code you requested: ```java public void save() { if (catListBox != null) catListBox.save(); if (prefs != null) { if (fileChooser != null) fileChooser.save(); if (catgenFileChooser != null) catgenFileChooser.save(); prefs.putInt(HDIVIDER, split.getD...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/coord/CoordinateTimeIntv.java
CoordinateTimeIntv.makeCalendarDateRange
@Override public CalendarDateRange makeCalendarDateRange(ucar.nc2.time.Calendar cal) { CalendarDateUnit cdu = CalendarDateUnit.of(cal, timeUnit.getField(), refDate); CalendarDate start = cdu.makeCalendarDate( timeUnit.getValue() * timeIntervals.get(0).getBounds2()); CalendarDate end = cdu.makeCalendarDate...
java
@Override public CalendarDateRange makeCalendarDateRange(ucar.nc2.time.Calendar cal) { CalendarDateUnit cdu = CalendarDateUnit.of(cal, timeUnit.getField(), refDate); CalendarDate start = cdu.makeCalendarDate( timeUnit.getValue() * timeIntervals.get(0).getBounds2()); CalendarDate end = cdu.makeCalendarDate...
[ "@", "Override", "public", "CalendarDateRange", "makeCalendarDateRange", "(", "ucar", ".", "nc2", ".", "time", ".", "Calendar", "cal", ")", "{", "CalendarDateUnit", "cdu", "=", "CalendarDateUnit", ".", "of", "(", "cal", ",", "timeUnit", ".", "getField", "(", ...
Make calendar date range, using the first and last ending bounds @param cal optional calendar, may be null @return calendar date range
[ "Make", "calendar", "date", "range", "using", "the", "first", "and", "last", "ending", "bounds" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/coord/CoordinateTimeIntv.java#L105-L111
test
Create a CalendarDateRange from a Calendar.
Of course, here is the Java code you requested: ```java @Override public CalendarDateRange makeCalendarDateRange(ucar.nc2.time.Calendar cal) { CalendarDateUnit cdu = CalendarDateUnit.of(cal, timeUnit.getField(), refDate); CalendarDate start = cdu.makeCalendarDate( timeUnit.getValue() * timeIntervals.get(0).g...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/transform/AbstractTransformBuilder.java
AbstractTransformBuilder.addParameter
protected boolean addParameter(CoordinateTransform rs, String paramName, NetcdfFile ds, String varNameEscaped) { if (null == (ds.findVariable(varNameEscaped))) { if (null != errBuffer) errBuffer.format("CoordTransBuilder %s: no Variable named %s%n", getTransformName(), varNameEscaped); return fa...
java
protected boolean addParameter(CoordinateTransform rs, String paramName, NetcdfFile ds, String varNameEscaped) { if (null == (ds.findVariable(varNameEscaped))) { if (null != errBuffer) errBuffer.format("CoordTransBuilder %s: no Variable named %s%n", getTransformName(), varNameEscaped); return fa...
[ "protected", "boolean", "addParameter", "(", "CoordinateTransform", "rs", ",", "String", "paramName", ",", "NetcdfFile", "ds", ",", "String", "varNameEscaped", ")", "{", "if", "(", "null", "==", "(", "ds", ".", "findVariable", "(", "varNameEscaped", ")", ")", ...
Add a Parameter to a CoordinateTransform. Make sure that the variable exists. If readData is true, read the data and use it as the value of the parameter, otherwise use the variable name as the value of the parameter. @param rs the CoordinateTransform @param paramName the parameter name @param ds ...
[ "Add", "a", "Parameter", "to", "a", "CoordinateTransform", ".", "Make", "sure", "that", "the", "variable", "exists", ".", "If", "readData", "is", "true", "read", "the", "data", "and", "use", "it", "as", "the", "value", "of", "the", "parameter", "otherwise"...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/transform/AbstractTransformBuilder.java#L152-L161
test
Add a parameter to the coordinate transform
Of course, here is the Java code you requested: ```java protected boolean addParameter(CoordinateTransform rs, String paramName, NetcdfFile ds, String varNameEscaped) { if (null == (ds.findVariable(varNameEscaped))) { if (null != errBuffer) errBuffer.format("CoordTransBuilder %s: no Variable named %s...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocumentHelper.java
ODocumentHelper.hasSameContentOf
@SuppressWarnings("unchecked") public static boolean hasSameContentOf(final ODocument iCurrent, final ODatabaseDocumentInternal iMyDb, final ODocument iOther, final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper, final boolean iCheckAlsoIdentity) { if (iOther == null) return false; ...
java
@SuppressWarnings("unchecked") public static boolean hasSameContentOf(final ODocument iCurrent, final ODatabaseDocumentInternal iMyDb, final ODocument iOther, final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper, final boolean iCheckAlsoIdentity) { if (iOther == null) return false; ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "boolean", "hasSameContentOf", "(", "final", "ODocument", "iCurrent", ",", "final", "ODatabaseDocumentInternal", "iMyDb", ",", "final", "ODocument", "iOther", ",", "final", "ODatabaseDocumentInterna...
Makes a deep comparison field by field to check if the passed ODocument instance is identical in the content to the current one. Instead equals() just checks if the RID are the same. @param iOther ODocument instance @return true if the two document are identical, otherwise false @see #equals(Object)
[ "Makes", "a", "deep", "comparison", "field", "by", "field", "to", "check", "if", "the", "passed", "ODocument", "instance", "is", "identical", "in", "the", "content", "to", "the", "current", "one", ".", "Instead", "equals", "()", "just", "checks", "if", "th...
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocumentHelper.java#L1038-L1128
test
Checks if the two documents are the same content of the other document.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static boolean hasSameContentOf(final ODocument iCurrent, final ODatabaseDocumentInternal iMyDb, final ODocument iOther, final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper, final boolean iCheckAlsoIdentit...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
NetcdfDataset.dumpClasses
void dumpClasses(Group g, PrintWriter out) { out.println("Dimensions:"); for (Dimension ds : g.getDimensions()) { out.println(" " + ds.getShortName() + " " + ds.getClass().getName()); } out.println("Atributes:"); for (Attribute a : g.getAttributes()) { out.println(" " + a.getShortNam...
java
void dumpClasses(Group g, PrintWriter out) { out.println("Dimensions:"); for (Dimension ds : g.getDimensions()) { out.println(" " + ds.getShortName() + " " + ds.getClass().getName()); } out.println("Atributes:"); for (Attribute a : g.getAttributes()) { out.println(" " + a.getShortNam...
[ "void", "dumpClasses", "(", "Group", "g", ",", "PrintWriter", "out", ")", "{", "out", ".", "println", "(", "\"Dimensions:\"", ")", ";", "for", "(", "Dimension", "ds", ":", "g", ".", "getDimensions", "(", ")", ")", "{", "out", ".", "println", "(", "\"...
/* Debugging: get the information from parsing @return NetcdfDatasetInfo object public NetcdfDatasetInfo getInfo() { return new NetcdfDatasetInfo(this); }
[ "/", "*", "Debugging", ":", "get", "the", "information", "from", "parsing" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java#L1512-L1532
test
Dump classes of a group.
Of course, here is the Java code you requested: ```java void dumpClasses(Group g, PrintWriter out) { out.println("Dimensions:"); for (Dimension ds : g.getDimensions()) { out.println(" " + ds.getShortName() + " " + ds.getClass().getName()); } out.println("Atributes:"); for (Attribute a : g....
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java
ClassWriter.replaceAsmInstructions
private byte[] replaceAsmInstructions(final byte[] classFile, final boolean hasFrames) { final Attribute[] attributes = getAttributePrototypes(); firstField = null; lastField = null; firstMethod = null; lastMethod = null; lastRuntimeVisibleAnnotation = null; lastRuntimeInvisibleAnnotation = ...
java
private byte[] replaceAsmInstructions(final byte[] classFile, final boolean hasFrames) { final Attribute[] attributes = getAttributePrototypes(); firstField = null; lastField = null; firstMethod = null; lastMethod = null; lastRuntimeVisibleAnnotation = null; lastRuntimeInvisibleAnnotation = ...
[ "private", "byte", "[", "]", "replaceAsmInstructions", "(", "final", "byte", "[", "]", "classFile", ",", "final", "boolean", "hasFrames", ")", "{", "final", "Attribute", "[", "]", "attributes", "=", "getAttributePrototypes", "(", ")", ";", "firstField", "=", ...
Returns the equivalent of the given class file, with the ASM specific instructions replaced with standard ones. This is done with a ClassReader -&gt; ClassWriter round trip. @param classFile a class file containing ASM specific instructions, generated by this ClassWriter. @param hasFrames whether there is at least one...
[ "Returns", "the", "equivalent", "of", "the", "given", "class", "file", "with", "the", "ASM", "specific", "instructions", "replaced", "with", "standard", "ones", ".", "This", "is", "done", "with", "a", "ClassReader", "-", "&gt", ";", "ClassWriter", "round", "...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java#L675-L697
test
Replace ASM instructions.
Of course, here is the Java code you requested: ```java private byte[] replaceAsmInstructions(final byte[] classFile, final boolean hasFrames) { final Attribute[] attributes = getAttributePrototypes(); firstField = null; lastField = null; firstMethod = null; lastMethod = null; lastRuntimeVisibl...
Unidata/thredds
cdm/src/main/java/ucar/atd/dorade/DoradeSWIB.java
DoradeSWIB.getAltitudes
public float[] getAltitudes() { if (myASIBs == null) return null; float[] alts = new float[nRays]; for (int i = 0; i < nRays; i++) alts[i] = myASIBs[i].getAltitude(); return alts; }
java
public float[] getAltitudes() { if (myASIBs == null) return null; float[] alts = new float[nRays]; for (int i = 0; i < nRays; i++) alts[i] = myASIBs[i].getAltitude(); return alts; }
[ "public", "float", "[", "]", "getAltitudes", "(", ")", "{", "if", "(", "myASIBs", "==", "null", ")", "return", "null", ";", "float", "[", "]", "alts", "=", "new", "float", "[", "nRays", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<",...
Get the array of per-ray altitudes. If we do not have per-ray position information, null is returned. @return an array of per-ray altitudes in km MSL, or null if no per-ray position information is available.
[ "Get", "the", "array", "of", "per", "-", "ray", "altitudes", ".", "If", "we", "do", "not", "have", "per", "-", "ray", "position", "information", "null", "is", "returned", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/atd/dorade/DoradeSWIB.java#L193-L200
test
Get the altitude values of the ASIBs.
Of course, here is the Java code you requested: ```java public float[] getAltitudes() { if (myASIBs == null) return null; float[] alts = new float[nRays]; for (int i = 0; i < nRays; i++) alts[i] = myASIBs[i].getAltitude(); return alts; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java
GradsDataDescriptorFile.swapByteOrder
private void swapByteOrder() { // NB: we are setting bigEndian to be opposite the system arch String arch = System.getProperty("os.arch"); if (arch.equals("x86") || // Windows, Linux arch.equals("arm") || // Window CE arch.equals("x86_64") || ...
java
private void swapByteOrder() { // NB: we are setting bigEndian to be opposite the system arch String arch = System.getProperty("os.arch"); if (arch.equals("x86") || // Windows, Linux arch.equals("arm") || // Window CE arch.equals("x86_64") || ...
[ "private", "void", "swapByteOrder", "(", ")", "{", "// NB: we are setting bigEndian to be opposite the system arch\r", "String", "arch", "=", "System", ".", "getProperty", "(", "\"os.arch\"", ")", ";", "if", "(", "arch", ".", "equals", "(", "\"x86\"", ")", "||", "...
Swap the byte order from the system default
[ "Swap", "the", "byte", "order", "from", "the", "system", "default" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java#L587-L599
test
Swap byte order for the
Of course, here is the Java code you requested: ```java private void swapByteOrder() { // NB: we are setting bigEndian to be opposite the system arch String arch = System.getProperty("os.arch"); if (arch.equals("x86") || // Windows, Linux arch.equals("arm") || ...
kocakosm/pitaya
src/org/kocakosm/pitaya/collection/ImmutableList.java
ImmutableList.copyOf
public static <E> List<E> copyOf(Collection<? extends E> c) { return new ImmutableList<E>(new ArrayList<E>(c)); }
java
public static <E> List<E> copyOf(Collection<? extends E> c) { return new ImmutableList<E>(new ArrayList<E>(c)); }
[ "public", "static", "<", "E", ">", "List", "<", "E", ">", "copyOf", "(", "Collection", "<", "?", "extends", "E", ">", "c", ")", "{", "return", "new", "ImmutableList", "<", "E", ">", "(", "new", "ArrayList", "<", "E", ">", "(", "c", ")", ")", ";...
Creates a new {@code ImmutableList} from the given {@code Collection}. @param <E> the type of the {@code List}'s elements. @param c the source {@code Collection}. @return the created {@code ImmutableList}. @throws NullPointerException if {@code c} is {@code null}.
[ "Creates", "a", "new", "{", "@code", "ImmutableList", "}", "from", "the", "given", "{", "@code", "Collection", "}", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/collection/ImmutableList.java#L225-L228
test
Creates a new immutable list of the specified collection.
Of course, here is the Java code you requested: ```java public static <E> List<E> copyOf(Collection<? extends E> c) { return new ImmutableList<E>(new ArrayList<E>(c)); } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/io/Scanf.java
Scanf.readString
public static String readString(Charset charset) throws IOException { Reader in = new InputStreamReader(System.in, charset); BufferedReader reader = new BufferedReader(in); try { return reader.readLine(); } finally { reader.close(); } }
java
public static String readString(Charset charset) throws IOException { Reader in = new InputStreamReader(System.in, charset); BufferedReader reader = new BufferedReader(in); try { return reader.readLine(); } finally { reader.close(); } }
[ "public", "static", "String", "readString", "(", "Charset", "charset", ")", "throws", "IOException", "{", "Reader", "in", "=", "new", "InputStreamReader", "(", "System", ".", "in", ",", "charset", ")", ";", "BufferedReader", "reader", "=", "new", "BufferedRead...
Reads the next line from the standard input using the given charset. @param charset the charset to use. @return the next line read from the standard input. @throws NullPointerException if {@code charset} is {@code null}. @throws IOException if the standard input cannot be read.
[ "Reads", "the", "next", "line", "from", "the", "standard", "input", "using", "the", "given", "charset", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/Scanf.java#L61-L70
test
Read a string from the system in using the specified charset.
Of course, here is the Java code you requested: ```java public static String readString(Charset charset) throws IOException { Reader in = new InputStreamReader(System.in, charset); BufferedReader reader = new BufferedReader(in); try { return reader.readLine(); } finally { reader.close(); } } ``` Hop...
chrisbanes/Android-PullToRefresh
library/src/com/handmark/pulltorefresh/library/PullToRefreshBase.java
PullToRefreshBase.createLoadingLayoutProxy
protected LoadingLayoutProxy createLoadingLayoutProxy(final boolean includeStart, final boolean includeEnd) { LoadingLayoutProxy proxy = new LoadingLayoutProxy(); if (includeStart && mMode.showHeaderLoadingLayout()) { proxy.addLayout(mHeaderLayout); } if (includeEnd && mMode.showFooterLoadingLayout()) { ...
java
protected LoadingLayoutProxy createLoadingLayoutProxy(final boolean includeStart, final boolean includeEnd) { LoadingLayoutProxy proxy = new LoadingLayoutProxy(); if (includeStart && mMode.showHeaderLoadingLayout()) { proxy.addLayout(mHeaderLayout); } if (includeEnd && mMode.showFooterLoadingLayout()) { ...
[ "protected", "LoadingLayoutProxy", "createLoadingLayoutProxy", "(", "final", "boolean", "includeStart", ",", "final", "boolean", "includeEnd", ")", "{", "LoadingLayoutProxy", "proxy", "=", "new", "LoadingLayoutProxy", "(", ")", ";", "if", "(", "includeStart", "&&", ...
Used internally for {@link #getLoadingLayoutProxy(boolean, boolean)}. Allows derivative classes to include any extra LoadingLayouts.
[ "Used", "internally", "for", "{" ]
3bd8ef6869c3297bfe874d2f15c2ee53c3456e99
https://github.com/chrisbanes/Android-PullToRefresh/blob/3bd8ef6869c3297bfe874d2f15c2ee53c3456e99/library/src/com/handmark/pulltorefresh/library/PullToRefreshBase.java#L597-L608
test
Creates a loading layout proxy.
Of course, here is the Java code you requested: ```java protected LoadingLayoutProxy createLoadingLayoutProxy(final boolean includeStart, final boolean includeEnd) { LoadingLayoutProxy proxy = new LoadingLayoutProxy(); if (includeStart && mMode.showHeaderLoadingLayout()) { proxy.addLayout(mHeaderLayout); } ...
Unidata/thredds
cdm/src/main/java/ucar/ma2/ArrayObject.java
ArrayObject.copyFrom1DJavaArray
protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray) { Object[] ja = (Object []) javaArray; for (Object aJa : ja) iter.setObjectNext(aJa); }
java
protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray) { Object[] ja = (Object []) javaArray; for (Object aJa : ja) iter.setObjectNext(aJa); }
[ "protected", "void", "copyFrom1DJavaArray", "(", "IndexIterator", "iter", ",", "Object", "javaArray", ")", "{", "Object", "[", "]", "ja", "=", "(", "Object", "[", "]", ")", "javaArray", ";", "for", "(", "Object", "aJa", ":", "ja", ")", "iter", ".", "se...
copy from javaArray to storage using the iterator: used by factory( Object);
[ "copy", "from", "javaArray", "to", "storage", "using", "the", "iterator", ":", "used", "by", "factory", "(", "Object", ")", ";" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/ArrayObject.java#L116-L119
test
Copy the contents of a 1D Java array to the index iterator.
Of course, here is the Java code you requested: ```java protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray) { Object[] ja = (Object []) javaArray; for (Object aJa : ja) iter.setObjectNext(aJa); } ``` Hope this helps!
Unidata/thredds
opendap/src/main/java/opendap/servers/SDSequence.java
SDSequence.printVal
public void printVal(PrintWriter os, String space, boolean print_decl_p) { if (!isProject()) return; if (print_decl_p) { printDecl(os, space, false, true); os.print(" = "); } os.print("{ "); try { boolean firstPass = true; ...
java
public void printVal(PrintWriter os, String space, boolean print_decl_p) { if (!isProject()) return; if (print_decl_p) { printDecl(os, space, false, true); os.print(" = "); } os.print("{ "); try { boolean firstPass = true; ...
[ "public", "void", "printVal", "(", "PrintWriter", "os", ",", "String", "space", ",", "boolean", "print_decl_p", ")", "{", "if", "(", "!", "isProject", "(", ")", ")", "return", ";", "if", "(", "print_decl_p", ")", "{", "printDecl", "(", "os", ",", "spac...
Prints the value of the variable, with its declaration. This function is primarily intended for debugging OPeNDAP applications and text-based clients such as geturl. <p/> <h2> Important Note</h2> This method overrides the BaseType method of the same name and type signature and it significantly changes the behavior for...
[ "Prints", "the", "value", "of", "the", "variable", "with", "its", "declaration", ".", "This", "function", "is", "primarily", "intended", "for", "debugging", "OPeNDAP", "applications", "and", "text", "-", "based", "clients", "such", "as", "geturl", ".", "<p", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/SDSequence.java#L196-L233
test
Print the value of the Sequence.
Of course, here is the Java code you requested: ```java public void printVal(PrintWriter os, String space, boolean print_decl_p) { if (!isProject()) return; if (print_decl_p) { printDecl(os, space, false, true); os.print(" = "); } os.print("{ "); ...
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.startWith
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final <T> Observable<T> startWith(Observable<T> other) { ObjectHelper.requireNonNull(other, "other is null"); return other.concatWith(this.<T>toObservable()); }
java
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final <T> Observable<T> startWith(Observable<T> other) { ObjectHelper.requireNonNull(other, "other is null"); return other.concatWith(this.<T>toObservable()); }
[ "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "T", ">", "Observable", "<", "T", ">", "startWith", "(", "Observable", "<", "T", ">", "other", ")", "{", "ObjectHelper", "....
Returns an Observable which first delivers the events of the other Observable then runs this CompletableConsumable. <p> <img width="640" height="289" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.startWith.o.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>{@code startWith} does not ...
[ "Returns", "an", "Observable", "which", "first", "delivers", "the", "events", "of", "the", "other", "Observable", "then", "runs", "this", "CompletableConsumable", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "289", "src", "=", "https", ":", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L2228-L2234
test
Returns an observable that is composed of the elements of this observable that start with the elements of the other observable.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final <T> Observable<T> startWith(Observable<T> other) { ObjectHelper.requireNonNull(other, "other is null"); return other.concatWith(this.<T>toObservable()); ...
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/helper/StreamHelper.java
StreamHelper.copy
public static long copy(InputStream inputStream, OutputStream outputStream, int bufferSize) throws IOException { byte[] buffer = new byte[bufferSize]; long count = 0; int n; while ( -1 != ( n = inputStream.read( buffer ) ) ) { outputStream.write( buffer, 0, n ); count += n; } return count; }
java
public static long copy(InputStream inputStream, OutputStream outputStream, int bufferSize) throws IOException { byte[] buffer = new byte[bufferSize]; long count = 0; int n; while ( -1 != ( n = inputStream.read( buffer ) ) ) { outputStream.write( buffer, 0, n ); count += n; } return count; }
[ "public", "static", "long", "copy", "(", "InputStream", "inputStream", ",", "OutputStream", "outputStream", ",", "int", "bufferSize", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "bufferSize", "]", ";", "long", "cou...
input->output字节流copy @param inputStream @param outputStream @param bufferSize @return @throws IOException
[ "input", "-", ">", "output字节流copy" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/helper/StreamHelper.java#L145-L155
test
Copy the contents of the given input stream to the given output stream.
Of course, here is the Java code you requested: ```java public static long copy(InputStream inputStream, OutputStream outputStream, int bufferSize) throws IOException { byte[] buffer = new byte[bufferSize]; long count = 0; int n; while ( -1 != ( n = inputStream.read( buffer ) ) ) { outputStream.write( buffe...
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/mathutils/RegulaFalsiRootFinder.java
RegulaFalsiRootFinder.computeNextPosition
@Override protected void computeNextPosition () { m_fPrevXFalse = m_fXFalse; m_fXFalse = m_fXPos - m_fPos * (m_fXNeg - m_fXPos) / (m_fNeg - m_fPos); m_fFalse = m_aFunction.at (m_fXFalse); }
java
@Override protected void computeNextPosition () { m_fPrevXFalse = m_fXFalse; m_fXFalse = m_fXPos - m_fPos * (m_fXNeg - m_fXPos) / (m_fNeg - m_fPos); m_fFalse = m_aFunction.at (m_fXFalse); }
[ "@", "Override", "protected", "void", "computeNextPosition", "(", ")", "{", "m_fPrevXFalse", "=", "m_fXFalse", ";", "m_fXFalse", "=", "m_fXPos", "-", "m_fPos", "*", "(", "m_fXNeg", "-", "m_fXPos", ")", "/", "(", "m_fNeg", "-", "m_fPos", ")", ";", "m_fFalse...
Compute the next position of x-false.
[ "Compute", "the", "next", "position", "of", "x", "-", "false", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/mathutils/RegulaFalsiRootFinder.java#L177-L183
test
Compute the next position of the node.
Of course, here is the Java code you requested: ```java @Override protected void computeNextPosition () { m_fPrevXFalse = m_fXFalse; m_fXFalse = m_fXPos - m_fPos * (m_fXNeg - m_fXPos) / (m_fNeg - m_fPos); m_fFalse = m_aFunction.at (m_fXFalse); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/util/ClassLoaderUtil.java
ClassLoaderUtil.getResourceAsStream
public static InputStream getResourceAsStream(final String resourceName, final ClassLoader callingClass, final boolean useCache) throws IOException { URL url = getResourceUrl(resourceName, callingClass); if (url != null) { URLConnection urlConnection = url.openConnection(); urlConnection.setUseCaches(useCache...
java
public static InputStream getResourceAsStream(final String resourceName, final ClassLoader callingClass, final boolean useCache) throws IOException { URL url = getResourceUrl(resourceName, callingClass); if (url != null) { URLConnection urlConnection = url.openConnection(); urlConnection.setUseCaches(useCache...
[ "public", "static", "InputStream", "getResourceAsStream", "(", "final", "String", "resourceName", ",", "final", "ClassLoader", "callingClass", ",", "final", "boolean", "useCache", ")", "throws", "IOException", "{", "URL", "url", "=", "getResourceUrl", "(", "resource...
Opens a resource of the specified name for reading. Controls caching, that is important when the same jar is reloaded using custom classloader.
[ "Opens", "a", "resource", "of", "the", "specified", "name", "for", "reading", ".", "Controls", "caching", "that", "is", "important", "when", "the", "same", "jar", "is", "reloaded", "using", "custom", "classloader", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ClassLoaderUtil.java#L358-L366
test
Get the resource with the specified name using the specified class loader.
Of course, here is the Java code you requested: ```java public static InputStream getResourceAsStream(final String resourceName, final ClassLoader callingClass, final boolean useCache) throws IOException { URL url = getResourceUrl(resourceName, callingClass); if (url != null) { URLConnection urlConnection = url...
google/guice
core/src/com/google/inject/Key.java
Key.get
public static Key<?> get(Type type, Annotation annotation) { return new Key<Object>(type, strategyFor(annotation)); }
java
public static Key<?> get(Type type, Annotation annotation) { return new Key<Object>(type, strategyFor(annotation)); }
[ "public", "static", "Key", "<", "?", ">", "get", "(", "Type", "type", ",", "Annotation", "annotation", ")", "{", "return", "new", "Key", "<", "Object", ">", "(", "type", ",", "strategyFor", "(", "annotation", ")", ")", ";", "}" ]
Gets a key for an injection type and an annotation.
[ "Gets", "a", "key", "for", "an", "injection", "type", "and", "an", "annotation", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/Key.java#L238-L240
test
Gets a key for the given type and annotation.
Of course, here is the Java code you requested: ```java public static Key<?> get(Type type, Annotation annotation) { return new Key<Object>(type, strategyFor(annotation)); } ``` Hope this helps!
streamsets/datacollector
thycotic-credentialstore-lib/src/main/java/com/streamsets/datacollector/credential/thycotic/api/AuthRenewalTask.java
AuthRenewalTask.getAccessToken
public String getAccessToken() { if (System.currentTimeMillis() > getExpireTime()) { try { synchronized (this) { if (System.currentTimeMillis() > getExpireTime()) { accessToken = fetchAccessToken(); if (accessToken != null && !accessToken.isEmpty()) { ex...
java
public String getAccessToken() { if (System.currentTimeMillis() > getExpireTime()) { try { synchronized (this) { if (System.currentTimeMillis() > getExpireTime()) { accessToken = fetchAccessToken(); if (accessToken != null && !accessToken.isEmpty()) { ex...
[ "public", "String", "getAccessToken", "(", ")", "{", "if", "(", "System", ".", "currentTimeMillis", "(", ")", ">", "getExpireTime", "(", ")", ")", "{", "try", "{", "synchronized", "(", "this", ")", "{", "if", "(", "System", ".", "currentTimeMillis", "(",...
<p> Scheduler is not used since a dedicated thread will be running to update the token.Even if the thycotic server is not being used,the thread will hit for every refresh interval to get a new access token. So instead <tt>volatile</tt> variables are used to store the token.So only when the token expires, thycotic serve...
[ "<p", ">", "Scheduler", "is", "not", "used", "since", "a", "dedicated", "thread", "will", "be", "running", "to", "update", "the", "token", ".", "Even", "if", "the", "thycotic", "server", "is", "not", "being", "used", "the", "thread", "will", "hit", "for"...
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/thycotic-credentialstore-lib/src/main/java/com/streamsets/datacollector/credential/thycotic/api/AuthRenewalTask.java#L70-L86
test
Get the access token from the server.
Of course, here is the Java code you requested: ```java public String getAccessToken() { if (System.currentTimeMillis() > getExpireTime()) { try { synchronized (this) { if (System.currentTimeMillis() > getExpireTime()) { accessToken = fetchAccessToken(); if (accessTo...
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/container/management/jmx/TraceMBeanImpl.java
TraceMBeanImpl.isTracerDefined
public boolean isTracerDefined(NotificationSource src, String tracerName) throws ManagementException { TracerStorage ts = this.tracerStorage.get(src); if (ts == null) { throw new ManagementException("NotificationSource has been uninstalled from SLEE. Can not create tracer."); } return ts.isTracerDefin...
java
public boolean isTracerDefined(NotificationSource src, String tracerName) throws ManagementException { TracerStorage ts = this.tracerStorage.get(src); if (ts == null) { throw new ManagementException("NotificationSource has been uninstalled from SLEE. Can not create tracer."); } return ts.isTracerDefin...
[ "public", "boolean", "isTracerDefined", "(", "NotificationSource", "src", ",", "String", "tracerName", ")", "throws", "ManagementException", "{", "TracerStorage", "ts", "=", "this", ".", "tracerStorage", ".", "get", "(", "src", ")", ";", "if", "(", "ts", "==",...
/* (non-Javadoc) @see org.mobicents.slee.container.management.jmx.TraceManagement#isTracerDefined(javax.slee.management.NotificationSource, java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/container/management/jmx/TraceMBeanImpl.java#L474-L481
test
Checks if a tracer is defined for a notification source.
Of course, here is the Java code you requested: ```java public boolean isTracerDefined(NotificationSource src, String tracerName) throws ManagementException { TracerStorage ts = this.tracerStorage.get(src); if (ts == null) { throw new ManagementException("NotificationSource has been uninstalled from SLEE. Ca...
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java
ObjectFactory.createGrundstueckEmpfohleneNutzungMehrfamilienhaus
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Mehrfamilienhaus", scope = GrundstueckEmpfohleneNutzung.class) public JAXBElement<Object> createGrundstueckEmpfohleneNutzungMehrfamilienhaus(Object value) { return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungM...
java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Mehrfamilienhaus", scope = GrundstueckEmpfohleneNutzung.class) public JAXBElement<Object> createGrundstueckEmpfohleneNutzungMehrfamilienhaus(Object value) { return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungM...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immobilienscout24.de/immobilientransfer\"", ",", "name", "=", "\"Mehrfamilienhaus\"", ",", "scope", "=", "GrundstueckEmpfohleneNutzung", ".", "class", ")", "public", "JAXBElement", "<", "Object", ">", "createGrun...
Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Object", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L1107-L1110
test
Create an instance of a JAXBElement that will be used to store the Mehrfamilienhaus value.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Mehrfamilienhaus", scope = GrundstueckEmpfohleneNutzung.class) public JAXBElement<Object> createGrundstueckEmpfohleneNutzungMehrfamilienhaus(Object value) { retu...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createVersteigerungstermin
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "versteigerungstermin") @XmlJavaTypeAdapter(Adapter4 .class) public JAXBElement<Calendar> createVersteigerungstermin(Calendar value) { return new JAXBElement<Calendar>(_Versteigerungstermin_QNAME, Calendar.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "versteigerungstermin") @XmlJavaTypeAdapter(Adapter4 .class) public JAXBElement<Calendar> createVersteigerungstermin(Calendar value) { return new JAXBElement<Calendar>(_Versteigerungstermin_QNAME, Calendar.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"versteigerungstermin\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter4", ".", "class", ")", "public", "JAXBElement", "<", "Calendar", ">", "createVersteigerungstermin", "(...
Create an instance of {@link JAXBElement }{@code <}{@link Calendar }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Calendar", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L2177-L2181
test
Create an instance of a Versteigerungstermin_Calendar
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "versteigerungstermin") @XmlJavaTypeAdapter(Adapter4 .class) public JAXBElement<Calendar> createVersteigerungstermin(Calendar value) { return new JAXBElement<Calendar>(_Versteigerungsterm...
square/retrofit
retrofit-converters/jaxb/src/main/java/retrofit2/converter/jaxb/JaxbConverterFactory.java
JaxbConverterFactory.create
@SuppressWarnings("ConstantConditions") // Guarding public API nullability. public static JaxbConverterFactory create(JAXBContext context) { if (context == null) throw new NullPointerException("context == null"); return new JaxbConverterFactory(context); }
java
@SuppressWarnings("ConstantConditions") // Guarding public API nullability. public static JaxbConverterFactory create(JAXBContext context) { if (context == null) throw new NullPointerException("context == null"); return new JaxbConverterFactory(context); }
[ "@", "SuppressWarnings", "(", "\"ConstantConditions\"", ")", "// Guarding public API nullability.", "public", "static", "JaxbConverterFactory", "create", "(", "JAXBContext", "context", ")", "{", "if", "(", "context", "==", "null", ")", "throw", "new", "NullPointerExcept...
Create an instance using {@code context} for conversion.
[ "Create", "an", "instance", "using", "{" ]
81a6193a7b3f2b1bf25e78adc2638681b0514fe8
https://github.com/square/retrofit/blob/81a6193a7b3f2b1bf25e78adc2638681b0514fe8/retrofit-converters/jaxb/src/main/java/retrofit2/converter/jaxb/JaxbConverterFactory.java#L43-L47
test
Creates a new instance of the JaxbConverterFactory class.
Of course, here is the Java code you requested: ```java @SuppressWarnings("ConstantConditions") // Guarding public API nullability. public static JaxbConverterFactory create(JAXBContext context) { if (context == null) throw new NullPointerException("context == null"); return new JaxbConverterFactory(context)...
ArpNetworking/logback-steno
src/main/java/com/arpnetworking/logback/serialization/steno/SafeSerializationHelper.java
SafeSerializationHelper.safeEncodeThrowable
static void safeEncodeThrowable(final StringBuilder encoder, final Throwable throwable) { encoder.append("{\"type\":\"") .append(throwable.getClass().getName()) .append("\",\"message\":"); safeEncodeValue(encoder, throwable.getMessage()); encoder.append(",\"backtr...
java
static void safeEncodeThrowable(final StringBuilder encoder, final Throwable throwable) { encoder.append("{\"type\":\"") .append(throwable.getClass().getName()) .append("\",\"message\":"); safeEncodeValue(encoder, throwable.getMessage()); encoder.append(",\"backtr...
[ "static", "void", "safeEncodeThrowable", "(", "final", "StringBuilder", "encoder", ",", "final", "Throwable", "throwable", ")", "{", "encoder", ".", "append", "(", "\"{\\\"type\\\":\\\"\"", ")", ".", "append", "(", "throwable", ".", "getClass", "(", ")", ".", ...
/* package private
[ "/", "*", "package", "private" ]
abd5c68ce7d42c39f80ffbad6d162d5fed3a346e
https://github.com/ArpNetworking/logback-steno/blob/abd5c68ce7d42c39f80ffbad6d162d5fed3a346e/src/main/java/com/arpnetworking/logback/serialization/steno/SafeSerializationHelper.java#L121-L157
test
Safe encode Throwable.
Of course, here is the Java code you requested: ```java static void safeEncodeThrowable(final StringBuilder encoder, final Throwable throwable) { encoder.append("{\"type\":\"") .append(throwable.getClass().getName()) .append("\",\"message\":"); safeEncodeValue(encoder, t...
mbeiter/jaas
loginmodules/password/authenticators/jdbc/src/main/java/org/beiter/michael/authn/jaas/loginmodules/password/authenticators/jdbc/DbUtil.java
DbUtil.close
public static void close(final ResultSet resultSet) { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { final String error = "Error closing JDBC result set. This may indicate a resource leak."; LOG.warn(error, e);...
java
public static void close(final ResultSet resultSet) { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { final String error = "Error closing JDBC result set. This may indicate a resource leak."; LOG.warn(error, e);...
[ "public", "static", "void", "close", "(", "final", "ResultSet", "resultSet", ")", "{", "if", "(", "resultSet", "!=", "null", ")", "{", "try", "{", "resultSet", ".", "close", "(", ")", ";", "}", "catch", "(", "SQLException", "e", ")", "{", "final", "S...
Close a {@code ResultSet} and log any SQLExceptions that occur. @param resultSet ResultSet to close (may be {@code null})
[ "Close", "a", "{", "@code", "ResultSet", "}", "and", "log", "any", "SQLExceptions", "that", "occur", "." ]
540e78af91c73291fa0e57b0df352f4a22950772
https://github.com/mbeiter/jaas/blob/540e78af91c73291fa0e57b0df352f4a22950772/loginmodules/password/authenticators/jdbc/src/main/java/org/beiter/michael/authn/jaas/loginmodules/password/authenticators/jdbc/DbUtil.java#L97-L106
test
Close the result set.
Of course, here is the Java code you requested: ```java public static void close(final ResultSet resultSet) { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { final String error = "Error closing JDBC result set. This may indica...
jboss/jboss-common-core
src/main/java/org/jboss/util/collection/WeakTypeCache.java
WeakTypeCache.peek
protected T peek(ParameterizedType type) { Class<?> rawType = (Class<?>) type.getRawType(); ClassLoader cl = SecurityActions.getClassLoader(rawType); Map<String, T> classLoaderCache = getClassLoaderCache(cl); synchronized (classLoaderCache) { return classLoaderCache.get(...
java
protected T peek(ParameterizedType type) { Class<?> rawType = (Class<?>) type.getRawType(); ClassLoader cl = SecurityActions.getClassLoader(rawType); Map<String, T> classLoaderCache = getClassLoaderCache(cl); synchronized (classLoaderCache) { return classLoaderCache.get(...
[ "protected", "T", "peek", "(", "ParameterizedType", "type", ")", "{", "Class", "<", "?", ">", "rawType", "=", "(", "Class", "<", "?", ">", ")", "type", ".", "getRawType", "(", ")", ";", "ClassLoader", "cl", "=", "SecurityActions", ".", "getClassLoader", ...
Peek into the cache @param type the type @return the value
[ "Peek", "into", "the", "cache" ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/collection/WeakTypeCache.java#L194-L204
test
peek in the cache
Of course, here is the Java code you requested: ```java protected T peek(ParameterizedType type) { Class<?> rawType = (Class<?>) type.getRawType(); ClassLoader cl = SecurityActions.getClassLoader(rawType); Map<String, T> classLoaderCache = getClassLoaderCache(cl); synchronized (classL...
js-lib-com/tiny-container
src/main/java/js/http/encoder/XmlValueWriter.java
XmlValueWriter.write
@Override public void write(HttpServletResponse httpResponse, Object value) throws IOException { final Document document = (Document) value; document.serialize(new OutputStreamWriter(httpResponse.getOutputStream(), "UTF-8")); }
java
@Override public void write(HttpServletResponse httpResponse, Object value) throws IOException { final Document document = (Document) value; document.serialize(new OutputStreamWriter(httpResponse.getOutputStream(), "UTF-8")); }
[ "@", "Override", "public", "void", "write", "(", "HttpServletResponse", "httpResponse", ",", "Object", "value", ")", "throws", "IOException", "{", "final", "Document", "document", "=", "(", "Document", ")", "value", ";", "document", ".", "serialize", "(", "new...
Serialize XML document to output stream of given HTTP response. @param httpResponse HTTP response, @param value value object is a XML document. @throws IOException if output stream write operation fails.
[ "Serialize", "XML", "document", "to", "output", "stream", "of", "given", "HTTP", "response", "." ]
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/http/encoder/XmlValueWriter.java#L24-L28
test
Write a Document object to the HttpServletResponse.
Of course, here is the Java code you requested: ```java @Override public void write(HttpServletResponse httpResponse, Object value) throws IOException { final Document document = (Document) value; document.serialize(new OutputStreamWriter(httpResponse.getOutputStream(), "UTF-8")); } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/util/prefs/ui/ComboBox.java
ComboBox.getItemList
public List<Object> getItemList() { ArrayList<Object> list = new ArrayList<Object>(); for (int i=0; i< getItemCount() && i < nkeep; i++) list.add( getItemAt(i)); return list; } /** * Use this to set the list of items. * @param list of items, may be any Object type. */ public...
java
public List<Object> getItemList() { ArrayList<Object> list = new ArrayList<Object>(); for (int i=0; i< getItemCount() && i < nkeep; i++) list.add( getItemAt(i)); return list; } /** * Use this to set the list of items. * @param list of items, may be any Object type. */ public...
[ "public", "List", "<", "Object", ">", "getItemList", "(", ")", "{", "ArrayList", "<", "Object", ">", "list", "=", "new", "ArrayList", "<", "Object", ">", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getItemCount", "(", ")", "&...
Use this to obtain the list of items. @return ArrayList of items, may be any Object type.
[ "Use", "this", "to", "obtain", "the", "list", "of", "items", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/util/prefs/ui/ComboBox.java#L175-L253
test
Get the list of items.
Of course, here is the Java code you requested: ```java public List<Object> getItemList() { ArrayList<Object> list = new ArrayList<Object>(); for (int i=0; i< getItemCount() && i < nkeep; i++) list.add( getItemAt(i)); return list; } /** * Use this to set the list of items. * @para...
ReactiveX/RxJava
src/main/java/io/reactivex/parallel/ParallelFlowable.java
ParallelFlowable.doOnNext
@CheckReturnValue @NonNull public final ParallelFlowable<T> doOnNext(@NonNull Consumer<? super T> onNext, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(onNext, "onNext is null"); ObjectHelper.requireNonNull(errorHandler, "errorHandler is null"); return RxJa...
java
@CheckReturnValue @NonNull public final ParallelFlowable<T> doOnNext(@NonNull Consumer<? super T> onNext, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(onNext, "onNext is null"); ObjectHelper.requireNonNull(errorHandler, "errorHandler is null"); return RxJa...
[ "@", "CheckReturnValue", "@", "NonNull", "public", "final", "ParallelFlowable", "<", "T", ">", "doOnNext", "(", "@", "NonNull", "Consumer", "<", "?", "super", "T", ">", "onNext", ",", "@", "NonNull", "ParallelFailureHandling", "errorHandler", ")", "{", "Object...
Call the specified consumer with the current element passing through any 'rail' and handles errors based on the given {@link ParallelFailureHandling} enumeration value. <p>History: 2.0.8 - experimental @param onNext the callback @param errorHandler the enumeration that defines how to handle errors thrown from the onNex...
[ "Call", "the", "specified", "consumer", "with", "the", "current", "element", "passing", "through", "any", "rail", "and", "handles", "errors", "based", "on", "the", "given", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L548-L554
test
Performs a parallel do on next sequence.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull public final ParallelFlowable<T> doOnNext(@NonNull Consumer<? super T> onNext, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(onNext, "onNext is null"); ObjectHelper.requireNonNull(e...
Unidata/thredds
legacy/src/main/java/thredds/cataloggen/config/DatasetSource.java
DatasetSource.newDatasetSource
public static final DatasetSource newDatasetSource( String name, DatasetSourceType type, DatasetSourceStructure structure, String accessPoint, ResultService resultService ) { if (...
java
public static final DatasetSource newDatasetSource( String name, DatasetSourceType type, DatasetSourceStructure structure, String accessPoint, ResultService resultService ) { if (...
[ "public", "static", "final", "DatasetSource", "newDatasetSource", "(", "String", "name", ",", "DatasetSourceType", "type", ",", "DatasetSourceStructure", "structure", ",", "String", "accessPoint", ",", "ResultService", "resultService", ")", "{", "if", "(", "type", "...
Factory method for this abstract class. @param name @param type @param structure @param accessPoint @throws IllegalArgumentException if DatasetSource type is null or unsupported.
[ "Factory", "method", "for", "this", "abstract", "class", ".", "@param", "name", "@param", "type", "@param", "structure", "@param", "accessPoint" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/cataloggen/config/DatasetSource.java#L99-L154
test
Create a new DatasetSource object.
Of course, here is the Java code you requested: ```java public static final DatasetSource newDatasetSource( String name, DatasetSourceType type, DatasetSourceStructure structure, String accessPoint, ...
Unidata/thredds
legacy/src/main/java/ucar/nc2/dt/point/WriterStationObsDataset.java
WriterStationObsDataset.write
private void write(StationObsDataset sobsDataset) throws IOException { createGlobalAttributes(); createStations(sobsDataset.getStations()); ncfile.addGlobalAttribute("time_coverage_start", dateFormatter.toDateTimeStringISO(sobsDataset.getStartDate())); ncfile.addGlobalAttribute("time_coverage_end", dat...
java
private void write(StationObsDataset sobsDataset) throws IOException { createGlobalAttributes(); createStations(sobsDataset.getStations()); ncfile.addGlobalAttribute("time_coverage_start", dateFormatter.toDateTimeStringISO(sobsDataset.getStartDate())); ncfile.addGlobalAttribute("time_coverage_end", dat...
[ "private", "void", "write", "(", "StationObsDataset", "sobsDataset", ")", "throws", "IOException", "{", "createGlobalAttributes", "(", ")", ";", "createStations", "(", "sobsDataset", ".", "getStations", "(", ")", ")", ";", "ncfile", ".", "addGlobalAttribute", "(",...
not tested
[ "not", "tested" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/dt/point/WriterStationObsDataset.java#L387-L447
test
Write the data in the StationObsDataset to the NetcdfFile.
Of course, here is the Java code you requested: ```java private void write(StationObsDataset sobsDataset) throws IOException { createGlobalAttributes(); createStations(sobsDataset.getStations()); ncfile.addGlobalAttribute("time_coverage_start", dateFormatter.toDateTimeStringISO(sobsDataset.getStartDate())...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.addPolygon
private void addPolygon(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Path path, Polygon polygon) { List<LineString> rings = polygon.getRings(); if (!rings.isEmpty()) { // Add the polygon points LineString polygonLineString = rings.get(0); ...
java
private void addPolygon(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Path path, Polygon polygon) { List<LineString> rings = polygon.getRings(); if (!rings.isEmpty()) { // Add the polygon points LineString polygonLineString = rings.get(0); ...
[ "private", "void", "addPolygon", "(", "double", "simplifyTolerance", ",", "BoundingBox", "boundingBox", ",", "ProjectionTransform", "transform", ",", "Path", "path", ",", "Polygon", "polygon", ")", "{", "List", "<", "LineString", ">", "rings", "=", "polygon", "....
Add the polygon on the canvas @param simplifyTolerance simplify tolerance in meters @param boundingBox bounding box @param transform projection transform @param path path @param polygon polygon
[ "Add", "the", "polygon", "on", "the", "canvas" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L454-L474
test
Add a polygon to the image
Of course, here is the Java code you requested: ```java private void addPolygon(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Path path, Polygon polygon) { List<LineString> rings = polygon.getRings(); if (!rings.isEmpty()) { // Add the polygon points ...
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/access/AbstractDBAccess.java
AbstractDBAccess.buildMap
private Map<String, Object> buildMap(String sql, Object[] args, int[] type) { Map<String, Object> map = new HashMap<String, Object>(); map.put(KEY_SQL, sql); map.put(KEY_ARGS, args); map.put(KEY_TYPE, type); return map; }
java
private Map<String, Object> buildMap(String sql, Object[] args, int[] type) { Map<String, Object> map = new HashMap<String, Object>(); map.put(KEY_SQL, sql); map.put(KEY_ARGS, args); map.put(KEY_TYPE, type); return map; }
[ "private", "Map", "<", "String", ",", "Object", ">", "buildMap", "(", "String", "sql", ",", "Object", "[", "]", "args", ",", "int", "[", "]", "type", ")", "{", "Map", "<", "String", ",", "Object", ">", "map", "=", "new", "HashMap", "<", "String", ...
isORM为false,需要构造map传递给实现类 @param sql 需要执行的sql语句 @param args sql语句中的参数列表 @param type sql语句中的参数类型 @return 构造的map
[ "isORM为false,需要构造map传递给实现类" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/access/AbstractDBAccess.java#L134-L140
test
Build a map from the sql args and type.
Of course, here is the Java code you requested: ```java private Map<String, Object> buildMap(String sql, Object[] args, int[] type) { Map<String, Object> map = new HashMap<String, Object>(); map.put(KEY_SQL, sql); map.put(KEY_ARGS, args); map.put(KEY_TYPE, type); return map; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java
GradsDataDescriptorFile.getFileNames
private List<String> getFileNames() throws IOException { if (fileNames == null) { fileNames = new ArrayList<>(); timeStepsPerFile = tDim.getSize(); if (!isTemplate()) { // single file fileNames.add(getFullPath(getDataFile())); } else { // figure out template type...
java
private List<String> getFileNames() throws IOException { if (fileNames == null) { fileNames = new ArrayList<>(); timeStepsPerFile = tDim.getSize(); if (!isTemplate()) { // single file fileNames.add(getFullPath(getDataFile())); } else { // figure out template type...
[ "private", "List", "<", "String", ">", "getFileNames", "(", ")", "throws", "IOException", "{", "if", "(", "fileNames", "==", "null", ")", "{", "fileNames", "=", "new", "ArrayList", "<>", "(", ")", ";", "timeStepsPerFile", "=", "tDim", ".", "getSize", "("...
Get the list of filenames @return the filenames @throws IOException file does not exist.
[ "Get", "the", "list", "of", "filenames" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java#L891-L954
test
Gets the file names.
Of course, here is the Java code you requested: ```java private List<String> getFileNames() throws IOException { if (fileNames == null) { fileNames = new ArrayList<>(); timeStepsPerFile = tDim.getSize(); if (!isTemplate()) { // single file fileNames.add(getFullPath(getDataFile())); ...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/BitStreamFilterType.java
BitStreamFilterType.getInstalledBitStreamFilterTypes
public static java.util.Collection<BitStreamFilterType> getInstalledBitStreamFilterTypes() { java.util.Collection<BitStreamFilterType> retval = new java.util.HashSet<BitStreamFilterType>(); int count = getNumBitStreamFilterTypes(); for(int i=0;i<count;i++) { BitStreamFilterType t = getBitStrea...
java
public static java.util.Collection<BitStreamFilterType> getInstalledBitStreamFilterTypes() { java.util.Collection<BitStreamFilterType> retval = new java.util.HashSet<BitStreamFilterType>(); int count = getNumBitStreamFilterTypes(); for(int i=0;i<count;i++) { BitStreamFilterType t = getBitStrea...
[ "public", "static", "java", ".", "util", ".", "Collection", "<", "BitStreamFilterType", ">", "getInstalledBitStreamFilterTypes", "(", ")", "{", "java", ".", "util", ".", "Collection", "<", "BitStreamFilterType", ">", "retval", "=", "new", "java", ".", "util", ...
Gets a collection of ALL codecs installed on this system. @return A collection of all installed codecs.
[ "Gets", "a", "collection", "of", "ALL", "codecs", "installed", "on", "this", "system", "." ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/BitStreamFilterType.java#L138-L150
test
Gets the installed bit stream filter types.
Of course, here is the Java code you requested: ```java public static java.util.Collection<BitStreamFilterType> getInstalledBitStreamFilterTypes() { java.util.Collection<BitStreamFilterType> retval = new java.util.HashSet<BitStreamFilterType>(); int count = getNumBitStreamFilterTypes(); for(int i=0;i<c...
Jasig/BookmarksPortlet
src/main/java/edu/wisc/my/portlets/bookmarks/domain/Folder.java
Folder.getSortedChildren
public List<Entry> getSortedChildren() { if (this.children == null) { return null; } else { final Collection<Entry> childCollection = this.children.values(); final List<Entry> childList = new ArrayList<Entry>(childCollection); Collections.sort(chil...
java
public List<Entry> getSortedChildren() { if (this.children == null) { return null; } else { final Collection<Entry> childCollection = this.children.values(); final List<Entry> childList = new ArrayList<Entry>(childCollection); Collections.sort(chil...
[ "public", "List", "<", "Entry", ">", "getSortedChildren", "(", ")", "{", "if", "(", "this", ".", "children", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "final", "Collection", "<", "Entry", ">", "childCollection", "=", "this", ".",...
Returns an immutable sorted view of the values of the children Map. The sorting is done using the current childComparator. Warning, this is has a time cost of 2n log(n) on every call. @return An immutable sorted view of the folder's children.
[ "Returns", "an", "immutable", "sorted", "view", "of", "the", "values", "of", "the", "children", "Map", ".", "The", "sorting", "is", "done", "using", "the", "current", "childComparator", ".", "Warning", "this", "is", "has", "a", "time", "cost", "of", "2n", ...
45e8dc1636ee59593a28f72d783acd256746d1e9
https://github.com/Jasig/BookmarksPortlet/blob/45e8dc1636ee59593a28f72d783acd256746d1e9/src/main/java/edu/wisc/my/portlets/bookmarks/domain/Folder.java#L100-L110
test
Get the sorted children.
Of course, here is the Java code you requested: ```java public List<Entry> getSortedChildren() { if (this.children == null) { return null; } else { final Collection<Entry> childCollection = this.children.values(); final List<Entry> childList = new ArrayList<E...
lessthanoptimal/GeoRegression
main/src/georegression/struct/GeoTuple4D_F64.java
GeoTuple4D_F64.plusIP
public void plusIP( GeoTuple4D_F64 a ) { x += a.x; y += a.y; z += a.z; w += a.w; }
java
public void plusIP( GeoTuple4D_F64 a ) { x += a.x; y += a.y; z += a.z; w += a.w; }
[ "public", "void", "plusIP", "(", "GeoTuple4D_F64", "a", ")", "{", "x", "+=", "a", ".", "x", ";", "y", "+=", "a", ".", "y", ";", "z", "+=", "a", ".", "z", ";", "w", "+=", "a", ".", "w", ";", "}" ]
<p>In-place addition</p> this.x = this.x + a.x; @param a value which is to be added
[ "<p", ">", "In", "-", "place", "addition<", "/", "p", ">" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/GeoTuple4D_F64.java#L136-L141
test
Adds the IP values of the input tuple to this one.
Of course, here is the Java code you requested: ```java public void plusIP( GeoTuple4D_F64 a ) { x += a.x; y += a.y; z += a.z; w += a.w; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
DaftIE/src/main/jaxb/org/openestate/io/daft_ie/xml/OverseasRentalAdType.java
OverseasRentalAdType.setAgentId
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setAgentId(java.lang.String value) { this.agentId = 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 setAgentId(java.lang.String value) { this.agentId = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:41:42+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setAgentId", "(", "java", ".", "lang", ".", "String", "value", ")", "{", ...
Sets the value of the agentId property. @param value allowed object is {@link java.lang.String }
[ "Sets", "the", "value", "of", "the", "agentId", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/DaftIE/src/main/jaxb/org/openestate/io/daft_ie/xml/OverseasRentalAdType.java#L1091-L1094
test
Sets the value of the agentId 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 setAgentId(java.lang.String value) { this.agentId = value; } ``` Hope this helps!
rupertlssmith/lojix
lojix/state/src/main/com/thesett/aima/state/impl/PropertyIntrospectorBase.java
PropertyIntrospectorBase.isAssignableFromPrimitive
private boolean isAssignableFromPrimitive(Class wrapperType, Class primitiveType) { boolean result = false; if (primitiveType.equals(boolean.class) && wrapperType.equals(Boolean.class)) { result = true; } else if (primitiveType.equals(byte.class) && wrapperType.e...
java
private boolean isAssignableFromPrimitive(Class wrapperType, Class primitiveType) { boolean result = false; if (primitiveType.equals(boolean.class) && wrapperType.equals(Boolean.class)) { result = true; } else if (primitiveType.equals(byte.class) && wrapperType.e...
[ "private", "boolean", "isAssignableFromPrimitive", "(", "Class", "wrapperType", ",", "Class", "primitiveType", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "primitiveType", ".", "equals", "(", "boolean", ".", "class", ")", "&&", "wrapperType", ...
Checks if a wrapper type is assignable from a primtive type. @param wrapperType The wrapper type. @param primitiveType The primitive type. @return <tt>true</tt> if the wrapper type can be assinged from the primitive.
[ "Checks", "if", "a", "wrapper", "type", "is", "assignable", "from", "a", "primtive", "type", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/state/src/main/com/thesett/aima/state/impl/PropertyIntrospectorBase.java#L226-L268
test
Checks if a class is assignable from a primitive type.
Of course, here is the Java code you requested: ```java private boolean isAssignableFromPrimitive(Class wrapperType, Class primitiveType) { boolean result = false; if (primitiveType.equals(boolean.class) && wrapperType.equals(Boolean.class)) { result = true; } e...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java
FeatureStyleExtension.setFeatureStyles
public void setFeatureStyles(String featureTable, long featureId, FeatureStyles featureStyles) { if (featureStyles != null) { setStyles(featureTable, featureId, featureStyles.getStyles()); setIcons(featureTable, featureId, featureStyles.getIcons()); ...
java
public void setFeatureStyles(String featureTable, long featureId, FeatureStyles featureStyles) { if (featureStyles != null) { setStyles(featureTable, featureId, featureStyles.getStyles()); setIcons(featureTable, featureId, featureStyles.getIcons()); ...
[ "public", "void", "setFeatureStyles", "(", "String", "featureTable", ",", "long", "featureId", ",", "FeatureStyles", "featureStyles", ")", "{", "if", "(", "featureStyles", "!=", "null", ")", "{", "setStyles", "(", "featureTable", ",", "featureId", ",", "featureS...
Set the feature styles for the feature table and feature id @param featureTable feature table @param featureId feature id @param featureStyles feature styles
[ "Set", "the", "feature", "styles", "for", "the", "feature", "table", "and", "feature", "id" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java#L991-L1000
test
Set the feature styles.
Of course, here is the Java code you requested: ```java public void setFeatureStyles(String featureTable, long featureId, FeatureStyles featureStyles) { if (featureStyles != null) { setStyles(featureTable, featureId, featureStyles.getStyles()); setIcons(...
spring-projects/spring-security
core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java
MapBasedAttributes2GrantedAuthoritiesMapper.getGrantedAuthorities
public List<GrantedAuthority> getGrantedAuthorities(Collection<String> attributes) { ArrayList<GrantedAuthority> gaList = new ArrayList<>(); for (String attribute : attributes) { Collection<GrantedAuthority> c = attributes2grantedAuthoritiesMap .get(attribute); if (c != null) { gaList.addAll(c); }...
java
public List<GrantedAuthority> getGrantedAuthorities(Collection<String> attributes) { ArrayList<GrantedAuthority> gaList = new ArrayList<>(); for (String attribute : attributes) { Collection<GrantedAuthority> c = attributes2grantedAuthoritiesMap .get(attribute); if (c != null) { gaList.addAll(c); }...
[ "public", "List", "<", "GrantedAuthority", ">", "getGrantedAuthorities", "(", "Collection", "<", "String", ">", "attributes", ")", "{", "ArrayList", "<", "GrantedAuthority", ">", "gaList", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "String", "...
Map the given array of attributes to Spring Security GrantedAuthorities.
[ "Map", "the", "given", "array", "of", "attributes", "to", "Spring", "Security", "GrantedAuthorities", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java#L49-L61
test
Gets the granted authorities for a collection of attributes.
Of course, here is the Java code you requested: ```java public List<GrantedAuthority> getGrantedAuthorities(Collection<String> attributes) { ArrayList<GrantedAuthority> gaList = new ArrayList<>(); for (String attribute : attributes) { Collection<GrantedAuthority> c = attributes2grantedAuthoritiesMap .get(a...
spring-projects/spring-security
remoting/src/main/java/org/springframework/security/remoting/dns/JndiDnsResolver.java
JndiDnsResolver.resolveServiceEntry
private String resolveServiceEntry(String serviceType, String domain, DirContext ctx) { String result = null; try { String query = new StringBuilder("_").append(serviceType).append("._tcp.") .append(domain).toString(); Attribute dnsRecord = lookup(query, ctx, "SRV"); // There are maybe more records...
java
private String resolveServiceEntry(String serviceType, String domain, DirContext ctx) { String result = null; try { String query = new StringBuilder("_").append(serviceType).append("._tcp.") .append(domain).toString(); Attribute dnsRecord = lookup(query, ctx, "SRV"); // There are maybe more records...
[ "private", "String", "resolveServiceEntry", "(", "String", "serviceType", ",", "String", "domain", ",", "DirContext", "ctx", ")", "{", "String", "result", "=", "null", ";", "try", "{", "String", "query", "=", "new", "StringBuilder", "(", "\"_\"", ")", ".", ...
resolveServiceIpAddress().
[ "resolveServiceIpAddress", "()", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/remoting/src/main/java/org/springframework/security/remoting/dns/JndiDnsResolver.java#L110-L155
test
Resolves the service entry.
Of course, here is the Java code you requested: ```java private String resolveServiceEntry(String serviceType, String domain, DirContext ctx) { String result = null; try { String query = new StringBuilder("_").append(serviceType).append("._tcp.") .append(domain).toString(); Attribute dnsRecord = look...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.distinct
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <K> Observable<T> distinct(Function<? super T, K> keySelector) { return distinct(keySelector, Functions.createHashSet()); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <K> Observable<T> distinct(Function<? super T, K> keySelector) { return distinct(keySelector, Functions.createHashSet()); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "K", ">", "Observable", "<", "T", ">", "distinct", "(", "Function", "<", "?", "super", "T", ",", "K", ">", "keySelector", ")", "{", "retu...
Returns an Observable that emits all items emitted by the source ObservableSource that are distinct according to a key selector function and based on {@link Object#equals(Object)} comparison of the objects returned by the key selector function. <p> <img width="640" height="310" src="https://raw.github.com/wiki/Reactive...
[ "Returns", "an", "Observable", "that", "emits", "all", "items", "emitted", "by", "the", "source", "ObservableSource", "that", "are", "distinct", "according", "to", "a", "key", "selector", "function", "and", "based", "on", "{", "@link", "Object#equals", "(", "O...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L7844-L7848
test
Returns an observable containing the distinct elements of the source with the specified key selector.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <K> Observable<T> distinct(Function<? super T, K> keySelector) { return distinct(keySelector, Functions.createHashSet()); } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/table/JTableSorted.java
JTableSorted.getSelected
public TableRow getSelected() { if (list.size() == 0) return null; int sel = jtable.getSelectedRow(); if (sel >= 0) return (TableRow) list.get(sel); else return null; }
java
public TableRow getSelected() { if (list.size() == 0) return null; int sel = jtable.getSelectedRow(); if (sel >= 0) return (TableRow) list.get(sel); else return null; }
[ "public", "TableRow", "getSelected", "(", ")", "{", "if", "(", "list", ".", "size", "(", ")", "==", "0", ")", "return", "null", ";", "int", "sel", "=", "jtable", ".", "getSelectedRow", "(", ")", ";", "if", "(", "sel", ">=", "0", ")", "return", "(...
Get the currently selected row. @return selected TableRow
[ "Get", "the", "currently", "selected", "row", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/table/JTableSorted.java#L347-L355
test
Get the selected row from the table.
Of course, here is the Java code you requested: ```java public TableRow getSelected() { if (list.size() == 0) return null; int sel = jtable.getSelectedRow(); if (sel >= 0) return (TableRow) list.get(sel); else return null; } ``` Hope this helps!
google/guice
core/src/com/google/inject/internal/util/SourceProvider.java
SourceProvider.asStrings
private static List<String> asStrings(Class... classes) { List<String> strings = Lists.newArrayList(); for (Class c : classes) { strings.add(c.getName()); } return strings; }
java
private static List<String> asStrings(Class... classes) { List<String> strings = Lists.newArrayList(); for (Class c : classes) { strings.add(c.getName()); } return strings; }
[ "private", "static", "List", "<", "String", ">", "asStrings", "(", "Class", "...", "classes", ")", "{", "List", "<", "String", ">", "strings", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "(", "Class", "c", ":", "classes", ")", "{", "stri...
Returns the class names as Strings
[ "Returns", "the", "class", "names", "as", "Strings" ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/util/SourceProvider.java#L68-L74
test
Returns a list of strings from the given classes.
Of course, here is the Java code you requested: ```java private static List<String> asStrings(Class... classes) { List<String> strings = Lists.newArrayList(); for (Class c : classes) { strings.add(c.getName()); } return strings; } ``` Hope this helps!
wildfly/wildfly
picketlink/src/main/java/org/wildfly/extension/picketlink/idm/jpa/transaction/TransactionalEntityManagerHelper.java
TransactionalEntityManagerHelper.putEntityManagerInTransactionRegistry
public void putEntityManagerInTransactionRegistry(String scopedPuName, EntityManager entityManager) { try { Transaction transaction = this.transactionManager.getTransaction(); transaction.registerSynchronization(new TransactionalEntityManagerSynchronization(entityManager)); ...
java
public void putEntityManagerInTransactionRegistry(String scopedPuName, EntityManager entityManager) { try { Transaction transaction = this.transactionManager.getTransaction(); transaction.registerSynchronization(new TransactionalEntityManagerSynchronization(entityManager)); ...
[ "public", "void", "putEntityManagerInTransactionRegistry", "(", "String", "scopedPuName", ",", "EntityManager", "entityManager", ")", "{", "try", "{", "Transaction", "transaction", "=", "this", ".", "transactionManager", ".", "getTransaction", "(", ")", ";", "transact...
Save the specified EntityManager in the local threads active transaction. The TransactionSynchronizationRegistry will clear the reference to the EntityManager when the transaction completes. @param scopedPuName @param entityManager
[ "Save", "the", "specified", "EntityManager", "in", "the", "local", "threads", "active", "transaction", ".", "The", "TransactionSynchronizationRegistry", "will", "clear", "the", "reference", "to", "the", "EntityManager", "when", "the", "transaction", "completes", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/picketlink/src/main/java/org/wildfly/extension/picketlink/idm/jpa/transaction/TransactionalEntityManagerHelper.java#L65-L75
test
Put the given EntityManager in the transaction registry.
Of course, here is the Java code you requested: ```java public void putEntityManagerInTransactionRegistry(String scopedPuName, EntityManager entityManager) { try { Transaction transaction = this.transactionManager.getTransaction(); transaction.registerSynchronization(new Transactional...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java
BaseLevel2.tbmv
@Override public void tbmv(char order, char Uplo, char TransA, char Diag, INDArray A, INDArray X) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, A, X); // FIXME: int cast if (X.data().dataType()...
java
@Override public void tbmv(char order, char Uplo, char TransA, char Diag, INDArray A, INDArray X) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, A, X); // FIXME: int cast if (X.data().dataType()...
[ "@", "Override", "public", "void", "tbmv", "(", "char", "order", ",", "char", "Uplo", ",", "char", "TransA", ",", "char", "Diag", ",", "INDArray", "A", ",", "INDArray", "X", ")", "{", "if", "(", "Nd4j", ".", "getExecutioner", "(", ")", ".", "getProfi...
syr2 performs a rank-2 update of an n-by-n symmetric matrix a: a := alpha*x*y' + alpha*y*x' + a. @param order @param Uplo @param TransA @param Diag @param A @param X
[ "syr2", "performs", "a", "rank", "-", "2", "update", "of", "an", "n", "-", "by", "-", "n", "symmetric", "matrix", "a", ":", "a", ":", "=", "alpha", "*", "x", "*", "y", "+", "alpha", "*", "y", "*", "x", "+", "a", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java#L565-L579
test
Dual method to compute TBMV
Of course, here is the Java code you requested: ```java @Override public void tbmv(char order, char Uplo, char TransA, char Diag, INDArray A, INDArray X) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, A, X); ...
coinbase/coinbase-java
src/main/java/com/coinbase/api/CoinbaseBuilder.java
CoinbaseBuilder.withApiKey
public CoinbaseBuilder withApiKey(String api_key, String api_secret) { this.api_key = api_key; this.api_secret = api_secret; return this; }
java
public CoinbaseBuilder withApiKey(String api_key, String api_secret) { this.api_key = api_key; this.api_secret = api_secret; return this; }
[ "public", "CoinbaseBuilder", "withApiKey", "(", "String", "api_key", ",", "String", "api_secret", ")", "{", "this", ".", "api_key", "=", "api_key", ";", "this", ".", "api_secret", "=", "api_secret", ";", "return", "this", ";", "}" ]
Specify the HMAC api key and secret to be used for authenticated requests Having more than one client with the same api/secret globally is unsupported and will result in sporadic auth errors as the nonce is calculated from the system time. @param api_key the HMAC API Key @param api_secret the HMAC API Secret @return...
[ "Specify", "the", "HMAC", "api", "key", "and", "secret", "to", "be", "used", "for", "authenticated", "requests" ]
e3f48712a0f45aabd8e205f11fa76d1cc3fa0ff8
https://github.com/coinbase/coinbase-java/blob/e3f48712a0f45aabd8e205f11fa76d1cc3fa0ff8/src/main/java/com/coinbase/api/CoinbaseBuilder.java#L52-L56
test
Set the API key and secret.
Of course, here is the Java code you requested: ```java public CoinbaseBuilder withApiKey(String api_key, String api_secret) { this.api_key = api_key; this.api_secret = api_secret; return this; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/StructureDS.java
StructureDS.convertMemberInfo
private void convertMemberInfo(StructureMembers wrapperSm) { for (StructureMembers.Member m : wrapperSm.getMembers()) { Variable v = findVariable(m.getName()); if ((v == null) && (orgVar != null)) // may have been renamed v = (Variable) findVariableFromOrgName(m.getName()); if (v !=...
java
private void convertMemberInfo(StructureMembers wrapperSm) { for (StructureMembers.Member m : wrapperSm.getMembers()) { Variable v = findVariable(m.getName()); if ((v == null) && (orgVar != null)) // may have been renamed v = (Variable) findVariableFromOrgName(m.getName()); if (v !=...
[ "private", "void", "convertMemberInfo", "(", "StructureMembers", "wrapperSm", ")", "{", "for", "(", "StructureMembers", ".", "Member", "m", ":", "wrapperSm", ".", "getMembers", "(", ")", ")", "{", "Variable", "v", "=", "findVariable", "(", "m", ".", "getName...
the wrapper StructureMembers must be converted to correspond to the wrapper Structure
[ "the", "wrapper", "StructureMembers", "must", "be", "converted", "to", "correspond", "to", "the", "wrapper", "Structure" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/StructureDS.java#L437-L456
test
Convert member info to a single entry in the structure.
Of course, here is the Java code you requested: ```java private void convertMemberInfo(StructureMembers wrapperSm) { for (StructureMembers.Member m : wrapperSm.getMembers()) { Variable v = findVariable(m.getName()); if ((v == null) && (orgVar != null)) // may have been renamed v = (Variable...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java
FeatureStyleExtension.setFeatureStyle
public void setFeatureStyle(FeatureRow featureRow, FeatureStyle featureStyle) { setFeatureStyle(featureRow, featureRow.getGeometryType(), featureStyle); }
java
public void setFeatureStyle(FeatureRow featureRow, FeatureStyle featureStyle) { setFeatureStyle(featureRow, featureRow.getGeometryType(), featureStyle); }
[ "public", "void", "setFeatureStyle", "(", "FeatureRow", "featureRow", ",", "FeatureStyle", "featureStyle", ")", "{", "setFeatureStyle", "(", "featureRow", ",", "featureRow", ".", "getGeometryType", "(", ")", ",", "featureStyle", ")", ";", "}" ]
Set the feature style (style and icon) of the feature row @param featureRow feature row @param featureStyle feature style
[ "Set", "the", "feature", "style", "(", "style", "and", "icon", ")", "of", "the", "feature", "row" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java#L1008-L1010
test
Set the feature style for a feature row
Of course, here is the Java code you requested: ```java public void setFeatureStyle(FeatureRow featureRow, FeatureStyle featureStyle) { setFeatureStyle(featureRow, featureRow.getGeometryType(), featureStyle); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/thredds/inventory/NcmlCollectionReader.java
NcmlCollectionReader.readNcML
static public NcmlCollectionReader readNcML(String ncmlString, Formatter errlog) throws IOException { StringReader reader = new StringReader(ncmlString); org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(); if (debugURL) System.out.println(" NetcdfDataset N...
java
static public NcmlCollectionReader readNcML(String ncmlString, Formatter errlog) throws IOException { StringReader reader = new StringReader(ncmlString); org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(); if (debugURL) System.out.println(" NetcdfDataset N...
[ "static", "public", "NcmlCollectionReader", "readNcML", "(", "String", "ncmlString", ",", "Formatter", "errlog", ")", "throws", "IOException", "{", "StringReader", "reader", "=", "new", "StringReader", "(", "ncmlString", ")", ";", "org", ".", "jdom2", ".", "Docu...
Read an NcML file from a String, and construct a NcmlCollectionReader from its scan or scanFmrc element. @param ncmlString the NcML to construct the reader from @param errlog put error messages here @return the resulting NetcdfDataset @throws IOException on read error, or bad referencedDatasetUri URI
[ "Read", "an", "NcML", "file", "from", "a", "String", "and", "construct", "a", "NcmlCollectionReader", "from", "its", "scan", "or", "scanFmrc", "element", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/inventory/NcmlCollectionReader.java#L50-L64
test
Reads a NcML document from a String.
Of course, here is the Java code you requested: ```java static public NcmlCollectionReader readNcML(String ncmlString, Formatter errlog) throws IOException { StringReader reader = new StringReader(ncmlString); org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(); ...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepRuleClient.java
FlowStepRuleClient.updateFlowStepEntryRule
public FlowStepRule updateFlowStepEntryRule(FlowStepRule flowStepRuleParam) { if(flowStepRuleParam != null && this.serviceTicket != null) { flowStepRuleParam.setServiceTicket(this.serviceTicket); } return new FlowStepRule(this.postJson( flowStepRuleParam,...
java
public FlowStepRule updateFlowStepEntryRule(FlowStepRule flowStepRuleParam) { if(flowStepRuleParam != null && this.serviceTicket != null) { flowStepRuleParam.setServiceTicket(this.serviceTicket); } return new FlowStepRule(this.postJson( flowStepRuleParam,...
[ "public", "FlowStepRule", "updateFlowStepEntryRule", "(", "FlowStepRule", "flowStepRuleParam", ")", "{", "if", "(", "flowStepRuleParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "flowStepRuleParam", ".", "setServiceTicket", "(", "thi...
Update an existing Flow Step Entry rule. @param flowStepRuleParam Rule to update. @return Updated rule.
[ "Update", "an", "existing", "Flow", "Step", "Entry", "rule", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepRuleClient.java#L117-L126
test
Update FlowStepRule.
Of course, here is the Java code you requested: ```java public FlowStepRule updateFlowStepEntryRule(FlowStepRule flowStepRuleParam) { if(flowStepRuleParam != null && this.serviceTicket != null) { flowStepRuleParam.setServiceTicket(this.serviceTicket); } return new FlowS...
DigitalPebble/storm-crawler
core/src/main/java/com/digitalpebble/stormcrawler/util/CookieConverter.java
CookieConverter.checkDomainMatchToUrl
public static boolean checkDomainMatchToUrl(String cookieDomain, String urlHostName) { try { if (cookieDomain.startsWith(".")) { cookieDomain = cookieDomain.substring(1); } String[] domainTokens = cookieDomain.split("\\."); String[] hos...
java
public static boolean checkDomainMatchToUrl(String cookieDomain, String urlHostName) { try { if (cookieDomain.startsWith(".")) { cookieDomain = cookieDomain.substring(1); } String[] domainTokens = cookieDomain.split("\\."); String[] hos...
[ "public", "static", "boolean", "checkDomainMatchToUrl", "(", "String", "cookieDomain", ",", "String", "urlHostName", ")", "{", "try", "{", "if", "(", "cookieDomain", ".", "startsWith", "(", "\".\"", ")", ")", "{", "cookieDomain", "=", "cookieDomain", ".", "sub...
Helper method to check if url matches a cookie domain. @param cookieDomain the domain in the cookie @param urlHostName the host name of the url @return does the cookie match the host name
[ "Helper", "method", "to", "check", "if", "url", "matches", "a", "cookie", "domain", "." ]
5d0465192ab8fbd89a90db32cb20960a282411ea
https://github.com/DigitalPebble/storm-crawler/blob/5d0465192ab8fbd89a90db32cb20960a282411ea/core/src/main/java/com/digitalpebble/stormcrawler/util/CookieConverter.java#L142-L166
test
Check if the domain match to the url.
Of course, here is the Java code you requested: ```java public static boolean checkDomainMatchToUrl(String cookieDomain, String urlHostName) { try { if (cookieDomain.startsWith(".")) { cookieDomain = cookieDomain.substring(1); } String[] domainTok...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/collection/GribCollectionBuilder.java
GribCollectionBuilder.createIndex
boolean createIndex(FeatureCollectionConfig.PartitionType ptype, Formatter errlog) throws IOException { if (ptype == FeatureCollectionConfig.PartitionType.all) return createAllRuntimeCollections(errlog); else return createMultipleRuntimeCollections(errlog); }
java
boolean createIndex(FeatureCollectionConfig.PartitionType ptype, Formatter errlog) throws IOException { if (ptype == FeatureCollectionConfig.PartitionType.all) return createAllRuntimeCollections(errlog); else return createMultipleRuntimeCollections(errlog); }
[ "boolean", "createIndex", "(", "FeatureCollectionConfig", ".", "PartitionType", "ptype", ",", "Formatter", "errlog", ")", "throws", "IOException", "{", "if", "(", "ptype", "==", "FeatureCollectionConfig", ".", "PartitionType", ".", "all", ")", "return", "createAllRu...
Throw exception if failure
[ "Throw", "exception", "if", "failure" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/GribCollectionBuilder.java#L110-L115
test
Create a index of the feature collection.
Of course, here is the Java code you requested: ```java boolean createIndex(FeatureCollectionConfig.PartitionType ptype, Formatter errlog) throws IOException { if (ptype == FeatureCollectionConfig.PartitionType.all) return createAllRuntimeCollections(errlog); else return createMultipleRuntimeCollec...
oblac/jodd
jodd-core/src/main/java/jodd/util/ArraysUtil.java
ArraysUtil.subarray
@SuppressWarnings({"unchecked"}) public static <T> T[] subarray(T[] buffer, int offset, int length, Class<T> componentType) { T[] temp = (T[]) Array.newInstance(componentType, length); System.arraycopy(buffer, offset, temp, 0, length); return temp; }
java
@SuppressWarnings({"unchecked"}) public static <T> T[] subarray(T[] buffer, int offset, int length, Class<T> componentType) { T[] temp = (T[]) Array.newInstance(componentType, length); System.arraycopy(buffer, offset, temp, 0, length); return temp; }
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", "}", ")", "public", "static", "<", "T", ">", "T", "[", "]", "subarray", "(", "T", "[", "]", "buffer", ",", "int", "offset", ",", "int", "length", ",", "Class", "<", "T", ">", "componentType", ")", ...
Returns subarray.
[ "Returns", "subarray", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ArraysUtil.java#L670-L675
test
Subarray of the specified type from the specified buffer.
Of course, here is the Java code you requested: ```java @SuppressWarnings({"unchecked"}) public static <T> T[] subarray(T[] buffer, int offset, int length, Class<T> componentType) { T[] temp = (T[]) Array.newInstance(componentType, length); System.arraycopy(buffer, offset, temp, 0, length); return temp; } ``` ...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/SizeableLinkedList.java
SizeableLinkedList.add
public boolean add(T o) { boolean result = super.add(o); sizeOf += (result) ? o.sizeof() : 0; return result; }
java
public boolean add(T o) { boolean result = super.add(o); sizeOf += (result) ? o.sizeof() : 0; return result; }
[ "public", "boolean", "add", "(", "T", "o", ")", "{", "boolean", "result", "=", "super", ".", "add", "(", "o", ")", ";", "sizeOf", "+=", "(", "result", ")", "?", "o", ".", "sizeof", "(", ")", ":", "0", ";", "return", "result", ";", "}" ]
Appends the specified element to the end of this list (optional operation). <p/>Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. ...
[ "Appends", "the", "specified", "element", "to", "the", "end", "of", "this", "list", "(", "optional", "operation", ")", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/SizeableLinkedList.java#L66-L73
test
Add an object to the sequence of CID SEGMENTS.
Of course, here is the Java code you requested: ```java public boolean add(T o) { boolean result = super.add(o); sizeOf += (result) ? o.sizeof() : 0; return result; } ``` Hope this helps!
orientechnologies/orientdb
object/src/main/java/com/orientechnologies/orient/object/enhancement/field/ODocumentFieldHandlingStrategyFactory.java
ODocumentFieldHandlingStrategyFactory.create
public ODocumentFieldHandlingStrategy create(int strategy) { Optional<ODocumentFieldHandlingStrategy> registered = ODocumentFieldHandlingStrategyRegistry.getInstance() .getStrategy(strategy); if (registered.isPresent()) { return registered.get(); } Map<OType, ODocumentFieldOTypeHandlingS...
java
public ODocumentFieldHandlingStrategy create(int strategy) { Optional<ODocumentFieldHandlingStrategy> registered = ODocumentFieldHandlingStrategyRegistry.getInstance() .getStrategy(strategy); if (registered.isPresent()) { return registered.get(); } Map<OType, ODocumentFieldOTypeHandlingS...
[ "public", "ODocumentFieldHandlingStrategy", "create", "(", "int", "strategy", ")", "{", "Optional", "<", "ODocumentFieldHandlingStrategy", ">", "registered", "=", "ODocumentFieldHandlingStrategyRegistry", ".", "getInstance", "(", ")", ".", "getStrategy", "(", "strategy", ...
Creates a new instance of the requested strategy. Since strategies are stateless, if an existing instance already exists then it's returned. @param strategy @return strategy instance
[ "Creates", "a", "new", "instance", "of", "the", "requested", "strategy", ".", "Since", "strategies", "are", "stateless", "if", "an", "existing", "instance", "already", "exists", "then", "it", "s", "returned", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/object/src/main/java/com/orientechnologies/orient/object/enhancement/field/ODocumentFieldHandlingStrategyFactory.java#L57-L84
test
Create a new instance of the specified type handling strategy.
Of course, here is the Java code you requested: ```java public ODocumentFieldHandlingStrategy create(int strategy) { Optional<ODocumentFieldHandlingStrategy> registered = ODocumentFieldHandlingStrategyRegistry.getInstance() .getStrategy(strategy); if (registered.isPresent()) { return registered....
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/naming/TableNamingStrategy.java
TableNamingStrategy.applyToTableName
public String applyToTableName(final String tableName) { String entityName = convertTableNameToEntityName(tableName); return convertEntityNameToTableName(entityName); }
java
public String applyToTableName(final String tableName) { String entityName = convertTableNameToEntityName(tableName); return convertEntityNameToTableName(entityName); }
[ "public", "String", "applyToTableName", "(", "final", "String", "tableName", ")", "{", "String", "entityName", "=", "convertTableNameToEntityName", "(", "tableName", ")", ";", "return", "convertEntityNameToTableName", "(", "entityName", ")", ";", "}" ]
Applies table naming strategy to given table name hint. Returns full table name.
[ "Applies", "table", "naming", "strategy", "to", "given", "table", "name", "hint", ".", "Returns", "full", "table", "name", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/naming/TableNamingStrategy.java#L167-L171
test
Converts the given table name to the entity name.
Of course, here is the Java code you requested: ```java public String applyToTableName(final String tableName) { String entityName = convertTableNameToEntityName(tableName); return convertEntityNameToTableName(entityName); } ``` Hope this helps!
orientechnologies/orientdb
object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabaseTx.java
OObjectDatabaseTx.save
public <RET> RET save(final Object iPojo, final String iClusterName) { return (RET) save(iPojo, iClusterName, OPERATION_MODE.SYNCHRONOUS, false, null, null); }
java
public <RET> RET save(final Object iPojo, final String iClusterName) { return (RET) save(iPojo, iClusterName, OPERATION_MODE.SYNCHRONOUS, false, null, null); }
[ "public", "<", "RET", ">", "RET", "save", "(", "final", "Object", "iPojo", ",", "final", "String", "iClusterName", ")", "{", "return", "(", "RET", ")", "save", "(", "iPojo", ",", "iClusterName", ",", "OPERATION_MODE", ".", "SYNCHRONOUS", ",", "false", ",...
Saves an object in synchronous mode to the database forcing a record cluster where to store it. First checks if the object is new or not. In case it's new a new ODocument is created and bound to the object, otherwise the ODocument is retrieved and updated. The object is introspected using the Java Reflection to extract...
[ "Saves", "an", "object", "in", "synchronous", "mode", "to", "the", "database", "forcing", "a", "record", "cluster", "where", "to", "store", "it", ".", "First", "checks", "if", "the", "object", "is", "new", "or", "not", ".", "In", "case", "it", "s", "ne...
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabaseTx.java#L478-L480
test
Saves the entity into the database.
Of course, here is the Java code you requested: ```java public <RET> RET save(final Object iPojo, final String iClusterName) { return (RET) save(iPojo, iClusterName, OPERATION_MODE.SYNCHRONOUS, false, null, null); } ``` Hope this helps!
streamsets/datacollector
stagesupport/src/main/java/com/streamsets/pipeline/lib/event/EventCreator.java
EventCreator.create
public EventBuilder create(Stage.Context context, ToEventContext toEvent) { return new EventBuilder(context, toEvent); }
java
public EventBuilder create(Stage.Context context, ToEventContext toEvent) { return new EventBuilder(context, toEvent); }
[ "public", "EventBuilder", "create", "(", "Stage", ".", "Context", "context", ",", "ToEventContext", "toEvent", ")", "{", "return", "new", "EventBuilder", "(", "context", ",", "toEvent", ")", ";", "}" ]
Create new event record according for this stage context and event context.
[ "Create", "new", "event", "record", "according", "for", "this", "stage", "context", "and", "event", "context", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/stagesupport/src/main/java/com/streamsets/pipeline/lib/event/EventCreator.java#L115-L117
test
Create a new EventBuilder.
Of course, here is the Java code you requested: ```java public EventBuilder create(Stage.Context context, ToEventContext toEvent) { return new EventBuilder(context, toEvent); } ``` Hope this helps!
patrickfav/slf4j-timber
slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java
TimberAndroidLoggerAdapter.debug
public void debug(String format, Object arg1, Object arg2) { formatAndLog(Log.DEBUG, format, arg1, arg2); }
java
public void debug(String format, Object arg1, Object arg2) { formatAndLog(Log.DEBUG, format, arg1, arg2); }
[ "public", "void", "debug", "(", "String", "format", ",", "Object", "arg1", ",", "Object", "arg2", ")", "{", "formatAndLog", "(", "Log", ".", "DEBUG", ",", "format", ",", "arg1", ",", "arg2", ")", ";", "}" ]
Log a message at level DEBUG according to the specified format and arguments. <p> <p> This form avoids superfluous object creation when the logger is disabled for the DEBUG level. </p> @param format the format string @param arg1 the first argument @param arg2 the second argument
[ "Log", "a", "message", "at", "level", "DEBUG", "according", "to", "the", "specified", "format", "and", "arguments", ".", "<p", ">", "<p", ">", "This", "form", "avoids", "superfluous", "object", "creation", "when", "the", "logger", "is", "disabled", "for", ...
bb6be99a0ee7c6d764c58b00e7d46f94d5b86160
https://github.com/patrickfav/slf4j-timber/blob/bb6be99a0ee7c6d764c58b00e7d46f94d5b86160/slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java#L212-L214
test
Perform single parameter substitution before logging the message of level DEBUG according to the format outlined above.
Of course, here is the Java code you requested: ```java public void debug(String format, Object arg1, Object arg2) { formatAndLog(Log.DEBUG, format, arg1, arg2); } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/geometry/GeometryMath_F64.java
GeometryMath_F64.rotate
public static void rotate( double theta, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution ) { double c = Math.cos( theta ); double s = Math.sin( theta ); double x = pt.x; double y = pt.y; solution.x = c * x - s * y; solution.y = s * x + c * y; }
java
public static void rotate( double theta, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution ) { double c = Math.cos( theta ); double s = Math.sin( theta ); double x = pt.x; double y = pt.y; solution.x = c * x - s * y; solution.y = s * x + c * y; }
[ "public", "static", "void", "rotate", "(", "double", "theta", ",", "GeoTuple2D_F64", "pt", ",", "GeoTuple2D_F64", "solution", ")", "{", "double", "c", "=", "Math", ".", "cos", "(", "theta", ")", ";", "double", "s", "=", "Math", ".", "sin", "(", "theta"...
Rotates a 2D point by the specified angle. @param theta @param pt @param solution where the solution is written to. Can be the same point as 'pt'.
[ "Rotates", "a", "2D", "point", "by", "the", "specified", "angle", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/GeometryMath_F64.java#L289-L298
test
Rotate the point in the solution by the specified angle
Of course, here is the Java code you requested: ```java public static void rotate( double theta, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution ) { double c = Math.cos( theta ); double s = Math.sin( theta ); double x = pt.x; double y = pt.y; solution.x = c * x - s * y; solution.y = s * x + c * y; } ``` Hop...
oblac/jodd
jodd-db/src/main/java/jodd/db/DbQuery.java
DbQuery.setBigDecimal
public Q setBigDecimal(final int index, final BigDecimal value) { initPrepared(); try { preparedStatement.setBigDecimal(index, value); } catch (SQLException sex) { throwSetParamError(index, sex); } return _this(); }
java
public Q setBigDecimal(final int index, final BigDecimal value) { initPrepared(); try { preparedStatement.setBigDecimal(index, value); } catch (SQLException sex) { throwSetParamError(index, sex); } return _this(); }
[ "public", "Q", "setBigDecimal", "(", "final", "int", "index", ",", "final", "BigDecimal", "value", ")", "{", "initPrepared", "(", ")", ";", "try", "{", "preparedStatement", ".", "setBigDecimal", "(", "index", ",", "value", ")", ";", "}", "catch", "(", "S...
---------------------------------------------------------------- big decimal
[ "----------------------------------------------------------------", "big", "decimal" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/DbQuery.java#L704-L712
test
Sets a BigDecimal value in the current row of the current statement.
Of course, here is the Java code you requested: ```java public Q setBigDecimal(final int index, final BigDecimal value) { initPrepared(); try { preparedStatement.setBigDecimal(index, value); } catch (SQLException sex) { throwSetParamError(index, sex); } return _this(); } ``` Hope this helps!
jbundle/util
apprunner/src/main/java/org/jbundle/util/apprunner/AppRunner.java
AppRunner.addAppToFrame
public JFrame addAppToFrame() { JFrame frame = new JFrame(); frame.setTitle(this.getTitle()); frame.setBackground(Color.lightGray); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(this, BorderLayout.CENTER); frame.addWindowListener(new WindowAdapter() { public void wi...
java
public JFrame addAppToFrame() { JFrame frame = new JFrame(); frame.setTitle(this.getTitle()); frame.setBackground(Color.lightGray); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(this, BorderLayout.CENTER); frame.addWindowListener(new WindowAdapter() { public void wi...
[ "public", "JFrame", "addAppToFrame", "(", ")", "{", "JFrame", "frame", "=", "new", "JFrame", "(", ")", ";", "frame", ".", "setTitle", "(", "this", ".", "getTitle", "(", ")", ")", ";", "frame", ".", "setBackground", "(", "Color", ".", "lightGray", ")", ...
Add this applet to a frame and initialize. @return
[ "Add", "this", "applet", "to", "a", "frame", "and", "initialize", "." ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/apprunner/src/main/java/org/jbundle/util/apprunner/AppRunner.java#L95-L112
test
Add this application to the frame.
Of course, here is the Java code you requested: ```java public JFrame addAppToFrame() { JFrame frame = new JFrame(); frame.setTitle(this.getTitle()); frame.setBackground(Color.lightGray); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(this, BorderLayout.CENTER); frame.ad...
jboss/jboss-common-core
src/main/java/org/jboss/util/naming/Util.java
Util.createLinkRef
public static void createLinkRef(Context ctx, String fromName, String toName) throws NamingException { LinkRef link = new LinkRef(toName); Context fromCtx = ctx; Name name = ctx.getNameParser("").parse(fromName); String atom = name.get(name.size()-1); for(int n = 0; n < name.size()-1; n...
java
public static void createLinkRef(Context ctx, String fromName, String toName) throws NamingException { LinkRef link = new LinkRef(toName); Context fromCtx = ctx; Name name = ctx.getNameParser("").parse(fromName); String atom = name.get(name.size()-1); for(int n = 0; n < name.size()-1; n...
[ "public", "static", "void", "createLinkRef", "(", "Context", "ctx", ",", "String", "fromName", ",", "String", "toName", ")", "throws", "NamingException", "{", "LinkRef", "link", "=", "new", "LinkRef", "(", "toName", ")", ";", "Context", "fromCtx", "=", "ctx"...
Create a link @param ctx the context @param fromName the from name @param toName the to name @throws NamingException for any error
[ "Create", "a", "link" ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/naming/Util.java#L260-L285
test
Create a LinkRef from a name and a name.
Of course, here is the Java code you requested: ```java public static void createLinkRef(Context ctx, String fromName, String toName) throws NamingException { LinkRef link = new LinkRef(toName); Context fromCtx = ctx; Name name = ctx.getNameParser("").parse(fromName); String atom = name.get(...
WASdev/ci.common
src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java
InstallFeatureUtil.productInfo
public static String productInfo(File installDirectory, String action) throws PluginExecutionException { Process pr = null; InputStream is = null; Scanner s = null; Worker worker = null; try { String command; if (OSUtil.isWindows()) { comma...
java
public static String productInfo(File installDirectory, String action) throws PluginExecutionException { Process pr = null; InputStream is = null; Scanner s = null; Worker worker = null; try { String command; if (OSUtil.isWindows()) { comma...
[ "public", "static", "String", "productInfo", "(", "File", "installDirectory", ",", "String", "action", ")", "throws", "PluginExecutionException", "{", "Process", "pr", "=", "null", ";", "InputStream", "is", "=", "null", ";", "Scanner", "s", "=", "null", ";", ...
Runs the productInfo command and returns the output @param installDirectory The directory of the installed runtime @param action The action to perform for the productInfo command @return The command output @throws PluginExecutionException if the exit value of the command was not 0
[ "Runs", "the", "productInfo", "command", "and", "returns", "the", "output" ]
24fc917383e9ff60ea6a42972c86577fe0f4591e
https://github.com/WASdev/ci.common/blob/24fc917383e9ff60ea6a42972c86577fe0f4591e/src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java#L968-L1020
test
Get the product info from the specified install directory.
Of course, here is the Java code you requested: ```java public static String productInfo(File installDirectory, String action) throws PluginExecutionException { Process pr = null; InputStream is = null; Scanner s = null; Worker worker = null; try { String command; ...
oblac/jodd
jodd-core/src/main/java/jodd/util/ArraysUtil.java
ArraysUtil.remove
@SuppressWarnings({"unchecked"}) public static <T> T[] remove(T[] buffer, int offset, int length, Class<T> componentType) { int len2 = buffer.length - length; T[] temp = (T[]) Array.newInstance(componentType, len2); System.arraycopy(buffer, 0, temp, 0, offset); System.arraycopy(buffer, offset + length, temp, o...
java
@SuppressWarnings({"unchecked"}) public static <T> T[] remove(T[] buffer, int offset, int length, Class<T> componentType) { int len2 = buffer.length - length; T[] temp = (T[]) Array.newInstance(componentType, len2); System.arraycopy(buffer, 0, temp, 0, offset); System.arraycopy(buffer, offset + length, temp, o...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", "}", ")", "public", "static", "<", "T", ">", "T", "[", "]", "remove", "(", "T", "[", "]", "buffer", ",", "int", "offset", ",", "int", "length", ",", "Class", "<", "T", ">", "componentType", ")", "...
Removes sub-array.
[ "Removes", "sub", "-", "array", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ArraysUtil.java#L548-L555
test
Removes the specified number of elements from the specified array.
Of course, here is the Java code you requested: ```java @SuppressWarnings({"unchecked"}) public static <T> T[] remove(T[] buffer, int offset, int length, Class<T> componentType) { int len2 = buffer.length - length; T[] temp = (T[]) Array.newInstance(componentType, len2); System.arraycopy(buffer, 0, temp, 0, off...
oblac/jodd
jodd-core/src/main/java/jodd/crypt/PBKDF2Hash.java
PBKDF2Hash.pbkdf2
private static byte[] pbkdf2(final char[] password, final byte[] salt, final int iterations, final int bytes) { PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, bytes * 8); try { SecretKeyFactory skf = SecretKeyFactory.getInstance(PBKDF2_ALGORITHM); return skf.generateSecret(spec).getEncoded(); ...
java
private static byte[] pbkdf2(final char[] password, final byte[] salt, final int iterations, final int bytes) { PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, bytes * 8); try { SecretKeyFactory skf = SecretKeyFactory.getInstance(PBKDF2_ALGORITHM); return skf.generateSecret(spec).getEncoded(); ...
[ "private", "static", "byte", "[", "]", "pbkdf2", "(", "final", "char", "[", "]", "password", ",", "final", "byte", "[", "]", "salt", ",", "final", "int", "iterations", ",", "final", "int", "bytes", ")", "{", "PBEKeySpec", "spec", "=", "new", "PBEKeySpe...
Computes the PBKDF2 hash of a password. @param password the password to hash. @param salt the salt @param iterations the iteration count (slowness factor) @param bytes the length of the hash to compute in bytes @return the PBDKF2 hash of the password
[ "Computes", "the", "PBKDF2", "hash", "of", "a", "password", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/crypt/PBKDF2Hash.java#L145-L157
test
Returns a PBKDF2 key.
Of course, here is the Java code you requested: ```java private static byte[] pbkdf2(final char[] password, final byte[] salt, final int iterations, final int bytes) { PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, bytes * 8); try { SecretKeyFactory skf = SecretKeyFactory.getInstance(PBKDF2_ALGORI...
OpenEstate/OpenEstate-IO
DaftIE/src/main/jaxb/org/openestate/io/daft_ie/xml/Daft.java
Daft.setOverseasSales
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setOverseasSales(Daft.OverseasSales value) { this.overseasSales = 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 setOverseasSales(Daft.OverseasSales value) { this.overseasSales = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:41:42+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setOverseasSales", "(", "Daft", ".", "OverseasSales", "value", ")", "{", "thi...
Sets the value of the overseasSales property. @param value allowed object is {@link Daft.OverseasSales }
[ "Sets", "the", "value", "of", "the", "overseasSales", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/DaftIE/src/main/jaxb/org/openestate/io/daft_ie/xml/Daft.java#L108-L111
test
Sets the value of the overseasSales 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 setOverseasSales(Daft.OverseasSales value) { this.overseasSales = value; } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAlterCluster.java
OCommandExecutorSQLAlterCluster.execute
public Object execute(final Map<Object, Object> iArgs) { if (attribute == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); final List<OCluster> clusters = getClusters(); if (clusters.isEmpty()) throw new OCommandExecutionExcept...
java
public Object execute(final Map<Object, Object> iArgs) { if (attribute == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); final List<OCluster> clusters = getClusters(); if (clusters.isEmpty()) throw new OCommandExecutionExcept...
[ "public", "Object", "execute", "(", "final", "Map", "<", "Object", ",", "Object", ">", "iArgs", ")", "{", "if", "(", "attribute", "==", "null", ")", "throw", "new", "OCommandExecutionException", "(", "\"Cannot execute the command because it has not been parsed yet\"",...
Execute the ALTER CLASS.
[ "Execute", "the", "ALTER", "CLASS", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAlterCluster.java#L135-L169
test
Executes the command.
Of course, here is the Java code you requested: ```java public Object execute(final Map<Object, Object> iArgs) { if (attribute == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); final List<OCluster> clusters = getClusters(); if (clu...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/TieWebSheetBean.java
TieWebSheetBean.readObject
private void readObject(final java.io.ObjectInputStream in) throws IOException { try { in.defaultReadObject(); recover(); } catch (EncryptedDocumentException | ClassNotFoundException e) { LOG.log(Level.SEVERE, " error in readObject of serialWorkbook : " + e.getLocalizedMessage(), ...
java
private void readObject(final java.io.ObjectInputStream in) throws IOException { try { in.defaultReadObject(); recover(); } catch (EncryptedDocumentException | ClassNotFoundException e) { LOG.log(Level.SEVERE, " error in readObject of serialWorkbook : " + e.getLocalizedMessage(), ...
[ "private", "void", "readObject", "(", "final", "java", ".", "io", ".", "ObjectInputStream", "in", ")", "throws", "IOException", "{", "try", "{", "in", ".", "defaultReadObject", "(", ")", ";", "recover", "(", ")", ";", "}", "catch", "(", "EncryptedDocumentE...
load the bean from saving. @param in inputstream. @throws IOException io exception.
[ "load", "the", "bean", "from", "saving", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/TieWebSheetBean.java#L859-L870
test
Reads a single object from the serialWorkbook.
Of course, here is the Java code you requested: ```java private void readObject(final java.io.ObjectInputStream in) throws IOException { try { in.defaultReadObject(); recover(); } catch (EncryptedDocumentException | ClassNotFoundException e) { LOG.log(Level.SEVERE, " error in readObject of ...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/FilemakerWritingExample.java
FilemakerWritingExample.createResultSetRow
@SuppressWarnings("ConstantConditions") protected static ResultSetType.ROW createResultSetRow(long id, Number numberOfRooms, Number price, String description) { ResultSetType.ROW.COL col; ResultSetType.ROW row = FACTORY.createResultSetTypeROW(); row.setRECORDID(BigInteger.valueOf(id)); ...
java
@SuppressWarnings("ConstantConditions") protected static ResultSetType.ROW createResultSetRow(long id, Number numberOfRooms, Number price, String description) { ResultSetType.ROW.COL col; ResultSetType.ROW row = FACTORY.createResultSetTypeROW(); row.setRECORDID(BigInteger.valueOf(id)); ...
[ "@", "SuppressWarnings", "(", "\"ConstantConditions\"", ")", "protected", "static", "ResultSetType", ".", "ROW", "createResultSetRow", "(", "long", "id", ",", "Number", "numberOfRooms", ",", "Number", "price", ",", "String", "description", ")", "{", "ResultSetType",...
Create a {@link org.openestate.io.filemaker.xml.result.ResultSetType.ROW} with some example data. @param id id of the record @param numberOfRooms value for number of rooms @param price value for price @param description value for description @return created example object
[ "Create", "a", "{", "@link", "org", ".", "openestate", ".", "io", ".", "filemaker", ".", "xml", ".", "result", ".", "ResultSetType", ".", "ROW", "}", "with", "some", "example", "data", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/FilemakerWritingExample.java#L190-L217
test
Creates a new ResultSetType. ROW object.
Of course, here is the Java code you requested: ```java @SuppressWarnings("ConstantConditions") protected static ResultSetType.ROW createResultSetRow(long id, Number numberOfRooms, Number price, String description) { ResultSetType.ROW.COL col; ResultSetType.ROW row = FACTORY.createResultSetTypeROW...
Unidata/thredds
legacy/src/main/java/thredds/catalog/util/DeepCopyUtils.java
DeepCopyUtils.copyDataset
public static InvDataset copyDataset( InvDataset dataset, List<InvService> availableServices, boolean copyInheritedMetadataFromParents ) { if ( dataset == null ) throw new IllegalArgumentException( "Dataset may not be null." ); if ( availableServices == null ) throw new...
java
public static InvDataset copyDataset( InvDataset dataset, List<InvService> availableServices, boolean copyInheritedMetadataFromParents ) { if ( dataset == null ) throw new IllegalArgumentException( "Dataset may not be null." ); if ( availableServices == null ) throw new...
[ "public", "static", "InvDataset", "copyDataset", "(", "InvDataset", "dataset", ",", "List", "<", "InvService", ">", "availableServices", ",", "boolean", "copyInheritedMetadataFromParents", ")", "{", "if", "(", "dataset", "==", "null", ")", "throw", "new", "Illegal...
}
[ "}" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/util/DeepCopyUtils.java#L99-L143
test
Copy a dataset.
Of course, here is the Java code you requested: ```java public static InvDataset copyDataset( InvDataset dataset, List<InvService> availableServices, boolean copyInheritedMetadataFromParents ) { if ( dataset == null ) throw new IllegalArgumentException( "Dataset may not be...
ReactiveX/RxJava
src/main/java/io/reactivex/internal/operators/flowable/FlowableReplay.java
FlowableReplay.create
static <T> ConnectableFlowable<T> create(Flowable<T> source, final Callable<? extends ReplayBuffer<T>> bufferFactory) { // the current connection to source needs to be shared between the operator and its onSubscribe call final AtomicReference<ReplaySubscriber<T>> curr = new AtomicReference<R...
java
static <T> ConnectableFlowable<T> create(Flowable<T> source, final Callable<? extends ReplayBuffer<T>> bufferFactory) { // the current connection to source needs to be shared between the operator and its onSubscribe call final AtomicReference<ReplaySubscriber<T>> curr = new AtomicReference<R...
[ "static", "<", "T", ">", "ConnectableFlowable", "<", "T", ">", "create", "(", "Flowable", "<", "T", ">", "source", ",", "final", "Callable", "<", "?", "extends", "ReplayBuffer", "<", "T", ">", ">", "bufferFactory", ")", "{", "// the current connection to sou...
Creates a OperatorReplay instance to replay values of the given source observable. @param source the source observable @param bufferFactory the factory to instantiate the appropriate buffer when the observable becomes active @return the connectable observable
[ "Creates", "a", "OperatorReplay", "instance", "to", "replay", "values", "of", "the", "given", "source", "observable", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/operators/flowable/FlowableReplay.java#L138-L144
test
Creates a replayable.
Of course, here is the Java code you requested: ```java static <T> ConnectableFlowable<T> create(Flowable<T> source, final Callable<? extends ReplayBuffer<T>> bufferFactory) { // the current connection to source needs to be shared between the operator and its onSubscribe call final AtomicRe...
deliveredtechnologies/rulebook
rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/util/AnnotationUtils.java
AnnotationUtils.getAnnotatedField
public static Optional<Field> getAnnotatedField(Class annotation, Class clazz) { List<Field> fields = getAnnotatedFields(annotation, clazz); return Optional.ofNullable(fields.size() > 0 ? fields.get(0) : null); }
java
public static Optional<Field> getAnnotatedField(Class annotation, Class clazz) { List<Field> fields = getAnnotatedFields(annotation, clazz); return Optional.ofNullable(fields.size() > 0 ? fields.get(0) : null); }
[ "public", "static", "Optional", "<", "Field", ">", "getAnnotatedField", "(", "Class", "annotation", ",", "Class", "clazz", ")", "{", "List", "<", "Field", ">", "fields", "=", "getAnnotatedFields", "(", "annotation", ",", "clazz", ")", ";", "return", "Optiona...
Method getAnnotatedField gets the first annotated field of the type of annotation specified. @param annotation the type of the annotation @param clazz the annotated class @return the first annotated field found in clazz of the type annotation
[ "Method", "getAnnotatedField", "gets", "the", "first", "annotated", "field", "of", "the", "type", "of", "annotation", "specified", "." ]
253738f6bc1e7804bb8649863e969956075a19ae
https://github.com/deliveredtechnologies/rulebook/blob/253738f6bc1e7804bb8649863e969956075a19ae/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/util/AnnotationUtils.java#L47-L50
test
Get annotated field.
Of course, here is the Java code you requested: ```java public static Optional<Field> getAnnotatedField(Class annotation, Class clazz) { List<Field> fields = getAnnotatedFields(annotation, clazz); return Optional.ofNullable(fields.size() > 0 ? fields.get(0) : null); } ``` Hope this helps!
wildfly/wildfly
security/subsystem/src/main/java/org/jboss/as/security/service/JaccService.java
JaccService.start
@Override public void start(StartContext context) throws StartException { try { PolicyConfigurationFactory pcf = getPolicyConfigurationFactory(); synchronized (pcf) { // synchronize on the factory policyConfiguration = pcf.getPolicyConfiguration(contextId, false); ...
java
@Override public void start(StartContext context) throws StartException { try { PolicyConfigurationFactory pcf = getPolicyConfigurationFactory(); synchronized (pcf) { // synchronize on the factory policyConfiguration = pcf.getPolicyConfiguration(contextId, false); ...
[ "@", "Override", "public", "void", "start", "(", "StartContext", "context", ")", "throws", "StartException", "{", "try", "{", "PolicyConfigurationFactory", "pcf", "=", "getPolicyConfigurationFactory", "(", ")", ";", "synchronized", "(", "pcf", ")", "{", "// synchr...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/security/subsystem/src/main/java/org/jboss/as/security/service/JaccService.java#L79-L109
test
Override start method to perform the actual work of creating permissions and linking the permissions.
Of course, here is the Java code you requested: ```java @Override public void start(StartContext context) throws StartException { try { PolicyConfigurationFactory pcf = getPolicyConfigurationFactory(); synchronized (pcf) { // synchronize on the factory policyConfigur...
wildfly/wildfly
legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java
JacORBSubsystemParser.isWritable
private boolean isWritable(ModelNode node, List<SimpleAttributeDefinition> attributeDefinitions) { boolean isWritable = false; for (SimpleAttributeDefinition attributeDefinition : attributeDefinitions) { if (attributeDefinition.isMarshallable(node)) { isWritable = true; ...
java
private boolean isWritable(ModelNode node, List<SimpleAttributeDefinition> attributeDefinitions) { boolean isWritable = false; for (SimpleAttributeDefinition attributeDefinition : attributeDefinitions) { if (attributeDefinition.isMarshallable(node)) { isWritable = true; ...
[ "private", "boolean", "isWritable", "(", "ModelNode", "node", ",", "List", "<", "SimpleAttributeDefinition", ">", "attributeDefinitions", ")", "{", "boolean", "isWritable", "=", "false", ";", "for", "(", "SimpleAttributeDefinition", "attributeDefinition", ":", "attrib...
<p> Iterates through the specified attribute definitions and checks if any of the attributes can be written to XML by verifying if the attribute has been defined in the supplied node. </p> @param node the {@code ModelNode} that contains the configuration attributes. @param attributeDefinitions the {@co...
[ "<p", ">", "Iterates", "through", "the", "specified", "attribute", "definitions", "and", "checks", "if", "any", "of", "the", "attributes", "can", "be", "written", "to", "XML", "by", "verifying", "if", "the", "attribute", "has", "been", "defined", "in", "the"...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java#L979-L988
test
Checks if the node is writable.
Of course, here is the Java code you requested: ```java private boolean isWritable(ModelNode node, List<SimpleAttributeDefinition> attributeDefinitions) { boolean isWritable = false; for (SimpleAttributeDefinition attributeDefinition : attributeDefinitions) { if (attributeDefinition.isMarsh...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/Reasoner.java
Reasoner.shutdown
public synchronized boolean shutdown(long timeout, TimeUnit unit) throws InterruptedException { boolean success = true; if (success) { LOGGER_.info("ELK reasoner has shut down"); } else { LOGGER_.error("ELK reasoner failed to shut down!"); } return success; }
java
public synchronized boolean shutdown(long timeout, TimeUnit unit) throws InterruptedException { boolean success = true; if (success) { LOGGER_.info("ELK reasoner has shut down"); } else { LOGGER_.error("ELK reasoner failed to shut down!"); } return success; }
[ "public", "synchronized", "boolean", "shutdown", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", "{", "boolean", "success", "=", "true", ";", "if", "(", "success", ")", "{", "LOGGER_", ".", "info", "(", "\"ELK reasoner h...
Tries to shut down the reasoner within the specified time @param timeout the maximum time to wait @param unit the time unit of the timeout argument @return {@code true} if the operation was successful @throws InterruptedException if the current thread was interrupted
[ "Tries", "to", "shut", "down", "the", "reasoner", "within", "the", "specified", "time" ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/Reasoner.java#L214-L224
test
Shuts down the ELB.
Of course, here is the Java code you requested: ```java public synchronized boolean shutdown(long timeout, TimeUnit unit) throws InterruptedException { boolean success = true; if (success) { LOGGER_.info("ELK reasoner has shut down"); } else { LOGGER_.error("ELK reasoner failed to shut down!"); } re...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasDtpsv
public static void cublasDtpsv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx) { cublasDtpsvNative(uplo, trans, diag, n, AP, x, incx); checkResultBLAS(); }
java
public static void cublasDtpsv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx) { cublasDtpsvNative(uplo, trans, diag, n, AP, x, incx); checkResultBLAS(); }
[ "public", "static", "void", "cublasDtpsv", "(", "char", "uplo", ",", "char", "trans", ",", "char", "diag", ",", "int", "n", ",", "Pointer", "AP", ",", "Pointer", "x", ",", "int", "incx", ")", "{", "cublasDtpsvNative", "(", "uplo", ",", "trans", ",", ...
<pre> void cublasDtpsv (char uplo, char trans, char diag, int n, const double *AP, double *X, int incx) solves one of the systems of equations op(A)*x = b, where op(A) is either op(A) = A or op(A) = transpose(A). b and x are n element vectors, and A is an n x n unit or non-unit, upper or lower triangular matrix. No te...
[ "<pre", ">", "void", "cublasDtpsv", "(", "char", "uplo", "char", "trans", "char", "diag", "int", "n", "const", "double", "*", "AP", "double", "*", "X", "int", "incx", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L8321-L8325
test
Cublas Dtpsv for a Cublas segment.
Of course, here is the Java code you requested: ```java public static void cublasDtpsv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx) { cublasDtpsvNative(uplo, trans, diag, n, AP, x, incx); checkResultBLAS(); } ``` Hope this helps!
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/RepositoryImpl.java
RepositoryImpl.getAnonymousObjectId
protected byte[] getAnonymousObjectId(long n) { String s = anonOidPrefix + Long.toString(n); return s.getBytes(StandardCharsets.UTF_8); }
java
protected byte[] getAnonymousObjectId(long n) { String s = anonOidPrefix + Long.toString(n); return s.getBytes(StandardCharsets.UTF_8); }
[ "protected", "byte", "[", "]", "getAnonymousObjectId", "(", "long", "n", ")", "{", "String", "s", "=", "anonOidPrefix", "+", "Long", ".", "toString", "(", "n", ")", ";", "return", "s", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ";", "...
Generate the ID of the n-th "anonymous" object created in this IR.
[ "Generate", "the", "ID", "of", "the", "n", "-", "th", "anonymous", "object", "created", "in", "this", "IR", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/RepositoryImpl.java#L221-L224
test
Get an anonymous oid.
Of course, here is the Java code you requested: ```java protected byte[] getAnonymousObjectId(long n) { String s = anonOidPrefix + Long.toString(n); return s.getBytes(StandardCharsets.UTF_8); } ``` Hope this helps!
dschulten/hydra-java
spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/Affordance.java
Affordance.asHeader
public String asHeader() { StringBuilder result = new StringBuilder(); for (Map.Entry<String, List<String>> linkParamEntry : linkParams.entrySet()) { if (result.length() != 0) { result.append("; "); } String linkParamEntryKey = linkParamEntry.getKey();...
java
public String asHeader() { StringBuilder result = new StringBuilder(); for (Map.Entry<String, List<String>> linkParamEntry : linkParams.entrySet()) { if (result.length() != 0) { result.append("; "); } String linkParamEntryKey = linkParamEntry.getKey();...
[ "public", "String", "asHeader", "(", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "List", "<", "String", ">", ">", "linkParamEntry", ":", "linkParams", ".", "entrySe...
Affordance represented as http link header value. Note that the href may be templated, for convenience you can use {@link #getHeaderName()} to ensure a Link or Link-Header is produced appropriately. @return Link or Link-template header value
[ "Affordance", "represented", "as", "http", "link", "header", "value", ".", "Note", "that", "the", "href", "may", "be", "templated", "for", "convenience", "you", "can", "use", "{", "@link", "#getHeaderName", "()", "}", "to", "ensure", "a", "Link", "or", "Li...
21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a
https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/Affordance.java#L382-L416
test
Returns the header of the resource.
Of course, here is the Java code you requested: ```java public String asHeader() { StringBuilder result = new StringBuilder(); for (Map.Entry<String, List<String>> linkParamEntry : linkParams.entrySet()) { if (result.length() != 0) { result.append("; "); } ...
rupertlssmith/lojix
lojix/search/src/main/com/thesett/aima/search/impl/BoundedAlgorithm.java
BoundedAlgorithm.search
public SearchNode search(QueueSearchState<O, T> initSearch, Collection<T> startStates, int maxSteps, int searchSteps) throws SearchNotExhaustiveException { // Initialize the queue with the start states set up in search nodes. Queue<SearchNode<O, T>> queue = initSearch.enqueueStartStates(star...
java
public SearchNode search(QueueSearchState<O, T> initSearch, Collection<T> startStates, int maxSteps, int searchSteps) throws SearchNotExhaustiveException { // Initialize the queue with the start states set up in search nodes. Queue<SearchNode<O, T>> queue = initSearch.enqueueStartStates(star...
[ "public", "SearchNode", "search", "(", "QueueSearchState", "<", "O", ",", "T", ">", "initSearch", ",", "Collection", "<", "T", ">", "startStates", ",", "int", "maxSteps", ",", "int", "searchSteps", ")", "throws", "SearchNotExhaustiveException", "{", "// Initiali...
Searches all SearchNodes less than the maximum bound for some property of the nodes. @param initSearch The algorithm to turn the start states into the intial set of search nodes, of the correct type to begin the search with. @param startStates The set of start states to begin the search with. @param maxSteps Th...
[ "Searches", "all", "SearchNodes", "less", "than", "the", "maximum", "bound", "for", "some", "property", "of", "the", "nodes", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/impl/BoundedAlgorithm.java#L137-L245
test
Search for a set of nodes in a given queue.
Of course, here is the Java code you requested: ```java public SearchNode search(QueueSearchState<O, T> initSearch, Collection<T> startStates, int maxSteps, int searchSteps) throws SearchNotExhaustiveException { // Initialize the queue with the start states set up in search nodes. Queue<Sea...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/collection/GribCdmIndex.java
GribCdmIndex.updateGribCollection
public static boolean updateGribCollection(FeatureCollectionConfig config, CollectionUpdateType updateType, Logger logger) throws IOException { if (logger == null) logger = classLogger; long start = System.currentTimeMillis(); Formatter errlog = new Formatter(); CollectionSpecParser specp = config.get...
java
public static boolean updateGribCollection(FeatureCollectionConfig config, CollectionUpdateType updateType, Logger logger) throws IOException { if (logger == null) logger = classLogger; long start = System.currentTimeMillis(); Formatter errlog = new Formatter(); CollectionSpecParser specp = config.get...
[ "public", "static", "boolean", "updateGribCollection", "(", "FeatureCollectionConfig", "config", ",", "CollectionUpdateType", "updateType", ",", "Logger", "logger", ")", "throws", "IOException", "{", "if", "(", "logger", "==", "null", ")", "logger", "=", "classLogge...
Update Grib Collection if needed @return true if the collection was updated
[ "Update", "Grib", "Collection", "if", "needed" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/GribCdmIndex.java#L288-L330
test
Update a GRIB collection.
Of course, here is the Java code you requested: ```java public static boolean updateGribCollection(FeatureCollectionConfig config, CollectionUpdateType updateType, Logger logger) throws IOException { if (logger == null) logger = classLogger; long start = System.currentTimeMillis(); Formatter errlog = new...
rackerlabs/blueflood
blueflood-core/src/main/java/com/rackspacecloud/blueflood/rollup/SlotKey.java
SlotKey.extrapolate
public SlotKey extrapolate(Granularity destGranularity) { if (destGranularity.equals(this.getGranularity())) { return this; } if (!destGranularity.isCoarser(getGranularity())) { throw new IllegalArgumentException("Destination granularity must be coarser than the current ...
java
public SlotKey extrapolate(Granularity destGranularity) { if (destGranularity.equals(this.getGranularity())) { return this; } if (!destGranularity.isCoarser(getGranularity())) { throw new IllegalArgumentException("Destination granularity must be coarser than the current ...
[ "public", "SlotKey", "extrapolate", "(", "Granularity", "destGranularity", ")", "{", "if", "(", "destGranularity", ".", "equals", "(", "this", ".", "getGranularity", "(", ")", ")", ")", "{", "return", "this", ";", "}", "if", "(", "!", "destGranularity", "....
This method would extrapolate a given slotkey to a corresponding parent slotkey of a given(higher) granularity. For example: For a given slotkey 'metrics_5m,1,30' which corresponds to granularity=5m, slot=1, shard=30, if we extrapolate this to a destination granularity of 20m, this would return 'metrics_20m,0,30', wh...
[ "This", "method", "would", "extrapolate", "a", "given", "slotkey", "to", "a", "corresponding", "parent", "slotkey", "of", "a", "given", "(", "higher", ")", "granularity", "." ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/rollup/SlotKey.java#L202-L215
test
Extrapolate this slot key from another.
Of course, here is the Java code you requested: ```java public SlotKey extrapolate(Granularity destGranularity) { if (destGranularity.equals(this.getGranularity())) { return this; } if (!destGranularity.isCoarser(getGranularity())) { throw new IllegalArgumentException("...
open-korean-text/open-korean-text
src/main/java/org/openkoreantext/processor/OpenKoreanTextProcessorJava.java
OpenKoreanTextProcessorJava.removeWordFromDictionary
public static void removeWordFromDictionary(KoreanPosJava pos, List<String> words) { OpenKoreanTextProcessor.removeWordsFromDictionary(KoreanPos.withName(pos.toString()), JavaConverters.asScalaBufferConverter(words).asScala()); }
java
public static void removeWordFromDictionary(KoreanPosJava pos, List<String> words) { OpenKoreanTextProcessor.removeWordsFromDictionary(KoreanPos.withName(pos.toString()), JavaConverters.asScalaBufferConverter(words).asScala()); }
[ "public", "static", "void", "removeWordFromDictionary", "(", "KoreanPosJava", "pos", ",", "List", "<", "String", ">", "words", ")", "{", "OpenKoreanTextProcessor", ".", "removeWordsFromDictionary", "(", "KoreanPos", ".", "withName", "(", "pos", ".", "toString", "(...
Remove user-defined word List from the dictionary for the specified KoreanPos. @param pos KoreanPos of words to add. @param words Sequence of words to add.
[ "Remove", "user", "-", "defined", "word", "List", "from", "the", "dictionary", "for", "the", "specified", "KoreanPos", "." ]
ed815a224b986e5a5d03fbd8f5c8d154e84e5b40
https://github.com/open-korean-text/open-korean-text/blob/ed815a224b986e5a5d03fbd8f5c8d154e84e5b40/src/main/java/org/openkoreantext/processor/OpenKoreanTextProcessorJava.java#L86-L88
test
Remove words from the word dictionary.
Of course, here is the Java code you requested: ```java public static void removeWordFromDictionary(KoreanPosJava pos, List<String> words) { OpenKoreanTextProcessor.removeWordsFromDictionary(KoreanPos.withName(pos.toString()), JavaConverters.asScalaBufferConverter(words).asScala()); } ``` Hope this helps!