repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.addListenerIfPending
public <T> void addListenerIfPending(final Class<T> clazz, final Object requestCacheKey, final PendingRequestListener<T> requestListener) { addListenerIfPending(clazz, requestCacheKey, (RequestListener<T>) requestListener); }
java
public <T> void addListenerIfPending(final Class<T> clazz, final Object requestCacheKey, final PendingRequestListener<T> requestListener) { addListenerIfPending(clazz, requestCacheKey, (RequestListener<T>) requestListener); }
[ "public", "<", "T", ">", "void", "addListenerIfPending", "(", "final", "Class", "<", "T", ">", "clazz", ",", "final", "Object", "requestCacheKey", ",", "final", "PendingRequestListener", "<", "T", ">", "requestListener", ")", "{", "addListenerIfPending", "(", ...
Add listener to a pending request if it exists. If no such request exists, this method calls onRequestNotFound on the listener. If a request identified by clazz and requestCacheKey, it will receive an additional listener. @param clazz the class of the result of the pending request to look for. @param requestCacheKey th...
[ "Add", "listener", "to", "a", "pending", "request", "if", "it", "exists", ".", "If", "no", "such", "request", "exists", "this", "method", "calls", "onRequestNotFound", "on", "the", "listener", ".", "If", "a", "request", "identified", "by", "clazz", "and", ...
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L429-L431
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.execute
public <T> void execute(final CachedSpiceRequest<T> cachedSpiceRequest, final RequestListener<T> requestListener) { addRequestListenerToListOfRequestListeners(cachedSpiceRequest, requestListener); Ln.d("adding request to request queue"); this.requestQueue.add(cachedSpiceRequest); }
java
public <T> void execute(final CachedSpiceRequest<T> cachedSpiceRequest, final RequestListener<T> requestListener) { addRequestListenerToListOfRequestListeners(cachedSpiceRequest, requestListener); Ln.d("adding request to request queue"); this.requestQueue.add(cachedSpiceRequest); }
[ "public", "<", "T", ">", "void", "execute", "(", "final", "CachedSpiceRequest", "<", "T", ">", "cachedSpiceRequest", ",", "final", "RequestListener", "<", "T", ">", "requestListener", ")", "{", "addRequestListenerToListOfRequestListeners", "(", "cachedSpiceRequest", ...
Execute a request, put the result in cache and register listeners to notify when request is finished. @param cachedSpiceRequest the request to execute. {@link CachedSpiceRequest} is a wrapper of {@link SpiceRequest} that contains cache key and cache duration @param requestListener the listener to notify when the reques...
[ "Execute", "a", "request", "put", "the", "result", "in", "cache", "and", "register", "listeners", "to", "notify", "when", "request", "is", "finished", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L487-L491
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.putInCache
public <U, T extends U> void putInCache(final Class<U> clazz, final Object requestCacheKey, final T data, RequestListener<U> listener) { @SuppressWarnings({ "unchecked", "rawtypes" }) final SpiceRequest<U> spiceRequest = new SpiceRequest(clazz) { @Override public U loadDataFromNe...
java
public <U, T extends U> void putInCache(final Class<U> clazz, final Object requestCacheKey, final T data, RequestListener<U> listener) { @SuppressWarnings({ "unchecked", "rawtypes" }) final SpiceRequest<U> spiceRequest = new SpiceRequest(clazz) { @Override public U loadDataFromNe...
[ "public", "<", "U", ",", "T", "extends", "U", ">", "void", "putInCache", "(", "final", "Class", "<", "U", ">", "clazz", ",", "final", "Object", "requestCacheKey", ",", "final", "T", "data", ",", "RequestListener", "<", "U", ">", "listener", ")", "{", ...
Adds some data to the cache, asynchronously. @param clazz a super class or the class of data. @param requestCacheKey the request cache key that data will be stored in. @param data the data to store. Maybe null if supported by underlying ObjectPersister. @param listener a listener that will be notified of this request's...
[ "Adds", "some", "data", "to", "the", "cache", "asynchronously", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L537-L548
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.cancel
public <T> void cancel(final Class<T> clazz, final Object requestCacheKey) { final SpiceRequest<T> request = new SpiceRequest<T>(clazz) { @Override public T loadDataFromNetwork() throws Exception { return null; } }; final CachedSpiceRequest<T>...
java
public <T> void cancel(final Class<T> clazz, final Object requestCacheKey) { final SpiceRequest<T> request = new SpiceRequest<T>(clazz) { @Override public T loadDataFromNetwork() throws Exception { return null; } }; final CachedSpiceRequest<T>...
[ "public", "<", "T", ">", "void", "cancel", "(", "final", "Class", "<", "T", ">", "clazz", ",", "final", "Object", "requestCacheKey", ")", "{", "final", "SpiceRequest", "<", "T", ">", "request", "=", "new", "SpiceRequest", "<", "T", ">", "(", "clazz", ...
Cancel a pending request if it exists. If no such request exists, this method does nothing. If a request identified by clazz and requestCacheKey exists, it will be cancelled and its associated listeners will get notified. This method is asynchronous. @param clazz the class of the result of the pending request to look f...
[ "Cancel", "a", "pending", "request", "if", "it", "exists", ".", "If", "no", "such", "request", "exists", "this", "method", "does", "nothing", ".", "If", "a", "request", "identified", "by", "clazz", "and", "requestCacheKey", "exists", "it", "will", "be", "c...
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L610-L623
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.dontNotifyAnyRequestListenersInternal
protected void dontNotifyAnyRequestListenersInternal() { lockSendRequestsToService.lock(); try { if (spiceService == null) { return; } synchronized (mapRequestToLaunchToRequestListener) { if (!mapRequestToLaunchToRequestListener.isEmpty...
java
protected void dontNotifyAnyRequestListenersInternal() { lockSendRequestsToService.lock(); try { if (spiceService == null) { return; } synchronized (mapRequestToLaunchToRequestListener) { if (!mapRequestToLaunchToRequestListener.isEmpty...
[ "protected", "void", "dontNotifyAnyRequestListenersInternal", "(", ")", "{", "lockSendRequestsToService", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "spiceService", "==", "null", ")", "{", "return", ";", "}", "synchronized", "(", "mapRequestToLaunchToReque...
Remove all listeners of requests. All requests that have not been yet passed to the service will see their of listeners cleaned. For all requests that have been passed to the service, we ask the service to remove their listeners.
[ "Remove", "all", "listeners", "of", "requests", ".", "All", "requests", "that", "have", "not", "been", "yet", "passed", "to", "the", "service", "will", "see", "their", "of", "listeners", "cleaned", ".", "For", "all", "requests", "that", "have", "been", "pa...
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L749-L775
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.removeListenersOfAllPendingCachedRequests
private void removeListenersOfAllPendingCachedRequests() throws InterruptedException { synchronized (mapPendingRequestToRequestListener) { if (!mapPendingRequestToRequestListener.isEmpty()) { for (final CachedSpiceRequest<?> cachedSpiceRequest : mapPendingRequestToRequestListener.key...
java
private void removeListenersOfAllPendingCachedRequests() throws InterruptedException { synchronized (mapPendingRequestToRequestListener) { if (!mapPendingRequestToRequestListener.isEmpty()) { for (final CachedSpiceRequest<?> cachedSpiceRequest : mapPendingRequestToRequestListener.key...
[ "private", "void", "removeListenersOfAllPendingCachedRequests", "(", ")", "throws", "InterruptedException", "{", "synchronized", "(", "mapPendingRequestToRequestListener", ")", "{", "if", "(", "!", "mapPendingRequestToRequestListener", ".", "isEmpty", "(", ")", ")", "{", ...
Asynchronously ask service to remove all listeners of pending requests. @throws InterruptedException in case service binding fails.
[ "Asynchronously", "ask", "service", "to", "remove", "all", "listeners", "of", "pending", "requests", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L782-L797
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.isDataInCache
public Future<Boolean> isDataInCache(Class<?> clazz, final Object cacheKey, long cacheExpiryDuration) throws CacheCreationException { return executeCommand(new IsDataInCacheCommand(this, clazz, cacheKey, cacheExpiryDuration)); }
java
public Future<Boolean> isDataInCache(Class<?> clazz, final Object cacheKey, long cacheExpiryDuration) throws CacheCreationException { return executeCommand(new IsDataInCacheCommand(this, clazz, cacheKey, cacheExpiryDuration)); }
[ "public", "Future", "<", "Boolean", ">", "isDataInCache", "(", "Class", "<", "?", ">", "clazz", ",", "final", "Object", "cacheKey", ",", "long", "cacheExpiryDuration", ")", "throws", "CacheCreationException", "{", "return", "executeCommand", "(", "new", "IsDataI...
Tests whether some data is present in cache or not. @param clazz the class of the result to retrieve from cache. @param cacheKey the key used to store and retrieve the result of the request in the cache @param cacheExpiryDuration duration in milliseconds after which the content of the cache will be considered to be exp...
[ "Tests", "whether", "some", "data", "is", "present", "in", "cache", "or", "not", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L948-L950
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.getDateOfDataInCache
public Future<Date> getDateOfDataInCache(Class<?> clazz, final Object cacheKey) throws CacheCreationException { return executeCommand(new GetDateOfDataInCacheCommand(this, clazz, cacheKey)); }
java
public Future<Date> getDateOfDataInCache(Class<?> clazz, final Object cacheKey) throws CacheCreationException { return executeCommand(new GetDateOfDataInCacheCommand(this, clazz, cacheKey)); }
[ "public", "Future", "<", "Date", ">", "getDateOfDataInCache", "(", "Class", "<", "?", ">", "clazz", ",", "final", "Object", "cacheKey", ")", "throws", "CacheCreationException", "{", "return", "executeCommand", "(", "new", "GetDateOfDataInCacheCommand", "(", "this"...
Returns the last date of storage of a given data into the cache. @param clazz the class of the result to retrieve from cache. @param cacheKey the key used to store and retrieve the result of the request in the cache @return the date at which data has been stored in cache. Null if no such data is in Cache. @throws Cache...
[ "Returns", "the", "last", "date", "of", "storage", "of", "a", "given", "data", "into", "the", "cache", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L965-L967
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java
SpiceManager.dumpState
public void dumpState() { executorService.execute(new Runnable() { @Override public void run() { lockSendRequestsToService.lock(); try { final StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(...
java
public void dumpState() { executorService.execute(new Runnable() { @Override public void run() { lockSendRequestsToService.lock(); try { final StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(...
[ "public", "void", "dumpState", "(", ")", "{", "executorService", ".", "execute", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "lockSendRequestsToService", ".", "lock", "(", ")", ";", "try", "{", "final",...
Dumps request processor state.
[ "Dumps", "request", "processor", "state", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L1033-L1063
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java
SpiceServiceListenerNotifier.notifyObserversOfRequestFailure
public void notifyObserversOfRequestFailure(CachedSpiceRequest<?> request) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); post(new RequestFailedNotifier(request, spiceServiceListenerList, ...
java
public void notifyObserversOfRequestFailure(CachedSpiceRequest<?> request) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); post(new RequestFailedNotifier(request, spiceServiceListenerList, ...
[ "public", "void", "notifyObserversOfRequestFailure", "(", "CachedSpiceRequest", "<", "?", ">", "request", ")", "{", "RequestProcessingContext", "requestProcessingContext", "=", "new", "RequestProcessingContext", "(", ")", ";", "requestProcessingContext", ".", "setExecutionT...
Notify interested observers that the request failed. @param request the request that failed.
[ "Notify", "interested", "observers", "that", "the", "request", "failed", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L91-L95
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java
SpiceServiceListenerNotifier.notifyObserversOfRequestSuccess
public <T> void notifyObserversOfRequestSuccess(CachedSpiceRequest<T> request) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); post(new RequestSucceededNotifier<T>(request, spiceServiceList...
java
public <T> void notifyObserversOfRequestSuccess(CachedSpiceRequest<T> request) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); post(new RequestSucceededNotifier<T>(request, spiceServiceList...
[ "public", "<", "T", ">", "void", "notifyObserversOfRequestSuccess", "(", "CachedSpiceRequest", "<", "T", ">", "request", ")", "{", "RequestProcessingContext", "requestProcessingContext", "=", "new", "RequestProcessingContext", "(", ")", ";", "requestProcessingContext", ...
Notify interested observers that the request succeeded. @param request the request that succeeded.
[ "Notify", "interested", "observers", "that", "the", "request", "succeeded", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L101-L105
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java
SpiceServiceListenerNotifier.notifyObserversOfRequestCancellation
public void notifyObserversOfRequestCancellation(CachedSpiceRequest<?> request) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); post(new RequestCancelledNotifier(request, spiceServiceListen...
java
public void notifyObserversOfRequestCancellation(CachedSpiceRequest<?> request) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); post(new RequestCancelledNotifier(request, spiceServiceListen...
[ "public", "void", "notifyObserversOfRequestCancellation", "(", "CachedSpiceRequest", "<", "?", ">", "request", ")", "{", "RequestProcessingContext", "requestProcessingContext", "=", "new", "RequestProcessingContext", "(", ")", ";", "requestProcessingContext", ".", "setExecu...
Notify interested observers that the request was cancelled. @param request the request that was cancelled.
[ "Notify", "interested", "observers", "that", "the", "request", "was", "cancelled", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L111-L115
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java
SpiceServiceListenerNotifier.notifyObserversOfRequestProgress
public void notifyObserversOfRequestProgress(CachedSpiceRequest<?> request, RequestProgress requestProgress) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); requestProcessingContext.setRequ...
java
public void notifyObserversOfRequestProgress(CachedSpiceRequest<?> request, RequestProgress requestProgress) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); requestProcessingContext.setRequ...
[ "public", "void", "notifyObserversOfRequestProgress", "(", "CachedSpiceRequest", "<", "?", ">", "request", ",", "RequestProgress", "requestProgress", ")", "{", "RequestProcessingContext", "requestProcessingContext", "=", "new", "RequestProcessingContext", "(", ")", ";", "...
Notify interested observers of request progress. @param request the request in progress. @param requestProgress the progress of the request.
[ "Notify", "interested", "observers", "of", "request", "progress", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L122-L127
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java
SpiceServiceListenerNotifier.notifyObserversOfRequestProcessed
public void notifyObserversOfRequestProcessed(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); requestProcessingConte...
java
public void notifyObserversOfRequestProcessed(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) { RequestProcessingContext requestProcessingContext = new RequestProcessingContext(); requestProcessingContext.setExecutionThread(Thread.currentThread()); requestProcessingConte...
[ "public", "void", "notifyObserversOfRequestProcessed", "(", "CachedSpiceRequest", "<", "?", ">", "request", ",", "Set", "<", "RequestListener", "<", "?", ">", ">", "requestListeners", ")", "{", "RequestProcessingContext", "requestProcessingContext", "=", "new", "Reque...
Notify interested observers of request completion. @param request the request that has completed. @param requestListeners the listeners to notify.
[ "Notify", "interested", "observers", "of", "request", "completion", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L134-L139
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java
SpiceServiceListenerNotifier.post
protected void post(Runnable runnable) { Ln.d("Message queue is " + messageQueue); if (messageQueue == null) { return; } messageQueue.postAtTime(runnable, SystemClock.uptimeMillis()); }
java
protected void post(Runnable runnable) { Ln.d("Message queue is " + messageQueue); if (messageQueue == null) { return; } messageQueue.postAtTime(runnable, SystemClock.uptimeMillis()); }
[ "protected", "void", "post", "(", "Runnable", "runnable", ")", "{", "Ln", ".", "d", "(", "\"Message queue is \"", "+", "messageQueue", ")", ";", "if", "(", "messageQueue", "==", "null", ")", "{", "return", ";", "}", "messageQueue", ".", "postAtTime", "(", ...
Add the request update to the observer message queue. @param runnable a runnable to be posted immediatly on the queue.
[ "Add", "the", "request", "update", "to", "the", "observer", "message", "queue", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L145-L152
train
stephanenicolas/robospice
robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java
InFileObjectPersister.setCacheFolder
public void setCacheFolder(File cacheFolder) throws CacheCreationException { if (cacheFolder == null) { cacheFolder = new File(getApplication().getCacheDir(), DEFAULT_ROOT_CACHE_DIR); } synchronized (cacheFolder.getAbsolutePath().intern()) { if (!cacheFolder.exists() && !...
java
public void setCacheFolder(File cacheFolder) throws CacheCreationException { if (cacheFolder == null) { cacheFolder = new File(getApplication().getCacheDir(), DEFAULT_ROOT_CACHE_DIR); } synchronized (cacheFolder.getAbsolutePath().intern()) { if (!cacheFolder.exists() && !...
[ "public", "void", "setCacheFolder", "(", "File", "cacheFolder", ")", "throws", "CacheCreationException", "{", "if", "(", "cacheFolder", "==", "null", ")", "{", "cacheFolder", "=", "new", "File", "(", "getApplication", "(", ")", ".", "getCacheDir", "(", ")", ...
Set the cacheFolder to use. @param cacheFolder the new cache folder to use. Can be null, will then default to {@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application cache dir. @throws CacheCreationException if the cache folder doesn't exist or can't be created.
[ "Set", "the", "cacheFolder", "to", "use", "." ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java#L74-L84
train
stephanenicolas/robospice
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityThreadPoolExecutor.java
PriorityThreadPoolExecutor.submit
@Override public Future<?> submit(Runnable task) { if (task == null) { throw new NullPointerException(); } RunnableFuture<Object> ftask = newTaskFor(task, null); execute(ftask); return ftask; }
java
@Override public Future<?> submit(Runnable task) { if (task == null) { throw new NullPointerException(); } RunnableFuture<Object> ftask = newTaskFor(task, null); execute(ftask); return ftask; }
[ "@", "Override", "public", "Future", "<", "?", ">", "submit", "(", "Runnable", "task", ")", "{", "if", "(", "task", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "RunnableFuture", "<", "Object", ">", "ftask", "=", ...
form JDK 1.6, to ensure backward compatibility
[ "form", "JDK", "1", ".", "6", "to", "ensure", "backward", "compatibility" ]
8bffde88b3534a961a13cab72a8f07a755f0a0fe
https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityThreadPoolExecutor.java#L68-L76
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/KafkaHelper.java
KafkaHelper.createStringProducer
public KafkaProducer<String, String> createStringProducer(Properties overrideConfig) { return createProducer(new StringSerializer(), new StringSerializer(), overrideConfig); }
java
public KafkaProducer<String, String> createStringProducer(Properties overrideConfig) { return createProducer(new StringSerializer(), new StringSerializer(), overrideConfig); }
[ "public", "KafkaProducer", "<", "String", ",", "String", ">", "createStringProducer", "(", "Properties", "overrideConfig", ")", "{", "return", "createProducer", "(", "new", "StringSerializer", "(", ")", ",", "new", "StringSerializer", "(", ")", ",", "overrideConfi...
Create a producer that writes String keys and values @param overrideConfig Producer config to override @return KafkaProducer
[ "Create", "a", "producer", "that", "writes", "String", "keys", "and", "values" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/KafkaHelper.java#L147-L149
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/KafkaHelper.java
KafkaHelper.produce
public <K, V> void produce(String topic, KafkaProducer<K, V> producer, Map<K, V> data) { data.forEach((k, v) -> producer.send(new ProducerRecord<>(topic, k, v))); producer.flush(); }
java
public <K, V> void produce(String topic, KafkaProducer<K, V> producer, Map<K, V> data) { data.forEach((k, v) -> producer.send(new ProducerRecord<>(topic, k, v))); producer.flush(); }
[ "public", "<", "K", ",", "V", ">", "void", "produce", "(", "String", "topic", ",", "KafkaProducer", "<", "K", ",", "V", ">", "producer", ",", "Map", "<", "K", ",", "V", ">", "data", ")", "{", "data", ".", "forEach", "(", "(", "k", ",", "v", "...
Produce data to the specified topic @param topic Topic to produce to @param producer Producer to use @param data Data to produce @param <K> Type of key @param <V> Type of value
[ "Produce", "data", "to", "the", "specified", "topic" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/KafkaHelper.java#L179-L182
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/KafkaHelper.java
KafkaHelper.produceStrings
public void produceStrings(String topic, String... values) { try (KafkaProducer<String, String> producer = createStringProducer()) { Map<String, String> data = Arrays.stream(values) .collect(Collectors.toMap(k -> String.valueOf(k.hashCode()), Function.identity())); pr...
java
public void produceStrings(String topic, String... values) { try (KafkaProducer<String, String> producer = createStringProducer()) { Map<String, String> data = Arrays.stream(values) .collect(Collectors.toMap(k -> String.valueOf(k.hashCode()), Function.identity())); pr...
[ "public", "void", "produceStrings", "(", "String", "topic", ",", "String", "...", "values", ")", "{", "try", "(", "KafkaProducer", "<", "String", ",", "String", ">", "producer", "=", "createStringProducer", "(", ")", ")", "{", "Map", "<", "String", ",", ...
Convenience method to produce a set of strings to the specified topic @param topic Topic to produce to @param values Values produce
[ "Convenience", "method", "to", "produce", "a", "set", "of", "strings", "to", "the", "specified", "topic" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/KafkaHelper.java#L190-L196
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/KafkaHelper.java
KafkaHelper.createStringConsumer
public KafkaConsumer<String, String> createStringConsumer(Properties overrideConfig) { return createConsumer(new StringDeserializer(), new StringDeserializer(), overrideConfig); }
java
public KafkaConsumer<String, String> createStringConsumer(Properties overrideConfig) { return createConsumer(new StringDeserializer(), new StringDeserializer(), overrideConfig); }
[ "public", "KafkaConsumer", "<", "String", ",", "String", ">", "createStringConsumer", "(", "Properties", "overrideConfig", ")", "{", "return", "createConsumer", "(", "new", "StringDeserializer", "(", ")", ",", "new", "StringDeserializer", "(", ")", ",", "overrideC...
Create a consumer that reads strings @param overrideConfig Consumer config to override @return KafkaConsumer
[ "Create", "a", "consumer", "that", "reads", "strings" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/KafkaHelper.java#L228-L230
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/KafkaHelper.java
KafkaHelper.consume
public <K, V> ListenableFuture<List<ConsumerRecord<K, V>>> consume(String topic, KafkaConsumer<K, V> consumer, int numMessagesToConsume) { consumer.subscribe(Lists.newArrayList(topic)); ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); ret...
java
public <K, V> ListenableFuture<List<ConsumerRecord<K, V>>> consume(String topic, KafkaConsumer<K, V> consumer, int numMessagesToConsume) { consumer.subscribe(Lists.newArrayList(topic)); ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); ret...
[ "public", "<", "K", ",", "V", ">", "ListenableFuture", "<", "List", "<", "ConsumerRecord", "<", "K", ",", "V", ">", ">", ">", "consume", "(", "String", "topic", ",", "KafkaConsumer", "<", "K", ",", "V", ">", "consumer", ",", "int", "numMessagesToConsum...
Attempt to consume the specified number of messages @param topic Topic to consume @param consumer Consumer to use @param numMessagesToConsume Number of messages to consume @param <K> Type of Key @param <V> Type of Value @return ListenableFuture
[ "Attempt", "to", "consume", "the", "specified", "number", "of", "messages" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/KafkaHelper.java#L261-L265
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/KafkaHelper.java
KafkaHelper.consumeStrings
public ListenableFuture<List<String>> consumeStrings(String topic, int numMessagesToConsume) { KafkaConsumer<String, String> consumer = createStringConsumer(); ListenableFuture<List<ConsumerRecord<String, String>>> records = consume(topic, consumer, numMessagesToConsume); return Futures.transfor...
java
public ListenableFuture<List<String>> consumeStrings(String topic, int numMessagesToConsume) { KafkaConsumer<String, String> consumer = createStringConsumer(); ListenableFuture<List<ConsumerRecord<String, String>>> records = consume(topic, consumer, numMessagesToConsume); return Futures.transfor...
[ "public", "ListenableFuture", "<", "List", "<", "String", ">", ">", "consumeStrings", "(", "String", "topic", ",", "int", "numMessagesToConsume", ")", "{", "KafkaConsumer", "<", "String", ",", "String", ">", "consumer", "=", "createStringConsumer", "(", ")", "...
Consume specified number of string messages @param topic Topic to consume from @param numMessagesToConsume Number of messages to consume @return ListenableFuture
[ "Consume", "specified", "number", "of", "string", "messages" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/KafkaHelper.java#L274-L278
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java
EphemeralKafkaBroker.create
public static EphemeralKafkaBroker create(int kafkaPort, int zookeeperPort, Properties overrideBrokerProperties) { return new EphemeralKafkaBroker(kafkaPort, zookeeperPort, overrideBrokerProperties); }
java
public static EphemeralKafkaBroker create(int kafkaPort, int zookeeperPort, Properties overrideBrokerProperties) { return new EphemeralKafkaBroker(kafkaPort, zookeeperPort, overrideBrokerProperties); }
[ "public", "static", "EphemeralKafkaBroker", "create", "(", "int", "kafkaPort", ",", "int", "zookeeperPort", ",", "Properties", "overrideBrokerProperties", ")", "{", "return", "new", "EphemeralKafkaBroker", "(", "kafkaPort", ",", "zookeeperPort", ",", "overrideBrokerProp...
Create a new ephemeral Kafka broker with the specified broker port, Zookeeper port and config overrides. @param kafkaPort Port the broker should listen on @param zookeeperPort Port the Zookeeper should listen on @param overrideBrokerProperties Broker properties to override. Pass null if there...
[ "Create", "a", "new", "ephemeral", "Kafka", "broker", "with", "the", "specified", "broker", "port", "Zookeeper", "port", "and", "config", "overrides", "." ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java#L97-L99
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java
EphemeralKafkaBroker.getLogDir
public Optional<String> getLogDir() { return brokerStarted ? Optional.of(kafkaLogDir.toString()) : Optional.empty(); }
java
public Optional<String> getLogDir() { return brokerStarted ? Optional.of(kafkaLogDir.toString()) : Optional.empty(); }
[ "public", "Optional", "<", "String", ">", "getLogDir", "(", ")", "{", "return", "brokerStarted", "?", "Optional", ".", "of", "(", "kafkaLogDir", ".", "toString", "(", ")", ")", ":", "Optional", ".", "empty", "(", ")", ";", "}" ]
Get the path to the Kafka log directory @return An Optional that will only contain a value if the broker is running
[ "Get", "the", "path", "to", "the", "Kafka", "log", "directory" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java#L342-L344
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java
EphemeralKafkaBroker.getZookeeperConnectString
public Optional<String> getZookeeperConnectString() { return brokerStarted ? Optional.of(zookeeper.getConnectString()) : Optional.empty(); }
java
public Optional<String> getZookeeperConnectString() { return brokerStarted ? Optional.of(zookeeper.getConnectString()) : Optional.empty(); }
[ "public", "Optional", "<", "String", ">", "getZookeeperConnectString", "(", ")", "{", "return", "brokerStarted", "?", "Optional", ".", "of", "(", "zookeeper", ".", "getConnectString", "(", ")", ")", ":", "Optional", ".", "empty", "(", ")", ";", "}" ]
Get the current Zookeeper connection string @return An Optional that will only contain a value if the broker is running
[ "Get", "the", "current", "Zookeeper", "connection", "string" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java#L351-L353
train
charithe/kafka-junit
src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java
EphemeralKafkaBroker.getBrokerList
public Optional<String> getBrokerList() { return brokerStarted ? Optional.of(LOCALHOST + ":" + kafkaPort) : Optional.empty(); }
java
public Optional<String> getBrokerList() { return brokerStarted ? Optional.of(LOCALHOST + ":" + kafkaPort) : Optional.empty(); }
[ "public", "Optional", "<", "String", ">", "getBrokerList", "(", ")", "{", "return", "brokerStarted", "?", "Optional", ".", "of", "(", "LOCALHOST", "+", "\":\"", "+", "kafkaPort", ")", ":", "Optional", ".", "empty", "(", ")", ";", "}" ]
Get the current broker list string @return An Optional that will only contain a value if the broker is running
[ "Get", "the", "current", "broker", "list", "string" ]
b808b3d1dec8105346d316f92f68950f36aeb871
https://github.com/charithe/kafka-junit/blob/b808b3d1dec8105346d316f92f68950f36aeb871/src/main/java/com/github/charithe/kafka/EphemeralKafkaBroker.java#L360-L362
train
landawn/AbacusUtil
src/com/landawn/abacus/util/JdbcUtil.java
JdbcUtil.parse
public static <E extends Exception, E2 extends Exception> void parse(final Connection conn, final String sql, final long offset, final long count, final int processThreadNum, final int queueSize, final Try.Consumer<Object[], E> rowParser, final Try.Runnable<E2> onComplete) throws UncheckedSQLE...
java
public static <E extends Exception, E2 extends Exception> void parse(final Connection conn, final String sql, final long offset, final long count, final int processThreadNum, final int queueSize, final Try.Consumer<Object[], E> rowParser, final Try.Runnable<E2> onComplete) throws UncheckedSQLE...
[ "public", "static", "<", "E", "extends", "Exception", ",", "E2", "extends", "Exception", ">", "void", "parse", "(", "final", "Connection", "conn", ",", "final", "String", "sql", ",", "final", "long", "offset", ",", "final", "long", "count", ",", "final", ...
Parse the ResultSet obtained by executing query with the specified Connection and sql. @param conn @param sql @param offset @param count @param processThreadNum new threads started to parse/process the lines/records @param queueSize size of queue to save the processing records/lines loaded from source data. Default si...
[ "Parse", "the", "ResultSet", "obtained", "by", "executing", "query", "with", "the", "specified", "Connection", "and", "sql", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2920-L2935
train
landawn/AbacusUtil
src/com/landawn/abacus/util/JdbcUtil.java
JdbcUtil.parse
public static <E extends Exception, E2 extends Exception> void parse(final PreparedStatement stmt, final long offset, final long count, final int processThreadNum, final int queueSize, final Try.Consumer<Object[], E> rowParser, final Try.Runnable<E2> onComplete) throws UncheckedSQLException, E...
java
public static <E extends Exception, E2 extends Exception> void parse(final PreparedStatement stmt, final long offset, final long count, final int processThreadNum, final int queueSize, final Try.Consumer<Object[], E> rowParser, final Try.Runnable<E2> onComplete) throws UncheckedSQLException, E...
[ "public", "static", "<", "E", "extends", "Exception", ",", "E2", "extends", "Exception", ">", "void", "parse", "(", "final", "PreparedStatement", "stmt", ",", "final", "long", "offset", ",", "final", "long", "count", ",", "final", "int", "processThreadNum", ...
Parse the ResultSet obtained by executing query with the specified PreparedStatement. @param stmt @param offset @param count @param processThreadNum new threads started to parse/process the lines/records @param queueSize size of queue to save the processing records/lines loaded from source data. Default size is 1024. ...
[ "Parse", "the", "ResultSet", "obtained", "by", "executing", "query", "with", "the", "specified", "PreparedStatement", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2973-L2987
train
landawn/AbacusUtil
src/com/landawn/abacus/util/JdbcUtil.java
JdbcUtil.parse
public static <E extends Exception, E2 extends Exception> void parse(final ResultSet rs, long offset, long count, final int processThreadNum, final int queueSize, final Try.Consumer<Object[], E> rowParser, final Try.Runnable<E2> onComplete) throws UncheckedSQLException, E, E2 { final Iterator<Ob...
java
public static <E extends Exception, E2 extends Exception> void parse(final ResultSet rs, long offset, long count, final int processThreadNum, final int queueSize, final Try.Consumer<Object[], E> rowParser, final Try.Runnable<E2> onComplete) throws UncheckedSQLException, E, E2 { final Iterator<Ob...
[ "public", "static", "<", "E", "extends", "Exception", ",", "E2", "extends", "Exception", ">", "void", "parse", "(", "final", "ResultSet", "rs", ",", "long", "offset", ",", "long", "count", ",", "final", "int", "processThreadNum", ",", "final", "int", "queu...
Parse the ResultSet. @param stmt @param offset @param count @param processThreadNum new threads started to parse/process the lines/records @param queueSize size of queue to save the processing records/lines loaded from source data. Default size is 1024. @param rowParser @param onComplete @throws UncheckedSQLException
[ "Parse", "the", "ResultSet", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L3025-L3067
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.close
@Override public void close() throws SQLException { if ((id == null) || (poolableConn == null)) { internalStmt.close(); } else { poolableConn.cachePreparedStatement(this); } }
java
@Override public void close() throws SQLException { if ((id == null) || (poolableConn == null)) { internalStmt.close(); } else { poolableConn.cachePreparedStatement(this); } }
[ "@", "Override", "public", "void", "close", "(", ")", "throws", "SQLException", "{", "if", "(", "(", "id", "==", "null", ")", "||", "(", "poolableConn", "==", "null", ")", ")", "{", "internalStmt", ".", "close", "(", ")", ";", "}", "else", "{", "po...
Method close. @throws SQLException @see java.sql.Statement#close()
[ "Method", "close", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L69-L76
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.execute
@Override public boolean execute() throws SQLException { boolean isOk = false; try { boolean result = internalStmt.execute(); isOk = true; return result; } finally { poolableConn.updateLastSQLExecutionTime(isOk); } }
java
@Override public boolean execute() throws SQLException { boolean isOk = false; try { boolean result = internalStmt.execute(); isOk = true; return result; } finally { poolableConn.updateLastSQLExecutionTime(isOk); } }
[ "@", "Override", "public", "boolean", "execute", "(", ")", "throws", "SQLException", "{", "boolean", "isOk", "=", "false", ";", "try", "{", "boolean", "result", "=", "internalStmt", ".", "execute", "(", ")", ";", "isOk", "=", "true", ";", "return", "resu...
Method execute. @return boolean @throws SQLException @see java.sql.PreparedStatement#execute()
[ "Method", "execute", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L128-L140
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.executeQuery
@Override public ResultSet executeQuery(String sql) throws SQLException { boolean isOk = false; try { final ResultSet result = wrap(internalStmt.executeQuery(sql)); isOk = true; return result; } finally { poolableConn.updateLastSQLExe...
java
@Override public ResultSet executeQuery(String sql) throws SQLException { boolean isOk = false; try { final ResultSet result = wrap(internalStmt.executeQuery(sql)); isOk = true; return result; } finally { poolableConn.updateLastSQLExe...
[ "@", "Override", "public", "ResultSet", "executeQuery", "(", "String", "sql", ")", "throws", "SQLException", "{", "boolean", "isOk", "=", "false", ";", "try", "{", "final", "ResultSet", "result", "=", "wrap", "(", "internalStmt", ".", "executeQuery", "(", "s...
Method executeQuery. @param sql @return ResultSet @throws SQLException @see java.sql.Statement#executeQuery(String)
[ "Method", "executeQuery", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L303-L314
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setArray
@Override public void setArray(int parameterIndex, Array x) throws SQLException { internalStmt.setArray(parameterIndex, x); }
java
@Override public void setArray(int parameterIndex, Array x) throws SQLException { internalStmt.setArray(parameterIndex, x); }
[ "@", "Override", "public", "void", "setArray", "(", "int", "parameterIndex", ",", "Array", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setArray", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setArray. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setArray(int, Array)
[ "Method", "setArray", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L443-L446
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setAsciiStream
@Override public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { internalStmt.setAsciiStream(parameterIndex, x, length); }
java
@Override public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { internalStmt.setAsciiStream(parameterIndex, x, length); }
[ "@", "Override", "public", "void", "setAsciiStream", "(", "int", "parameterIndex", ",", "InputStream", "x", ",", "int", "length", ")", "throws", "SQLException", "{", "internalStmt", ".", "setAsciiStream", "(", "parameterIndex", ",", "x", ",", "length", ")", ";...
Method setAsciiStream. @param parameterIndex @param x @param length @throws SQLException @see java.sql.PreparedStatement#setAsciiStream(int, InputStream, int)
[ "Method", "setAsciiStream", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L470-L473
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setBigDecimal
@Override public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { internalStmt.setBigDecimal(parameterIndex, x); }
java
@Override public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { internalStmt.setBigDecimal(parameterIndex, x); }
[ "@", "Override", "public", "void", "setBigDecimal", "(", "int", "parameterIndex", ",", "BigDecimal", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setBigDecimal", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setBigDecimal. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setBigDecimal(int, BigDecimal)
[ "Method", "setBigDecimal", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L497-L500
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setBinaryStream
@Override public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { internalStmt.setBinaryStream(parameterIndex, x); }
java
@Override public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { internalStmt.setBinaryStream(parameterIndex, x); }
[ "@", "Override", "public", "void", "setBinaryStream", "(", "int", "parameterIndex", ",", "InputStream", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setBinaryStream", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setBinaryStream. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setBinaryStream(int, InputStream)
[ "Method", "setBinaryStream", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L510-L513
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setDate
@Override public void setDate(int parameterIndex, Date x) throws SQLException { internalStmt.setDate(parameterIndex, x); }
java
@Override public void setDate(int parameterIndex, Date x) throws SQLException { internalStmt.setDate(parameterIndex, x); }
[ "@", "Override", "public", "void", "setDate", "(", "int", "parameterIndex", ",", "Date", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setDate", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setDate. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setDate(int, Date)
[ "Method", "setDate", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L711-L714
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setNCharacterStream
@Override public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { internalStmt.setNCharacterStream(parameterIndex, value); }
java
@Override public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { internalStmt.setNCharacterStream(parameterIndex, value); }
[ "@", "Override", "public", "void", "setNCharacterStream", "(", "int", "parameterIndex", ",", "Reader", "value", ")", "throws", "SQLException", "{", "internalStmt", ".", "setNCharacterStream", "(", "parameterIndex", ",", "value", ")", ";", "}" ]
Method setNCharacterStream. @param parameterIndex @param value @throws SQLException @see java.sql.PreparedStatement#setNCharacterStream(int, Reader)
[ "Method", "setNCharacterStream", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L790-L793
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setNString
@Override public void setNString(int parameterIndex, String value) throws SQLException { internalStmt.setNString(parameterIndex, value); }
java
@Override public void setNString(int parameterIndex, String value) throws SQLException { internalStmt.setNString(parameterIndex, value); }
[ "@", "Override", "public", "void", "setNString", "(", "int", "parameterIndex", ",", "String", "value", ")", "throws", "SQLException", "{", "internalStmt", ".", "setNString", "(", "parameterIndex", ",", "value", ")", ";", "}" ]
Method setNString. @param parameterIndex @param value @throws SQLException @see java.sql.PreparedStatement#setNString(int, String)
[ "Method", "setNString", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L857-L860
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setRef
@Override public void setRef(int parameterIndex, Ref x) throws SQLException { internalStmt.setRef(parameterIndex, x); }
java
@Override public void setRef(int parameterIndex, Ref x) throws SQLException { internalStmt.setRef(parameterIndex, x); }
[ "@", "Override", "public", "void", "setRef", "(", "int", "parameterIndex", ",", "Ref", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setRef", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setRef. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setRef(int, Ref)
[ "Method", "setRef", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L939-L942
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setRowId
@Override public void setRowId(int parameterIndex, RowId x) throws SQLException { internalStmt.setRowId(parameterIndex, x); }
java
@Override public void setRowId(int parameterIndex, RowId x) throws SQLException { internalStmt.setRowId(parameterIndex, x); }
[ "@", "Override", "public", "void", "setRowId", "(", "int", "parameterIndex", ",", "RowId", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setRowId", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setRowId. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setRowId(int, RowId)
[ "Method", "setRowId", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L952-L955
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setSQLXML
@Override public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { internalStmt.setSQLXML(parameterIndex, xmlObject); }
java
@Override public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { internalStmt.setSQLXML(parameterIndex, xmlObject); }
[ "@", "Override", "public", "void", "setSQLXML", "(", "int", "parameterIndex", ",", "SQLXML", "xmlObject", ")", "throws", "SQLException", "{", "internalStmt", ".", "setSQLXML", "(", "parameterIndex", ",", "xmlObject", ")", ";", "}" ]
Method setSQLXML. @param parameterIndex @param xmlObject @throws SQLException @see java.sql.PreparedStatement#setSQLXML(int, SQLXML)
[ "Method", "setSQLXML", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L965-L968
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setString
@Override public void setString(int parameterIndex, String x) throws SQLException { internalStmt.setString(parameterIndex, x); }
java
@Override public void setString(int parameterIndex, String x) throws SQLException { internalStmt.setString(parameterIndex, x); }
[ "@", "Override", "public", "void", "setString", "(", "int", "parameterIndex", ",", "String", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setString", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setString. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setString(int, String)
[ "Method", "setString", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L991-L994
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setTime
@Override public void setTime(int parameterIndex, Time x) throws SQLException { internalStmt.setTime(parameterIndex, x); }
java
@Override public void setTime(int parameterIndex, Time x) throws SQLException { internalStmt.setTime(parameterIndex, x); }
[ "@", "Override", "public", "void", "setTime", "(", "int", "parameterIndex", ",", "Time", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setTime", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setTime. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setTime(int, Time)
[ "Method", "setTime", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L1004-L1007
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setTimestamp
@Override public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { internalStmt.setTimestamp(parameterIndex, x); }
java
@Override public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { internalStmt.setTimestamp(parameterIndex, x); }
[ "@", "Override", "public", "void", "setTimestamp", "(", "int", "parameterIndex", ",", "Timestamp", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setTimestamp", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setTimestamp. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setTimestamp(int, Timestamp)
[ "Method", "setTimestamp", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L1031-L1034
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java
PoolablePreparedStatement.setURL
@Override public void setURL(int parameterIndex, URL x) throws SQLException { internalStmt.setURL(parameterIndex, x); }
java
@Override public void setURL(int parameterIndex, URL x) throws SQLException { internalStmt.setURL(parameterIndex, x); }
[ "@", "Override", "public", "void", "setURL", "(", "int", "parameterIndex", ",", "URL", "x", ")", "throws", "SQLException", "{", "internalStmt", ".", "setURL", "(", "parameterIndex", ",", "x", ")", ";", "}" ]
Method setURL. @param parameterIndex @param x @throws SQLException @see java.sql.PreparedStatement#setURL(int, URL)
[ "Method", "setURL", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L1058-L1061
train
landawn/AbacusUtil
src/com/landawn/abacus/util/ContinuableFuture.java
ContinuableFuture.cancelAll
public boolean cancelAll(boolean mayInterruptIfRunning) { boolean res = true; if (N.notNullOrEmpty(upFutures)) { for (ContinuableFuture<?> preFuture : upFutures) { res = res & preFuture.cancelAll(mayInterruptIfRunning); } } return cancel...
java
public boolean cancelAll(boolean mayInterruptIfRunning) { boolean res = true; if (N.notNullOrEmpty(upFutures)) { for (ContinuableFuture<?> preFuture : upFutures) { res = res & preFuture.cancelAll(mayInterruptIfRunning); } } return cancel...
[ "public", "boolean", "cancelAll", "(", "boolean", "mayInterruptIfRunning", ")", "{", "boolean", "res", "=", "true", ";", "if", "(", "N", ".", "notNullOrEmpty", "(", "upFutures", ")", ")", "{", "for", "(", "ContinuableFuture", "<", "?", ">", "preFuture", ":...
Cancel this future and all the previous stage future recursively. @param mayInterruptIfRunning @return
[ "Cancel", "this", "future", "and", "all", "the", "previous", "stage", "future", "recursively", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ContinuableFuture.java#L169-L179
train
landawn/AbacusUtil
src/com/landawn/abacus/util/ContinuableFuture.java
ContinuableFuture.isAllCancelled
public boolean isAllCancelled() { boolean res = true; if (N.notNullOrEmpty(upFutures)) { for (ContinuableFuture<?> preFuture : upFutures) { res = res & preFuture.isAllCancelled(); } } return isCancelled() && res; }
java
public boolean isAllCancelled() { boolean res = true; if (N.notNullOrEmpty(upFutures)) { for (ContinuableFuture<?> preFuture : upFutures) { res = res & preFuture.isAllCancelled(); } } return isCancelled() && res; }
[ "public", "boolean", "isAllCancelled", "(", ")", "{", "boolean", "res", "=", "true", ";", "if", "(", "N", ".", "notNullOrEmpty", "(", "upFutures", ")", ")", "{", "for", "(", "ContinuableFuture", "<", "?", ">", "preFuture", ":", "upFutures", ")", "{", "...
Returns true if this future and all previous stage futures have been recursively cancelled, otherwise false is returned. @return
[ "Returns", "true", "if", "this", "future", "and", "all", "previous", "stage", "futures", "have", "been", "recursively", "cancelled", "otherwise", "false", "is", "returned", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ContinuableFuture.java#L186-L196
train
landawn/AbacusUtil
src/com/landawn/abacus/hash/HashingInputStream.java
HashingInputStream.read
@Override public int read() throws IOException { int b = in.read(); if (b != -1) { hasher.put((byte) b); } return b; }
java
@Override public int read() throws IOException { int b = in.read(); if (b != -1) { hasher.put((byte) b); } return b; }
[ "@", "Override", "public", "int", "read", "(", ")", "throws", "IOException", "{", "int", "b", "=", "in", ".", "read", "(", ")", ";", "if", "(", "b", "!=", "-", "1", ")", "{", "hasher", ".", "put", "(", "(", "byte", ")", "b", ")", ";", "}", ...
Reads the next byte of data from the underlying input stream and updates the hasher with the byte read.
[ "Reads", "the", "next", "byte", "of", "data", "from", "the", "underlying", "input", "stream", "and", "updates", "the", "hasher", "with", "the", "byte", "read", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/hash/HashingInputStream.java#L49-L57
train
landawn/AbacusUtil
src/com/landawn/abacus/hash/HashingInputStream.java
HashingInputStream.read
@Override public int read(byte[] bytes, int off, int len) throws IOException { int numOfBytesRead = in.read(bytes, off, len); if (numOfBytesRead != -1) { hasher.put(bytes, off, numOfBytesRead); } return numOfBytesRead; }
java
@Override public int read(byte[] bytes, int off, int len) throws IOException { int numOfBytesRead = in.read(bytes, off, len); if (numOfBytesRead != -1) { hasher.put(bytes, off, numOfBytesRead); } return numOfBytesRead; }
[ "@", "Override", "public", "int", "read", "(", "byte", "[", "]", "bytes", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "int", "numOfBytesRead", "=", "in", ".", "read", "(", "bytes", ",", "off", ",", "len", ")", ";", "if"...
Reads the specified bytes of data from the underlying input stream and updates the hasher with the bytes read.
[ "Reads", "the", "specified", "bytes", "of", "data", "from", "the", "underlying", "input", "stream", "and", "updates", "the", "hasher", "with", "the", "bytes", "read", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/hash/HashingInputStream.java#L63-L71
train
landawn/AbacusUtil
src/com/landawn/abacus/util/HBaseColumn.java
HBaseColumn.asSortedSet
public static <T> SortedSet<HBaseColumn<T>> asSortedSet(T value, long version) { return asSortedSet(value, version, DESC_HBASE_COLUMN_COMPARATOR); }
java
public static <T> SortedSet<HBaseColumn<T>> asSortedSet(T value, long version) { return asSortedSet(value, version, DESC_HBASE_COLUMN_COMPARATOR); }
[ "public", "static", "<", "T", ">", "SortedSet", "<", "HBaseColumn", "<", "T", ">", ">", "asSortedSet", "(", "T", "value", ",", "long", "version", ")", "{", "return", "asSortedSet", "(", "value", ",", "version", ",", "DESC_HBASE_COLUMN_COMPARATOR", ")", ";"...
Returns a sorted set descended by version @param value @param version @return
[ "Returns", "a", "sorted", "set", "descended", "by", "version" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/HBaseColumn.java#L143-L145
train
landawn/AbacusUtil
src/com/landawn/abacus/util/HBaseColumn.java
HBaseColumn.asSortedMap
public static <T> SortedMap<Long, HBaseColumn<T>> asSortedMap(T value) { return asSortedMap(value, DESC_HBASE_VERSION_COMPARATOR); }
java
public static <T> SortedMap<Long, HBaseColumn<T>> asSortedMap(T value) { return asSortedMap(value, DESC_HBASE_VERSION_COMPARATOR); }
[ "public", "static", "<", "T", ">", "SortedMap", "<", "Long", ",", "HBaseColumn", "<", "T", ">", ">", "asSortedMap", "(", "T", "value", ")", "{", "return", "asSortedMap", "(", "value", ",", "DESC_HBASE_VERSION_COMPARATOR", ")", ";", "}" ]
Returns a sorted map descended by version @param value @return
[ "Returns", "a", "sorted", "map", "descended", "by", "version" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/HBaseColumn.java#L173-L175
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Array.java
Array.asList
@SafeVarargs @NullSafe public static <T> List<T> asList(T... a) { return N.isNullOrEmpty(a) ? N.<T> emptyList() : Arrays.asList(a); }
java
@SafeVarargs @NullSafe public static <T> List<T> asList(T... a) { return N.isNullOrEmpty(a) ? N.<T> emptyList() : Arrays.asList(a); }
[ "@", "SafeVarargs", "@", "NullSafe", "public", "static", "<", "T", ">", "List", "<", "T", ">", "asList", "(", "T", "...", "a", ")", "{", "return", "N", ".", "isNullOrEmpty", "(", "a", ")", "?", "N", ".", "<", "T", ">", "emptyList", "(", ")", ":...
Returns a fixed-size list backed by the specified array if it's not null or empty, otherwise an immutable empty list is returned. @param a @return @see Arrays#asList(Object...)
[ "Returns", "a", "fixed", "-", "size", "list", "backed", "by", "the", "specified", "array", "if", "it", "s", "not", "null", "or", "empty", "otherwise", "an", "immutable", "empty", "list", "is", "returned", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Array.java#L162-L166
train
landawn/AbacusUtil
src/com/landawn/abacus/util/CQLBuilder.java
CQLBuilder.set
@SuppressWarnings("deprecation") public CQLBuilder set(final Object entity) { if (entity instanceof String) { return set(N.asArray((String) entity)); } else if (entity instanceof Map) { return set((Map<String, Object>) entity); } else { this.entityC...
java
@SuppressWarnings("deprecation") public CQLBuilder set(final Object entity) { if (entity instanceof String) { return set(N.asArray((String) entity)); } else if (entity instanceof Map) { return set((Map<String, Object>) entity); } else { this.entityC...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "CQLBuilder", "set", "(", "final", "Object", "entity", ")", "{", "if", "(", "entity", "instanceof", "String", ")", "{", "return", "set", "(", "N", ".", "asArray", "(", "(", "String", ")", "e...
Only the dirty properties will be set into the result CQL if the specified entity is a dirty marker entity. @param entity @return
[ "Only", "the", "dirty", "properties", "will", "be", "set", "into", "the", "result", "CQL", "if", "the", "specified", "entity", "is", "a", "dirty", "marker", "entity", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CQLBuilder.java#L1030-L1053
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Properties.java
Properties.remove
public boolean remove(Object key, Object value) { final Object curValue = get(key); if (!Objects.equals(curValue, value) || (curValue == null && !containsKey(key))) { return false; } remove(key); return true; }
java
public boolean remove(Object key, Object value) { final Object curValue = get(key); if (!Objects.equals(curValue, value) || (curValue == null && !containsKey(key))) { return false; } remove(key); return true; }
[ "public", "boolean", "remove", "(", "Object", "key", ",", "Object", "value", ")", "{", "final", "Object", "curValue", "=", "get", "(", "key", ")", ";", "if", "(", "!", "Objects", ".", "equals", "(", "curValue", ",", "value", ")", "||", "(", "curValue...
Removes the entry for the specified key only if it is currently mapped to the specified value.
[ "Removes", "the", "entry", "for", "the", "specified", "key", "only", "if", "it", "is", "currently", "mapped", "to", "the", "specified", "value", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Properties.java#L143-L153
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Properties.java
Properties.replace
public boolean replace(K key, V oldValue, V newValue) { Object curValue = get(key); if (!Objects.equals(curValue, oldValue) || (curValue == null && !containsKey(key))) { return false; } put(key, newValue); return true; }
java
public boolean replace(K key, V oldValue, V newValue) { Object curValue = get(key); if (!Objects.equals(curValue, oldValue) || (curValue == null && !containsKey(key))) { return false; } put(key, newValue); return true; }
[ "public", "boolean", "replace", "(", "K", "key", ",", "V", "oldValue", ",", "V", "newValue", ")", "{", "Object", "curValue", "=", "get", "(", "key", ")", ";", "if", "(", "!", "Objects", ".", "equals", "(", "curValue", ",", "oldValue", ")", "||", "(...
Replaces the entry for the specified key only if currently mapped to the specified value.
[ "Replaces", "the", "entry", "for", "the", "specified", "key", "only", "if", "currently", "mapped", "to", "the", "specified", "value", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Properties.java#L171-L178
train
landawn/AbacusUtil
src/com/landawn/abacus/util/stream/IteratorStream.java
IteratorStream.queued
@Override public Stream<T> queued(int queueSize) { final Iterator<T> iter = iterator(); if (iter instanceof QueuedIterator && ((QueuedIterator<? extends T>) iter).max() >= queueSize) { return newStream(elements, sorted, cmp); } else { return newStream(Stream.p...
java
@Override public Stream<T> queued(int queueSize) { final Iterator<T> iter = iterator(); if (iter instanceof QueuedIterator && ((QueuedIterator<? extends T>) iter).max() >= queueSize) { return newStream(elements, sorted, cmp); } else { return newStream(Stream.p...
[ "@", "Override", "public", "Stream", "<", "T", ">", "queued", "(", "int", "queueSize", ")", "{", "final", "Iterator", "<", "T", ">", "iter", "=", "iterator", "(", ")", ";", "if", "(", "iter", "instanceof", "QueuedIterator", "&&", "(", "(", "QueuedItera...
Returns a Stream with elements from a temporary queue which is filled by reading the elements from the specified iterator asynchronously. @param stream @param queueSize Default value is 8 @return
[ "Returns", "a", "Stream", "with", "elements", "from", "a", "temporary", "queue", "which", "is", "filled", "by", "reading", "the", "elements", "from", "the", "specified", "iterator", "asynchronously", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/IteratorStream.java#L3336-L3345
train
landawn/AbacusUtil
src/com/landawn/abacus/util/stream/EntryStream.java
EntryStream.iterator
@SequentialOnly public BiIterator<K, V> iterator() { final ObjIterator<Entry<K, V>> iter = s.iterator(); final BooleanSupplier hasNext = new BooleanSupplier() { @Override public boolean getAsBoolean() { return iter.hasNext(); } };...
java
@SequentialOnly public BiIterator<K, V> iterator() { final ObjIterator<Entry<K, V>> iter = s.iterator(); final BooleanSupplier hasNext = new BooleanSupplier() { @Override public boolean getAsBoolean() { return iter.hasNext(); } };...
[ "@", "SequentialOnly", "public", "BiIterator", "<", "K", ",", "V", ">", "iterator", "(", ")", "{", "final", "ObjIterator", "<", "Entry", "<", "K", ",", "V", ">", ">", "iter", "=", "s", ".", "iterator", "(", ")", ";", "final", "BooleanSupplier", "hasN...
Remember to close this Stream after the iteration is done, if required. @return
[ "Remember", "to", "close", "this", "Stream", "after", "the", "iteration", "is", "done", "if", "required", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/EntryStream.java#L968-L990
train
landawn/AbacusUtil
src/com/landawn/abacus/util/StringUtil.java
StringUtil.removePattern
public static String removePattern(final String source, final String regex) { return replacePattern(source, regex, N.EMPTY_STRING); }
java
public static String removePattern(final String source, final String regex) { return replacePattern(source, regex, N.EMPTY_STRING); }
[ "public", "static", "String", "removePattern", "(", "final", "String", "source", ",", "final", "String", "regex", ")", "{", "return", "replacePattern", "(", "source", ",", "regex", ",", "N", ".", "EMPTY_STRING", ")", ";", "}" ]
Removes each substring of the source String that matches the given regular expression using the DOTALL option. @param source the source string @param regex the regular expression to which this string is to be matched @return The resulting {@code String} @see String#replaceAll(String, String) @see Pattern#DOTALL @since...
[ "Removes", "each", "substring", "of", "the", "source", "String", "that", "matches", "the", "given", "regular", "expression", "using", "the", "DOTALL", "option", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L1400-L1402
train
landawn/AbacusUtil
src/com/landawn/abacus/hash/FarmHashFingerprint64.java
FarmHashFingerprint64.fingerprint
static long fingerprint(byte[] bytes, int offset, int length) { if (length <= 32) { if (length <= 16) { return hashLength0to16(bytes, offset, length); } else { return hashLength17to32(bytes, offset, length); } } else if (length <= 64) {...
java
static long fingerprint(byte[] bytes, int offset, int length) { if (length <= 32) { if (length <= 16) { return hashLength0to16(bytes, offset, length); } else { return hashLength17to32(bytes, offset, length); } } else if (length <= 64) {...
[ "static", "long", "fingerprint", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ",", "int", "length", ")", "{", "if", "(", "length", "<=", "32", ")", "{", "if", "(", "length", "<=", "16", ")", "{", "return", "hashLength0to16", "(", "bytes", ...
End of public functions.
[ "End", "of", "public", "functions", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/hash/FarmHashFingerprint64.java#L65-L77
train
landawn/AbacusUtil
src/com/landawn/abacus/util/SQLExecutor.java
SQLExecutor.getDBSequence
public DBSequence getDBSequence(final String tableName, final String seqName, final long startVal, final int seqBufferSize) { return new DBSequence(this, tableName, seqName, startVal, seqBufferSize); }
java
public DBSequence getDBSequence(final String tableName, final String seqName, final long startVal, final int seqBufferSize) { return new DBSequence(this, tableName, seqName, startVal, seqBufferSize); }
[ "public", "DBSequence", "getDBSequence", "(", "final", "String", "tableName", ",", "final", "String", "seqName", ",", "final", "long", "startVal", ",", "final", "int", "seqBufferSize", ")", "{", "return", "new", "DBSequence", "(", "this", ",", "tableName", ","...
Supports global sequence by db table. @param tableName @param seqName @param startVal @param seqBufferSize the numbers to allocate/reserve from database table when cached numbers are used up. @return
[ "Supports", "global", "sequence", "by", "db", "table", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L3233-L3235
train
landawn/AbacusUtil
src/com/landawn/abacus/util/SQLExecutor.java
SQLExecutor.close
@Override public void close() throws IOException { try { if (_ds != null && _ds.isClosed() == false) { _ds.close(); } } finally { if (_dsm != null && _dsm.isClosed() == false) { _dsm.close(); } } }
java
@Override public void close() throws IOException { try { if (_ds != null && _ds.isClosed() == false) { _ds.close(); } } finally { if (_dsm != null && _dsm.isClosed() == false) { _dsm.close(); } } }
[ "@", "Override", "public", "void", "close", "(", ")", "throws", "IOException", "{", "try", "{", "if", "(", "_ds", "!=", "null", "&&", "_ds", ".", "isClosed", "(", ")", "==", "false", ")", "{", "_ds", ".", "close", "(", ")", ";", "}", "}", "finall...
Close the underline data source
[ "Close", "the", "underline", "data", "source" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L3566-L3577
train
landawn/AbacusUtil
src/com/landawn/abacus/pool/AbstractPool.java
AbstractPool.evict
protected void evict() { lock.lock(); Map<K, E> removingObjects = null; try { for (Map.Entry<K, E> entry : pool.entrySet()) { if (entry.getValue().activityPrint().isExpired()) { if (removingObjects == null) { removi...
java
protected void evict() { lock.lock(); Map<K, E> removingObjects = null; try { for (Map.Entry<K, E> entry : pool.entrySet()) { if (entry.getValue().activityPrint().isExpired()) { if (removingObjects == null) { removi...
[ "protected", "void", "evict", "(", ")", "{", "lock", ".", "lock", "(", ")", ";", "Map", "<", "K", ",", "E", ">", "removingObjects", "=", "null", ";", "try", "{", "for", "(", "Map", ".", "Entry", "<", "K", ",", "E", ">", "entry", ":", "pool", ...
scan the object pool to find the idle object which inactive time greater than permitted the inactive time for it or it's time out.
[ "scan", "the", "object", "pool", "to", "find", "the", "idle", "object", "which", "inactive", "time", "greater", "than", "permitted", "the", "inactive", "time", "for", "it", "or", "it", "s", "time", "out", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/pool/AbstractPool.java#L410-L444
train
landawn/AbacusUtil
src/com/landawn/abacus/util/DynamoDBExecutor.java
DynamoDBExecutor.asItem
@SafeVarargs public static Map<String, AttributeValue> asItem(Object... a) { if (0 != (a.length % 2)) { throw new IllegalArgumentException( "The parameters must be the pairs of property name and value, or Map, or an entity class with getter/setter methods."); } ...
java
@SafeVarargs public static Map<String, AttributeValue> asItem(Object... a) { if (0 != (a.length % 2)) { throw new IllegalArgumentException( "The parameters must be the pairs of property name and value, or Map, or an entity class with getter/setter methods."); } ...
[ "@", "SafeVarargs", "public", "static", "Map", "<", "String", ",", "AttributeValue", ">", "asItem", "(", "Object", "...", "a", ")", "{", "if", "(", "0", "!=", "(", "a", ".", "length", "%", "2", ")", ")", "{", "throw", "new", "IllegalArgumentException",...
May misused with toItem
[ "May", "misused", "with", "toItem" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DynamoDBExecutor.java#L192-L206
train
landawn/AbacusUtil
src/com/landawn/abacus/util/DynamoDBExecutor.java
DynamoDBExecutor.asUpdateItem
@SafeVarargs public static Map<String, AttributeValueUpdate> asUpdateItem(Object... a) { if (0 != (a.length % 2)) { throw new IllegalArgumentException( "The parameters must be the pairs of property name and value, or Map, or an entity class with getter/setter methods."); ...
java
@SafeVarargs public static Map<String, AttributeValueUpdate> asUpdateItem(Object... a) { if (0 != (a.length % 2)) { throw new IllegalArgumentException( "The parameters must be the pairs of property name and value, or Map, or an entity class with getter/setter methods."); ...
[ "@", "SafeVarargs", "public", "static", "Map", "<", "String", ",", "AttributeValueUpdate", ">", "asUpdateItem", "(", "Object", "...", "a", ")", "{", "if", "(", "0", "!=", "(", "a", ".", "length", "%", "2", ")", ")", "{", "throw", "new", "IllegalArgumen...
May misused with toUpdateItem
[ "May", "misused", "with", "toUpdateItem" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DynamoDBExecutor.java#L222-L236
train
landawn/AbacusUtil
src/com/landawn/abacus/util/DynamoDBExecutor.java
DynamoDBExecutor.toUpdateItem
public static Map<String, AttributeValueUpdate> toUpdateItem(final Object entity) { return toUpdateItem(entity, NamingPolicy.LOWER_CAMEL_CASE); }
java
public static Map<String, AttributeValueUpdate> toUpdateItem(final Object entity) { return toUpdateItem(entity, NamingPolicy.LOWER_CAMEL_CASE); }
[ "public", "static", "Map", "<", "String", ",", "AttributeValueUpdate", ">", "toUpdateItem", "(", "final", "Object", "entity", ")", "{", "return", "toUpdateItem", "(", "entity", ",", "NamingPolicy", ".", "LOWER_CAMEL_CASE", ")", ";", "}" ]
Only the dirty properties will be set to the result Map if the specified entity is a dirty marker entity. @param entity @return
[ "Only", "the", "dirty", "properties", "will", "be", "set", "to", "the", "result", "Map", "if", "the", "specified", "entity", "is", "a", "dirty", "marker", "entity", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DynamoDBExecutor.java#L710-L712
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Sheet.java
Sheet.moveRow
public void moveRow(Object rowKey, int newRowIndex) { checkFrozen(); this.checkRowIndex(newRowIndex); final int rowIndex = this.getRowIndex(rowKey); final List<R> tmp = new ArrayList<>(rowLength()); tmp.addAll(_rowKeySet); tmp.add(newRowIndex, tmp.remove(rowInde...
java
public void moveRow(Object rowKey, int newRowIndex) { checkFrozen(); this.checkRowIndex(newRowIndex); final int rowIndex = this.getRowIndex(rowKey); final List<R> tmp = new ArrayList<>(rowLength()); tmp.addAll(_rowKeySet); tmp.add(newRowIndex, tmp.remove(rowInde...
[ "public", "void", "moveRow", "(", "Object", "rowKey", ",", "int", "newRowIndex", ")", "{", "checkFrozen", "(", ")", ";", "this", ".", "checkRowIndex", "(", "newRowIndex", ")", ";", "final", "int", "rowIndex", "=", "this", ".", "getRowIndex", "(", "rowKey",...
Move the specified row to the new position. @param rowKey @param newRowIndex
[ "Move", "the", "specified", "row", "to", "the", "new", "position", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L554-L574
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Sheet.java
Sheet.swapRows
public void swapRows(Object rowKeyA, Object rowKeyB) { checkFrozen(); final int rowIndexA = this.getRowIndex(rowKeyA); final int rowIndexB = this.getRowIndex(rowKeyB); final List<R> tmp = new ArrayList<>(rowLength()); tmp.addAll(_rowKeySet); final R tmpRowKeyA =...
java
public void swapRows(Object rowKeyA, Object rowKeyB) { checkFrozen(); final int rowIndexA = this.getRowIndex(rowKeyA); final int rowIndexB = this.getRowIndex(rowKeyB); final List<R> tmp = new ArrayList<>(rowLength()); tmp.addAll(_rowKeySet); final R tmpRowKeyA =...
[ "public", "void", "swapRows", "(", "Object", "rowKeyA", ",", "Object", "rowKeyB", ")", "{", "checkFrozen", "(", ")", ";", "final", "int", "rowIndexA", "=", "this", ".", "getRowIndex", "(", "rowKeyA", ")", ";", "final", "int", "rowIndexB", "=", "this", "....
Swap the positions of the two specified rows. @param rowKeyA @param rowKeyB
[ "Swap", "the", "positions", "of", "the", "two", "specified", "rows", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L582-L609
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Sheet.java
Sheet.moveColumn
public void moveColumn(Object columnKey, int newColumnIndex) { checkFrozen(); this.checkColumnIndex(newColumnIndex); final int columnIndex = this.getColumnIndex(columnKey); final List<C> tmp = new ArrayList<>(columnLength()); tmp.addAll(_columnKeySet); tmp.add(n...
java
public void moveColumn(Object columnKey, int newColumnIndex) { checkFrozen(); this.checkColumnIndex(newColumnIndex); final int columnIndex = this.getColumnIndex(columnKey); final List<C> tmp = new ArrayList<>(columnLength()); tmp.addAll(_columnKeySet); tmp.add(n...
[ "public", "void", "moveColumn", "(", "Object", "columnKey", ",", "int", "newColumnIndex", ")", "{", "checkFrozen", "(", ")", ";", "this", ".", "checkColumnIndex", "(", "newColumnIndex", ")", ";", "final", "int", "columnIndex", "=", "this", ".", "getColumnIndex...
Move the specified column to the new position. @param columnKey @param newColumnIndex
[ "Move", "the", "specified", "column", "to", "the", "new", "position", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L823-L841
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Sheet.java
Sheet.swapColumns
public void swapColumns(Object columnKeyA, Object columnKeyB) { checkFrozen(); final int columnIndexA = this.getColumnIndex(columnKeyA); final int columnIndexB = this.getColumnIndex(columnKeyB); final List<C> tmp = new ArrayList<>(rowLength()); tmp.addAll(_columnKeySet);...
java
public void swapColumns(Object columnKeyA, Object columnKeyB) { checkFrozen(); final int columnIndexA = this.getColumnIndex(columnKeyA); final int columnIndexB = this.getColumnIndex(columnKeyB); final List<C> tmp = new ArrayList<>(rowLength()); tmp.addAll(_columnKeySet);...
[ "public", "void", "swapColumns", "(", "Object", "columnKeyA", ",", "Object", "columnKeyB", ")", "{", "checkFrozen", "(", ")", ";", "final", "int", "columnIndexA", "=", "this", ".", "getColumnIndex", "(", "columnKeyA", ")", ";", "final", "int", "columnIndexB", ...
Swap the positions of the two specified columns. @param columnKeyA @param columnKeyB
[ "Swap", "the", "positions", "of", "the", "two", "specified", "columns", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L849-L873
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Fraction.java
Fraction.mulPosAndCheck
private static int mulPosAndCheck(final int x, final int y) { /* assert x>=0 && y>=0; */ final long m = (long) x * (long) y; if (m > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: mulPos"); } return (int) m; }
java
private static int mulPosAndCheck(final int x, final int y) { /* assert x>=0 && y>=0; */ final long m = (long) x * (long) y; if (m > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: mulPos"); } return (int) m; }
[ "private", "static", "int", "mulPosAndCheck", "(", "final", "int", "x", ",", "final", "int", "y", ")", "{", "/* assert x>=0 && y>=0; */", "final", "long", "m", "=", "(", "long", ")", "x", "*", "(", "long", ")", "y", ";", "if", "(", "m", ">", "Integer...
Multiply two non-negative integers, checking for overflow. @param x a non-negative factor @param y a non-negative factor @return the product <code>x*y</code> @throws ArithmeticException if the result can not be represented as an int
[ "Multiply", "two", "non", "-", "negative", "integers", "checking", "for", "overflow", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L780-L787
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Fraction.java
Fraction.addAndCheck
private static int addAndCheck(final int x, final int y) { final long s = (long) x + (long) y; if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: add"); } return (int) s; }
java
private static int addAndCheck(final int x, final int y) { final long s = (long) x + (long) y; if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: add"); } return (int) s; }
[ "private", "static", "int", "addAndCheck", "(", "final", "int", "x", ",", "final", "int", "y", ")", "{", "final", "long", "s", "=", "(", "long", ")", "x", "+", "(", "long", ")", "y", ";", "if", "(", "s", "<", "Integer", ".", "MIN_VALUE", "||", ...
Add two integers, checking for overflow. @param x an addend @param y an addend @return the sum <code>x+y</code> @throws ArithmeticException if the result can not be represented as an int
[ "Add", "two", "integers", "checking", "for", "overflow", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L800-L806
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Fraction.java
Fraction.subAndCheck
private static int subAndCheck(final int x, final int y) { final long s = (long) x - (long) y; if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: add"); } return (int) s; }
java
private static int subAndCheck(final int x, final int y) { final long s = (long) x - (long) y; if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: add"); } return (int) s; }
[ "private", "static", "int", "subAndCheck", "(", "final", "int", "x", ",", "final", "int", "y", ")", "{", "final", "long", "s", "=", "(", "long", ")", "x", "-", "(", "long", ")", "y", ";", "if", "(", "s", "<", "Integer", ".", "MIN_VALUE", "||", ...
Subtract two integers, checking for overflow. @param x the minuend @param y the subtrahend @return the difference <code>x-y</code> @throws ArithmeticException if the result can not be represented as an int
[ "Subtract", "two", "integers", "checking", "for", "overflow", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L819-L825
train
landawn/AbacusUtil
src/com/landawn/abacus/util/IntList.java
IntList.binarySearch
public int binarySearch(final int fromIndex, final int toIndex, final int key) { checkFromToIndex(fromIndex, toIndex); return N.binarySearch(elementData, fromIndex, toIndex, key); }
java
public int binarySearch(final int fromIndex, final int toIndex, final int key) { checkFromToIndex(fromIndex, toIndex); return N.binarySearch(elementData, fromIndex, toIndex, key); }
[ "public", "int", "binarySearch", "(", "final", "int", "fromIndex", ",", "final", "int", "toIndex", ",", "final", "int", "key", ")", "{", "checkFromToIndex", "(", "fromIndex", ",", "toIndex", ")", ";", "return", "N", ".", "binarySearch", "(", "elementData", ...
This List should be sorted first. @param fromIndex @param toIndex @param key @return
[ "This", "List", "should", "be", "sorted", "first", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/IntList.java#L1275-L1279
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Maps.java
Maps.remove
public static <K, V> boolean remove(final Map<K, V> map, Map.Entry<?, ?> entry) { return remove(map, entry.getKey(), entry.getValue()); }
java
public static <K, V> boolean remove(final Map<K, V> map, Map.Entry<?, ?> entry) { return remove(map, entry.getKey(), entry.getValue()); }
[ "public", "static", "<", "K", ",", "V", ">", "boolean", "remove", "(", "final", "Map", "<", "K", ",", "V", ">", "map", ",", "Map", ".", "Entry", "<", "?", ",", "?", ">", "entry", ")", "{", "return", "remove", "(", "map", ",", "entry", ".", "g...
Removes the specified entry. @param map @param entry @return
[ "Removes", "the", "specified", "entry", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Maps.java#L529-L531
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Matth.java
Matth.asinh
public static double asinh(double a) { boolean negative = false; if (a < 0) { negative = true; a = -a; } double absAsinh; if (a > 0.167) { absAsinh = Math.log(Math.sqrt(a * a + 1) + a); } else { final double a2 =...
java
public static double asinh(double a) { boolean negative = false; if (a < 0) { negative = true; a = -a; } double absAsinh; if (a > 0.167) { absAsinh = Math.log(Math.sqrt(a * a + 1) + a); } else { final double a2 =...
[ "public", "static", "double", "asinh", "(", "double", "a", ")", "{", "boolean", "negative", "=", "false", ";", "if", "(", "a", "<", "0", ")", "{", "negative", "=", "true", ";", "a", "=", "-", "a", ";", "}", "double", "absAsinh", ";", "if", "(", ...
Compute the inverse hyperbolic sine of a number. @param a number on which evaluation is done @return inverse hyperbolic sine of a
[ "Compute", "the", "inverse", "hyperbolic", "sine", "of", "a", "number", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L2557-L2585
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Matth.java
Matth.atanh
public static double atanh(double a) { boolean negative = false; if (a < 0) { negative = true; a = -a; } double absAtanh; if (a > 0.15) { absAtanh = 0.5 * Math.log((1 + a) / (1 - a)); } else { final double a2 = a...
java
public static double atanh(double a) { boolean negative = false; if (a < 0) { negative = true; a = -a; } double absAtanh; if (a > 0.15) { absAtanh = 0.5 * Math.log((1 + a) / (1 - a)); } else { final double a2 = a...
[ "public", "static", "double", "atanh", "(", "double", "a", ")", "{", "boolean", "negative", "=", "false", ";", "if", "(", "a", "<", "0", ")", "{", "negative", "=", "true", ";", "a", "=", "-", "a", ";", "}", "double", "absAtanh", ";", "if", "(", ...
Compute the inverse hyperbolic tangent of a number. @param a number on which evaluation is done @return inverse hyperbolic tangent of a
[ "Compute", "the", "inverse", "hyperbolic", "tangent", "of", "a", "number", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L2599-L2623
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolableConnection.java
PoolableConnection.createStatement
@Override public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { // return new // NativeStatement(internalConn.createStatement(resultSetType, // resultSetConcurrency), this); return internalConn.createStatement(resultSetType, resultSe...
java
@Override public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { // return new // NativeStatement(internalConn.createStatement(resultSetType, // resultSetConcurrency), this); return internalConn.createStatement(resultSetType, resultSe...
[ "@", "Override", "public", "Statement", "createStatement", "(", "int", "resultSetType", ",", "int", "resultSetConcurrency", ")", "throws", "SQLException", "{", "// return new\r", "// NativeStatement(internalConn.createStatement(resultSetType,\r", "// resultSetConcurrency), this);\r...
Method createStatement. @param resultSetType @param resultSetConcurrency @return Statement @throws SQLException @see java.sql.Connection#createStatement(int, int)
[ "Method", "createStatement", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L272-L278
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolableConnection.java
PoolableConnection.isClosed
@Override public boolean isClosed() throws SQLException { if (!isClosed) { try { if (internalConn.isClosed()) { destroy(); } } catch (SQLException e) { // ignore destroy(); ...
java
@Override public boolean isClosed() throws SQLException { if (!isClosed) { try { if (internalConn.isClosed()) { destroy(); } } catch (SQLException e) { // ignore destroy(); ...
[ "@", "Override", "public", "boolean", "isClosed", "(", ")", "throws", "SQLException", "{", "if", "(", "!", "isClosed", ")", "{", "try", "{", "if", "(", "internalConn", ".", "isClosed", "(", ")", ")", "{", "destroy", "(", ")", ";", "}", "}", "catch", ...
Method isClosed. @return boolean @throws SQLException @see java.sql.Connection#isClosed()
[ "Method", "isClosed", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L390-L408
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolableConnection.java
PoolableConnection.setTypeMap
@Override public void setTypeMap(Map<String, Class<?>> arg0) throws SQLException { internalConn.setTypeMap(arg0); }
java
@Override public void setTypeMap(Map<String, Class<?>> arg0) throws SQLException { internalConn.setTypeMap(arg0); }
[ "@", "Override", "public", "void", "setTypeMap", "(", "Map", "<", "String", ",", "Class", "<", "?", ">", ">", "arg0", ")", "throws", "SQLException", "{", "internalConn", ".", "setTypeMap", "(", "arg0", ")", ";", "}" ]
Method setTypeMap. @param arg0 @throws SQLException @see java.sql.Connection#setTypeMap(Map<String,Class<?>>)
[ "Method", "setTypeMap", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L718-L721
train
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolableConnection.java
PoolableConnection.setClientInfo
@Override public void setClientInfo(String name, String value) throws SQLClientInfoException { internalConn.setClientInfo(name, value); }
java
@Override public void setClientInfo(String name, String value) throws SQLClientInfoException { internalConn.setClientInfo(name, value); }
[ "@", "Override", "public", "void", "setClientInfo", "(", "String", "name", ",", "String", "value", ")", "throws", "SQLClientInfoException", "{", "internalConn", ".", "setClientInfo", "(", "name", ",", "value", ")", ";", "}" ]
Method setClientInfo. @param name @param value @throws SQLClientInfoException @see java.sql.Connection#setClientInfo(String, String)
[ "Method", "setClientInfo", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L857-L860
train
landawn/AbacusUtil
src/com/landawn/abacus/util/AnyDelete.java
AnyDelete.addFamilyVersion
public AnyDelete addFamilyVersion(String family, final long timestamp) { delete.addFamilyVersion(toFamilyQualifierBytes(family), timestamp); return this; }
java
public AnyDelete addFamilyVersion(String family, final long timestamp) { delete.addFamilyVersion(toFamilyQualifierBytes(family), timestamp); return this; }
[ "public", "AnyDelete", "addFamilyVersion", "(", "String", "family", ",", "final", "long", "timestamp", ")", "{", "delete", ".", "addFamilyVersion", "(", "toFamilyQualifierBytes", "(", "family", ")", ",", "timestamp", ")", ";", "return", "this", ";", "}" ]
Delete all columns of the specified family with a timestamp equal to the specified timestamp. @param family @param timestamp @return
[ "Delete", "all", "columns", "of", "the", "specified", "family", "with", "a", "timestamp", "equal", "to", "the", "specified", "timestamp", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/AnyDelete.java#L120-L124
train
landawn/AbacusUtil
src/com/landawn/abacus/util/AnyDelete.java
AnyDelete.addColumn
public AnyDelete addColumn(String family, String qualifier) { delete.addColumn(toFamilyQualifierBytes(family), toFamilyQualifierBytes(qualifier)); return this; }
java
public AnyDelete addColumn(String family, String qualifier) { delete.addColumn(toFamilyQualifierBytes(family), toFamilyQualifierBytes(qualifier)); return this; }
[ "public", "AnyDelete", "addColumn", "(", "String", "family", ",", "String", "qualifier", ")", "{", "delete", ".", "addColumn", "(", "toFamilyQualifierBytes", "(", "family", ")", ",", "toFamilyQualifierBytes", "(", "qualifier", ")", ")", ";", "return", "this", ...
Delete the latest version of the specified column. This is an expensive call in that on the server-side, it first does a get to find the latest versions timestamp. Then it adds a delete using the fetched cells timestamp. @param family @param qualifier @return
[ "Delete", "the", "latest", "version", "of", "the", "specified", "column", ".", "This", "is", "an", "expensive", "call", "in", "that", "on", "the", "server", "-", "side", "it", "first", "does", "a", "get", "to", "find", "the", "latest", "versions", "times...
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/AnyDelete.java#L140-L144
train
landawn/AbacusUtil
src/com/landawn/abacus/util/AnyDelete.java
AnyDelete.addColumns
public AnyDelete addColumns(String family, String qualifier) { delete.addColumns(toFamilyQualifierBytes(family), toFamilyQualifierBytes(qualifier)); return this; }
java
public AnyDelete addColumns(String family, String qualifier) { delete.addColumns(toFamilyQualifierBytes(family), toFamilyQualifierBytes(qualifier)); return this; }
[ "public", "AnyDelete", "addColumns", "(", "String", "family", ",", "String", "qualifier", ")", "{", "delete", ".", "addColumns", "(", "toFamilyQualifierBytes", "(", "family", ")", ",", "toFamilyQualifierBytes", "(", "qualifier", ")", ")", ";", "return", "this", ...
Delete all versions of the specified column. @param family @param qualifier @return
[ "Delete", "all", "versions", "of", "the", "specified", "column", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/AnyDelete.java#L167-L171
train
landawn/AbacusUtil
src/com/landawn/abacus/util/Triple.java
Triple.reversed
@Beta public Triple<R, M, L> reversed() { return new Triple<>(this.right, this.middle, this.left); }
java
@Beta public Triple<R, M, L> reversed() { return new Triple<>(this.right, this.middle, this.left); }
[ "@", "Beta", "public", "Triple", "<", "R", ",", "M", ",", "L", ">", "reversed", "(", ")", "{", "return", "new", "Triple", "<>", "(", "this", ".", "right", ",", "this", ".", "middle", ",", "this", ".", "left", ")", ";", "}" ]
Returns a new instance of Triple&lt;R, M, L&gt;. @return a new instance of Triple&lt;R, M, L&gt;.
[ "Returns", "a", "new", "instance", "of", "Triple&lt", ";", "R", "M", "L&gt", ";", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Triple.java#L225-L228
train
landawn/AbacusUtil
src/com/landawn/abacus/util/FileSystemUtil.java
FileSystemUtil.freeSpaceWindows
long freeSpaceWindows(String path, final long timeout) throws IOException { path = FilenameUtil.normalize(path, false); if (path.length() > 0 && path.charAt(0) != '"') { path = "\"" + path + "\""; } // build and run the 'dir' command final String[] cmdAttribs ...
java
long freeSpaceWindows(String path, final long timeout) throws IOException { path = FilenameUtil.normalize(path, false); if (path.length() > 0 && path.charAt(0) != '"') { path = "\"" + path + "\""; } // build and run the 'dir' command final String[] cmdAttribs ...
[ "long", "freeSpaceWindows", "(", "String", "path", ",", "final", "long", "timeout", ")", "throws", "IOException", "{", "path", "=", "FilenameUtil", ".", "normalize", "(", "path", ",", "false", ")", ";", "if", "(", "path", ".", "length", "(", ")", ">", ...
Find free space on the Windows platform using the 'dir' command. @param path the path to get free space for, including the colon @param timeout The timeout amount in milliseconds or no timeout if the value is zero or less @return the amount of free drive space on the drive @throws IOException if an error occurs
[ "Find", "free", "space", "on", "the", "Windows", "platform", "using", "the", "dir", "command", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FileSystemUtil.java#L248-L272
train
landawn/AbacusUtil
src/com/landawn/abacus/util/FileSystemUtil.java
FileSystemUtil.parseDir
long parseDir(final String line, final String path) throws IOException { // read from the end of the line to find the last numeric // character on the line, then continue until we find the first // non-numeric character, and everything between that and the last // numeric character i...
java
long parseDir(final String line, final String path) throws IOException { // read from the end of the line to find the last numeric // character on the line, then continue until we find the first // non-numeric character, and everything between that and the last // numeric character i...
[ "long", "parseDir", "(", "final", "String", "line", ",", "final", "String", "path", ")", "throws", "IOException", "{", "// read from the end of the line to find the last numeric\r", "// character on the line, then continue until we find the first\r", "// non-numeric character, and ev...
Parses the Windows dir response last line @param line the line to parse @param path the path that was sent @return the number of bytes @throws IOException if an error occurs
[ "Parses", "the", "Windows", "dir", "response", "last", "line" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FileSystemUtil.java#L282-L322
train
landawn/AbacusUtil
src/com/landawn/abacus/util/FileSystemUtil.java
FileSystemUtil.parseBytes
long parseBytes(final String freeSpace, final String path) throws IOException { try { final long bytes = Long.parseLong(freeSpace); if (bytes < 0) { throw new IOException("Command line '" + DF + "' did not find free space in response " + "for path '" + path + "'- chec...
java
long parseBytes(final String freeSpace, final String path) throws IOException { try { final long bytes = Long.parseLong(freeSpace); if (bytes < 0) { throw new IOException("Command line '" + DF + "' did not find free space in response " + "for path '" + path + "'- chec...
[ "long", "parseBytes", "(", "final", "String", "freeSpace", ",", "final", "String", "path", ")", "throws", "IOException", "{", "try", "{", "final", "long", "bytes", "=", "Long", ".", "parseLong", "(", "freeSpace", ")", ";", "if", "(", "bytes", "<", "0", ...
Parses the bytes from a string. @param freeSpace the free space string @param path the path @return the number of bytes @throws IOException if an error occurs
[ "Parses", "the", "bytes", "from", "a", "string", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FileSystemUtil.java#L387-L398
train
landawn/AbacusUtil
src/com/landawn/abacus/util/FileSystemUtil.java
FileSystemUtil.performCommand
List<String> performCommand(final String[] cmdAttribs, final int max, final long timeout) throws IOException { // this method does what it can to avoid the 'Too many open files' error // based on trial and error and these links: // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4784692 ...
java
List<String> performCommand(final String[] cmdAttribs, final int max, final long timeout) throws IOException { // this method does what it can to avoid the 'Too many open files' error // based on trial and error and these links: // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4784692 ...
[ "List", "<", "String", ">", "performCommand", "(", "final", "String", "[", "]", "cmdAttribs", ",", "final", "int", "max", ",", "final", "long", "timeout", ")", "throws", "IOException", "{", "// this method does what it can to avoid the 'Too many open files' error\r", ...
Performs the os command. @param cmdAttribs the command line parameters @param max The maximum limit for the lines returned @param timeout The timeout amount in milliseconds or no timeout if the value is zero or less @return the lines returned by the command, converted to lower-case @throws IOException if an error occ...
[ "Performs", "the", "os", "command", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FileSystemUtil.java#L411-L468
train
landawn/AbacusUtil
src/com/landawn/abacus/util/BiMap.java
BiMap.entrySet
@Override public Set<Map.Entry<K, V>> entrySet() { return new AbstractSet<Map.Entry<K, V>>() { @Override public Iterator<Map.Entry<K, V>> iterator() { return new ObjIterator<Map.Entry<K, V>>() { private final Iterator<Map.Entry<K, V>> keyValu...
java
@Override public Set<Map.Entry<K, V>> entrySet() { return new AbstractSet<Map.Entry<K, V>>() { @Override public Iterator<Map.Entry<K, V>> iterator() { return new ObjIterator<Map.Entry<K, V>>() { private final Iterator<Map.Entry<K, V>> keyValu...
[ "@", "Override", "public", "Set", "<", "Map", ".", "Entry", "<", "K", ",", "V", ">", ">", "entrySet", "(", ")", "{", "return", "new", "AbstractSet", "<", "Map", ".", "Entry", "<", "K", ",", "V", ">", ">", "(", ")", "{", "@", "Override", "public...
Returns an immutable Set of Immutable entry.
[ "Returns", "an", "immutable", "Set", "of", "Immutable", "entry", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/BiMap.java#L329-L383
train
landawn/AbacusUtil
src/com/landawn/abacus/util/BiMap.java
BiMap.inversed
public BiMap<V, K> inversed() { return (inverse == null) ? inverse = new BiMap<>(valueMap, keyMap) : inverse; }
java
public BiMap<V, K> inversed() { return (inverse == null) ? inverse = new BiMap<>(valueMap, keyMap) : inverse; }
[ "public", "BiMap", "<", "V", ",", "K", ">", "inversed", "(", ")", "{", "return", "(", "inverse", "==", "null", ")", "?", "inverse", "=", "new", "BiMap", "<>", "(", "valueMap", ",", "keyMap", ")", ":", "inverse", ";", "}" ]
Returns the inverse view of this BiMap, which maps each of this bimap's values to its associated key. The two BiMaps are backed by the same data; any changes to one will appear in the other. @return
[ "Returns", "the", "inverse", "view", "of", "this", "BiMap", "which", "maps", "each", "of", "this", "bimap", "s", "values", "to", "its", "associated", "key", ".", "The", "two", "BiMaps", "are", "backed", "by", "the", "same", "data", ";", "any", "changes",...
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/BiMap.java#L391-L393
train
landawn/AbacusUtil
src/com/landawn/abacus/cache/OffHeapCache.java
OffHeapCache.evict
protected void evict() { for (int i = 0, len = _segments.length; i < len; i++) { if (_segments[i].blockBitSet.isEmpty()) { final Deque<Segment> queue = _segmentQueueMap.get(i); if (queue != null) { synchronized (queue) { ...
java
protected void evict() { for (int i = 0, len = _segments.length; i < len; i++) { if (_segments[i].blockBitSet.isEmpty()) { final Deque<Segment> queue = _segmentQueueMap.get(i); if (queue != null) { synchronized (queue) { ...
[ "protected", "void", "evict", "(", ")", "{", "for", "(", "int", "i", "=", "0", ",", "len", "=", "_segments", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "_segments", "[", "i", "]", ".", "blockBitSet", ".", "isEmpty...
recycle the empty Segment.
[ "recycle", "the", "empty", "Segment", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/cache/OffHeapCache.java#L552-L571
train
landawn/AbacusUtil
src/com/landawn/abacus/logging/JDKLogger.java
JDKLogger.log
private void log(String callerFQCN, Level level, String msg, Throwable t) { // millis and thread are filled by the constructor LogRecord record = new LogRecord(level, msg); record.setLoggerName(getName()); record.setThrown(t); // Note: parameters in record are not set becaus...
java
private void log(String callerFQCN, Level level, String msg, Throwable t) { // millis and thread are filled by the constructor LogRecord record = new LogRecord(level, msg); record.setLoggerName(getName()); record.setThrown(t); // Note: parameters in record are not set becaus...
[ "private", "void", "log", "(", "String", "callerFQCN", ",", "Level", "level", ",", "String", "msg", ",", "Throwable", "t", ")", "{", "// millis and thread are filled by the constructor\r", "LogRecord", "record", "=", "new", "LogRecord", "(", "level", ",", "msg", ...
Log the message at the specified level with the specified throwable if any. This method creates a LogRecord and fills in caller date before calling this instance's JDK14 logger. See bug report #13 for more details. @param level @param msg @param t
[ "Log", "the", "message", "at", "the", "specified", "level", "with", "the", "specified", "throwable", "if", "any", ".", "This", "method", "creates", "a", "LogRecord", "and", "fills", "in", "caller", "date", "before", "calling", "this", "instance", "s", "JDK14...
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/logging/JDKLogger.java#L131-L140
train
landawn/AbacusUtil
src/com/landawn/abacus/logging/JDKLogger.java
JDKLogger.fillCallerData
final private void fillCallerData(String callerFQCN, LogRecord record) { StackTraceElement[] steArray = new Throwable().getStackTrace(); int selfIndex = -1; for (int i = 0; i < steArray.length; i++) { final String className = steArray[i].getClassName(); if (classNa...
java
final private void fillCallerData(String callerFQCN, LogRecord record) { StackTraceElement[] steArray = new Throwable().getStackTrace(); int selfIndex = -1; for (int i = 0; i < steArray.length; i++) { final String className = steArray[i].getClassName(); if (classNa...
[ "final", "private", "void", "fillCallerData", "(", "String", "callerFQCN", ",", "LogRecord", "record", ")", "{", "StackTraceElement", "[", "]", "steArray", "=", "new", "Throwable", "(", ")", ".", "getStackTrace", "(", ")", ";", "int", "selfIndex", "=", "-", ...
Fill in caller data if possible. @param record The record to update
[ "Fill", "in", "caller", "data", "if", "possible", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/logging/JDKLogger.java#L148-L176
train
landawn/AbacusUtil
src/com/landawn/abacus/util/LongMultiset.java
LongMultiset.removeAll
public boolean removeAll(final Collection<?> c, final long occurrences) { checkOccurrences(occurrences); if (N.isNullOrEmpty(c) || occurrences == 0) { return false; } boolean result = false; for (Object e : c) { if (result == false) { ...
java
public boolean removeAll(final Collection<?> c, final long occurrences) { checkOccurrences(occurrences); if (N.isNullOrEmpty(c) || occurrences == 0) { return false; } boolean result = false; for (Object e : c) { if (result == false) { ...
[ "public", "boolean", "removeAll", "(", "final", "Collection", "<", "?", ">", "c", ",", "final", "long", "occurrences", ")", "{", "checkOccurrences", "(", "occurrences", ")", ";", "if", "(", "N", ".", "isNullOrEmpty", "(", "c", ")", "||", "occurrences", "...
Remove the specified occurrences from the specified elements. The elements will be removed from this set if the occurrences equals to or less than 0 after the operation. @param c @param occurrences the occurrences to remove if the element is in the specified collection <code>c</code>. @return <tt>true</tt> if this set...
[ "Remove", "the", "specified", "occurrences", "from", "the", "specified", "elements", ".", "The", "elements", "will", "be", "removed", "from", "this", "set", "if", "the", "occurrences", "equals", "to", "or", "less", "than", "0", "after", "the", "operation", "...
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/LongMultiset.java#L873-L891
train
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.newInstance
public static <T> T newInstance(final Class<T> cls) { if (Modifier.isAbstract(cls.getModifiers())) { if (cls.equals(Map.class)) { return (T) new HashMap<>(); } else if (cls.equals(List.class)) { return (T) new ArrayList<>(); } else if (cl...
java
public static <T> T newInstance(final Class<T> cls) { if (Modifier.isAbstract(cls.getModifiers())) { if (cls.equals(Map.class)) { return (T) new HashMap<>(); } else if (cls.equals(List.class)) { return (T) new ArrayList<>(); } else if (cl...
[ "public", "static", "<", "T", ">", "T", "newInstance", "(", "final", "Class", "<", "T", ">", "cls", ")", "{", "if", "(", "Modifier", ".", "isAbstract", "(", "cls", ".", "getModifiers", "(", ")", ")", ")", "{", "if", "(", "cls", ".", "equals", "("...
Method newInstance. @param cls @return T
[ "Method", "newInstance", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L688-L738
train
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.newArray
@SuppressWarnings("unchecked") public static <T> T newArray(final Class<?> componentType, final int length) { // if (length == 0) { // final Object result = CLASS_EMPTY_ARRAY.get(componentType); // // if (result != null) { // ...
java
@SuppressWarnings("unchecked") public static <T> T newArray(final Class<?> componentType, final int length) { // if (length == 0) { // final Object result = CLASS_EMPTY_ARRAY.get(componentType); // // if (result != null) { // ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "newArray", "(", "final", "Class", "<", "?", ">", "componentType", ",", "final", "int", "length", ")", "{", "// if (length == 0) {\r", "// final Object re...
Method newArray. @param componentType @param length @return T[]
[ "Method", "newArray", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L772-L783
train
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.newSetFromMap
public static <E> Set<E> newSetFromMap(final Map<E, Boolean> map) { return Collections.newSetFromMap(map); }
java
public static <E> Set<E> newSetFromMap(final Map<E, Boolean> map) { return Collections.newSetFromMap(map); }
[ "public", "static", "<", "E", ">", "Set", "<", "E", ">", "newSetFromMap", "(", "final", "Map", "<", "E", ",", "Boolean", ">", "map", ")", "{", "return", "Collections", ".", "newSetFromMap", "(", "map", ")", ";", "}" ]
Returns a set backed by the specified map. @param map the backing map @return the set backed by the map @see Collections#newSetFromMap(Map)
[ "Returns", "a", "set", "backed", "by", "the", "specified", "map", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L811-L813
train
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.toArray
@SuppressWarnings("unchecked") public static Object[] toArray(final Collection<?> c) { if (N.isNullOrEmpty(c)) { return N.EMPTY_OBJECT_ARRAY; } return c.toArray(new Object[c.size()]); }
java
@SuppressWarnings("unchecked") public static Object[] toArray(final Collection<?> c) { if (N.isNullOrEmpty(c)) { return N.EMPTY_OBJECT_ARRAY; } return c.toArray(new Object[c.size()]); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "Object", "[", "]", "toArray", "(", "final", "Collection", "<", "?", ">", "c", ")", "{", "if", "(", "N", ".", "isNullOrEmpty", "(", "c", ")", ")", "{", "return", "N", ".", "EMPTY...
Returns an empty array if the specified collection is null or empty. @param c @return
[ "Returns", "an", "empty", "array", "if", "the", "specified", "collection", "is", "null", "or", "empty", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L1620-L1627
train