id
int32
0
165k
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
60,400
ehcache/ehcache3
clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ClusteringServiceConfigurationBuilder.java
ClusteringServiceConfigurationBuilder.timeouts
public ClusteringServiceConfigurationBuilder timeouts(Builder<? extends Timeouts> timeoutsBuilder) { return new ClusteringServiceConfigurationBuilder(this.connectionSource, timeoutsBuilder.build(), this.autoCreate); }
java
public ClusteringServiceConfigurationBuilder timeouts(Builder<? extends Timeouts> timeoutsBuilder) { return new ClusteringServiceConfigurationBuilder(this.connectionSource, timeoutsBuilder.build(), this.autoCreate); }
[ "public", "ClusteringServiceConfigurationBuilder", "timeouts", "(", "Builder", "<", "?", "extends", "Timeouts", ">", "timeoutsBuilder", ")", "{", "return", "new", "ClusteringServiceConfigurationBuilder", "(", "this", ".", "connectionSource", ",", "timeoutsBuilder", ".", ...
Adds timeouts. Read operations which time out return a result comparable to a cache miss. Write operations which time out won't do anything. Lifecycle operations which time out will fail with exception @param timeoutsBuilder the builder for amount of time permitted for all operations @return a clustering service conf...
[ "Adds", "timeouts", ".", "Read", "operations", "which", "time", "out", "return", "a", "result", "comparable", "to", "a", "cache", "miss", ".", "Write", "operations", "which", "time", "out", "won", "t", "do", "anything", ".", "Lifecycle", "operations", "which...
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ClusteringServiceConfigurationBuilder.java#L119-L121
60,401
ehcache/ehcache3
clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ClusteringServiceConfigurationBuilder.java
ClusteringServiceConfigurationBuilder.readOperationTimeout
@Deprecated public ClusteringServiceConfigurationBuilder readOperationTimeout(long duration, TimeUnit unit) { Duration readTimeout = Duration.of(duration, toChronoUnit(unit)); return timeouts(TimeoutsBuilder.timeouts().read(readTimeout).build()); }
java
@Deprecated public ClusteringServiceConfigurationBuilder readOperationTimeout(long duration, TimeUnit unit) { Duration readTimeout = Duration.of(duration, toChronoUnit(unit)); return timeouts(TimeoutsBuilder.timeouts().read(readTimeout).build()); }
[ "@", "Deprecated", "public", "ClusteringServiceConfigurationBuilder", "readOperationTimeout", "(", "long", "duration", ",", "TimeUnit", "unit", ")", "{", "Duration", "readTimeout", "=", "Duration", ".", "of", "(", "duration", ",", "toChronoUnit", "(", "unit", ")", ...
Adds a read operation timeout. Read operations which time out return a result comparable to a cache miss. @param duration the amount of time permitted for read operations @param unit the time units for {@code duration} @return a clustering service configuration builder @throws NullPointerException if {@code unit} i...
[ "Adds", "a", "read", "operation", "timeout", ".", "Read", "operations", "which", "time", "out", "return", "a", "result", "comparable", "to", "a", "cache", "miss", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ClusteringServiceConfigurationBuilder.java#L138-L142
60,402
ehcache/ehcache3
core/src/main/java/org/ehcache/core/EhcacheManager.java
EhcacheManager.removeCache
private void removeCache(final String alias, final boolean removeFromConfig) { statusTransitioner.checkAvailable(); final CacheHolder cacheHolder = caches.remove(alias); if(cacheHolder != null) { final InternalCache<?, ?> ehcache = cacheHolder.retrieve(cacheHolder.keyType, cacheHolder.valueType); ...
java
private void removeCache(final String alias, final boolean removeFromConfig) { statusTransitioner.checkAvailable(); final CacheHolder cacheHolder = caches.remove(alias); if(cacheHolder != null) { final InternalCache<?, ?> ehcache = cacheHolder.retrieve(cacheHolder.keyType, cacheHolder.valueType); ...
[ "private", "void", "removeCache", "(", "final", "String", "alias", ",", "final", "boolean", "removeFromConfig", ")", "{", "statusTransitioner", ".", "checkAvailable", "(", ")", ";", "final", "CacheHolder", "cacheHolder", "=", "caches", ".", "remove", "(", "alias...
Closes and removes a cache, by alias, from this cache manager. @param alias the alias of the cache to remove @param removeFromConfig if {@code true}, the cache configuration is altered to remove the cache
[ "Closes", "and", "removes", "a", "cache", "by", "alias", "from", "this", "cache", "manager", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/EhcacheManager.java#L199-L220
60,403
ehcache/ehcache3
core/src/main/java/org/ehcache/core/EhcacheManager.java
EhcacheManager.adjustConfigurationWithCacheManagerDefaults
private <K, V> CacheConfiguration<K, V> adjustConfigurationWithCacheManagerDefaults(String alias, CacheConfiguration<K, V> config) { ClassLoader cacheClassLoader = config.getClassLoader(); List<ServiceConfiguration<?>> configurationList = new ArrayList<>(); configurationList.addAll(config.getServiceConfigu...
java
private <K, V> CacheConfiguration<K, V> adjustConfigurationWithCacheManagerDefaults(String alias, CacheConfiguration<K, V> config) { ClassLoader cacheClassLoader = config.getClassLoader(); List<ServiceConfiguration<?>> configurationList = new ArrayList<>(); configurationList.addAll(config.getServiceConfigu...
[ "private", "<", "K", ",", "V", ">", "CacheConfiguration", "<", "K", ",", "V", ">", "adjustConfigurationWithCacheManagerDefaults", "(", "String", "alias", ",", "CacheConfiguration", "<", "K", ",", "V", ">", "config", ")", "{", "ClassLoader", "cacheClassLoader", ...
adjusts the config to reflect new classloader & serialization provider
[ "adjusts", "the", "config", "to", "reflect", "new", "classloader", "&", "serialization", "provider" ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/EhcacheManager.java#L534-L569
60,404
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java
OnHeapStore.evict
boolean evict(StoreEventSink<K, V> eventSink) { evictionObserver.begin(); Random random = new Random(); @SuppressWarnings("unchecked") Map.Entry<K, OnHeapValueHolder<V>> candidate = map.getEvictionCandidate(random, SAMPLE_SIZE, EVICTION_PRIORITIZER, EVICTION_ADVISOR); if (candidate == null) { ...
java
boolean evict(StoreEventSink<K, V> eventSink) { evictionObserver.begin(); Random random = new Random(); @SuppressWarnings("unchecked") Map.Entry<K, OnHeapValueHolder<V>> candidate = map.getEvictionCandidate(random, SAMPLE_SIZE, EVICTION_PRIORITIZER, EVICTION_ADVISOR); if (candidate == null) { ...
[ "boolean", "evict", "(", "StoreEventSink", "<", "K", ",", "V", ">", "eventSink", ")", "{", "evictionObserver", ".", "begin", "(", ")", ";", "Random", "random", "=", "new", "Random", "(", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Map"...
Try to evict a mapping. @return true if a mapping was evicted, false otherwise. @param eventSink target of eviction event
[ "Try", "to", "evict", "a", "mapping", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java#L1575-L1612
60,405
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.getFailure
@Override public V getFailure(K key, StoreAccessException e) { try { return loaderWriter.load(key); } catch (Exception e1) { throw ExceptionFactory.newCacheLoadingException(e1, e); } finally { cleanup(key, e); } }
java
@Override public V getFailure(K key, StoreAccessException e) { try { return loaderWriter.load(key); } catch (Exception e1) { throw ExceptionFactory.newCacheLoadingException(e1, e); } finally { cleanup(key, e); } }
[ "@", "Override", "public", "V", "getFailure", "(", "K", "key", ",", "StoreAccessException", "e", ")", "{", "try", "{", "return", "loaderWriter", ".", "load", "(", "key", ")", ";", "}", "catch", "(", "Exception", "e1", ")", "{", "throw", "ExceptionFactory...
Get the value from the loader-writer. @param key the key being retrieved @param e the triggered failure @return value as loaded from the loader-writer
[ "Get", "the", "value", "from", "the", "loader", "-", "writer", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L55-L64
60,406
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.containsKeyFailure
@Override public boolean containsKeyFailure(K key, StoreAccessException e) { cleanup(key, e); return false; }
java
@Override public boolean containsKeyFailure(K key, StoreAccessException e) { cleanup(key, e); return false; }
[ "@", "Override", "public", "boolean", "containsKeyFailure", "(", "K", "key", ",", "StoreAccessException", "e", ")", "{", "cleanup", "(", "key", ",", "e", ")", ";", "return", "false", ";", "}" ]
Return false. It doesn't matter if the key is present in the backend, we consider it's not in the cache. @param key the key being queried @param e the triggered failure @return false
[ "Return", "false", ".", "It", "doesn", "t", "matter", "if", "the", "key", "is", "present", "in", "the", "backend", "we", "consider", "it", "s", "not", "in", "the", "cache", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L73-L77
60,407
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.putFailure
@Override public void putFailure(K key, V value, StoreAccessException e) { try { loaderWriter.write(key, value); } catch (Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } finally { cleanup(key, e); } }
java
@Override public void putFailure(K key, V value, StoreAccessException e) { try { loaderWriter.write(key, value); } catch (Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } finally { cleanup(key, e); } }
[ "@", "Override", "public", "void", "putFailure", "(", "K", "key", ",", "V", "value", ",", "StoreAccessException", "e", ")", "{", "try", "{", "loaderWriter", ".", "write", "(", "key", ",", "value", ")", ";", "}", "catch", "(", "Exception", "e1", ")", ...
Write the value to the loader-write. @param key the key being put @param value the value being put @param e the triggered failure
[ "Write", "the", "value", "to", "the", "loader", "-", "write", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L86-L95
60,408
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.removeFailure
@Override public void removeFailure(K key, StoreAccessException e) { try { loaderWriter.delete(key); } catch(Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } finally { cleanup(key, e); } }
java
@Override public void removeFailure(K key, StoreAccessException e) { try { loaderWriter.delete(key); } catch(Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } finally { cleanup(key, e); } }
[ "@", "Override", "public", "void", "removeFailure", "(", "K", "key", ",", "StoreAccessException", "e", ")", "{", "try", "{", "loaderWriter", ".", "delete", "(", "key", ")", ";", "}", "catch", "(", "Exception", "e1", ")", "{", "throw", "ExceptionFactory", ...
Delete the key from the loader-writer. @param key the key being removed @param e the triggered failure
[ "Delete", "the", "key", "from", "the", "loader", "-", "writer", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L103-L112
60,409
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.putIfAbsentFailure
@Override public V putIfAbsentFailure(K key, V value, StoreAccessException e) { // FIXME: Should I care about useLoaderInAtomics? try { try { V loaded = loaderWriter.load(key); if (loaded != null) { return loaded; } } catch (Exception e1) { throw Exception...
java
@Override public V putIfAbsentFailure(K key, V value, StoreAccessException e) { // FIXME: Should I care about useLoaderInAtomics? try { try { V loaded = loaderWriter.load(key); if (loaded != null) { return loaded; } } catch (Exception e1) { throw Exception...
[ "@", "Override", "public", "V", "putIfAbsentFailure", "(", "K", "key", ",", "V", "value", ",", "StoreAccessException", "e", ")", "{", "// FIXME: Should I care about useLoaderInAtomics?", "try", "{", "try", "{", "V", "loaded", "=", "loaderWriter", ".", "load", "(...
Write the value to the loader-writer if it doesn't already exist in it. Note that the load and write pair is not atomic. This atomicity, if needed, should be handled by the something else. @param key the key being put @param value the value being put @param e the triggered failure @return the existing value or null if...
[ "Write", "the", "value", "to", "the", "loader", "-", "writer", "if", "it", "doesn", "t", "already", "exist", "in", "it", ".", "Note", "that", "the", "load", "and", "write", "pair", "is", "not", "atomic", ".", "This", "atomicity", "if", "needed", "shoul...
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L133-L154
60,410
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.removeFailure
@Override public boolean removeFailure(K key, V value, StoreAccessException e) { try { V loadedValue; try { loadedValue = loaderWriter.load(key); } catch (Exception e1) { throw ExceptionFactory.newCacheLoadingException(e1, e); } if (loadedValue == null) { re...
java
@Override public boolean removeFailure(K key, V value, StoreAccessException e) { try { V loadedValue; try { loadedValue = loaderWriter.load(key); } catch (Exception e1) { throw ExceptionFactory.newCacheLoadingException(e1, e); } if (loadedValue == null) { re...
[ "@", "Override", "public", "boolean", "removeFailure", "(", "K", "key", ",", "V", "value", ",", "StoreAccessException", "e", ")", "{", "try", "{", "V", "loadedValue", ";", "try", "{", "loadedValue", "=", "loaderWriter", ".", "load", "(", "key", ")", ";",...
Delete the key from the loader-writer if it is found with a matching value. Note that the load and write pair is not atomic. This atomicity, if needed, should be handled by the something else. @param key the key being removed @param value the value being removed @param e the triggered failure @return if the value was...
[ "Delete", "the", "key", "from", "the", "loader", "-", "writer", "if", "it", "is", "found", "with", "a", "matching", "value", ".", "Note", "that", "the", "load", "and", "write", "pair", "is", "not", "atomic", ".", "This", "atomicity", "if", "needed", "s...
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L165-L192
60,411
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.getAllFailure
@SuppressWarnings("unchecked") @Override public Map<K, V> getAllFailure(Iterable<? extends K> keys, StoreAccessException e) { try { return loaderWriter.loadAll((Iterable) keys); // FIXME: bad typing that we should fix } catch(BulkCacheLoadingException e1) { throw e1; } catch (Exception e1) {...
java
@SuppressWarnings("unchecked") @Override public Map<K, V> getAllFailure(Iterable<? extends K> keys, StoreAccessException e) { try { return loaderWriter.loadAll((Iterable) keys); // FIXME: bad typing that we should fix } catch(BulkCacheLoadingException e1) { throw e1; } catch (Exception e1) {...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "Map", "<", "K", ",", "V", ">", "getAllFailure", "(", "Iterable", "<", "?", "extends", "K", ">", "keys", ",", "StoreAccessException", "e", ")", "{", "try", "{", "return", "loa...
Get all entries for the provided keys. Entries not found by the loader-writer are expected to be an entry with the key and a null value. @param keys the keys being retrieved @param e the triggered failure @return a map of key-value pairs as loaded by the loader-writer
[ "Get", "all", "entries", "for", "the", "provided", "keys", ".", "Entries", "not", "found", "by", "the", "loader", "-", "writer", "are", "expected", "to", "be", "an", "entry", "with", "the", "key", "and", "a", "null", "value", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L270-L282
60,412
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.putAllFailure
@Override public void putAllFailure(Map<? extends K, ? extends V> entries, StoreAccessException e) { try { loaderWriter.writeAll(entries.entrySet()); // FIXME: bad typing that we should fix } catch(BulkCacheWritingException e1) { throw e1; } catch (Exception e1) { throw ExceptionFactory....
java
@Override public void putAllFailure(Map<? extends K, ? extends V> entries, StoreAccessException e) { try { loaderWriter.writeAll(entries.entrySet()); // FIXME: bad typing that we should fix } catch(BulkCacheWritingException e1) { throw e1; } catch (Exception e1) { throw ExceptionFactory....
[ "@", "Override", "public", "void", "putAllFailure", "(", "Map", "<", "?", "extends", "K", ",", "?", "extends", "V", ">", "entries", ",", "StoreAccessException", "e", ")", "{", "try", "{", "loaderWriter", ".", "writeAll", "(", "entries", ".", "entrySet", ...
Write all entries to the loader-writer. @param entries the entries being put @param e the triggered failure
[ "Write", "all", "entries", "to", "the", "loader", "-", "writer", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L290-L301
60,413
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.removeAllFailure
@Override public void removeAllFailure(Iterable<? extends K> keys, StoreAccessException e) { try { loaderWriter.deleteAll(keys); } catch(BulkCacheWritingException e1) { throw e1; } catch (Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } finally { cleanu...
java
@Override public void removeAllFailure(Iterable<? extends K> keys, StoreAccessException e) { try { loaderWriter.deleteAll(keys); } catch(BulkCacheWritingException e1) { throw e1; } catch (Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } finally { cleanu...
[ "@", "Override", "public", "void", "removeAllFailure", "(", "Iterable", "<", "?", "extends", "K", ">", "keys", ",", "StoreAccessException", "e", ")", "{", "try", "{", "loaderWriter", ".", "deleteAll", "(", "keys", ")", ";", "}", "catch", "(", "BulkCacheWri...
Delete all keys from the loader-writer. @param keys the keys being removed @param e the triggered failure
[ "Delete", "all", "keys", "from", "the", "loader", "-", "writer", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L309-L320
60,414
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/config/executor/PooledExecutionServiceConfiguration.java
PooledExecutionServiceConfiguration.addPool
public void addPool(String alias, int minSize, int maxSize) { if (alias == null) { throw new NullPointerException("Pool alias cannot be null"); } if (poolConfigurations.containsKey(alias)) { throw new IllegalArgumentException("A pool with the alias '" + alias + "' is already configured"); } ...
java
public void addPool(String alias, int minSize, int maxSize) { if (alias == null) { throw new NullPointerException("Pool alias cannot be null"); } if (poolConfigurations.containsKey(alias)) { throw new IllegalArgumentException("A pool with the alias '" + alias + "' is already configured"); } ...
[ "public", "void", "addPool", "(", "String", "alias", ",", "int", "minSize", ",", "int", "maxSize", ")", "{", "if", "(", "alias", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Pool alias cannot be null\"", ")", ";", "}", "if", "(",...
Adds a new pool with the provided minimum and maximum. @param alias the pool alias @param minSize the minimum size @param maxSize the maximum size @throws NullPointerException if alias is null @throws IllegalArgumentException if another pool with the same alias was configured already
[ "Adds", "a", "new", "pool", "with", "the", "provided", "minimum", "and", "maximum", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/config/executor/PooledExecutionServiceConfiguration.java#L82-L91
60,415
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java
AbstractResilienceStrategy.cleanup
protected void cleanup(StoreAccessException from) { try { store.obliterate(); } catch (StoreAccessException e) { inconsistent(from, e); return; } recovered(from); }
java
protected void cleanup(StoreAccessException from) { try { store.obliterate(); } catch (StoreAccessException e) { inconsistent(from, e); return; } recovered(from); }
[ "protected", "void", "cleanup", "(", "StoreAccessException", "from", ")", "{", "try", "{", "store", ".", "obliterate", "(", ")", ";", "}", "catch", "(", "StoreAccessException", "e", ")", "{", "inconsistent", "(", "from", ",", "e", ")", ";", "return", ";"...
Clear all entries from the store. @param from original failure causing the cleanup
[ "Clear", "all", "entries", "from", "the", "store", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java#L67-L75
60,416
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java
AbstractResilienceStrategy.cleanup
protected void cleanup(Iterable<? extends K> keys, StoreAccessException from) { try { store.obliterate(keys); } catch (StoreAccessException e) { inconsistent(keys, from, e); return; } recovered(keys, from); }
java
protected void cleanup(Iterable<? extends K> keys, StoreAccessException from) { try { store.obliterate(keys); } catch (StoreAccessException e) { inconsistent(keys, from, e); return; } recovered(keys, from); }
[ "protected", "void", "cleanup", "(", "Iterable", "<", "?", "extends", "K", ">", "keys", ",", "StoreAccessException", "from", ")", "{", "try", "{", "store", ".", "obliterate", "(", "keys", ")", ";", "}", "catch", "(", "StoreAccessException", "e", ")", "{"...
Clean all keys from the store. @param keys keys to clean @param from original failure causing the cleanup
[ "Clean", "all", "keys", "from", "the", "store", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java#L83-L91
60,417
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java
AbstractResilienceStrategy.recovered
protected void recovered(Iterable<? extends K> keys, StoreAccessException from) { LOGGER.info("Ehcache keys {} recovered from", keys, from); }
java
protected void recovered(Iterable<? extends K> keys, StoreAccessException from) { LOGGER.info("Ehcache keys {} recovered from", keys, from); }
[ "protected", "void", "recovered", "(", "Iterable", "<", "?", "extends", "K", ">", "keys", ",", "StoreAccessException", "from", ")", "{", "LOGGER", ".", "info", "(", "\"Ehcache keys {} recovered from\"", ",", "keys", ",", "from", ")", ";", "}" ]
Called when the cache recovered from a failing store operation on a list of keys. @param keys keys that failed @param from exception thrown by the failing operation
[ "Called", "when", "the", "cache", "recovered", "from", "a", "failing", "store", "operation", "on", "a", "list", "of", "keys", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java#L125-L127
60,418
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java
AbstractResilienceStrategy.inconsistent
protected void inconsistent(K key, StoreAccessException because, StoreAccessException... cleanup) { pacedErrorLog("Ehcache key {} in possible inconsistent state", key, because); }
java
protected void inconsistent(K key, StoreAccessException because, StoreAccessException... cleanup) { pacedErrorLog("Ehcache key {} in possible inconsistent state", key, because); }
[ "protected", "void", "inconsistent", "(", "K", "key", ",", "StoreAccessException", "because", ",", "StoreAccessException", "...", "cleanup", ")", "{", "pacedErrorLog", "(", "\"Ehcache key {} in possible inconsistent state\"", ",", "key", ",", "because", ")", ";", "}" ...
Called when the cache failed to recover from a failing store operation on a key. @param key key now inconsistent @param because exception thrown by the failing operation @param cleanup all the exceptions that occurred during cleanup
[ "Called", "when", "the", "cache", "failed", "to", "recover", "from", "a", "failing", "store", "operation", "on", "a", "key", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java#L146-L148
60,419
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java
AbstractResilienceStrategy.inconsistent
protected void inconsistent(Iterable<? extends K> keys, StoreAccessException because, StoreAccessException... cleanup) { pacedErrorLog("Ehcache keys {} in possible inconsistent state", keys, because); }
java
protected void inconsistent(Iterable<? extends K> keys, StoreAccessException because, StoreAccessException... cleanup) { pacedErrorLog("Ehcache keys {} in possible inconsistent state", keys, because); }
[ "protected", "void", "inconsistent", "(", "Iterable", "<", "?", "extends", "K", ">", "keys", ",", "StoreAccessException", "because", ",", "StoreAccessException", "...", "cleanup", ")", "{", "pacedErrorLog", "(", "\"Ehcache keys {} in possible inconsistent state\"", ",",...
Called when the cache failed to recover from a failing store operation on a list of keys. @param keys @param because exception thrown by the failing operation @param cleanup all the exceptions that occurred during cleanup
[ "Called", "when", "the", "cache", "failed", "to", "recover", "from", "a", "failing", "store", "operation", "on", "a", "list", "of", "keys", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/AbstractResilienceStrategy.java#L157-L159
60,420
ehcache/ehcache3
clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ServerSideConfigurationBuilder.java
ServerSideConfigurationBuilder.resourcePool
public ServerSideConfigurationBuilder resourcePool(String name, long size, MemoryUnit unit, String serverResource) { return resourcePool(name, new Pool(unit.toBytes(size), serverResource)); }
java
public ServerSideConfigurationBuilder resourcePool(String name, long size, MemoryUnit unit, String serverResource) { return resourcePool(name, new Pool(unit.toBytes(size), serverResource)); }
[ "public", "ServerSideConfigurationBuilder", "resourcePool", "(", "String", "name", ",", "long", "size", ",", "MemoryUnit", "unit", ",", "String", "serverResource", ")", "{", "return", "resourcePool", "(", "name", ",", "new", "Pool", "(", "unit", ".", "toBytes", ...
Adds a resource pool with the given name and size and consuming the given server resource. @param name pool name @param size pool size @param unit pool size unit @param serverResource server resource to consume @return a clustering service configuration builder
[ "Adds", "a", "resource", "pool", "with", "the", "given", "name", "and", "size", "and", "consuming", "the", "given", "server", "resource", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ServerSideConfigurationBuilder.java#L88-L90
60,421
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java
CacheEventDispatcherImpl.registerCacheEventListener
private synchronized void registerCacheEventListener(EventListenerWrapper<K, V> wrapper) { if(aSyncListenersList.contains(wrapper) || syncListenersList.contains(wrapper)) { throw new IllegalStateException("Cache Event Listener already registered: " + wrapper.getListener()); } if (wrapper.isOrdered() ...
java
private synchronized void registerCacheEventListener(EventListenerWrapper<K, V> wrapper) { if(aSyncListenersList.contains(wrapper) || syncListenersList.contains(wrapper)) { throw new IllegalStateException("Cache Event Listener already registered: " + wrapper.getListener()); } if (wrapper.isOrdered() ...
[ "private", "synchronized", "void", "registerCacheEventListener", "(", "EventListenerWrapper", "<", "K", ",", "V", ">", "wrapper", ")", "{", "if", "(", "aSyncListenersList", ".", "contains", "(", "wrapper", ")", "||", "syncListenersList", ".", "contains", "(", "w...
Synchronized to make sure listener addition is atomic in order to prevent having the same listener registered under multiple configurations @param wrapper the listener wrapper to register
[ "Synchronized", "to", "make", "sure", "listener", "addition", "is", "atomic", "in", "order", "to", "prevent", "having", "the", "same", "listener", "registered", "under", "multiple", "configurations" ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java#L96-L119
60,422
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java
CacheEventDispatcherImpl.removeWrapperFromList
private synchronized boolean removeWrapperFromList(EventListenerWrapper<K, V> wrapper, List<EventListenerWrapper<K, V>> listenersList) { int index = listenersList.indexOf(wrapper); if (index != -1) { EventListenerWrapper<K, V> containedWrapper = listenersList.remove(index); if(containedWrapper.isOrd...
java
private synchronized boolean removeWrapperFromList(EventListenerWrapper<K, V> wrapper, List<EventListenerWrapper<K, V>> listenersList) { int index = listenersList.indexOf(wrapper); if (index != -1) { EventListenerWrapper<K, V> containedWrapper = listenersList.remove(index); if(containedWrapper.isOrd...
[ "private", "synchronized", "boolean", "removeWrapperFromList", "(", "EventListenerWrapper", "<", "K", ",", "V", ">", "wrapper", ",", "List", "<", "EventListenerWrapper", "<", "K", ",", "V", ">", ">", "listenersList", ")", "{", "int", "index", "=", "listenersLi...
Synchronized to make sure listener removal is atomic @param wrapper the listener wrapper to unregister @param listenersList the listener list to remove from
[ "Synchronized", "to", "make", "sure", "listener", "removal", "is", "atomic" ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java#L141-L154
60,423
ehcache/ehcache3
clustered/server/src/main/java/org/ehcache/clustered/server/management/Management.java
Management.init
private void init() { CompletableFuture.allOf( managementRegistry.register(generateClusterTierManagerBinding()), // PoolBinding.ALL_SHARED is a marker so that we can send events not specifically related to 1 pool // this object is ignored from the stats and descriptors managementRegistry.reg...
java
private void init() { CompletableFuture.allOf( managementRegistry.register(generateClusterTierManagerBinding()), // PoolBinding.ALL_SHARED is a marker so that we can send events not specifically related to 1 pool // this object is ignored from the stats and descriptors managementRegistry.reg...
[ "private", "void", "init", "(", ")", "{", "CompletableFuture", ".", "allOf", "(", "managementRegistry", ".", "register", "(", "generateClusterTierManagerBinding", "(", ")", ")", ",", "// PoolBinding.ALL_SHARED is a marker so that we can send events not specifically related to 1...
the goal of the following code is to send the management metadata from the entity into the monitoring tre AFTER the entity creation
[ "the", "goal", "of", "the", "following", "code", "is", "to", "send", "the", "management", "metadata", "from", "the", "entity", "into", "the", "monitoring", "tre", "AFTER", "the", "entity", "creation" ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/management/Management.java#L117-L124
60,424
ehcache/ehcache3
clustered/server/src/main/java/org/ehcache/clustered/server/state/MessageTracker.java
MessageTracker.seen
public boolean seen(long msgId) { boolean seen = nonContiguousMsgIds.contains(msgId) || msgId <= highestContiguousMsgId; tryReconcile(); return seen; }
java
public boolean seen(long msgId) { boolean seen = nonContiguousMsgIds.contains(msgId) || msgId <= highestContiguousMsgId; tryReconcile(); return seen; }
[ "public", "boolean", "seen", "(", "long", "msgId", ")", "{", "boolean", "seen", "=", "nonContiguousMsgIds", ".", "contains", "(", "msgId", ")", "||", "msgId", "<=", "highestContiguousMsgId", ";", "tryReconcile", "(", ")", ";", "return", "seen", ";", "}" ]
Check wheather the given message id is already seen by track call. @param msgId Message Identifier to be checked. @return true if the given msgId is already tracked otherwise false.
[ "Check", "wheather", "the", "given", "message", "id", "is", "already", "seen", "by", "track", "call", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/state/MessageTracker.java#L71-L75
60,425
ehcache/ehcache3
clustered/server/src/main/java/org/ehcache/clustered/server/state/MessageTracker.java
MessageTracker.reconcile
private void reconcile() { // If nonContiguousMsgIds is empty then nothing to reconcile. if (nonContiguousMsgIds.isEmpty()) { return; } // This happens when a passive is started after Active has moved on and // passive starts to see msgIDs starting from a number > 0. // Once the sync is ...
java
private void reconcile() { // If nonContiguousMsgIds is empty then nothing to reconcile. if (nonContiguousMsgIds.isEmpty()) { return; } // This happens when a passive is started after Active has moved on and // passive starts to see msgIDs starting from a number > 0. // Once the sync is ...
[ "private", "void", "reconcile", "(", ")", "{", "// If nonContiguousMsgIds is empty then nothing to reconcile.", "if", "(", "nonContiguousMsgIds", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "// This happens when a passive is started after Active has moved on and", ...
Remove the contiguous seen msgIds from the nonContiguousMsgIds and update highestContiguousMsgId
[ "Remove", "the", "contiguous", "seen", "msgIds", "from", "the", "nonContiguousMsgIds", "and", "update", "highestContiguousMsgId" ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/state/MessageTracker.java#L97-L127
60,426
ehcache/ehcache3
clustered/server/src/main/java/org/ehcache/clustered/server/state/MessageTracker.java
MessageTracker.tryReconcile
private void tryReconcile() { if (!this.reconciliationLock.tryLock()) { return; } try { reconcile(); // Keep on warning after every reconcile if nonContiguousMsgIds reaches 500 (kept it a bit higher so that we won't get unnecessary warning due to high concurrency). if (nonContiguou...
java
private void tryReconcile() { if (!this.reconciliationLock.tryLock()) { return; } try { reconcile(); // Keep on warning after every reconcile if nonContiguousMsgIds reaches 500 (kept it a bit higher so that we won't get unnecessary warning due to high concurrency). if (nonContiguou...
[ "private", "void", "tryReconcile", "(", ")", "{", "if", "(", "!", "this", ".", "reconciliationLock", ".", "tryLock", "(", ")", ")", "{", "return", ";", "}", "try", "{", "reconcile", "(", ")", ";", "// Keep on warning after every reconcile if nonContiguousMsgIds ...
Try to reconcile, if the lock is available otherwise just return as other thread would have hold the lock and performing reconcile.
[ "Try", "to", "reconcile", "if", "the", "lock", "is", "available", "otherwise", "just", "return", "as", "other", "thread", "would", "have", "hold", "the", "lock", "and", "performing", "reconcile", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/state/MessageTracker.java#L132-L147
60,427
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/config/resilience/DefaultResilienceStrategyConfiguration.java
DefaultResilienceStrategyConfiguration.bind
public DefaultResilienceStrategyConfiguration bind(RecoveryStore<?> store, CacheLoaderWriter<?, ?> loaderWriter) throws IllegalStateException { if (getInstance() == null) { Object[] arguments = getArguments(); Object[] boundArguments = Arrays.copyOf(arguments, arguments.length + 2); boundArguments...
java
public DefaultResilienceStrategyConfiguration bind(RecoveryStore<?> store, CacheLoaderWriter<?, ?> loaderWriter) throws IllegalStateException { if (getInstance() == null) { Object[] arguments = getArguments(); Object[] boundArguments = Arrays.copyOf(arguments, arguments.length + 2); boundArguments...
[ "public", "DefaultResilienceStrategyConfiguration", "bind", "(", "RecoveryStore", "<", "?", ">", "store", ",", "CacheLoaderWriter", "<", "?", ",", "?", ">", "loaderWriter", ")", "throws", "IllegalStateException", "{", "if", "(", "getInstance", "(", ")", "==", "n...
Returns a configuration object bound to the given store and cache loader-writer. @param store store to bind to @param loaderWriter loader to bind to @return a bound configuration @throws IllegalStateException if the configuration is already bound
[ "Returns", "a", "configuration", "object", "bound", "to", "the", "given", "store", "and", "cache", "loader", "-", "writer", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/config/resilience/DefaultResilienceStrategyConfiguration.java#L68-L78
60,428
ehcache/ehcache3
core/src/main/java/org/ehcache/core/spi/store/AbstractValueHolder.java
AbstractValueHolder.setLastAccessTime
public void setLastAccessTime(long lastAccessTime) { while (true) { long current = this.lastAccessTime; if (current >= lastAccessTime) { break; } if (ACCESSTIME_UPDATER.compareAndSet(this, current, lastAccessTime)) { break; } } }
java
public void setLastAccessTime(long lastAccessTime) { while (true) { long current = this.lastAccessTime; if (current >= lastAccessTime) { break; } if (ACCESSTIME_UPDATER.compareAndSet(this, current, lastAccessTime)) { break; } } }
[ "public", "void", "setLastAccessTime", "(", "long", "lastAccessTime", ")", "{", "while", "(", "true", ")", "{", "long", "current", "=", "this", ".", "lastAccessTime", ";", "if", "(", "current", ">=", "lastAccessTime", ")", "{", "break", ";", "}", "if", "...
Set the last time this entry was accessed in milliseconds. @param lastAccessTime last time the entry was accessed
[ "Set", "the", "last", "time", "this", "entry", "was", "accessed", "in", "milliseconds", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/spi/store/AbstractValueHolder.java#L125-L135
60,429
ehcache/ehcache3
clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/EternalChainResolver.java
EternalChainResolver.applyOperation
public PutOperation<K, V> applyOperation(K key, PutOperation<K, V> existing, Operation<K, V> operation) { final Result<K, V> newValue = operation.apply(existing); if (newValue == null) { return null; } else { return newValue.asOperationExpiringAt(Long.MAX_VALUE); } }
java
public PutOperation<K, V> applyOperation(K key, PutOperation<K, V> existing, Operation<K, V> operation) { final Result<K, V> newValue = operation.apply(existing); if (newValue == null) { return null; } else { return newValue.asOperationExpiringAt(Long.MAX_VALUE); } }
[ "public", "PutOperation", "<", "K", ",", "V", ">", "applyOperation", "(", "K", "key", ",", "PutOperation", "<", "K", ",", "V", ">", "existing", ",", "Operation", "<", "K", ",", "V", ">", "operation", ")", "{", "final", "Result", "<", "K", ",", "V",...
Applies the given operation returning a result that never expires. {@inheritDoc}
[ "Applies", "the", "given", "operation", "returning", "a", "result", "that", "never", "expires", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/EternalChainResolver.java#L69-L76
60,430
ehcache/ehcache3
clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/ClusteredStore.java
ClusteredStore.bulkCompute
@Override public Map<K, ValueHolder<V>> bulkCompute(final Set<? extends K> keys, final Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>> remappingFunction) throws StoreAccessException { Map<K, ValueHolder<V>> valueHolderMap = new HashM...
java
@Override public Map<K, ValueHolder<V>> bulkCompute(final Set<? extends K> keys, final Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>> remappingFunction) throws StoreAccessException { Map<K, ValueHolder<V>> valueHolderMap = new HashM...
[ "@", "Override", "public", "Map", "<", "K", ",", "ValueHolder", "<", "V", ">", ">", "bulkCompute", "(", "final", "Set", "<", "?", "extends", "K", ">", "keys", ",", "final", "Function", "<", "Iterable", "<", "?", "extends", "Map", ".", "Entry", "<", ...
The assumption is that this method will be invoked only by cache.putAll and cache.removeAll methods.
[ "The", "assumption", "is", "that", "this", "method", "will", "be", "invoked", "only", "by", "cache", ".", "putAll", "and", "cache", ".", "removeAll", "methods", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/ClusteredStore.java#L475-L501
60,431
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java
RobustResilienceStrategy.getFailure
@Override public V getFailure(K key, StoreAccessException e) { cleanup(key, e); return null; }
java
@Override public V getFailure(K key, StoreAccessException e) { cleanup(key, e); return null; }
[ "@", "Override", "public", "V", "getFailure", "(", "K", "key", ",", "StoreAccessException", "e", ")", "{", "cleanup", "(", "key", ",", "e", ")", ";", "return", "null", ";", "}" ]
Return null. @param key the key being retrieved @param e the triggered failure @return null
[ "Return", "null", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java#L54-L58
60,432
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java
RobustResilienceStrategy.putIfAbsentFailure
@Override public V putIfAbsentFailure(K key, V value, StoreAccessException e) { cleanup(key, e); return null; }
java
@Override public V putIfAbsentFailure(K key, V value, StoreAccessException e) { cleanup(key, e); return null; }
[ "@", "Override", "public", "V", "putIfAbsentFailure", "(", "K", "key", ",", "V", "value", ",", "StoreAccessException", "e", ")", "{", "cleanup", "(", "key", ",", "e", ")", ";", "return", "null", ";", "}" ]
Do nothing and return null. @param key the key being put @param value the value being put @param e the triggered failure @return null
[ "Do", "nothing", "and", "return", "null", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java#L114-L118
60,433
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java
RobustResilienceStrategy.getAllFailure
@Override public Map<K, V> getAllFailure(Iterable<? extends K> keys, StoreAccessException e) { cleanup(keys, e); HashMap<K, V> result = keys instanceof Collection<?> ? new HashMap<>(((Collection<? extends K>) keys).size()) : new HashMap<>(); for (K key : keys) { result.put(key, null); } ret...
java
@Override public Map<K, V> getAllFailure(Iterable<? extends K> keys, StoreAccessException e) { cleanup(keys, e); HashMap<K, V> result = keys instanceof Collection<?> ? new HashMap<>(((Collection<? extends K>) keys).size()) : new HashMap<>(); for (K key : keys) { result.put(key, null); } ret...
[ "@", "Override", "public", "Map", "<", "K", ",", "V", ">", "getAllFailure", "(", "Iterable", "<", "?", "extends", "K", ">", "keys", ",", "StoreAccessException", "e", ")", "{", "cleanup", "(", "keys", ",", "e", ")", ";", "HashMap", "<", "K", ",", "V...
Do nothing and return a map of all the provided keys and null values. @param keys the keys being retrieved @param e the triggered failure @return map of all provided keys and null values
[ "Do", "nothing", "and", "return", "a", "map", "of", "all", "the", "provided", "keys", "and", "null", "values", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java#L170-L179
60,434
ehcache/ehcache3
impl/src/main/java/org/ehcache/config/builders/PooledExecutionServiceConfigurationBuilder.java
PooledExecutionServiceConfigurationBuilder.defaultPool
public PooledExecutionServiceConfigurationBuilder defaultPool(String alias, int minSize, int maxSize) { PooledExecutionServiceConfigurationBuilder other = new PooledExecutionServiceConfigurationBuilder(this); other.defaultPool = new Pool(alias, minSize, maxSize); return other; }
java
public PooledExecutionServiceConfigurationBuilder defaultPool(String alias, int minSize, int maxSize) { PooledExecutionServiceConfigurationBuilder other = new PooledExecutionServiceConfigurationBuilder(this); other.defaultPool = new Pool(alias, minSize, maxSize); return other; }
[ "public", "PooledExecutionServiceConfigurationBuilder", "defaultPool", "(", "String", "alias", ",", "int", "minSize", ",", "int", "maxSize", ")", "{", "PooledExecutionServiceConfigurationBuilder", "other", "=", "new", "PooledExecutionServiceConfigurationBuilder", "(", "this",...
Adds a default pool configuration to the returned builder. @param alias the pool alias @param minSize the minimum number of threads in the pool @param maxSize the maximum number of threads in the pool @return a new builder with the added default pool
[ "Adds", "a", "default", "pool", "configuration", "to", "the", "returned", "builder", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/PooledExecutionServiceConfigurationBuilder.java#L63-L67
60,435
ehcache/ehcache3
impl/src/main/java/org/ehcache/config/builders/PooledExecutionServiceConfigurationBuilder.java
PooledExecutionServiceConfigurationBuilder.pool
public PooledExecutionServiceConfigurationBuilder pool(String alias, int minSize, int maxSize) { PooledExecutionServiceConfigurationBuilder other = new PooledExecutionServiceConfigurationBuilder(this); other.pools.add(new Pool(alias, minSize, maxSize)); return other; }
java
public PooledExecutionServiceConfigurationBuilder pool(String alias, int minSize, int maxSize) { PooledExecutionServiceConfigurationBuilder other = new PooledExecutionServiceConfigurationBuilder(this); other.pools.add(new Pool(alias, minSize, maxSize)); return other; }
[ "public", "PooledExecutionServiceConfigurationBuilder", "pool", "(", "String", "alias", ",", "int", "minSize", ",", "int", "maxSize", ")", "{", "PooledExecutionServiceConfigurationBuilder", "other", "=", "new", "PooledExecutionServiceConfigurationBuilder", "(", "this", ")",...
Adds a pool configuration to the returned builder. @param alias the pool alias @param minSize the minimum number of threads in the pool @param maxSize the maximum number of threads in the pool @return a new builder with the added default pool
[ "Adds", "a", "pool", "configuration", "to", "the", "returned", "builder", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/PooledExecutionServiceConfigurationBuilder.java#L77-L81
60,436
ehcache/ehcache3
clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/ExpiryChainResolver.java
ExpiryChainResolver.calculateExpiryTime
private long calculateExpiryTime(K key, PutOperation<K, V> existing, Operation<K, V> operation, Result<K, V> newValue) { if (operation.isExpiryAvailable()) { return operation.expirationTime(); } else { try { Duration duration; if (existing == null) { duration = requireNonNu...
java
private long calculateExpiryTime(K key, PutOperation<K, V> existing, Operation<K, V> operation, Result<K, V> newValue) { if (operation.isExpiryAvailable()) { return operation.expirationTime(); } else { try { Duration duration; if (existing == null) { duration = requireNonNu...
[ "private", "long", "calculateExpiryTime", "(", "K", "key", ",", "PutOperation", "<", "K", ",", "V", ">", "existing", ",", "Operation", "<", "K", ",", "V", ">", "operation", ",", "Result", "<", "K", ",", "V", ">", "newValue", ")", "{", "if", "(", "o...
Calculates the expiration time of the new state based on this resolvers expiry policy. @param key cache key @param existing current state @param operation operation to apply @param newValue new state @return the calculated expiry time
[ "Calculates", "the", "expiration", "time", "of", "the", "new", "state", "based", "on", "this", "resolvers", "expiry", "policy", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/ExpiryChainResolver.java#L130-L155
60,437
ehcache/ehcache3
management/src/main/java/org/ehcache/management/cluster/Clustering.java
Clustering.isAvailable
public static boolean isAvailable(ServiceProvider<Service> serviceProvider) { return ENTITY_SERVICE_CLASS != null && serviceProvider.getService(ENTITY_SERVICE_CLASS) != null; }
java
public static boolean isAvailable(ServiceProvider<Service> serviceProvider) { return ENTITY_SERVICE_CLASS != null && serviceProvider.getService(ENTITY_SERVICE_CLASS) != null; }
[ "public", "static", "boolean", "isAvailable", "(", "ServiceProvider", "<", "Service", ">", "serviceProvider", ")", "{", "return", "ENTITY_SERVICE_CLASS", "!=", "null", "&&", "serviceProvider", ".", "getService", "(", "ENTITY_SERVICE_CLASS", ")", "!=", "null", ";", ...
Check if clustering is active for this cache manager
[ "Check", "if", "clustering", "is", "active", "for", "this", "cache", "manager" ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/management/src/main/java/org/ehcache/management/cluster/Clustering.java#L42-L44
60,438
ehcache/ehcache3
core/src/main/java/org/ehcache/core/util/CollectionUtil.java
CollectionUtil.findBestCollectionSize
public static int findBestCollectionSize(Iterable<?> iterable, int bestBet) { return (iterable instanceof Collection ? ((Collection<?>) iterable).size() : bestBet); }
java
public static int findBestCollectionSize(Iterable<?> iterable, int bestBet) { return (iterable instanceof Collection ? ((Collection<?>) iterable).size() : bestBet); }
[ "public", "static", "int", "findBestCollectionSize", "(", "Iterable", "<", "?", ">", "iterable", ",", "int", "bestBet", ")", "{", "return", "(", "iterable", "instanceof", "Collection", "?", "(", "(", "Collection", "<", "?", ">", ")", "iterable", ")", ".", ...
Used to create a new collection with the correct size. Given an iterable, will try to see it the iterable actually have a size and will return it. If the iterable has no known size, we return the best bet. @param iterable the iterable we will try to find the size of @param bestBet our best bet for the size if the iter...
[ "Used", "to", "create", "a", "new", "collection", "with", "the", "correct", "size", ".", "Given", "an", "iterable", "will", "try", "to", "see", "it", "the", "iterable", "actually", "have", "a", "size", "and", "will", "return", "it", ".", "If", "the", "...
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/util/CollectionUtil.java#L37-L39
60,439
ehcache/ehcache3
clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ClusteredResourcePoolBuilder.java
ClusteredResourcePoolBuilder.clusteredDedicated
public static DedicatedClusteredResourcePool clusteredDedicated(String fromResource, long size, MemoryUnit unit) { return new DedicatedClusteredResourcePoolImpl(fromResource, size, unit); }
java
public static DedicatedClusteredResourcePool clusteredDedicated(String fromResource, long size, MemoryUnit unit) { return new DedicatedClusteredResourcePoolImpl(fromResource, size, unit); }
[ "public", "static", "DedicatedClusteredResourcePool", "clusteredDedicated", "(", "String", "fromResource", ",", "long", "size", ",", "MemoryUnit", "unit", ")", "{", "return", "new", "DedicatedClusteredResourcePoolImpl", "(", "fromResource", ",", "size", ",", "unit", "...
Creates a new clustered resource pool using dedicated clustered resources. @param fromResource the name of the server-based resource from which this dedicated resource pool is reserved; may be {@code null} @param size the size @param unit the unit for the size
[ "Creates", "a", "new", "clustered", "resource", "pool", "using", "dedicated", "clustered", "resources", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/config/builders/ClusteredResourcePoolBuilder.java#L54-L56
60,440
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/statistics/StatsUtils.java
StatsUtils.findStatisticOnDescendants
public static <T> Optional<T> findStatisticOnDescendants(Object context, String tag, String statName) { @SuppressWarnings("unchecked") Set<TreeNode> statResult = queryBuilder() .descendants() .filter(context(attributes(Matchers.allOf( hasAttribute("name", statName), hasTag(tag))))) ...
java
public static <T> Optional<T> findStatisticOnDescendants(Object context, String tag, String statName) { @SuppressWarnings("unchecked") Set<TreeNode> statResult = queryBuilder() .descendants() .filter(context(attributes(Matchers.allOf( hasAttribute("name", statName), hasTag(tag))))) ...
[ "public", "static", "<", "T", ">", "Optional", "<", "T", ">", "findStatisticOnDescendants", "(", "Object", "context", ",", "String", "tag", ",", "String", "statName", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Set", "<", "TreeNode", ">", ...
Search for a statistic on the descendant of the context that matches the tag and statistic name. @param context the context of the query @param tag the tag we are looking for @param statName statistic name @param <T> type of the statistic that will be returned @return the wanted statistic or null if no such statistic ...
[ "Search", "for", "a", "statistic", "on", "the", "descendant", "of", "the", "context", "that", "matches", "the", "tag", "and", "statistic", "name", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/statistics/StatsUtils.java#L108-L130
60,441
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/loaderwriter/writebehind/BatchingLocalHeapWriteBehindQueue.java
BatchingLocalHeapWriteBehindQueue.getQueueSize
@Override public long getQueueSize() { Batch snapshot = openBatch; return executorQueue.size() * batchSize + (snapshot == null ? 0 : snapshot.size()); }
java
@Override public long getQueueSize() { Batch snapshot = openBatch; return executorQueue.size() * batchSize + (snapshot == null ? 0 : snapshot.size()); }
[ "@", "Override", "public", "long", "getQueueSize", "(", ")", "{", "Batch", "snapshot", "=", "openBatch", ";", "return", "executorQueue", ".", "size", "(", ")", "*", "batchSize", "+", "(", "snapshot", "==", "null", "?", "0", ":", "snapshot", ".", "size", ...
Gets the best estimate for items in the queue still awaiting processing. Since the value returned is a rough estimate, it can sometimes be more than the number of items actually in the queue but not less. @return the amount of elements still awaiting processing.
[ "Gets", "the", "best", "estimate", "for", "items", "in", "the", "queue", "still", "awaiting", "processing", ".", "Since", "the", "value", "returned", "is", "a", "rough", "estimate", "it", "can", "sometimes", "be", "more", "than", "the", "number", "of", "it...
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/loaderwriter/writebehind/BatchingLocalHeapWriteBehindQueue.java#L162-L166
60,442
ehcache/ehcache3
clustered/common/src/main/java/org/ehcache/clustered/common/internal/store/operations/PutIfAbsentOperation.java
PutIfAbsentOperation.apply
@Override public Result<K, V> apply(final Result<K, V> previousOperation) { if(previousOperation == null) { return this; } else { return previousOperation; } }
java
@Override public Result<K, V> apply(final Result<K, V> previousOperation) { if(previousOperation == null) { return this; } else { return previousOperation; } }
[ "@", "Override", "public", "Result", "<", "K", ",", "V", ">", "apply", "(", "final", "Result", "<", "K", ",", "V", ">", "previousOperation", ")", "{", "if", "(", "previousOperation", "==", "null", ")", "{", "return", "this", ";", "}", "else", "{", ...
PutIfAbsent operation succeeds only when there is no previous operation for the same key.
[ "PutIfAbsent", "operation", "succeeds", "only", "when", "there", "is", "no", "previous", "operation", "for", "the", "same", "key", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/common/src/main/java/org/ehcache/clustered/common/internal/store/operations/PutIfAbsentOperation.java#L42-L49
60,443
tabulapdf/tabula-java
src/main/java/technology/tabula/CohenSutherlandClipping.java
CohenSutherlandClipping.setClip
public void setClip(Rectangle2D clip) { xMin = clip.getX(); xMax = xMin + clip.getWidth(); yMin = clip.getY(); yMax = yMin + clip.getHeight(); }
java
public void setClip(Rectangle2D clip) { xMin = clip.getX(); xMax = xMin + clip.getWidth(); yMin = clip.getY(); yMax = yMin + clip.getHeight(); }
[ "public", "void", "setClip", "(", "Rectangle2D", "clip", ")", "{", "xMin", "=", "clip", ".", "getX", "(", ")", ";", "xMax", "=", "xMin", "+", "clip", ".", "getWidth", "(", ")", ";", "yMin", "=", "clip", ".", "getY", "(", ")", ";", "yMax", "=", ...
Sets the clip rectangle. @param clip the clip rectangle
[ "Sets", "the", "clip", "rectangle", "." ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/CohenSutherlandClipping.java#L46-L51
60,444
tabulapdf/tabula-java
src/main/java/technology/tabula/QuickSort.java
QuickSort.sort
public static <T extends Comparable<? super T>> void sort(List<T> list) { sort(list, QuickSort.<T>naturalOrder()); // JAVA_8 replace with Comparator.naturalOrder() (and cleanup) }
java
public static <T extends Comparable<? super T>> void sort(List<T> list) { sort(list, QuickSort.<T>naturalOrder()); // JAVA_8 replace with Comparator.naturalOrder() (and cleanup) }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "void", "sort", "(", "List", "<", "T", ">", "list", ")", "{", "sort", "(", "list", ",", "QuickSort", ".", "<", "T", ">", "naturalOrder", "(", ")", ")", ";", ...
Sorts the given list according to natural order.
[ "Sorts", "the", "given", "list", "according", "to", "natural", "order", "." ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/QuickSort.java#L41-L43
60,445
tabulapdf/tabula-java
src/main/java/technology/tabula/QuickSort.java
QuickSort.sort
public static <T> void sort(List<T> list, Comparator<? super T> comparator) { if (list instanceof RandomAccess) { quicksort(list, comparator); } else { List<T> copy = new ArrayList<>(list); quicksort(copy, comparator); list.clear(); list.addAll(copy); } }
java
public static <T> void sort(List<T> list, Comparator<? super T> comparator) { if (list instanceof RandomAccess) { quicksort(list, comparator); } else { List<T> copy = new ArrayList<>(list); quicksort(copy, comparator); list.clear(); list.addAll(copy); } }
[ "public", "static", "<", "T", ">", "void", "sort", "(", "List", "<", "T", ">", "list", ",", "Comparator", "<", "?", "super", "T", ">", "comparator", ")", "{", "if", "(", "list", "instanceof", "RandomAccess", ")", "{", "quicksort", "(", "list", ",", ...
Sorts the given list using the given comparator.
[ "Sorts", "the", "given", "list", "using", "the", "given", "comparator", "." ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/QuickSort.java#L48-L57
60,446
tabulapdf/tabula-java
src/main/java/technology/tabula/Page.java
Page.getTextBounds
public Rectangle getTextBounds() { List<TextElement> texts = this.getText(); if (!texts.isEmpty()) { return Utils.bounds(texts); } else { return new Rectangle(); } }
java
public Rectangle getTextBounds() { List<TextElement> texts = this.getText(); if (!texts.isEmpty()) { return Utils.bounds(texts); } else { return new Rectangle(); } }
[ "public", "Rectangle", "getTextBounds", "(", ")", "{", "List", "<", "TextElement", ">", "texts", "=", "this", ".", "getText", "(", ")", ";", "if", "(", "!", "texts", ".", "isEmpty", "(", ")", ")", "{", "return", "Utils", ".", "bounds", "(", "texts", ...
Returns the minimum bounding box that contains all the TextElements on this Page
[ "Returns", "the", "minimum", "bounding", "box", "that", "contains", "all", "the", "TextElements", "on", "this", "Page" ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/Page.java#L139-L148
60,447
tabulapdf/tabula-java
src/main/java/technology/tabula/ProjectionProfile.java
ProjectionProfile.filter
public static float[] filter(float[] data, float alpha) { float[] rv = new float[data.length]; rv[0] = data[0]; for (int i = 1; i < data.length; i++) { rv[i] = rv[i-1] + alpha * (data[i] - rv[i-1]); } return rv; }
java
public static float[] filter(float[] data, float alpha) { float[] rv = new float[data.length]; rv[0] = data[0]; for (int i = 1; i < data.length; i++) { rv[i] = rv[i-1] + alpha * (data[i] - rv[i-1]); } return rv; }
[ "public", "static", "float", "[", "]", "filter", "(", "float", "[", "]", "data", ",", "float", "alpha", ")", "{", "float", "[", "]", "rv", "=", "new", "float", "[", "data", ".", "length", "]", ";", "rv", "[", "0", "]", "=", "data", "[", "0", ...
Simple Low pass filter
[ "Simple", "Low", "pass", "filter" ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/ProjectionProfile.java#L180-L189
60,448
tabulapdf/tabula-java
src/main/java/technology/tabula/extractors/SpreadsheetExtractionAlgorithm.java
SpreadsheetExtractionAlgorithm.extract
public List<Table> extract(Page page, List<Ruling> rulings) { // split rulings into horizontal and vertical List<Ruling> horizontalR = new ArrayList<>(), verticalR = new ArrayList<>(); for (Ruling r: rulings) { if (r.horizontal()) { horizonta...
java
public List<Table> extract(Page page, List<Ruling> rulings) { // split rulings into horizontal and vertical List<Ruling> horizontalR = new ArrayList<>(), verticalR = new ArrayList<>(); for (Ruling r: rulings) { if (r.horizontal()) { horizonta...
[ "public", "List", "<", "Table", ">", "extract", "(", "Page", "page", ",", "List", "<", "Ruling", ">", "rulings", ")", "{", "// split rulings into horizontal and vertical", "List", "<", "Ruling", ">", "horizontalR", "=", "new", "ArrayList", "<>", "(", ")", ",...
Extract a list of Table from page using rulings as separators
[ "Extract", "a", "list", "of", "Table", "from", "page", "using", "rulings", "as", "separators" ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/extractors/SpreadsheetExtractionAlgorithm.java#L90-L139
60,449
tabulapdf/tabula-java
src/main/java/technology/tabula/Utils.java
Utils.sort
public static <T extends Comparable<? super T>> void sort(List<T> list) { if (useQuickSort) QuickSort.sort(list); else Collections.sort(list); }
java
public static <T extends Comparable<? super T>> void sort(List<T> list) { if (useQuickSort) QuickSort.sort(list); else Collections.sort(list); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "void", "sort", "(", "List", "<", "T", ">", "list", ")", "{", "if", "(", "useQuickSort", ")", "QuickSort", ".", "sort", "(", "list", ")", ";", "else", "Collect...
Wrap Collections.sort so we can fallback to a non-stable quicksort if we're running on JDK7+
[ "Wrap", "Collections", ".", "sort", "so", "we", "can", "fallback", "to", "a", "non", "-", "stable", "quicksort", "if", "we", "re", "running", "on", "JDK7", "+" ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/Utils.java#L124-L127
60,450
tabulapdf/tabula-java
src/main/java/technology/tabula/Ruling.java
Ruling.normalize
public void normalize() { double angle = this.getAngle(); if (Utils.within(angle, 0, 1) || Utils.within(angle, 180, 1)) { // almost horizontal this.setLine(this.x1, this.y1, this.x2, this.y1); } else if (Utils.within(angle, 90, 1) || Utils.within(angle, 270, 1)) { // almost ...
java
public void normalize() { double angle = this.getAngle(); if (Utils.within(angle, 0, 1) || Utils.within(angle, 180, 1)) { // almost horizontal this.setLine(this.x1, this.y1, this.x2, this.y1); } else if (Utils.within(angle, 90, 1) || Utils.within(angle, 270, 1)) { // almost ...
[ "public", "void", "normalize", "(", ")", "{", "double", "angle", "=", "this", ".", "getAngle", "(", ")", ";", "if", "(", "Utils", ".", "within", "(", "angle", ",", "0", ",", "1", ")", "||", "Utils", ".", "within", "(", "angle", ",", "180", ",", ...
Normalize almost horizontal or almost vertical lines
[ "Normalize", "almost", "horizontal", "or", "almost", "vertical", "lines" ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/Ruling.java#L33-L45
60,451
tabulapdf/tabula-java
src/main/java/technology/tabula/CommandLineApp.java
CommandLineApp.whichOutputFormat
private static OutputFormat whichOutputFormat(CommandLine line) throws ParseException { if (!line.hasOption('f')) { return OutputFormat.CSV; } try { return OutputFormat.valueOf(line.getOptionValue('f')); } catch (IllegalArgumentException e) { throw ne...
java
private static OutputFormat whichOutputFormat(CommandLine line) throws ParseException { if (!line.hasOption('f')) { return OutputFormat.CSV; } try { return OutputFormat.valueOf(line.getOptionValue('f')); } catch (IllegalArgumentException e) { throw ne...
[ "private", "static", "OutputFormat", "whichOutputFormat", "(", "CommandLine", "line", ")", "throws", "ParseException", "{", "if", "(", "!", "line", ".", "hasOption", "(", "'", "'", ")", ")", "{", "return", "OutputFormat", ".", "CSV", ";", "}", "try", "{", ...
CommandLine parsing methods
[ "CommandLine", "parsing", "methods" ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/CommandLineApp.java#L204-L217
60,452
tabulapdf/tabula-java
src/main/java/technology/tabula/CommandLineApp.java
CommandLineApp.parseFloatList
public static List<Float> parseFloatList(String option) throws ParseException { String[] f = option.split(","); List<Float> rv = new ArrayList<>(); try { for (int i = 0; i < f.length; i++) { rv.add(Float.parseFloat(f[i])); } return rv; ...
java
public static List<Float> parseFloatList(String option) throws ParseException { String[] f = option.split(","); List<Float> rv = new ArrayList<>(); try { for (int i = 0; i < f.length; i++) { rv.add(Float.parseFloat(f[i])); } return rv; ...
[ "public", "static", "List", "<", "Float", ">", "parseFloatList", "(", "String", "option", ")", "throws", "ParseException", "{", "String", "[", "]", "f", "=", "option", ".", "split", "(", "\",\"", ")", ";", "List", "<", "Float", ">", "rv", "=", "new", ...
utilities, etc.
[ "utilities", "etc", "." ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/CommandLineApp.java#L275-L286
60,453
tabulapdf/tabula-java
src/main/java/technology/tabula/TextChunk.java
TextChunk.splitAt
public TextChunk[] splitAt(int i) { if (i < 1 || i >= this.getTextElements().size()) { throw new IllegalArgumentException(); } TextChunk[] rv = new TextChunk[]{ new TextChunk(this.getTextElements().subList(0, i)), new TextChunk(this.getTextElements()....
java
public TextChunk[] splitAt(int i) { if (i < 1 || i >= this.getTextElements().size()) { throw new IllegalArgumentException(); } TextChunk[] rv = new TextChunk[]{ new TextChunk(this.getTextElements().subList(0, i)), new TextChunk(this.getTextElements()....
[ "public", "TextChunk", "[", "]", "splitAt", "(", "int", "i", ")", "{", "if", "(", "i", "<", "1", "||", "i", ">=", "this", ".", "getTextElements", "(", ")", ".", "size", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", ...
Splits a TextChunk in two, at the position of the i-th TextElement
[ "Splits", "a", "TextChunk", "in", "two", "at", "the", "position", "of", "the", "i", "-", "th", "TextElement" ]
a86b72aa81c0bcb4b8b4402dc94ca1211f152930
https://github.com/tabulapdf/tabula-java/blob/a86b72aa81c0bcb4b8b4402dc94ca1211f152930/src/main/java/technology/tabula/TextChunk.java#L212-L222
60,454
lsjwzh/RecyclerViewPager
lib/src/main/java/com/lsjwzh/widget/recyclerviewpager/LoopRecyclerViewPager.java
LoopRecyclerViewPager.smoothScrollToPosition
@Override public void smoothScrollToPosition(int position) { int transformedPosition = transformInnerPositionIfNeed(position); super.smoothScrollToPosition(transformedPosition); Log.e("test", "transformedPosition:" + transformedPosition); }
java
@Override public void smoothScrollToPosition(int position) { int transformedPosition = transformInnerPositionIfNeed(position); super.smoothScrollToPosition(transformedPosition); Log.e("test", "transformedPosition:" + transformedPosition); }
[ "@", "Override", "public", "void", "smoothScrollToPosition", "(", "int", "position", ")", "{", "int", "transformedPosition", "=", "transformInnerPositionIfNeed", "(", "position", ")", ";", "super", ".", "smoothScrollToPosition", "(", "transformedPosition", ")", ";", ...
Starts a smooth scroll to an adapter position. if position < adapter.getActualCount, position will be transform to right position. @param position target position
[ "Starts", "a", "smooth", "scroll", "to", "an", "adapter", "position", ".", "if", "position", "<", "adapter", ".", "getActualCount", "position", "will", "be", "transform", "to", "right", "position", "." ]
28567e666b58ba710f52a02cff7a9961d26775fd
https://github.com/lsjwzh/RecyclerViewPager/blob/28567e666b58ba710f52a02cff7a9961d26775fd/lib/src/main/java/com/lsjwzh/widget/recyclerviewpager/LoopRecyclerViewPager.java#L49-L54
60,455
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/Utils.java
Utils.createClass
@SuppressWarnings("unchecked") static <T, A extends BindingCollectionAdapter<T>> A createClass(Class<? extends BindingCollectionAdapter> adapterClass, ItemBinding<T> itemBinding) { try { return (A) adapterClass.getConstructor(ItemBinding.class).newInstance(itemBinding); } catch (Exceptio...
java
@SuppressWarnings("unchecked") static <T, A extends BindingCollectionAdapter<T>> A createClass(Class<? extends BindingCollectionAdapter> adapterClass, ItemBinding<T> itemBinding) { try { return (A) adapterClass.getConstructor(ItemBinding.class).newInstance(itemBinding); } catch (Exceptio...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "static", "<", "T", ",", "A", "extends", "BindingCollectionAdapter", "<", "T", ">", ">", "A", "createClass", "(", "Class", "<", "?", "extends", "BindingCollectionAdapter", ">", "adapterClass", ",", "ItemBinding...
Constructs a binding adapter class from it's class name using reflection.
[ "Constructs", "a", "binding", "adapter", "class", "from", "it", "s", "class", "name", "using", "reflection", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/Utils.java#L99-L106
60,456
evant/binding-collection-adapter
bindingcollectionadapter-recyclerview/src/main/java/me/tatarka/bindingcollectionadapter2/collections/DiffObservableList.java
DiffObservableList.calculateDiff
@NonNull public DiffUtil.DiffResult calculateDiff(@NonNull final List<T> newItems) { final ArrayList<T> frozenList; synchronized (LIST_LOCK) { frozenList = new ArrayList<>(list); } return doCalculateDiff(frozenList, newItems); }
java
@NonNull public DiffUtil.DiffResult calculateDiff(@NonNull final List<T> newItems) { final ArrayList<T> frozenList; synchronized (LIST_LOCK) { frozenList = new ArrayList<>(list); } return doCalculateDiff(frozenList, newItems); }
[ "@", "NonNull", "public", "DiffUtil", ".", "DiffResult", "calculateDiff", "(", "@", "NonNull", "final", "List", "<", "T", ">", "newItems", ")", "{", "final", "ArrayList", "<", "T", ">", "frozenList", ";", "synchronized", "(", "LIST_LOCK", ")", "{", "frozen...
Calculates the list of update operations that can convert this list into the given one. @param newItems The items that this list will be set to. @return A DiffResult that contains the information about the edit sequence to covert this list into the given one.
[ "Calculates", "the", "list", "of", "update", "operations", "that", "can", "convert", "this", "list", "into", "the", "given", "one", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter-recyclerview/src/main/java/me/tatarka/bindingcollectionadapter2/collections/DiffObservableList.java#L82-L89
60,457
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/ItemBinding.java
ItemBinding.bindExtra
@NonNull public final ItemBinding<T> bindExtra(int variableId, Object value) { if (extraBindings == null) { extraBindings = new SparseArray<>(1); } extraBindings.put(variableId, value); return this; }
java
@NonNull public final ItemBinding<T> bindExtra(int variableId, Object value) { if (extraBindings == null) { extraBindings = new SparseArray<>(1); } extraBindings.put(variableId, value); return this; }
[ "@", "NonNull", "public", "final", "ItemBinding", "<", "T", ">", "bindExtra", "(", "int", "variableId", ",", "Object", "value", ")", "{", "if", "(", "extraBindings", "==", "null", ")", "{", "extraBindings", "=", "new", "SparseArray", "<>", "(", "1", ")",...
Bind an extra variable to the view with the given variable id. The same instance will be provided to all views the binding is bound to.
[ "Bind", "an", "extra", "variable", "to", "the", "view", "with", "the", "given", "variable", "id", ".", "The", "same", "instance", "will", "be", "provided", "to", "all", "views", "the", "binding", "is", "bound", "to", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/ItemBinding.java#L95-L102
60,458
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/ItemBinding.java
ItemBinding.extraBinding
@Nullable public final Object extraBinding(int variableId) { if (extraBindings == null) { return null; } return extraBindings.get(variableId); }
java
@Nullable public final Object extraBinding(int variableId) { if (extraBindings == null) { return null; } return extraBindings.get(variableId); }
[ "@", "Nullable", "public", "final", "Object", "extraBinding", "(", "int", "variableId", ")", "{", "if", "(", "extraBindings", "==", "null", ")", "{", "return", "null", ";", "}", "return", "extraBindings", ".", "get", "(", "variableId", ")", ";", "}" ]
Returns the current extra binding for the given variable id or null if one isn't present.
[ "Returns", "the", "current", "extra", "binding", "for", "the", "given", "variable", "id", "or", "null", "if", "one", "isn", "t", "present", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/ItemBinding.java#L146-L152
60,459
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/ItemBinding.java
ItemBinding.onItemBind
public void onItemBind(int position, T item) { if (onItemBind != null) { variableId = VAR_INVALID; layoutRes = LAYOUT_NONE; onItemBind.onItemBind(this, position, item); if (variableId == VAR_INVALID) { throw new IllegalStateException("variableId no...
java
public void onItemBind(int position, T item) { if (onItemBind != null) { variableId = VAR_INVALID; layoutRes = LAYOUT_NONE; onItemBind.onItemBind(this, position, item); if (variableId == VAR_INVALID) { throw new IllegalStateException("variableId no...
[ "public", "void", "onItemBind", "(", "int", "position", ",", "T", "item", ")", "{", "if", "(", "onItemBind", "!=", "null", ")", "{", "variableId", "=", "VAR_INVALID", ";", "layoutRes", "=", "LAYOUT_NONE", ";", "onItemBind", ".", "onItemBind", "(", "this", ...
Updates the state of the binding for the given item and position. This is called internally by the binding collection adapters.
[ "Updates", "the", "state", "of", "the", "binding", "for", "the", "given", "item", "and", "position", ".", "This", "is", "called", "internally", "by", "the", "binding", "collection", "adapters", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/ItemBinding.java#L158-L170
60,460
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java
MergeObservableList.insertItem
public MergeObservableList<T> insertItem(T object) { lists.add(Collections.singletonList(object)); modCount += 1; listeners.notifyInserted(this, size() - 1, 1); return this; }
java
public MergeObservableList<T> insertItem(T object) { lists.add(Collections.singletonList(object)); modCount += 1; listeners.notifyInserted(this, size() - 1, 1); return this; }
[ "public", "MergeObservableList", "<", "T", ">", "insertItem", "(", "T", "object", ")", "{", "lists", ".", "add", "(", "Collections", ".", "singletonList", "(", "object", ")", ")", ";", "modCount", "+=", "1", ";", "listeners", ".", "notifyInserted", "(", ...
Inserts the given item into the merge list.
[ "Inserts", "the", "given", "item", "into", "the", "merge", "list", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java#L37-L42
60,461
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java
MergeObservableList.removeItem
public boolean removeItem(T object) { int size = 0; for (int i = 0, listsSize = lists.size(); i < listsSize; i++) { List<? extends T> list = lists.get(i); if (!(list instanceof ObservableList)) { Object item = list.get(0); if ((object == null) ? (i...
java
public boolean removeItem(T object) { int size = 0; for (int i = 0, listsSize = lists.size(); i < listsSize; i++) { List<? extends T> list = lists.get(i); if (!(list instanceof ObservableList)) { Object item = list.get(0); if ((object == null) ? (i...
[ "public", "boolean", "removeItem", "(", "T", "object", ")", "{", "int", "size", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "listsSize", "=", "lists", ".", "size", "(", ")", ";", "i", "<", "listsSize", ";", "i", "++", ")", "{", "List"...
Removes the given item from the merge list.
[ "Removes", "the", "given", "item", "from", "the", "merge", "list", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java#L63-L79
60,462
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java
MergeObservableList.removeAll
public void removeAll() { int size = size(); if (size == 0) { return; } for (int i = 0, listSize = lists.size(); i < listSize; i++) { List<? extends T> list = lists.get(i); if (list instanceof ObservableList) { ((ObservableList) list).r...
java
public void removeAll() { int size = size(); if (size == 0) { return; } for (int i = 0, listSize = lists.size(); i < listSize; i++) { List<? extends T> list = lists.get(i); if (list instanceof ObservableList) { ((ObservableList) list).r...
[ "public", "void", "removeAll", "(", ")", "{", "int", "size", "=", "size", "(", ")", ";", "if", "(", "size", "==", "0", ")", "{", "return", ";", "}", "for", "(", "int", "i", "=", "0", ",", "listSize", "=", "lists", ".", "size", "(", ")", ";", ...
Removes all items and lists from the merge list.
[ "Removes", "all", "items", "and", "lists", "from", "the", "merge", "list", "." ]
f669eda0a7002128bb504dcba012c51531f1bedd
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java#L104-L118
60,463
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java
TransitionManager.endTransitions
public static void endTransitions(final @NonNull ViewGroup sceneRoot) { sPendingTransitions.remove(sceneRoot); final ArrayList<Transition> runningTransitions = getRunningTransitions(sceneRoot); if (!runningTransitions.isEmpty()) { // Make a copy in case this is called by an onTransi...
java
public static void endTransitions(final @NonNull ViewGroup sceneRoot) { sPendingTransitions.remove(sceneRoot); final ArrayList<Transition> runningTransitions = getRunningTransitions(sceneRoot); if (!runningTransitions.isEmpty()) { // Make a copy in case this is called by an onTransi...
[ "public", "static", "void", "endTransitions", "(", "final", "@", "NonNull", "ViewGroup", "sceneRoot", ")", "{", "sPendingTransitions", ".", "remove", "(", "sceneRoot", ")", ";", "final", "ArrayList", "<", "Transition", ">", "runningTransitions", "=", "getRunningTr...
Ends all pending and ongoing transitions on the specified scene root. @param sceneRoot The root of the View hierarchy to end transitions on.
[ "Ends", "all", "pending", "and", "ongoing", "transitions", "on", "the", "specified", "scene", "root", "." ]
828efe5f152a2f05e2bfeee6254b74ad2269d4f1
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java#L453-L465
60,464
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/TransitionSet.java
TransitionSet.setOrdering
@NonNull public TransitionSet setOrdering(int ordering) { switch (ordering) { case ORDERING_SEQUENTIAL: mPlayTogether = false; break; case ORDERING_TOGETHER: mPlayTogether = true; break; default: ...
java
@NonNull public TransitionSet setOrdering(int ordering) { switch (ordering) { case ORDERING_SEQUENTIAL: mPlayTogether = false; break; case ORDERING_TOGETHER: mPlayTogether = true; break; default: ...
[ "@", "NonNull", "public", "TransitionSet", "setOrdering", "(", "int", "ordering", ")", "{", "switch", "(", "ordering", ")", "{", "case", "ORDERING_SEQUENTIAL", ":", "mPlayTogether", "=", "false", ";", "break", ";", "case", "ORDERING_TOGETHER", ":", "mPlayTogethe...
Sets the play order of this set's child transitions. @param ordering {@link #ORDERING_TOGETHER} to play this set's child transitions together, {@link #ORDERING_SEQUENTIAL} to play the child transitions in sequence. @return This transitionSet object.
[ "Sets", "the", "play", "order", "of", "this", "set", "s", "child", "transitions", "." ]
828efe5f152a2f05e2bfeee6254b74ad2269d4f1
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionSet.java#L101-L115
60,465
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/TransitionSet.java
TransitionSet.getTransitionAt
@Nullable public Transition getTransitionAt(int index) { if (index < 0 || index >= mTransitions.size()) { return null; } return mTransitions.get(index); }
java
@Nullable public Transition getTransitionAt(int index) { if (index < 0 || index >= mTransitions.size()) { return null; } return mTransitions.get(index); }
[ "@", "Nullable", "public", "Transition", "getTransitionAt", "(", "int", "index", ")", "{", "if", "(", "index", "<", "0", "||", "index", ">=", "mTransitions", ".", "size", "(", ")", ")", "{", "return", "null", ";", "}", "return", "mTransitions", ".", "g...
Returns the child Transition at the specified position in the TransitionSet. @param index The position of the Transition to retrieve. @see #addTransition(Transition) @see #getTransitionCount()
[ "Returns", "the", "child", "Transition", "at", "the", "specified", "position", "in", "the", "TransitionSet", "." ]
828efe5f152a2f05e2bfeee6254b74ad2269d4f1
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionSet.java#L183-L189
60,466
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/PathParser.java
PathParser.extract
private static void extract(String s, int start, ExtractFloatResult result) { // Now looking for ' ', ',', '.' or '-' from the start. int currentIndex = start; boolean foundSeparator = false; result.mEndWithNegOrDot = false; boolean secondDot = false; boolean isExponentia...
java
private static void extract(String s, int start, ExtractFloatResult result) { // Now looking for ' ', ',', '.' or '-' from the start. int currentIndex = start; boolean foundSeparator = false; result.mEndWithNegOrDot = false; boolean secondDot = false; boolean isExponentia...
[ "private", "static", "void", "extract", "(", "String", "s", ",", "int", "start", ",", "ExtractFloatResult", "result", ")", "{", "// Now looking for ' ', ',', '.' or '-' from the start.", "int", "currentIndex", "=", "start", ";", "boolean", "foundSeparator", "=", "fals...
Calculate the position of the next comma or space or negative sign @param s the string to search @param start the position to start searching @param result the result of the extraction, including the position of the the starting position of next number, whether it is ending with a '-'.
[ "Calculate", "the", "position", "of", "the", "next", "comma", "or", "space", "or", "negative", "sign" ]
828efe5f152a2f05e2bfeee6254b74ad2269d4f1
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/PathParser.java#L200-L244
60,467
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/Transition.java
Transition.runAnimators
protected void runAnimators() { if (DBG) { Log.d(LOG_TAG, "runAnimators() on " + this); } start(); ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators(); // Now start every Animator that was previously created for this transition for (Anim...
java
protected void runAnimators() { if (DBG) { Log.d(LOG_TAG, "runAnimators() on " + this); } start(); ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators(); // Now start every Animator that was previously created for this transition for (Anim...
[ "protected", "void", "runAnimators", "(", ")", "{", "if", "(", "DBG", ")", "{", "Log", ".", "d", "(", "LOG_TAG", ",", "\"runAnimators() on \"", "+", "this", ")", ";", "}", "start", "(", ")", ";", "ArrayMap", "<", "Animator", ",", "AnimationInfo", ">", ...
This is called internally once all animations have been set up by the transition hierarchy. @hide
[ "This", "is", "called", "internally", "once", "all", "animations", "have", "been", "set", "up", "by", "the", "transition", "hierarchy", "." ]
828efe5f152a2f05e2bfeee6254b74ad2269d4f1
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Transition.java#L899-L917
60,468
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/Transition.java
Transition.start
protected void start() { if (mNumInstances == 0) { if (mListeners != null && mListeners.size() > 0) { ArrayList<TransitionListener> tmpListeners = (ArrayList<TransitionListener>) mListeners.clone(); int numListeners = tmpListeners.size(); ...
java
protected void start() { if (mNumInstances == 0) { if (mListeners != null && mListeners.size() > 0) { ArrayList<TransitionListener> tmpListeners = (ArrayList<TransitionListener>) mListeners.clone(); int numListeners = tmpListeners.size(); ...
[ "protected", "void", "start", "(", ")", "{", "if", "(", "mNumInstances", "==", "0", ")", "{", "if", "(", "mListeners", "!=", "null", "&&", "mListeners", ".", "size", "(", ")", ">", "0", ")", "{", "ArrayList", "<", "TransitionListener", ">", "tmpListene...
This method is called automatically by the transition and TransitionSet classes prior to a Transition subclass starting; subclasses should not need to call it directly. @hide
[ "This", "method", "is", "called", "automatically", "by", "the", "transition", "and", "TransitionSet", "classes", "prior", "to", "a", "Transition", "subclass", "starting", ";", "subclasses", "should", "not", "need", "to", "call", "it", "directly", "." ]
828efe5f152a2f05e2bfeee6254b74ad2269d4f1
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Transition.java#L1932-L1945
60,469
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/Transition.java
Transition.cancel
protected void cancel() { int numAnimators = mCurrentAnimators.size(); for (int i = numAnimators - 1; i >= 0; i--) { Animator animator = mCurrentAnimators.get(i); animator.cancel(); } if (mListeners != null && mListeners.size() > 0) { ArrayList<Transit...
java
protected void cancel() { int numAnimators = mCurrentAnimators.size(); for (int i = numAnimators - 1; i >= 0; i--) { Animator animator = mCurrentAnimators.get(i); animator.cancel(); } if (mListeners != null && mListeners.size() > 0) { ArrayList<Transit...
[ "protected", "void", "cancel", "(", ")", "{", "int", "numAnimators", "=", "mCurrentAnimators", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "numAnimators", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "Animator", "animator", ...
This method cancels a transition that is currently running. @hide
[ "This", "method", "cancels", "a", "transition", "that", "is", "currently", "running", "." ]
828efe5f152a2f05e2bfeee6254b74ad2269d4f1
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Transition.java#L1990-L2004
60,470
influxdata/influxdb-java
src/main/java/org/influxdb/dto/BatchPoints.java
BatchPoints.point
public BatchPoints point(final Point point) { point.getTags().putAll(this.tags); this.points.add(point); return this; }
java
public BatchPoints point(final Point point) { point.getTags().putAll(this.tags); this.points.add(point); return this; }
[ "public", "BatchPoints", "point", "(", "final", "Point", "point", ")", "{", "point", ".", "getTags", "(", ")", ".", "putAll", "(", "this", ".", "tags", ")", ";", "this", ".", "points", ".", "add", "(", "point", ")", ";", "return", "this", ";", "}" ...
Add a single Point to these batches. @param point the Point to add @return this Instance to be able to daisy chain calls.
[ "Add", "a", "single", "Point", "to", "these", "batches", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/dto/BatchPoints.java#L242-L246
60,471
influxdata/influxdb-java
src/main/java/org/influxdb/dto/BatchPoints.java
BatchPoints.lineProtocol
public String lineProtocol() { StringBuilder sb = new StringBuilder(); for (Point point : this.points) { sb.append(point.lineProtocol(this.precision)).append("\n"); } return sb.toString(); }
java
public String lineProtocol() { StringBuilder sb = new StringBuilder(); for (Point point : this.points) { sb.append(point.lineProtocol(this.precision)).append("\n"); } return sb.toString(); }
[ "public", "String", "lineProtocol", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Point", "point", ":", "this", ".", "points", ")", "{", "sb", ".", "append", "(", "point", ".", "lineProtocol", "(", "this...
calculate the lineprotocol for all Points. @return the String with newLines.
[ "calculate", "the", "lineprotocol", "for", "all", "Points", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/dto/BatchPoints.java#L328-L335
60,472
influxdata/influxdb-java
src/main/java/org/influxdb/dto/BatchPoints.java
BatchPoints.isMergeAbleWith
public boolean isMergeAbleWith(final BatchPoints that) { return Objects.equals(database, that.database) && Objects.equals(retentionPolicy, that.retentionPolicy) && Objects.equals(tags, that.tags) && consistency == that.consistency; }
java
public boolean isMergeAbleWith(final BatchPoints that) { return Objects.equals(database, that.database) && Objects.equals(retentionPolicy, that.retentionPolicy) && Objects.equals(tags, that.tags) && consistency == that.consistency; }
[ "public", "boolean", "isMergeAbleWith", "(", "final", "BatchPoints", "that", ")", "{", "return", "Objects", ".", "equals", "(", "database", ",", "that", ".", "database", ")", "&&", "Objects", ".", "equals", "(", "retentionPolicy", ",", "that", ".", "retentio...
Test whether is possible to merge two BatchPoints objects. @param that batch point to merge in @return true if the batch points can be sent in a single HTTP request write
[ "Test", "whether", "is", "possible", "to", "merge", "two", "BatchPoints", "objects", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/dto/BatchPoints.java#L343-L348
60,473
influxdata/influxdb-java
src/main/java/org/influxdb/dto/BatchPoints.java
BatchPoints.mergeIn
public boolean mergeIn(final BatchPoints that) { boolean mergeAble = isMergeAbleWith(that); if (mergeAble) { this.points.addAll(that.points); } return mergeAble; }
java
public boolean mergeIn(final BatchPoints that) { boolean mergeAble = isMergeAbleWith(that); if (mergeAble) { this.points.addAll(that.points); } return mergeAble; }
[ "public", "boolean", "mergeIn", "(", "final", "BatchPoints", "that", ")", "{", "boolean", "mergeAble", "=", "isMergeAbleWith", "(", "that", ")", ";", "if", "(", "mergeAble", ")", "{", "this", ".", "points", ".", "addAll", "(", "that", ".", "points", ")",...
Merge two BatchPoints objects. @param that batch point to merge in @return true if the batch points have been merged into this BatchPoints instance. Return false otherwise.
[ "Merge", "two", "BatchPoints", "objects", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/dto/BatchPoints.java#L356-L362
60,474
influxdata/influxdb-java
src/main/java/org/influxdb/msgpack/MessagePackTraverser.java
MessagePackTraverser.traverse
public Iterable<QueryResult> traverse(final InputStream is) { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(is); return () -> { return new Iterator<QueryResult>() { @Override public boolean hasNext() { try { return unpacker.hasNext(); } catch (I...
java
public Iterable<QueryResult> traverse(final InputStream is) { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(is); return () -> { return new Iterator<QueryResult>() { @Override public boolean hasNext() { try { return unpacker.hasNext(); } catch (I...
[ "public", "Iterable", "<", "QueryResult", ">", "traverse", "(", "final", "InputStream", "is", ")", "{", "MessageUnpacker", "unpacker", "=", "MessagePack", ".", "newDefaultUnpacker", "(", "is", ")", ";", "return", "(", ")", "->", "{", "return", "new", "Iterat...
Traverse over the whole message pack stream. This method can be used for converting query results in chunk. @param is The MessagePack format input stream @return an Iterable over the QueryResult objects
[ "Traverse", "over", "the", "whole", "message", "pack", "stream", ".", "This", "method", "can", "be", "used", "for", "converting", "query", "results", "in", "chunk", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/msgpack/MessagePackTraverser.java#L43-L64
60,475
influxdata/influxdb-java
src/main/java/org/influxdb/msgpack/MessagePackTraverser.java
MessagePackTraverser.parse
public QueryResult parse(final InputStream is) { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(is); return parse(unpacker); }
java
public QueryResult parse(final InputStream is) { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(is); return parse(unpacker); }
[ "public", "QueryResult", "parse", "(", "final", "InputStream", "is", ")", "{", "MessageUnpacker", "unpacker", "=", "MessagePack", ".", "newDefaultUnpacker", "(", "is", ")", ";", "return", "parse", "(", "unpacker", ")", ";", "}" ]
Parse the message pack stream. This method can be used for converting query result from normal query response where exactly one QueryResult returned @param is The MessagePack format input stream @return QueryResult
[ "Parse", "the", "message", "pack", "stream", ".", "This", "method", "can", "be", "used", "for", "converting", "query", "result", "from", "normal", "query", "response", "where", "exactly", "one", "QueryResult", "returned" ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/msgpack/MessagePackTraverser.java#L76-L79
60,476
influxdata/influxdb-java
src/main/java/org/influxdb/impl/Preconditions.java
Preconditions.checkPositiveNumber
public static void checkPositiveNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() <= 0) { throw new IllegalArgumentException("Expecting a positive number for " + name); } }
java
public static void checkPositiveNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() <= 0) { throw new IllegalArgumentException("Expecting a positive number for " + name); } }
[ "public", "static", "void", "checkPositiveNumber", "(", "final", "Number", "number", ",", "final", "String", "name", ")", "throws", "IllegalArgumentException", "{", "if", "(", "number", "==", "null", "||", "number", ".", "doubleValue", "(", ")", "<=", "0", "...
Enforces that the number is larger than 0. @param number the number to test @param name variable name for reporting @throws IllegalArgumentException if the number is less or equal to 0
[ "Enforces", "that", "the", "number", "is", "larger", "than", "0", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/Preconditions.java#L33-L37
60,477
influxdata/influxdb-java
src/main/java/org/influxdb/impl/Preconditions.java
Preconditions.checkNotNegativeNumber
public static void checkNotNegativeNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() < 0) { throw new IllegalArgumentException("Expecting a positive or zero number for " + name); } }
java
public static void checkNotNegativeNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() < 0) { throw new IllegalArgumentException("Expecting a positive or zero number for " + name); } }
[ "public", "static", "void", "checkNotNegativeNumber", "(", "final", "Number", "number", ",", "final", "String", "name", ")", "throws", "IllegalArgumentException", "{", "if", "(", "number", "==", "null", "||", "number", ".", "doubleValue", "(", ")", "<", "0", ...
Enforces that the number is not negative. @param number the number to test @param name variable name for reporting @throws IllegalArgumentException if the number is less or equal to 0
[ "Enforces", "that", "the", "number", "is", "not", "negative", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/Preconditions.java#L45-L49
60,478
influxdata/influxdb-java
src/main/java/org/influxdb/impl/Preconditions.java
Preconditions.checkDuration
public static void checkDuration(final String duration, final String name) throws IllegalArgumentException { if (!duration.matches("(\\d+[wdmhs])+|inf")) { throw new IllegalArgumentException("Invalid InfluxDB duration: " + duration + " for " + name); } }
java
public static void checkDuration(final String duration, final String name) throws IllegalArgumentException { if (!duration.matches("(\\d+[wdmhs])+|inf")) { throw new IllegalArgumentException("Invalid InfluxDB duration: " + duration + " for " + name); } }
[ "public", "static", "void", "checkDuration", "(", "final", "String", "duration", ",", "final", "String", "name", ")", "throws", "IllegalArgumentException", "{", "if", "(", "!", "duration", ".", "matches", "(", "\"(\\\\d+[wdmhs])+|inf\"", ")", ")", "{", "throw", ...
Enforces that the duration is a valid influxDB duration. @param duration the duration to test @param name variable name for reporting @throws IllegalArgumentException if the given duration is not valid.
[ "Enforces", "that", "the", "duration", "is", "a", "valid", "influxDB", "duration", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/Preconditions.java#L56-L61
60,479
influxdata/influxdb-java
src/main/java/org/influxdb/BatchOptions.java
BatchOptions.jitterDuration
public BatchOptions jitterDuration(final int jitterDuration) { BatchOptions clone = getClone(); clone.jitterDuration = jitterDuration; return clone; }
java
public BatchOptions jitterDuration(final int jitterDuration) { BatchOptions clone = getClone(); clone.jitterDuration = jitterDuration; return clone; }
[ "public", "BatchOptions", "jitterDuration", "(", "final", "int", "jitterDuration", ")", "{", "BatchOptions", "clone", "=", "getClone", "(", ")", ";", "clone", ".", "jitterDuration", "=", "jitterDuration", ";", "return", "clone", ";", "}" ]
Jitters the batch flush interval by a random amount. This is primarily to avoid large write spikes for users running a large number of client instances. ie, a jitter of 5s and flush duration 10s means flushes will happen every 10-15s. @param jitterDuration (milliseconds) @return the BatchOptions instance to be able to...
[ "Jitters", "the", "batch", "flush", "interval", "by", "a", "random", "amount", ".", "This", "is", "primarily", "to", "avoid", "large", "write", "spikes", "for", "users", "running", "a", "large", "number", "of", "client", "instances", ".", "ie", "a", "jitte...
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/BatchOptions.java#L72-L76
60,480
influxdata/influxdb-java
src/main/java/org/influxdb/BatchOptions.java
BatchOptions.bufferLimit
public BatchOptions bufferLimit(final int bufferLimit) { BatchOptions clone = getClone(); clone.bufferLimit = bufferLimit; return clone; }
java
public BatchOptions bufferLimit(final int bufferLimit) { BatchOptions clone = getClone(); clone.bufferLimit = bufferLimit; return clone; }
[ "public", "BatchOptions", "bufferLimit", "(", "final", "int", "bufferLimit", ")", "{", "BatchOptions", "clone", "=", "getClone", "(", ")", ";", "clone", ".", "bufferLimit", "=", "bufferLimit", ";", "return", "clone", ";", "}" ]
The client maintains a buffer for failed writes so that the writes will be retried later on. This may help to overcome temporary network problems or InfluxDB load spikes. When the buffer is full and new points are written, oldest entries in the buffer are lost. To disable this feature set buffer limit to a value small...
[ "The", "client", "maintains", "a", "buffer", "for", "failed", "writes", "so", "that", "the", "writes", "will", "be", "retried", "later", "on", ".", "This", "may", "help", "to", "overcome", "temporary", "network", "problems", "or", "InfluxDB", "load", "spikes...
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/BatchOptions.java#L88-L92
60,481
influxdata/influxdb-java
src/main/java/org/influxdb/impl/InfluxDBImpl.java
InfluxDBImpl.callQuery
private Call<QueryResult> callQuery(final Query query) { Call<QueryResult> call; String db = query.getDatabase(); if (db == null) { db = this.database; } if (query instanceof BoundParameterQuery) { BoundParameterQuery boundParameterQuery = (BoundParameterQuery) query; call = ...
java
private Call<QueryResult> callQuery(final Query query) { Call<QueryResult> call; String db = query.getDatabase(); if (db == null) { db = this.database; } if (query instanceof BoundParameterQuery) { BoundParameterQuery boundParameterQuery = (BoundParameterQuery) query; call = ...
[ "private", "Call", "<", "QueryResult", ">", "callQuery", "(", "final", "Query", "query", ")", "{", "Call", "<", "QueryResult", ">", "call", ";", "String", "db", "=", "query", ".", "getDatabase", "(", ")", ";", "if", "(", "db", "==", "null", ")", "{",...
Calls the influxDBService for the query.
[ "Calls", "the", "influxDBService", "for", "the", "query", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/InfluxDBImpl.java#L747-L765
60,482
influxdata/influxdb-java
src/main/java/org/influxdb/InfluxDBException.java
InfluxDBException.buildExceptionForErrorState
public static InfluxDBException buildExceptionForErrorState(final InputStream messagePackErrorBody) { try { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(messagePackErrorBody); ImmutableMapValue mapVal = (ImmutableMapValue) unpacker.unpackValue(); return InfluxDBException.buildExceptio...
java
public static InfluxDBException buildExceptionForErrorState(final InputStream messagePackErrorBody) { try { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(messagePackErrorBody); ImmutableMapValue mapVal = (ImmutableMapValue) unpacker.unpackValue(); return InfluxDBException.buildExceptio...
[ "public", "static", "InfluxDBException", "buildExceptionForErrorState", "(", "final", "InputStream", "messagePackErrorBody", ")", "{", "try", "{", "MessageUnpacker", "unpacker", "=", "MessagePack", ".", "newDefaultUnpacker", "(", "messagePackErrorBody", ")", ";", "Immutab...
Create corresponding InfluxDBException from the message pack error body. @param messagePackErrorBody the error body if any @return the Exception
[ "Create", "corresponding", "InfluxDBException", "from", "the", "message", "pack", "error", "body", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/InfluxDBException.java#L185-L194
60,483
influxdata/influxdb-java
src/main/java/org/influxdb/impl/BatchProcessor.java
BatchProcessor.put
void put(final AbstractBatchEntry batchEntry) { try { this.queue.put(batchEntry); } catch (InterruptedException e) { throw new RuntimeException(e); } if (this.queue.size() >= this.actions) { this.scheduler.submit(new Runnable() { @Override public void run() { ...
java
void put(final AbstractBatchEntry batchEntry) { try { this.queue.put(batchEntry); } catch (InterruptedException e) { throw new RuntimeException(e); } if (this.queue.size() >= this.actions) { this.scheduler.submit(new Runnable() { @Override public void run() { ...
[ "void", "put", "(", "final", "AbstractBatchEntry", "batchEntry", ")", "{", "try", "{", "this", ".", "queue", ".", "put", "(", "batchEntry", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ...
Put a single BatchEntry to the cache for later processing. @param batchEntry the batchEntry to write to the cache.
[ "Put", "a", "single", "BatchEntry", "to", "the", "cache", "for", "later", "processing", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/BatchProcessor.java#L360-L374
60,484
influxdata/influxdb-java
src/main/java/org/influxdb/dto/Point.java
Point.measurementByPOJO
public static Builder measurementByPOJO(final Class<?> clazz) { Objects.requireNonNull(clazz, "clazz"); throwExceptionIfMissingAnnotation(clazz, Measurement.class); String measurementName = findMeasurementName(clazz); return new Builder(measurementName); }
java
public static Builder measurementByPOJO(final Class<?> clazz) { Objects.requireNonNull(clazz, "clazz"); throwExceptionIfMissingAnnotation(clazz, Measurement.class); String measurementName = findMeasurementName(clazz); return new Builder(measurementName); }
[ "public", "static", "Builder", "measurementByPOJO", "(", "final", "Class", "<", "?", ">", "clazz", ")", "{", "Objects", ".", "requireNonNull", "(", "clazz", ",", "\"clazz\"", ")", ";", "throwExceptionIfMissingAnnotation", "(", "clazz", ",", "Measurement", ".", ...
Create a new Point Build build to create a new Point in a fluent manner from a POJO. @param clazz Class of the POJO @return the Builder instance
[ "Create", "a", "new", "Point", "Build", "build", "to", "create", "a", "new", "Point", "in", "a", "fluent", "manner", "from", "a", "POJO", "." ]
8ae777f34aa2e598f609208cf4fa12d4642f83f5
https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/dto/Point.java#L67-L72
60,485
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java
MvpViewState.restoreState
protected void restoreState(View view, Set<ViewCommand<View>> currentState) { if (mViewCommands.isEmpty()) { return; } mViewCommands.reapply(view, currentState); }
java
protected void restoreState(View view, Set<ViewCommand<View>> currentState) { if (mViewCommands.isEmpty()) { return; } mViewCommands.reapply(view, currentState); }
[ "protected", "void", "restoreState", "(", "View", "view", ",", "Set", "<", "ViewCommand", "<", "View", ">", ">", "currentState", ")", "{", "if", "(", "mViewCommands", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "mViewCommands", ".", "reapply"...
Apply saved state to attached view @param view mvp view to restore state @param currentState commands that was applied already
[ "Apply", "saved", "state", "to", "attached", "view" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java#L36-L42
60,486
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java
MvpViewState.attachView
public void attachView(View view) { if (view == null) { throw new IllegalArgumentException("Mvp view must be not null"); } boolean isViewAdded = mViews.add(view); if (!isViewAdded) { return; } mInRestoreState.add(view); Set<ViewCommand<View>> currentState = mViewStates.get(view); currentState ...
java
public void attachView(View view) { if (view == null) { throw new IllegalArgumentException("Mvp view must be not null"); } boolean isViewAdded = mViews.add(view); if (!isViewAdded) { return; } mInRestoreState.add(view); Set<ViewCommand<View>> currentState = mViewStates.get(view); currentState ...
[ "public", "void", "attachView", "(", "View", "view", ")", "{", "if", "(", "view", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Mvp view must be not null\"", ")", ";", "}", "boolean", "isViewAdded", "=", "mViews", ".", "add", "(...
Attach view to view state and apply saves state @param view attachment
[ "Attach", "view", "to", "view", "state", "and", "apply", "saves", "state" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java#L49-L70
60,487
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/PresenterStore.java
PresenterStore.add
public <T extends MvpPresenter> void add(String tag, T instance) { mPresenters.put(tag, instance); }
java
public <T extends MvpPresenter> void add(String tag, T instance) { mPresenters.put(tag, instance); }
[ "public", "<", "T", "extends", "MvpPresenter", ">", "void", "add", "(", "String", "tag", ",", "T", "instance", ")", "{", "mPresenters", ".", "put", "(", "tag", ",", "instance", ")", ";", "}" ]
Add presenter to storage @param tag Tag of presenter. Local presenters contains also delegate's tag as prefix @param instance Instance of MvpPresenter implementation to store @param <T> Type of presenter
[ "Add", "presenter", "to", "storage" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/PresenterStore.java#L26-L28
60,488
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/MvpPresenter.java
MvpPresenter.isInRestoreState
@SuppressWarnings("unused") public boolean isInRestoreState(View view) { //noinspection SimplifiableIfStatement if (mViewState != null) { return mViewState.isInRestoreState(view); } return false; }
java
@SuppressWarnings("unused") public boolean isInRestoreState(View view) { //noinspection SimplifiableIfStatement if (mViewState != null) { return mViewState.isInRestoreState(view); } return false; }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "boolean", "isInRestoreState", "(", "View", "view", ")", "{", "//noinspection SimplifiableIfStatement", "if", "(", "mViewState", "!=", "null", ")", "{", "return", "mViewState", ".", "isInRestoreState", "(", ...
Check if view is in restore state or not @param view view for check @return true if view state restore state to incoming view. false otherwise.
[ "Check", "if", "view", "is", "in", "restore", "state", "or", "not" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/MvpPresenter.java#L110-L117
60,489
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/MvpPresenter.java
MvpPresenter.setViewState
@SuppressWarnings({"unchecked", "unused"}) public void setViewState(MvpViewState<View> viewState) { mViewStateAsView = (View) viewState; mViewState = (MvpViewState) viewState; }
java
@SuppressWarnings({"unchecked", "unused"}) public void setViewState(MvpViewState<View> viewState) { mViewStateAsView = (View) viewState; mViewState = (MvpViewState) viewState; }
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"unused\"", "}", ")", "public", "void", "setViewState", "(", "MvpViewState", "<", "View", ">", "viewState", ")", "{", "mViewStateAsView", "=", "(", "View", ")", "viewState", ";", "mViewState", "=", "...
Set view state to presenter @param viewState that implements type, setted as View generic param
[ "Set", "view", "state", "to", "presenter" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/MvpPresenter.java#L124-L128
60,490
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/MvpProcessor.java
MvpProcessor.hasMoxyReflector
private static boolean hasMoxyReflector() { if (hasMoxyReflector != null) { return hasMoxyReflector; } try { new MoxyReflector(); hasMoxyReflector = true; } catch (NoClassDefFoundError error) { hasMoxyReflector = false; } return hasMoxyReflector; }
java
private static boolean hasMoxyReflector() { if (hasMoxyReflector != null) { return hasMoxyReflector; } try { new MoxyReflector(); hasMoxyReflector = true; } catch (NoClassDefFoundError error) { hasMoxyReflector = false; } return hasMoxyReflector; }
[ "private", "static", "boolean", "hasMoxyReflector", "(", ")", "{", "if", "(", "hasMoxyReflector", "!=", "null", ")", "{", "return", "hasMoxyReflector", ";", "}", "try", "{", "new", "MoxyReflector", "(", ")", ";", "hasMoxyReflector", "=", "true", ";", "}", ...
Check is it have generated MoxyReflector without usage of reflection API
[ "Check", "is", "it", "have", "generated", "MoxyReflector", "without", "usage", "of", "reflection", "API" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/MvpProcessor.java#L118-L132
60,491
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/MvpDelegate.java
MvpDelegate.onSaveInstanceState
public void onSaveInstanceState(Bundle outState) { if (mParentDelegate == null) { Bundle moxyDelegateBundle = new Bundle(); outState.putBundle(MOXY_DELEGATE_TAGS_KEY, moxyDelegateBundle); outState = moxyDelegateBundle; } outState.putAll(mBundle); outState.putString(mKeyTag, mDelegateTag); for (MvpD...
java
public void onSaveInstanceState(Bundle outState) { if (mParentDelegate == null) { Bundle moxyDelegateBundle = new Bundle(); outState.putBundle(MOXY_DELEGATE_TAGS_KEY, moxyDelegateBundle); outState = moxyDelegateBundle; } outState.putAll(mBundle); outState.putString(mKeyTag, mDelegateTag); for (MvpD...
[ "public", "void", "onSaveInstanceState", "(", "Bundle", "outState", ")", "{", "if", "(", "mParentDelegate", "==", "null", ")", "{", "Bundle", "moxyDelegateBundle", "=", "new", "Bundle", "(", ")", ";", "outState", ".", "putBundle", "(", "MOXY_DELEGATE_TAGS_KEY", ...
Save presenters tag prefix to save state for restore presenters at future after delegate recreate @param outState out state from Android component
[ "Save", "presenters", "tag", "prefix", "to", "save", "state", "for", "restore", "presenters", "at", "future", "after", "delegate", "recreate" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/MvpDelegate.java#L240-L253
60,492
Arello-Mobile/Moxy
moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/reflector/MoxyReflectorGenerator.java
MoxyReflectorGenerator.getPresenterBinders
private static SortedMap<TypeElement, List<TypeElement>> getPresenterBinders(List<TypeElement> presentersContainers) { Map<TypeElement, TypeElement> extendingMap = new HashMap<>(); for (TypeElement presentersContainer : presentersContainers) { TypeMirror superclass = presentersContainer.getSuperclass(); Typ...
java
private static SortedMap<TypeElement, List<TypeElement>> getPresenterBinders(List<TypeElement> presentersContainers) { Map<TypeElement, TypeElement> extendingMap = new HashMap<>(); for (TypeElement presentersContainer : presentersContainers) { TypeMirror superclass = presentersContainer.getSuperclass(); Typ...
[ "private", "static", "SortedMap", "<", "TypeElement", ",", "List", "<", "TypeElement", ">", ">", "getPresenterBinders", "(", "List", "<", "TypeElement", ">", "presentersContainers", ")", "{", "Map", "<", "TypeElement", ",", "TypeElement", ">", "extendingMap", "=...
Collects presenter binders from superclasses that are also presenter containers. @return sorted map between presenter container and list of corresponding binders
[ "Collects", "presenter", "binders", "from", "superclasses", "that", "are", "also", "presenter", "containers", "." ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/reflector/MoxyReflectorGenerator.java#L181-L218
60,493
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/PresentersCounter.java
PresentersCounter.injectPresenter
public void injectPresenter(MvpPresenter<?> presenter, String delegateTag) { Set<String> delegateTags = mConnections.get(presenter); if (delegateTags == null) { delegateTags = new HashSet<>(); mConnections.put(presenter, delegateTags); } delegateTags.add(delegateTag); Set<MvpPresenter> presenters = mT...
java
public void injectPresenter(MvpPresenter<?> presenter, String delegateTag) { Set<String> delegateTags = mConnections.get(presenter); if (delegateTags == null) { delegateTags = new HashSet<>(); mConnections.put(presenter, delegateTags); } delegateTags.add(delegateTag); Set<MvpPresenter> presenters = mT...
[ "public", "void", "injectPresenter", "(", "MvpPresenter", "<", "?", ">", "presenter", ",", "String", "delegateTag", ")", "{", "Set", "<", "String", ">", "delegateTags", "=", "mConnections", ".", "get", "(", "presenter", ")", ";", "if", "(", "delegateTags", ...
Save delegate tag when it inject presenter to delegate's object @param presenter Injected presenter @param delegateTag Delegate tag
[ "Save", "delegate", "tag", "when", "it", "inject", "presenter", "to", "delegate", "s", "object" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/PresentersCounter.java#L27-L42
60,494
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/PresentersCounter.java
PresentersCounter.rejectPresenter
public boolean rejectPresenter(MvpPresenter<?> presenter, String delegateTag) { Set<MvpPresenter> presenters = mTags.get(delegateTag); if (presenters != null) { presenters.remove(presenter); } if (presenters == null || presenters.isEmpty()) { mTags.remove(delegateTag); } Set<String> delegateTags = mC...
java
public boolean rejectPresenter(MvpPresenter<?> presenter, String delegateTag) { Set<MvpPresenter> presenters = mTags.get(delegateTag); if (presenters != null) { presenters.remove(presenter); } if (presenters == null || presenters.isEmpty()) { mTags.remove(delegateTag); } Set<String> delegateTags = mC...
[ "public", "boolean", "rejectPresenter", "(", "MvpPresenter", "<", "?", ">", "presenter", ",", "String", "delegateTag", ")", "{", "Set", "<", "MvpPresenter", ">", "presenters", "=", "mTags", ".", "get", "(", "delegateTag", ")", ";", "if", "(", "presenters", ...
Remove tag when delegate's object was fully destroyed @param presenter Rejected presenter @param delegateTag Delegate tag @return True if there are no links to this presenter and presenter be able to destroy. False otherwise
[ "Remove", "tag", "when", "delegate", "s", "object", "was", "fully", "destroyed" ]
83c608de22a55864f0cdd8c1eee878e72afa3e71
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/PresentersCounter.java#L51-L82
60,495
OpenHFT/Java-Thread-Affinity
affinity/src/main/java/net/openhft/affinity/AffinityLock.java
AffinityLock.bind
public void bind(boolean wholeCore) { if (bound && assignedThread != null && assignedThread.isAlive()) throw new IllegalStateException("cpu " + cpuId + " already bound to " + assignedThread); if (areAssertionsEnabled()) boundHere = new Throwable("Bound here"); if (wholeC...
java
public void bind(boolean wholeCore) { if (bound && assignedThread != null && assignedThread.isAlive()) throw new IllegalStateException("cpu " + cpuId + " already bound to " + assignedThread); if (areAssertionsEnabled()) boundHere = new Throwable("Bound here"); if (wholeC...
[ "public", "void", "bind", "(", "boolean", "wholeCore", ")", "{", "if", "(", "bound", "&&", "assignedThread", "!=", "null", "&&", "assignedThread", ".", "isAlive", "(", ")", ")", "throw", "new", "IllegalStateException", "(", "\"cpu \"", "+", "cpuId", "+", "...
Bind the current thread to this reservable lock. @param wholeCore if true, also reserve the whole core.
[ "Bind", "the", "current", "thread", "to", "this", "reservable", "lock", "." ]
e0987f6f21aeea89830d8010483bb4abca54fc1b
https://github.com/OpenHFT/Java-Thread-Affinity/blob/e0987f6f21aeea89830d8010483bb4abca54fc1b/affinity/src/main/java/net/openhft/affinity/AffinityLock.java#L238-L257
60,496
OpenHFT/Java-Thread-Affinity
affinity/src/main/java/net/openhft/affinity/impl/Utilities.java
Utilities.toHexString
public static String toHexString(final BitSet set) { ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter(out); final long[] longs = set.toLongArray(); for (long aLong : longs) { writer.write(Long.toHexString(aLong)); } ...
java
public static String toHexString(final BitSet set) { ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter(out); final long[] longs = set.toLongArray(); for (long aLong : longs) { writer.write(Long.toHexString(aLong)); } ...
[ "public", "static", "String", "toHexString", "(", "final", "BitSet", "set", ")", "{", "ByteArrayOutputStream", "out", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "PrintWriter", "writer", "=", "new", "PrintWriter", "(", "out", ")", ";", "final", "long",...
Creates a hexademical representation of the bit set @param set the bit set to convert @return the hexademical string representation
[ "Creates", "a", "hexademical", "representation", "of", "the", "bit", "set" ]
e0987f6f21aeea89830d8010483bb4abca54fc1b
https://github.com/OpenHFT/Java-Thread-Affinity/blob/e0987f6f21aeea89830d8010483bb4abca54fc1b/affinity/src/main/java/net/openhft/affinity/impl/Utilities.java#L38-L48
60,497
sannies/mp4parser
muxer/src/main/java/org/mp4parser/muxer/builder/DefaultMp4Builder.java
DefaultMp4Builder.getChunkSizes
int[] getChunkSizes(Track track) { long[] referenceChunkStarts = fragmenter.sampleNumbers(track); int[] chunkSizes = new int[referenceChunkStarts.length]; for (int i = 0; i < referenceChunkStarts.length; i++) { long start = referenceChunkStarts[i] - 1; long end; ...
java
int[] getChunkSizes(Track track) { long[] referenceChunkStarts = fragmenter.sampleNumbers(track); int[] chunkSizes = new int[referenceChunkStarts.length]; for (int i = 0; i < referenceChunkStarts.length; i++) { long start = referenceChunkStarts[i] - 1; long end; ...
[ "int", "[", "]", "getChunkSizes", "(", "Track", "track", ")", "{", "long", "[", "]", "referenceChunkStarts", "=", "fragmenter", ".", "sampleNumbers", "(", "track", ")", ";", "int", "[", "]", "chunkSizes", "=", "new", "int", "[", "referenceChunkStarts", "."...
Gets the chunk sizes for the given track. @param track the track we are talking about @return the size of each chunk in number of samples
[ "Gets", "the", "chunk", "sizes", "for", "the", "given", "track", "." ]
3382ff5d489363900f352a8da0f794a20ad3b063
https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/muxer/src/main/java/org/mp4parser/muxer/builder/DefaultMp4Builder.java#L603-L624
60,498
sannies/mp4parser
examples/src/main/java/com/google/code/mp4parser/example/PrintStructure.java
PrintStructure.print
private void print(FileChannel fc, int level, long start, long end) throws IOException { fc.position(start); if(end <= 0) { end = start + fc.size(); System.out.println("Setting END to " + end); } while (end - fc.position() > 8) { long begin = fc.positi...
java
private void print(FileChannel fc, int level, long start, long end) throws IOException { fc.position(start); if(end <= 0) { end = start + fc.size(); System.out.println("Setting END to " + end); } while (end - fc.position() > 8) { long begin = fc.positi...
[ "private", "void", "print", "(", "FileChannel", "fc", ",", "int", "level", ",", "long", "start", ",", "long", "end", ")", "throws", "IOException", "{", "fc", ".", "position", "(", "start", ")", ";", "if", "(", "end", "<=", "0", ")", "{", "end", "="...
Parses the FileChannel, in the range [start, end) and prints the elements found Elements are printed, indented by "level" number of spaces. If an element is a container, then its contents will be, recursively, printed, with a greater indentation. @param fc @param level @param start @param end @throws IOException
[ "Parses", "the", "FileChannel", "in", "the", "range", "[", "start", "end", ")", "and", "prints", "the", "elements", "found" ]
3382ff5d489363900f352a8da0f794a20ad3b063
https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/examples/src/main/java/com/google/code/mp4parser/example/PrintStructure.java#L52-L83
60,499
sannies/mp4parser
isoparser/src/main/java/org/mp4parser/AbstractBoxParser.java
AbstractBoxParser.parseBox
public ParsableBox parseBox(ReadableByteChannel byteChannel, String parentType) throws IOException { header.get().rewind().limit(8); int bytesRead = 0; int b; while ((b = byteChannel.read(header.get())) + bytesRead < 8) { if (b < 0) { throw new EOFException()...
java
public ParsableBox parseBox(ReadableByteChannel byteChannel, String parentType) throws IOException { header.get().rewind().limit(8); int bytesRead = 0; int b; while ((b = byteChannel.read(header.get())) + bytesRead < 8) { if (b < 0) { throw new EOFException()...
[ "public", "ParsableBox", "parseBox", "(", "ReadableByteChannel", "byteChannel", ",", "String", "parentType", ")", "throws", "IOException", "{", "header", ".", "get", "(", ")", ".", "rewind", "(", ")", ".", "limit", "(", "8", ")", ";", "int", "bytesRead", "...
Parses the next size and type, creates a box instance and parses the box's content. @param byteChannel the DataSource pointing to the ISO file @param parentType the current box's parent's type (null if no parent) @return the box just parsed @throws java.io.IOException if reading from <code>in</code> fails
[ "Parses", "the", "next", "size", "and", "type", "creates", "a", "box", "instance", "and", "parses", "the", "box", "s", "content", "." ]
3382ff5d489363900f352a8da0f794a20ad3b063
https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/isoparser/src/main/java/org/mp4parser/AbstractBoxParser.java#L55-L117