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
31,200
jfinal/jfinal
src/main/java/com/jfinal/config/Constants.java
Constants.setRenderFactory
public void setRenderFactory(IRenderFactory renderFactory) { if (renderFactory == null) { throw new IllegalArgumentException("renderFactory can not be null."); } RenderManager.me().setRenderFactory(renderFactory); }
java
public void setRenderFactory(IRenderFactory renderFactory) { if (renderFactory == null) { throw new IllegalArgumentException("renderFactory can not be null."); } RenderManager.me().setRenderFactory(renderFactory); }
[ "public", "void", "setRenderFactory", "(", "IRenderFactory", "renderFactory", ")", "{", "if", "(", "renderFactory", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"renderFactory can not be null.\"", ")", ";", "}", "RenderManager", ".", "m...
Set the renderFactory
[ "Set", "the", "renderFactory" ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/config/Constants.java#L96-L101
31,201
jfinal/jfinal
src/main/java/com/jfinal/config/Constants.java
Constants.setUrlParaSeparator
public void setUrlParaSeparator(String urlParaSeparator) { if (StrKit.isBlank(urlParaSeparator) || urlParaSeparator.contains("/")) { throw new IllegalArgumentException("urlParaSepartor can not be blank and can not contains \"/\""); } this.urlParaSeparator = urlParaSeparator; }
java
public void setUrlParaSeparator(String urlParaSeparator) { if (StrKit.isBlank(urlParaSeparator) || urlParaSeparator.contains("/")) { throw new IllegalArgumentException("urlParaSepartor can not be blank and can not contains \"/\""); } this.urlParaSeparator = urlParaSeparator; }
[ "public", "void", "setUrlParaSeparator", "(", "String", "urlParaSeparator", ")", "{", "if", "(", "StrKit", ".", "isBlank", "(", "urlParaSeparator", ")", "||", "urlParaSeparator", ".", "contains", "(", "\"/\"", ")", ")", "{", "throw", "new", "IllegalArgumentExcep...
Set urlPara separator. The default value is "-" @param urlParaSeparator the urlPara separator
[ "Set", "urlPara", "separator", ".", "The", "default", "value", "is", "-" ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/config/Constants.java#L228-L233
31,202
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model._getAttrNames
public String[] _getAttrNames() { Set<String> attrNameSet = attrs.keySet(); return attrNameSet.toArray(new String[attrNameSet.size()]); }
java
public String[] _getAttrNames() { Set<String> attrNameSet = attrs.keySet(); return attrNameSet.toArray(new String[attrNameSet.size()]); }
[ "public", "String", "[", "]", "_getAttrNames", "(", ")", "{", "Set", "<", "String", ">", "attrNameSet", "=", "attrs", ".", "keySet", "(", ")", ";", "return", "attrNameSet", ".", "toArray", "(", "new", "String", "[", "attrNameSet", ".", "size", "(", ")"...
Return attribute names of this model.
[ "Return", "attribute", "names", "of", "this", "model", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L125-L128
31,203
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model._getAttrValues
public Object[] _getAttrValues() { java.util.Collection<Object> attrValueCollection = attrs.values(); return attrValueCollection.toArray(new Object[attrValueCollection.size()]); }
java
public Object[] _getAttrValues() { java.util.Collection<Object> attrValueCollection = attrs.values(); return attrValueCollection.toArray(new Object[attrValueCollection.size()]); }
[ "public", "Object", "[", "]", "_getAttrValues", "(", ")", "{", "java", ".", "util", ".", "Collection", "<", "Object", ">", "attrValueCollection", "=", "attrs", ".", "values", "(", ")", ";", "return", "attrValueCollection", ".", "toArray", "(", "new", "Obje...
Return attribute values of this model.
[ "Return", "attribute", "values", "of", "this", "model", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L133-L136
31,204
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model._setAttrs
public M _setAttrs(Map<String, Object> attrs) { for (Entry<String, Object> e : attrs.entrySet()) set(e.getKey(), e.getValue()); return (M)this; } /* private Set<String> getModifyFlag() { if (modifyFlag == null) modifyFlag = getConfig().containerFactory.getModifyFlagSet(); // new HashSet<String...
java
public M _setAttrs(Map<String, Object> attrs) { for (Entry<String, Object> e : attrs.entrySet()) set(e.getKey(), e.getValue()); return (M)this; } /* private Set<String> getModifyFlag() { if (modifyFlag == null) modifyFlag = getConfig().containerFactory.getModifyFlagSet(); // new HashSet<String...
[ "public", "M", "_setAttrs", "(", "Map", "<", "String", ",", "Object", ">", "attrs", ")", "{", "for", "(", "Entry", "<", "String", ",", "Object", ">", "e", ":", "attrs", ".", "entrySet", "(", ")", ")", "set", "(", "e", ".", "getKey", "(", ")", "...
Set attributes with Map. @param attrs attributes of this model @return this Model
[ "Set", "attributes", "with", "Map", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L152-L243
31,205
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.put
public M put(Map<String, Object> map) { attrs.putAll(map); return (M)this; }
java
public M put(Map<String, Object> map) { attrs.putAll(map); return (M)this; }
[ "public", "M", "put", "(", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "attrs", ".", "putAll", "(", "map", ")", ";", "return", "(", "M", ")", "this", ";", "}" ]
Put map to the model without check attribute name.
[ "Put", "map", "to", "the", "model", "without", "check", "attribute", "name", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L273-L276
31,206
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.get
public <T> T get(String attr, Object defaultValue) { Object result = attrs.get(attr); return (T)(result != null ? result : defaultValue); }
java
public <T> T get(String attr, Object defaultValue) { Object result = attrs.get(attr); return (T)(result != null ? result : defaultValue); }
[ "public", "<", "T", ">", "T", "get", "(", "String", "attr", ",", "Object", "defaultValue", ")", "{", "Object", "result", "=", "attrs", ".", "get", "(", "attr", ")", ";", "return", "(", "T", ")", "(", "result", "!=", "null", "?", "result", ":", "d...
Get attribute of any mysql type. Returns defaultValue if null.
[ "Get", "attribute", "of", "any", "mysql", "type", ".", "Returns", "defaultValue", "if", "null", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L311-L314
31,207
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.save
public boolean save() { filter(FILTER_BY_SAVE); Config config = _getConfig(); Table table = _getTable(); StringBuilder sql = new StringBuilder(); List<Object> paras = new ArrayList<Object>(); config.dialect.forModelSave(table, attrs, sql, paras); // if (paras.size() == 0) return false; // T...
java
public boolean save() { filter(FILTER_BY_SAVE); Config config = _getConfig(); Table table = _getTable(); StringBuilder sql = new StringBuilder(); List<Object> paras = new ArrayList<Object>(); config.dialect.forModelSave(table, attrs, sql, paras); // if (paras.size() == 0) return false; // T...
[ "public", "boolean", "save", "(", ")", "{", "filter", "(", "FILTER_BY_SAVE", ")", ";", "Config", "config", "=", "_getConfig", "(", ")", ";", "Table", "table", "=", "_getTable", "(", ")", ";", "StringBuilder", "sql", "=", "new", "StringBuilder", "(", ")",...
Save model.
[ "Save", "model", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L534-L566
31,208
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.deleteByIds
public boolean deleteByIds(Object... idValues) { Table table = _getTable(); if (idValues == null || idValues.length != table.getPrimaryKey().length) throw new IllegalArgumentException("Primary key nubmer must equals id value number and can not be null"); return deleteById(table, idValues); }
java
public boolean deleteByIds(Object... idValues) { Table table = _getTable(); if (idValues == null || idValues.length != table.getPrimaryKey().length) throw new IllegalArgumentException("Primary key nubmer must equals id value number and can not be null"); return deleteById(table, idValues); }
[ "public", "boolean", "deleteByIds", "(", "Object", "...", "idValues", ")", "{", "Table", "table", "=", "_getTable", "(", ")", ";", "if", "(", "idValues", "==", "null", "||", "idValues", ".", "length", "!=", "table", ".", "getPrimaryKey", "(", ")", ".", ...
Delete model by composite id values. @param idValues the composite id values of the model @return true if delete succeed otherwise false
[ "Delete", "model", "by", "composite", "id", "values", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L606-L612
31,209
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.update
public boolean update() { filter(FILTER_BY_UPDATE); if (_getModifyFlag().isEmpty()) { return false; } Table table = _getTable(); String[] pKeys = table.getPrimaryKey(); for (String pKey : pKeys) { Object id = attrs.get(pKey); if (id == null) throw new ActiveRecordException("Yo...
java
public boolean update() { filter(FILTER_BY_UPDATE); if (_getModifyFlag().isEmpty()) { return false; } Table table = _getTable(); String[] pKeys = table.getPrimaryKey(); for (String pKey : pKeys) { Object id = attrs.get(pKey); if (id == null) throw new ActiveRecordException("Yo...
[ "public", "boolean", "update", "(", ")", "{", "filter", "(", "FILTER_BY_UPDATE", ")", ";", "if", "(", "_getModifyFlag", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "Table", "table", "=", "_getTable", "(", ")", ";", "Str...
Update model.
[ "Update", "model", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L631-L670
31,210
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.remove
public M remove(String attr) { attrs.remove(attr); _getModifyFlag().remove(attr); return (M)this; }
java
public M remove(String attr) { attrs.remove(attr); _getModifyFlag().remove(attr); return (M)this; }
[ "public", "M", "remove", "(", "String", "attr", ")", "{", "attrs", ".", "remove", "(", "attr", ")", ";", "_getModifyFlag", "(", ")", ".", "remove", "(", "attr", ")", ";", "return", "(", "M", ")", "this", ";", "}" ]
Remove attribute of this model. @param attr the attribute name of the model @return this model
[ "Remove", "attribute", "of", "this", "model", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L800-L804
31,211
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.remove
public M remove(String... attrs) { if (attrs != null) for (String a : attrs) { this.attrs.remove(a); this._getModifyFlag().remove(a); } return (M)this; }
java
public M remove(String... attrs) { if (attrs != null) for (String a : attrs) { this.attrs.remove(a); this._getModifyFlag().remove(a); } return (M)this; }
[ "public", "M", "remove", "(", "String", "...", "attrs", ")", "{", "if", "(", "attrs", "!=", "null", ")", "for", "(", "String", "a", ":", "attrs", ")", "{", "this", ".", "attrs", ".", "remove", "(", "a", ")", ";", "this", ".", "_getModifyFlag", "(...
Remove attributes of this model. @param attrs the attribute names of the model @return this model
[ "Remove", "attributes", "of", "this", "model", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L811-L818
31,212
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.removeNullValueAttrs
public M removeNullValueAttrs() { for (Iterator<Entry<String, Object>> it = attrs.entrySet().iterator(); it.hasNext();) { Entry<String, Object> e = it.next(); if (e.getValue() == null) { it.remove(); _getModifyFlag().remove(e.getKey()); } } return (M)this; }
java
public M removeNullValueAttrs() { for (Iterator<Entry<String, Object>> it = attrs.entrySet().iterator(); it.hasNext();) { Entry<String, Object> e = it.next(); if (e.getValue() == null) { it.remove(); _getModifyFlag().remove(e.getKey()); } } return (M)this; }
[ "public", "M", "removeNullValueAttrs", "(", ")", "{", "for", "(", "Iterator", "<", "Entry", "<", "String", ",", "Object", ">", ">", "it", "=", "attrs", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ...
Remove attributes if it is null. @return this model
[ "Remove", "attributes", "if", "it", "is", "null", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L824-L833
31,213
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.keep
public M keep(String... attrs) { if (attrs != null && attrs.length > 0) { Config config = _getConfig(); if (config == null) { // 支持无数据库连接场景 config = DbKit.brokenConfig; } Map<String, Object> newAttrs = config.containerFactory.getAttrsMap(); // new HashMap<String, Object>(attrs.length); Set<S...
java
public M keep(String... attrs) { if (attrs != null && attrs.length > 0) { Config config = _getConfig(); if (config == null) { // 支持无数据库连接场景 config = DbKit.brokenConfig; } Map<String, Object> newAttrs = config.containerFactory.getAttrsMap(); // new HashMap<String, Object>(attrs.length); Set<S...
[ "public", "M", "keep", "(", "String", "...", "attrs", ")", "{", "if", "(", "attrs", "!=", "null", "&&", "attrs", ".", "length", ">", "0", ")", "{", "Config", "config", "=", "_getConfig", "(", ")", ";", "if", "(", "config", "==", "null", ")", "{",...
Keep attributes of this model and remove other attributes. @param attrs the attribute names of the model @return this model
[ "Keep", "attributes", "of", "this", "model", "and", "remove", "other", "attributes", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L840-L862
31,214
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.keep
public M keep(String attr) { if (attrs.containsKey(attr)) { // prevent put null value to the newColumns Object keepIt = attrs.get(attr); boolean keepFlag = _getModifyFlag().contains(attr); attrs.clear(); _getModifyFlag().clear(); attrs.put(attr, keepIt); if (keepFlag) _getModifyFlag().ad...
java
public M keep(String attr) { if (attrs.containsKey(attr)) { // prevent put null value to the newColumns Object keepIt = attrs.get(attr); boolean keepFlag = _getModifyFlag().contains(attr); attrs.clear(); _getModifyFlag().clear(); attrs.put(attr, keepIt); if (keepFlag) _getModifyFlag().ad...
[ "public", "M", "keep", "(", "String", "attr", ")", "{", "if", "(", "attrs", ".", "containsKey", "(", "attr", ")", ")", "{", "// prevent put null value to the newColumns\r", "Object", "keepIt", "=", "attrs", ".", "get", "(", "attr", ")", ";", "boolean", "ke...
Keep attribute of this model and remove other attributes. @param attr the attribute name of the model @return this model
[ "Keep", "attribute", "of", "this", "model", "and", "remove", "other", "attributes", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L869-L884
31,215
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.findByCache
public List<M> findByCache(String cacheName, Object key, String sql, Object... paras) { Config config = _getConfig(); ICache cache = config.getCache(); List<M> result = cache.get(cacheName, key); if (result == null) { result = find(config, sql, paras); cache.put(cacheName, key, result); } retu...
java
public List<M> findByCache(String cacheName, Object key, String sql, Object... paras) { Config config = _getConfig(); ICache cache = config.getCache(); List<M> result = cache.get(cacheName, key); if (result == null) { result = find(config, sql, paras); cache.put(cacheName, key, result); } retu...
[ "public", "List", "<", "M", ">", "findByCache", "(", "String", "cacheName", ",", "Object", "key", ",", "String", "sql", ",", "Object", "...", "paras", ")", "{", "Config", "config", "=", "_getConfig", "(", ")", ";", "ICache", "cache", "=", "config", "."...
Find model by cache. @see #find(String, Object...) @param cacheName the cache name @param key the key used to get data from cache @return the list of Model
[ "Find", "model", "by", "cache", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L941-L950
31,216
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Model.java
Model.findFirstByCache
public M findFirstByCache(String cacheName, Object key, String sql, Object... paras) { ICache cache = _getConfig().getCache(); M result = cache.get(cacheName, key); if (result == null) { result = findFirst(sql, paras); cache.put(cacheName, key, result); } return result; }
java
public M findFirstByCache(String cacheName, Object key, String sql, Object... paras) { ICache cache = _getConfig().getCache(); M result = cache.get(cacheName, key); if (result == null) { result = findFirst(sql, paras); cache.put(cacheName, key, result); } return result; }
[ "public", "M", "findFirstByCache", "(", "String", "cacheName", ",", "Object", "key", ",", "String", "sql", ",", "Object", "...", "paras", ")", "{", "ICache", "cache", "=", "_getConfig", "(", ")", ".", "getCache", "(", ")", ";", "M", "result", "=", "cac...
Find first model by cache. I recommend add "limit 1" in your sql. @see #findFirst(String, Object...) @param cacheName the cache name @param key the key used to get data from cache @param sql an SQL statement that may contain one or more '?' IN parameter placeholders @param paras the parameters of sql
[ "Find", "first", "model", "by", "cache", ".", "I", "recommend", "add", "limit", "1", "in", "your", "sql", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L967-L975
31,217
jfinal/jfinal
src/main/java/com/jfinal/i18n/I18n.java
I18n.use
public static Res use(String baseName, String locale) { String resKey = baseName + locale; Res res = resMap.get(resKey); if (res == null) { res = new Res(baseName, locale); resMap.put(resKey, res); } return res; }
java
public static Res use(String baseName, String locale) { String resKey = baseName + locale; Res res = resMap.get(resKey); if (res == null) { res = new Res(baseName, locale); resMap.put(resKey, res); } return res; }
[ "public", "static", "Res", "use", "(", "String", "baseName", ",", "String", "locale", ")", "{", "String", "resKey", "=", "baseName", "+", "locale", ";", "Res", "res", "=", "resMap", ".", "get", "(", "resKey", ")", ";", "if", "(", "res", "==", "null",...
Using the base name and locale to get the Res object, which is used to get i18n message value from the resource file. @param baseName the base name to load Resource bundle @param locale the locale string like this: "zh_CN" "en_US" @return the Res object to get i18n message value
[ "Using", "the", "base", "name", "and", "locale", "to", "get", "the", "Res", "object", "which", "is", "used", "to", "get", "i18n", "message", "value", "from", "the", "resource", "file", "." ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/i18n/I18n.java#L69-L77
31,218
jfinal/jfinal
src/main/java/com/jfinal/kit/HashKit.java
HashKit.generateSalt
public static String generateSalt(int saltLength) { StringBuilder salt = new StringBuilder(saltLength); for (int i=0; i<saltLength; i++) { salt.append(CHAR_ARRAY[random.nextInt(CHAR_ARRAY.length)]); } return salt.toString(); }
java
public static String generateSalt(int saltLength) { StringBuilder salt = new StringBuilder(saltLength); for (int i=0; i<saltLength; i++) { salt.append(CHAR_ARRAY[random.nextInt(CHAR_ARRAY.length)]); } return salt.toString(); }
[ "public", "static", "String", "generateSalt", "(", "int", "saltLength", ")", "{", "StringBuilder", "salt", "=", "new", "StringBuilder", "(", "saltLength", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "saltLength", ";", "i", "++", ")", "{"...
md5 128bit 16bytes sha1 160bit 20bytes sha256 256bit 32bytes sha384 384bit 48bytes sha512 512bit 64bytes
[ "md5", "128bit", "16bytes", "sha1", "160bit", "20bytes", "sha256", "256bit", "32bytes", "sha384", "384bit", "48bytes", "sha512", "512bit", "64bytes" ]
fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/kit/HashKit.java#L86-L92
31,219
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.startAutoCycle
public void startAutoCycle(long delay,long duration,boolean autoRecover){ if(mCycleTimer != null) mCycleTimer.cancel(); if(mCycleTask != null) mCycleTask.cancel(); if(mResumingTask != null) mResumingTask.cancel(); if(mResumingTimer != null) mResumingTimer.cancel(); mSliderDuratio...
java
public void startAutoCycle(long delay,long duration,boolean autoRecover){ if(mCycleTimer != null) mCycleTimer.cancel(); if(mCycleTask != null) mCycleTask.cancel(); if(mResumingTask != null) mResumingTask.cancel(); if(mResumingTimer != null) mResumingTimer.cancel(); mSliderDuratio...
[ "public", "void", "startAutoCycle", "(", "long", "delay", ",", "long", "duration", ",", "boolean", "autoRecover", ")", "{", "if", "(", "mCycleTimer", "!=", "null", ")", "mCycleTimer", ".", "cancel", "(", ")", ";", "if", "(", "mCycleTask", "!=", "null", "...
start auto cycle. @param delay delay time @param duration animation duration time. @param autoRecover if recover after user touches the slider.
[ "start", "auto", "cycle", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L258-L275
31,220
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.pauseAutoCycle
private void pauseAutoCycle(){ if(mCycling){ mCycleTimer.cancel(); mCycleTask.cancel(); mCycling = false; }else{ if(mResumingTimer != null && mResumingTask != null){ recoverCycle(); } } }
java
private void pauseAutoCycle(){ if(mCycling){ mCycleTimer.cancel(); mCycleTask.cancel(); mCycling = false; }else{ if(mResumingTimer != null && mResumingTask != null){ recoverCycle(); } } }
[ "private", "void", "pauseAutoCycle", "(", ")", "{", "if", "(", "mCycling", ")", "{", "mCycleTimer", ".", "cancel", "(", ")", ";", "mCycleTask", ".", "cancel", "(", ")", ";", "mCycling", "=", "false", ";", "}", "else", "{", "if", "(", "mResumingTimer", ...
pause auto cycle.
[ "pause", "auto", "cycle", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L280-L290
31,221
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.stopAutoCycle
public void stopAutoCycle(){ if(mCycleTask!=null){ mCycleTask.cancel(); } if(mCycleTimer!= null){ mCycleTimer.cancel(); } if(mResumingTimer!= null){ mResumingTimer.cancel(); } if(mResumingTask!=null){ mResumingTask.c...
java
public void stopAutoCycle(){ if(mCycleTask!=null){ mCycleTask.cancel(); } if(mCycleTimer!= null){ mCycleTimer.cancel(); } if(mResumingTimer!= null){ mResumingTimer.cancel(); } if(mResumingTask!=null){ mResumingTask.c...
[ "public", "void", "stopAutoCycle", "(", ")", "{", "if", "(", "mCycleTask", "!=", "null", ")", "{", "mCycleTask", ".", "cancel", "(", ")", ";", "}", "if", "(", "mCycleTimer", "!=", "null", ")", "{", "mCycleTimer", ".", "cancel", "(", ")", ";", "}", ...
stop the auto circle
[ "stop", "the", "auto", "circle" ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L308-L323
31,222
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.recoverCycle
private void recoverCycle(){ if(!mAutoRecover || !mAutoCycle){ return; } if(!mCycling){ if(mResumingTask != null && mResumingTimer!= null){ mResumingTimer.cancel(); mResumingTask.cancel(); } mResumingTimer = new Tim...
java
private void recoverCycle(){ if(!mAutoRecover || !mAutoCycle){ return; } if(!mCycling){ if(mResumingTask != null && mResumingTimer!= null){ mResumingTimer.cancel(); mResumingTask.cancel(); } mResumingTimer = new Tim...
[ "private", "void", "recoverCycle", "(", ")", "{", "if", "(", "!", "mAutoRecover", "||", "!", "mAutoCycle", ")", "{", "return", ";", "}", "if", "(", "!", "mCycling", ")", "{", "if", "(", "mResumingTask", "!=", "null", "&&", "mResumingTimer", "!=", "null...
when paused cycle, this method can weak it up.
[ "when", "paused", "cycle", "this", "method", "can", "weak", "it", "up", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L328-L347
31,223
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.setPagerTransformer
public void setPagerTransformer(boolean reverseDrawingOrder,BaseTransformer transformer){ mViewPagerTransformer = transformer; mViewPagerTransformer.setCustomAnimationInterface(mCustomAnimation); mViewPager.setPageTransformer(reverseDrawingOrder,mViewPagerTransformer); }
java
public void setPagerTransformer(boolean reverseDrawingOrder,BaseTransformer transformer){ mViewPagerTransformer = transformer; mViewPagerTransformer.setCustomAnimationInterface(mCustomAnimation); mViewPager.setPageTransformer(reverseDrawingOrder,mViewPagerTransformer); }
[ "public", "void", "setPagerTransformer", "(", "boolean", "reverseDrawingOrder", ",", "BaseTransformer", "transformer", ")", "{", "mViewPagerTransformer", "=", "transformer", ";", "mViewPagerTransformer", ".", "setCustomAnimationInterface", "(", "mCustomAnimation", ")", ";",...
set ViewPager transformer. @param reverseDrawingOrder @param transformer
[ "set", "ViewPager", "transformer", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L367-L371
31,224
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.setSliderTransformDuration
public void setSliderTransformDuration(int period,Interpolator interpolator){ try{ Field mScroller = ViewPagerEx.class.getDeclaredField("mScroller"); mScroller.setAccessible(true); FixedSpeedScroller scroller = new FixedSpeedScroller(mViewPager.getContext(),interpolator, peri...
java
public void setSliderTransformDuration(int period,Interpolator interpolator){ try{ Field mScroller = ViewPagerEx.class.getDeclaredField("mScroller"); mScroller.setAccessible(true); FixedSpeedScroller scroller = new FixedSpeedScroller(mViewPager.getContext(),interpolator, peri...
[ "public", "void", "setSliderTransformDuration", "(", "int", "period", ",", "Interpolator", "interpolator", ")", "{", "try", "{", "Field", "mScroller", "=", "ViewPagerEx", ".", "class", ".", "getDeclaredField", "(", "\"mScroller\"", ")", ";", "mScroller", ".", "s...
set the duration between two slider changes. @param period @param interpolator
[ "set", "the", "duration", "between", "two", "slider", "changes", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L380-L389
31,225
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.setPresetTransformer
public void setPresetTransformer(int transformerId){ for(Transformer t : Transformer.values()){ if(t.ordinal() == transformerId){ setPresetTransformer(t); break; } } }
java
public void setPresetTransformer(int transformerId){ for(Transformer t : Transformer.values()){ if(t.ordinal() == transformerId){ setPresetTransformer(t); break; } } }
[ "public", "void", "setPresetTransformer", "(", "int", "transformerId", ")", "{", "for", "(", "Transformer", "t", ":", "Transformer", ".", "values", "(", ")", ")", "{", "if", "(", "t", ".", "ordinal", "(", ")", "==", "transformerId", ")", "{", "setPresetT...
set a preset viewpager transformer by id. @param transformerId
[ "set", "a", "preset", "viewpager", "transformer", "by", "id", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L430-L437
31,226
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.setPresetTransformer
public void setPresetTransformer(String transformerName){ for(Transformer t : Transformer.values()){ if(t.equals(transformerName)){ setPresetTransformer(t); return; } } }
java
public void setPresetTransformer(String transformerName){ for(Transformer t : Transformer.values()){ if(t.equals(transformerName)){ setPresetTransformer(t); return; } } }
[ "public", "void", "setPresetTransformer", "(", "String", "transformerName", ")", "{", "for", "(", "Transformer", "t", ":", "Transformer", ".", "values", "(", ")", ")", "{", "if", "(", "t", ".", "equals", "(", "transformerName", ")", ")", "{", "setPresetTra...
set preset PagerTransformer via the name of transforemer. @param transformerName
[ "set", "preset", "PagerTransformer", "via", "the", "name", "of", "transforemer", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L443-L450
31,227
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.getCurrentSlider
public BaseSliderView getCurrentSlider(){ if(getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); int count = getRealAdapter().getCount(); int realCount = mViewPager.getCurrentItem() % count; return getRealAdapter().getSliderView(r...
java
public BaseSliderView getCurrentSlider(){ if(getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); int count = getRealAdapter().getCount(); int realCount = mViewPager.getCurrentItem() % count; return getRealAdapter().getSliderView(r...
[ "public", "BaseSliderView", "getCurrentSlider", "(", ")", "{", "if", "(", "getRealAdapter", "(", ")", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"You did not set a slider adapter\"", ")", ";", "int", "count", "=", "getRealAdapter", "(", ")"...
get current slider. @return
[ "get", "current", "slider", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L621-L629
31,228
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.setCurrentPosition
public void setCurrentPosition(int position, boolean smooth) { if (getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); if(position >= getRealAdapter().getCount()){ throw new IllegalStateException("Item position is not exist"); } ...
java
public void setCurrentPosition(int position, boolean smooth) { if (getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); if(position >= getRealAdapter().getCount()){ throw new IllegalStateException("Item position is not exist"); } ...
[ "public", "void", "setCurrentPosition", "(", "int", "position", ",", "boolean", "smooth", ")", "{", "if", "(", "getRealAdapter", "(", ")", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"You did not set a slider adapter\"", ")", ";", "if", "(...
set current slider @param position
[ "set", "current", "slider" ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L658-L667
31,229
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.movePrevPosition
public void movePrevPosition(boolean smooth) { if (getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); mViewPager.setCurrentItem(mViewPager.getCurrentItem() - 1, smooth); }
java
public void movePrevPosition(boolean smooth) { if (getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); mViewPager.setCurrentItem(mViewPager.getCurrentItem() - 1, smooth); }
[ "public", "void", "movePrevPosition", "(", "boolean", "smooth", ")", "{", "if", "(", "getRealAdapter", "(", ")", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"You did not set a slider adapter\"", ")", ";", "mViewPager", ".", "setCurrentItem", ...
move to prev slide.
[ "move", "to", "prev", "slide", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L676-L682
31,230
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderLayout.java
SliderLayout.moveNextPosition
public void moveNextPosition(boolean smooth) { if (getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); mViewPager.setCurrentItem(mViewPager.getCurrentItem() + 1, smooth); }
java
public void moveNextPosition(boolean smooth) { if (getRealAdapter() == null) throw new IllegalStateException("You did not set a slider adapter"); mViewPager.setCurrentItem(mViewPager.getCurrentItem() + 1, smooth); }
[ "public", "void", "moveNextPosition", "(", "boolean", "smooth", ")", "{", "if", "(", "getRealAdapter", "(", ")", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"You did not set a slider adapter\"", ")", ";", "mViewPager", ".", "setCurrentItem", ...
move to next slide.
[ "move", "to", "next", "slide", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L691-L697
31,231
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java
ViewPagerEx.setOffscreenPageLimit
public void setOffscreenPageLimit(int limit) { if (limit < DEFAULT_OFFSCREEN_PAGES) { Log.w(TAG, "Requested offscreen page limit " + limit + " too small; defaulting to " + DEFAULT_OFFSCREEN_PAGES); limit = DEFAULT_OFFSCREEN_PAGES; } if (limit != mOffsc...
java
public void setOffscreenPageLimit(int limit) { if (limit < DEFAULT_OFFSCREEN_PAGES) { Log.w(TAG, "Requested offscreen page limit " + limit + " too small; defaulting to " + DEFAULT_OFFSCREEN_PAGES); limit = DEFAULT_OFFSCREEN_PAGES; } if (limit != mOffsc...
[ "public", "void", "setOffscreenPageLimit", "(", "int", "limit", ")", "{", "if", "(", "limit", "<", "DEFAULT_OFFSCREEN_PAGES", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"Requested offscreen page limit \"", "+", "limit", "+", "\" too small; defaulting to \"", "+...
Set the number of pages that should be retained to either side of the current page in the view hierarchy in an idle state. Pages beyond this limit will be recreated from the adapter when needed. <p>This is offered as an optimization. If you know in advance the number of pages you will need to support or have lazy-load...
[ "Set", "the", "number", "of", "pages", "that", "should", "be", "retained", "to", "either", "side", "of", "the", "current", "page", "in", "the", "view", "hierarchy", "in", "an", "idle", "state", ".", "Pages", "beyond", "this", "limit", "will", "be", "recr...
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java#L703-L713
31,232
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java
ViewPagerEx.setPageMarginDrawable
public void setPageMarginDrawable(Drawable d) { mMarginDrawable = d; if (d != null) refreshDrawableState(); setWillNotDraw(d == null); invalidate(); }
java
public void setPageMarginDrawable(Drawable d) { mMarginDrawable = d; if (d != null) refreshDrawableState(); setWillNotDraw(d == null); invalidate(); }
[ "public", "void", "setPageMarginDrawable", "(", "Drawable", "d", ")", "{", "mMarginDrawable", "=", "d", ";", "if", "(", "d", "!=", "null", ")", "refreshDrawableState", "(", ")", ";", "setWillNotDraw", "(", "d", "==", "null", ")", ";", "invalidate", "(", ...
Set a drawable that will be used to fill the margin between pages. @param d Drawable to display between pages
[ "Set", "a", "drawable", "that", "will", "be", "used", "to", "fill", "the", "margin", "between", "pages", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java#L747-L752
31,233
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java
ViewPagerEx.addTouchables
@Override public void addTouchables(ArrayList<View> views) { // Note that we don't call super.addTouchables(), which means that // we don't call View.addTouchables(). This is okay because a ViewPager // is itself not touchable. for (int i = 0; i < getChildCount(); i++) { ...
java
@Override public void addTouchables(ArrayList<View> views) { // Note that we don't call super.addTouchables(), which means that // we don't call View.addTouchables(). This is okay because a ViewPager // is itself not touchable. for (int i = 0; i < getChildCount(); i++) { ...
[ "@", "Override", "public", "void", "addTouchables", "(", "ArrayList", "<", "View", ">", "views", ")", "{", "// Note that we don't call super.addTouchables(), which means that", "// we don't call View.addTouchables(). This is okay because a ViewPager", "// is itself not touchable.", ...
We only want the current page that is being shown to be touchable.
[ "We", "only", "want", "the", "current", "page", "that", "is", "being", "shown", "to", "be", "touchable", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Tricks/ViewPagerEx.java#L2686-L2700
31,234
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderAdapter.java
SliderAdapter.onEnd
@Override public void onEnd(boolean result, BaseSliderView target) { if(target.isErrorDisappear() == false || result == true){ return; } for (BaseSliderView slider: mImageContents){ if(slider.equals(target)){ removeSlider(target); break...
java
@Override public void onEnd(boolean result, BaseSliderView target) { if(target.isErrorDisappear() == false || result == true){ return; } for (BaseSliderView slider: mImageContents){ if(slider.equals(target)){ removeSlider(target); break...
[ "@", "Override", "public", "void", "onEnd", "(", "boolean", "result", ",", "BaseSliderView", "target", ")", "{", "if", "(", "target", ".", "isErrorDisappear", "(", ")", "==", "false", "||", "result", "==", "true", ")", "{", "return", ";", "}", "for", "...
When image download error, then remove. @param result @param target
[ "When", "image", "download", "error", "then", "remove", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderAdapter.java#L96-L107
31,235
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Animations/DescriptionAnimation.java
DescriptionAnimation.onPrepareNextItemShowInScreen
@Override public void onPrepareNextItemShowInScreen(View next) { View descriptionLayout = next.findViewById(R.id.description_layout); if(descriptionLayout!=null){ next.findViewById(R.id.description_layout).setVisibility(View.INVISIBLE); } }
java
@Override public void onPrepareNextItemShowInScreen(View next) { View descriptionLayout = next.findViewById(R.id.description_layout); if(descriptionLayout!=null){ next.findViewById(R.id.description_layout).setVisibility(View.INVISIBLE); } }
[ "@", "Override", "public", "void", "onPrepareNextItemShowInScreen", "(", "View", "next", ")", "{", "View", "descriptionLayout", "=", "next", ".", "findViewById", "(", "R", ".", "id", ".", "description_layout", ")", ";", "if", "(", "descriptionLayout", "!=", "n...
When next item is coming to show, let's hide the description layout. @param next
[ "When", "next", "item", "is", "coming", "to", "show", "let", "s", "hide", "the", "description", "layout", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Animations/DescriptionAnimation.java#L28-L34
31,236
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Animations/DescriptionAnimation.java
DescriptionAnimation.onNextItemAppear
@Override public void onNextItemAppear(View view) { View descriptionLayout = view.findViewById(R.id.description_layout); if(descriptionLayout!=null){ float layoutY = ViewHelper.getY(descriptionLayout); view.findViewById(R.id.description_layout).setVisibility(View.VISIBLE); ...
java
@Override public void onNextItemAppear(View view) { View descriptionLayout = view.findViewById(R.id.description_layout); if(descriptionLayout!=null){ float layoutY = ViewHelper.getY(descriptionLayout); view.findViewById(R.id.description_layout).setVisibility(View.VISIBLE); ...
[ "@", "Override", "public", "void", "onNextItemAppear", "(", "View", "view", ")", "{", "View", "descriptionLayout", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "description_layout", ")", ";", "if", "(", "descriptionLayout", "!=", "null", ")", ...
When next item show in ViewPagerEx, let's make an animation to show the description layout. @param view
[ "When", "next", "item", "show", "in", "ViewPagerEx", "let", "s", "make", "an", "animation", "to", "show", "the", "description", "layout", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Animations/DescriptionAnimation.java#L47-L60
31,237
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java
PagerIndicator.setDefaultIndicatorShape
public void setDefaultIndicatorShape(Shape shape){ if(mUserSetSelectedIndicatorResId == 0){ if(shape == Shape.Oval){ mSelectedGradientDrawable.setShape(GradientDrawable.OVAL); }else{ mSelectedGradientDrawable.setShape(GradientDrawable.RECTANGLE); ...
java
public void setDefaultIndicatorShape(Shape shape){ if(mUserSetSelectedIndicatorResId == 0){ if(shape == Shape.Oval){ mSelectedGradientDrawable.setShape(GradientDrawable.OVAL); }else{ mSelectedGradientDrawable.setShape(GradientDrawable.RECTANGLE); ...
[ "public", "void", "setDefaultIndicatorShape", "(", "Shape", "shape", ")", "{", "if", "(", "mUserSetSelectedIndicatorResId", "==", "0", ")", "{", "if", "(", "shape", "==", "Shape", ".", "Oval", ")", "{", "mSelectedGradientDrawable", ".", "setShape", "(", "Gradi...
if you are using the default indicator, this method will help you to set the shape of indicator, there are two kind of shapes you can set, oval and rect. @param shape
[ "if", "you", "are", "using", "the", "default", "indicator", "this", "method", "will", "help", "you", "to", "set", "the", "shape", "of", "indicator", "there", "are", "two", "kind", "of", "shapes", "you", "can", "set", "oval", "and", "rect", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L192-L208
31,238
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java
PagerIndicator.setIndicatorStyleResource
public void setIndicatorStyleResource(int selected, int unselected){ mUserSetSelectedIndicatorResId = selected; mUserSetUnSelectedIndicatorResId = unselected; if(selected == 0){ mSelectedDrawable = mSelectedLayerDrawable; }else{ mSelectedDrawable = mContext.getRes...
java
public void setIndicatorStyleResource(int selected, int unselected){ mUserSetSelectedIndicatorResId = selected; mUserSetUnSelectedIndicatorResId = unselected; if(selected == 0){ mSelectedDrawable = mSelectedLayerDrawable; }else{ mSelectedDrawable = mContext.getRes...
[ "public", "void", "setIndicatorStyleResource", "(", "int", "selected", ",", "int", "unselected", ")", "{", "mUserSetSelectedIndicatorResId", "=", "selected", ";", "mUserSetUnSelectedIndicatorResId", "=", "unselected", ";", "if", "(", "selected", "==", "0", ")", "{",...
Set Indicator style. @param selected page selected drawable @param unselected page unselected drawable
[ "Set", "Indicator", "style", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L216-L231
31,239
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java
PagerIndicator.setDefaultIndicatorColor
public void setDefaultIndicatorColor(int selectedColor,int unselectedColor){ if(mUserSetSelectedIndicatorResId == 0){ mSelectedGradientDrawable.setColor(selectedColor); } if(mUserSetUnSelectedIndicatorResId == 0){ mUnSelectedGradientDrawable.setColor(unselectedColor); ...
java
public void setDefaultIndicatorColor(int selectedColor,int unselectedColor){ if(mUserSetSelectedIndicatorResId == 0){ mSelectedGradientDrawable.setColor(selectedColor); } if(mUserSetUnSelectedIndicatorResId == 0){ mUnSelectedGradientDrawable.setColor(unselectedColor); ...
[ "public", "void", "setDefaultIndicatorColor", "(", "int", "selectedColor", ",", "int", "unselectedColor", ")", "{", "if", "(", "mUserSetSelectedIndicatorResId", "==", "0", ")", "{", "mSelectedGradientDrawable", ".", "setColor", "(", "selectedColor", ")", ";", "}", ...
if you are using the default indicator , this method will help you to set the selected status and the unselected status color. @param selectedColor @param unselectedColor
[ "if", "you", "are", "using", "the", "default", "indicator", "this", "method", "will", "help", "you", "to", "set", "the", "selected", "status", "and", "the", "unselected", "status", "color", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L239-L247
31,240
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java
PagerIndicator.setIndicatorVisibility
public void setIndicatorVisibility(IndicatorVisibility visibility){ if(visibility == IndicatorVisibility.Visible){ setVisibility(View.VISIBLE); }else{ setVisibility(View.INVISIBLE); } resetDrawable(); }
java
public void setIndicatorVisibility(IndicatorVisibility visibility){ if(visibility == IndicatorVisibility.Visible){ setVisibility(View.VISIBLE); }else{ setVisibility(View.INVISIBLE); } resetDrawable(); }
[ "public", "void", "setIndicatorVisibility", "(", "IndicatorVisibility", "visibility", ")", "{", "if", "(", "visibility", "==", "IndicatorVisibility", ".", "Visible", ")", "{", "setVisibility", "(", "View", ".", "VISIBLE", ")", ";", "}", "else", "{", "setVisibili...
set the visibility of indicator. @param visibility
[ "set", "the", "visibility", "of", "indicator", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L298-L305
31,241
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java
PagerIndicator.setViewPager
public void setViewPager(ViewPagerEx pager){ if(pager.getAdapter() == null){ throw new IllegalStateException("Viewpager does not have adapter instance"); } mPager = pager; mPager.addOnPageChangeListener(this); ((InfinitePagerAdapter)mPager.getAdapter()).getRealAdapter...
java
public void setViewPager(ViewPagerEx pager){ if(pager.getAdapter() == null){ throw new IllegalStateException("Viewpager does not have adapter instance"); } mPager = pager; mPager.addOnPageChangeListener(this); ((InfinitePagerAdapter)mPager.getAdapter()).getRealAdapter...
[ "public", "void", "setViewPager", "(", "ViewPagerEx", "pager", ")", "{", "if", "(", "pager", ".", "getAdapter", "(", ")", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Viewpager does not have adapter instance\"", ")", ";", "}", "mPager...
bind indicator with viewpagerEx. @param pager
[ "bind", "indicator", "with", "viewpagerEx", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L326-L333
31,242
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java
PagerIndicator.redraw
public void redraw(){ mItemCount = getShouldDrawCount(); mPreviousSelectedIndicator = null; for(View i:mIndicators){ removeView(i); } for(int i =0 ;i< mItemCount; i++){ ImageView indicator = new ImageView(mContext); indicator.setImageDrawable...
java
public void redraw(){ mItemCount = getShouldDrawCount(); mPreviousSelectedIndicator = null; for(View i:mIndicators){ removeView(i); } for(int i =0 ;i< mItemCount; i++){ ImageView indicator = new ImageView(mContext); indicator.setImageDrawable...
[ "public", "void", "redraw", "(", ")", "{", "mItemCount", "=", "getShouldDrawCount", "(", ")", ";", "mPreviousSelectedIndicator", "=", "null", ";", "for", "(", "View", "i", ":", "mIndicators", ")", "{", "removeView", "(", "i", ")", ";", "}", "for", "(", ...
redraw the indicators.
[ "redraw", "the", "indicators", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L350-L369
31,243
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java
PagerIndicator.getShouldDrawCount
private int getShouldDrawCount(){ if(mPager.getAdapter() instanceof InfinitePagerAdapter){ return ((InfinitePagerAdapter)mPager.getAdapter()).getRealCount(); }else{ return mPager.getAdapter().getCount(); } }
java
private int getShouldDrawCount(){ if(mPager.getAdapter() instanceof InfinitePagerAdapter){ return ((InfinitePagerAdapter)mPager.getAdapter()).getRealCount(); }else{ return mPager.getAdapter().getCount(); } }
[ "private", "int", "getShouldDrawCount", "(", ")", "{", "if", "(", "mPager", ".", "getAdapter", "(", ")", "instanceof", "InfinitePagerAdapter", ")", "{", "return", "(", "(", "InfinitePagerAdapter", ")", "mPager", ".", "getAdapter", "(", ")", ")", ".", "getRea...
since we used a adapter wrapper, so we can't getCount directly from wrapper. @return
[ "since", "we", "used", "a", "adapter", "wrapper", "so", "we", "can", "t", "getCount", "directly", "from", "wrapper", "." ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L375-L381
31,244
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderTypes/BaseSliderView.java
BaseSliderView.image
public BaseSliderView image(String url){ if(mFile != null || mRes != 0){ throw new IllegalStateException("Call multi image function," + "you only have permission to call it once"); } mUrl = url; return this; }
java
public BaseSliderView image(String url){ if(mFile != null || mRes != 0){ throw new IllegalStateException("Call multi image function," + "you only have permission to call it once"); } mUrl = url; return this; }
[ "public", "BaseSliderView", "image", "(", "String", "url", ")", "{", "if", "(", "mFile", "!=", "null", "||", "mRes", "!=", "0", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Call multi image function,\"", "+", "\"you only have permission to call it once...
set a url as a image that preparing to load @param url @return
[ "set", "a", "url", "as", "a", "image", "that", "preparing", "to", "load" ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderTypes/BaseSliderView.java#L110-L117
31,245
daimajia/AndroidImageSlider
library/src/main/java/com/daimajia/slider/library/SliderTypes/BaseSliderView.java
BaseSliderView.image
public BaseSliderView image(File file){ if(mUrl != null || mRes != 0){ throw new IllegalStateException("Call multi image function," + "you only have permission to call it once"); } mFile = file; return this; }
java
public BaseSliderView image(File file){ if(mUrl != null || mRes != 0){ throw new IllegalStateException("Call multi image function," + "you only have permission to call it once"); } mFile = file; return this; }
[ "public", "BaseSliderView", "image", "(", "File", "file", ")", "{", "if", "(", "mUrl", "!=", "null", "||", "mRes", "!=", "0", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Call multi image function,\"", "+", "\"you only have permission to call it once\"...
set a file as a image that will to load @param file @return
[ "set", "a", "file", "as", "a", "image", "that", "will", "to", "load" ]
e318cabdef668de985efdcc45ca304e2ac6f58b5
https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderTypes/BaseSliderView.java#L124-L131
31,246
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialUniqueIndex.java
PartialUniqueIndex.remove
public Object remove(Object key) { Object underlying = this.underlyingObjectGetter.getUnderlyingObject(key); return removeUsingUnderlying(underlying); }
java
public Object remove(Object key) { Object underlying = this.underlyingObjectGetter.getUnderlyingObject(key); return removeUsingUnderlying(underlying); }
[ "public", "Object", "remove", "(", "Object", "key", ")", "{", "Object", "underlying", "=", "this", ".", "underlyingObjectGetter", ".", "getUnderlyingObject", "(", "key", ")", ";", "return", "removeUsingUnderlying", "(", "underlying", ")", ";", "}" ]
Removes and returns the entry associated with the specified key in the HashMap. Returns null if the HashMap contains no mapping for this key.
[ "Removes", "and", "returns", "the", "entry", "associated", "with", "the", "specified", "key", "in", "the", "HashMap", ".", "Returns", "null", "if", "the", "HashMap", "contains", "no", "mapping", "for", "this", "key", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialUniqueIndex.java#L700-L704
31,247
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/util/HashUtil.java
HashUtil.hash
public static final int hash(double d, boolean isNull) { if (isNull) return NULL_HASH; long longVal = Double.doubleToLongBits(d); return (int)(longVal ^ (longVal >>> 32)); }
java
public static final int hash(double d, boolean isNull) { if (isNull) return NULL_HASH; long longVal = Double.doubleToLongBits(d); return (int)(longVal ^ (longVal >>> 32)); }
[ "public", "static", "final", "int", "hash", "(", "double", "d", ",", "boolean", "isNull", ")", "{", "if", "(", "isNull", ")", "return", "NULL_HASH", ";", "long", "longVal", "=", "Double", ".", "doubleToLongBits", "(", "d", ")", ";", "return", "(", "int...
need to mix the value, but have to keep it compatible with Double.hashcode !!
[ "need", "to", "mix", "the", "value", "but", "have", "to", "keep", "it", "compatible", "with", "Double", ".", "hashcode", "!!" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/HashUtil.java#L45-L50
31,248
goldmansachs/reladomo
reladomogen/src/main/java/com/gs/fw/common/mithra/generator/util/AutoShutdownThreadExecutor.java
AutoShutdownThreadExecutor.shutdown
public void shutdown() { while(true) { long cur = combinedState.get(); long newValue = cur | 0x8000000000000000L; if (combinedState.compareAndSet(cur, newValue)) { break; } } }
java
public void shutdown() { while(true) { long cur = combinedState.get(); long newValue = cur | 0x8000000000000000L; if (combinedState.compareAndSet(cur, newValue)) { break; } } }
[ "public", "void", "shutdown", "(", ")", "{", "while", "(", "true", ")", "{", "long", "cur", "=", "combinedState", ".", "get", "(", ")", ";", "long", "newValue", "=", "cur", "|", "0x8000000000000000", "", "L", ";", "if", "(", "combinedState", ".", "co...
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.
[ "Initiates", "an", "orderly", "shutdown", "in", "which", "previously", "submitted", "tasks", "are", "executed", "but", "no", "new", "tasks", "will", "be", "accepted", ".", "Invocation", "has", "no", "additional", "effect", "if", "already", "shut", "down", "." ...
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogen/src/main/java/com/gs/fw/common/mithra/generator/util/AutoShutdownThreadExecutor.java#L87-L99
31,249
goldmansachs/reladomo
reladomogen/src/main/java/com/gs/fw/common/mithra/generator/util/AutoShutdownThreadExecutor.java
AutoShutdownThreadExecutor.shutdownAndWaitUntilDone
public void shutdownAndWaitUntilDone() { shutdown(); while(true) { synchronized (endSignal) { try { if ((combinedState.get() & 0x7FFFFFFFFFFFFFFFL) == 0) break; endSignal.wait(100); ...
java
public void shutdownAndWaitUntilDone() { shutdown(); while(true) { synchronized (endSignal) { try { if ((combinedState.get() & 0x7FFFFFFFFFFFFFFFL) == 0) break; endSignal.wait(100); ...
[ "public", "void", "shutdownAndWaitUntilDone", "(", ")", "{", "shutdown", "(", ")", ";", "while", "(", "true", ")", "{", "synchronized", "(", "endSignal", ")", "{", "try", "{", "if", "(", "(", "combinedState", ".", "get", "(", ")", "&", "0x7FFFFFFFFFFFFFF...
Shuts down the executor and blocks until all tasks have completed execution
[ "Shuts", "down", "the", "executor", "and", "blocks", "until", "all", "tasks", "have", "completed", "execution" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogen/src/main/java/com/gs/fw/common/mithra/generator/util/AutoShutdownThreadExecutor.java#L116-L134
31,250
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/database/SyslogChecker.java
SyslogChecker.checkAndWaitForSyslogSynchronized
public synchronized void checkAndWaitForSyslogSynchronized(Object sourceAttribute, String schema, MithraDatabaseObject databaseObject) { long now = System.currentTimeMillis(); if (now > nextTimeToCheck) { this.checkAndWaitForSyslog(sourceAttribute, schema, databaseObject); ...
java
public synchronized void checkAndWaitForSyslogSynchronized(Object sourceAttribute, String schema, MithraDatabaseObject databaseObject) { long now = System.currentTimeMillis(); if (now > nextTimeToCheck) { this.checkAndWaitForSyslog(sourceAttribute, schema, databaseObject); ...
[ "public", "synchronized", "void", "checkAndWaitForSyslogSynchronized", "(", "Object", "sourceAttribute", ",", "String", "schema", ",", "MithraDatabaseObject", "databaseObject", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "if", "(...
synchronized so it does one check for all involved threads.
[ "synchronized", "so", "it", "does", "one", "check", "for", "all", "involved", "threads", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/database/SyslogChecker.java#L88-L95
31,251
goldmansachs/reladomo
reladomoxa/src/main/java/com/gs/reladomo/jms/TopicResourcesWithTransactionXid.java
TopicResourcesWithTransactionXid.initializeTransactionXidRange
private ReladomoTxIdInterface initializeTransactionXidRange(String flowId, int xidId) { ReladomoTxIdInterface transactionXid = null; MithraTransactionalList list = null; try { DeserializationClassMetaData deserializationClassMetaData = new DeserializationClassMetaDa...
java
private ReladomoTxIdInterface initializeTransactionXidRange(String flowId, int xidId) { ReladomoTxIdInterface transactionXid = null; MithraTransactionalList list = null; try { DeserializationClassMetaData deserializationClassMetaData = new DeserializationClassMetaDa...
[ "private", "ReladomoTxIdInterface", "initializeTransactionXidRange", "(", "String", "flowId", ",", "int", "xidId", ")", "{", "ReladomoTxIdInterface", "transactionXid", "=", "null", ";", "MithraTransactionalList", "list", "=", "null", ";", "try", "{", "DeserializationCla...
real records.
[ "real", "records", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomoxa/src/main/java/com/gs/reladomo/jms/TopicResourcesWithTransactionXid.java#L408-L441
31,252
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/finder/string/StringNotContainsOperation.java
StringNotContainsOperation.matchesWithoutDeleteCheck
protected boolean matchesWithoutDeleteCheck(Object o, Extractor extractor) { String s = ((StringExtractor) extractor).stringValueOf(o); return s != null && s.indexOf(this.getParameter()) < 0; }
java
protected boolean matchesWithoutDeleteCheck(Object o, Extractor extractor) { String s = ((StringExtractor) extractor).stringValueOf(o); return s != null && s.indexOf(this.getParameter()) < 0; }
[ "protected", "boolean", "matchesWithoutDeleteCheck", "(", "Object", "o", ",", "Extractor", "extractor", ")", "{", "String", "s", "=", "(", "(", "StringExtractor", ")", "extractor", ")", ".", "stringValueOf", "(", "o", ")", ";", "return", "s", "!=", "null", ...
null must not match anything, exactly as in SQL
[ "null", "must", "not", "match", "anything", "exactly", "as", "in", "SQL" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/finder/string/StringNotContainsOperation.java#L46-L50
31,253
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/notification/server/LinkedBlockingDeque.java
LinkedBlockingDeque.linkFirst
private boolean linkFirst(Node<E> node) { // assert lock.isHeldByCurrentThread(); if (count >= capacity) return false; Node<E> f = first; node.next = f; first = node; if (last == null) last = node; else f.prev = node; ...
java
private boolean linkFirst(Node<E> node) { // assert lock.isHeldByCurrentThread(); if (count >= capacity) return false; Node<E> f = first; node.next = f; first = node; if (last == null) last = node; else f.prev = node; ...
[ "private", "boolean", "linkFirst", "(", "Node", "<", "E", ">", "node", ")", "{", "// assert lock.isHeldByCurrentThread();\r", "if", "(", "count", ">=", "capacity", ")", "return", "false", ";", "Node", "<", "E", ">", "f", "=", "first", ";", "node", ".", "...
Links node as first element, or returns false if full.
[ "Links", "node", "as", "first", "element", "or", "returns", "false", "if", "full", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/notification/server/LinkedBlockingDeque.java#L203-L217
31,254
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/notification/server/LinkedBlockingDeque.java
LinkedBlockingDeque.linkLast
private boolean linkLast(Node<E> node) { // assert lock.isHeldByCurrentThread(); if (count >= capacity) return false; Node<E> l = last; node.prev = l; last = node; if (first == null) first = node; else l.next = node; ...
java
private boolean linkLast(Node<E> node) { // assert lock.isHeldByCurrentThread(); if (count >= capacity) return false; Node<E> l = last; node.prev = l; last = node; if (first == null) first = node; else l.next = node; ...
[ "private", "boolean", "linkLast", "(", "Node", "<", "E", ">", "node", ")", "{", "// assert lock.isHeldByCurrentThread();\r", "if", "(", "count", ">=", "capacity", ")", "return", "false", ";", "Node", "<", "E", ">", "l", "=", "last", ";", "node", ".", "pr...
Links node as last element, or returns false if full.
[ "Links", "node", "as", "last", "element", "or", "returns", "false", "if", "full", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/notification/server/LinkedBlockingDeque.java#L222-L236
31,255
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/notification/server/LinkedBlockingDeque.java
LinkedBlockingDeque.unlink
void unlink(Node<E> x) { // assert lock.isHeldByCurrentThread(); Node<E> p = x.prev; Node<E> n = x.next; if (p == null) { unlinkFirst(); } else if (n == null) { unlinkLast(); } else { p.next = n; n.prev = p; ...
java
void unlink(Node<E> x) { // assert lock.isHeldByCurrentThread(); Node<E> p = x.prev; Node<E> n = x.next; if (p == null) { unlinkFirst(); } else if (n == null) { unlinkLast(); } else { p.next = n; n.prev = p; ...
[ "void", "unlink", "(", "Node", "<", "E", ">", "x", ")", "{", "// assert lock.isHeldByCurrentThread();\r", "Node", "<", "E", ">", "p", "=", "x", ".", "prev", ";", "Node", "<", "E", ">", "n", "=", "x", ".", "next", ";", "if", "(", "p", "==", "null"...
Unlinks x.
[ "Unlinks", "x", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/notification/server/LinkedBlockingDeque.java#L285-L302
31,256
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java
TransactionLocalMap.getEntryAfterMiss
private Object getEntryAfterMiss(TransactionLocal key, int i, Entry e) { Entry[] tab = table; int len = tab.length; while (e != null) { if (e.key == key) return e.value; i = nextIndex(i, len); e = tab[i]; } ...
java
private Object getEntryAfterMiss(TransactionLocal key, int i, Entry e) { Entry[] tab = table; int len = tab.length; while (e != null) { if (e.key == key) return e.value; i = nextIndex(i, len); e = tab[i]; } ...
[ "private", "Object", "getEntryAfterMiss", "(", "TransactionLocal", "key", ",", "int", "i", ",", "Entry", "e", ")", "{", "Entry", "[", "]", "tab", "=", "table", ";", "int", "len", "=", "tab", ".", "length", ";", "while", "(", "e", "!=", "null", ")", ...
Version of getEntry method for use when key is not found in its direct hash slot. @param key the thread local object @param i the table index for key's hash code @param e the entry at table[i] @return the entry associated with key, or null if no such
[ "Version", "of", "getEntry", "method", "for", "use", "when", "key", "is", "not", "found", "in", "its", "direct", "hash", "slot", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java#L121-L134
31,257
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java
TransactionLocalMap.put
public void put(TransactionLocal key, Object value) { // We don't use a fast path as with get() because it is at // least as common to use set() to create new entries as // it is to replace existing ones, in which case, a fast // path would fail more often than not. ...
java
public void put(TransactionLocal key, Object value) { // We don't use a fast path as with get() because it is at // least as common to use set() to create new entries as // it is to replace existing ones, in which case, a fast // path would fail more often than not. ...
[ "public", "void", "put", "(", "TransactionLocal", "key", ",", "Object", "value", ")", "{", "// We don't use a fast path as with get() because it is at\r", "// least as common to use set() to create new entries as\r", "// it is to replace existing ones, in which case, a fast\r", "// path ...
Set the value associated with key. @param key the thread local object @param value the value to be set
[ "Set", "the", "value", "associated", "with", "key", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java#L142-L169
31,258
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java
TransactionLocalMap.remove
public void remove(TransactionLocal key) { Entry[] tab = table; int len = tab.length; int i = key.hashCode & (len - 1); for (Entry e = tab[i]; e != null; e = tab[i = nextIndex(i, len)]) { if (e.key == key) { ...
java
public void remove(TransactionLocal key) { Entry[] tab = table; int len = tab.length; int i = key.hashCode & (len - 1); for (Entry e = tab[i]; e != null; e = tab[i = nextIndex(i, len)]) { if (e.key == key) { ...
[ "public", "void", "remove", "(", "TransactionLocal", "key", ")", "{", "Entry", "[", "]", "tab", "=", "table", ";", "int", "len", "=", "tab", ".", "length", ";", "int", "i", "=", "key", ".", "hashCode", "&", "(", "len", "-", "1", ")", ";", "for", ...
Remove the entry for key. @param key to remove
[ "Remove", "the", "entry", "for", "key", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java#L175-L190
31,259
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java
TransactionLocalMap.expungeStaleEntry
private int expungeStaleEntry(int staleSlot) { Entry[] tab = table; int len = tab.length; // expunge entry at staleSlot tab[staleSlot].value = null; tab[staleSlot] = null; size--; // Rehash until we encounter null Entry e; int i; ...
java
private int expungeStaleEntry(int staleSlot) { Entry[] tab = table; int len = tab.length; // expunge entry at staleSlot tab[staleSlot].value = null; tab[staleSlot] = null; size--; // Rehash until we encounter null Entry e; int i; ...
[ "private", "int", "expungeStaleEntry", "(", "int", "staleSlot", ")", "{", "Entry", "[", "]", "tab", "=", "table", ";", "int", "len", "=", "tab", ".", "length", ";", "// expunge entry at staleSlot\r", "tab", "[", "staleSlot", "]", ".", "value", "=", "null",...
Expunge a stale entry by rehashing any possibly colliding entries lying between staleSlot and the next null slot. This also expunges any other stale entries encountered before the trailing null. See Knuth, Section 6.4 @param staleSlot index of slot known to have null key @return the index of the next null slot after...
[ "Expunge", "a", "stale", "entry", "by", "rehashing", "any", "possibly", "colliding", "entries", "lying", "between", "staleSlot", "and", "the", "next", "null", "slot", ".", "This", "also", "expunges", "any", "other", "stale", "entries", "encountered", "before", ...
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java#L203-L233
31,260
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java
TransactionLocalMap.resize
private void resize() { Entry[] oldTab = table; int oldLen = oldTab.length; int newLen = oldLen * 2; Entry[] newTab = new Entry[newLen]; int count = 0; for (int j = 0; j < oldLen; ++j) { Entry e = oldTab[j]; if (e != null) ...
java
private void resize() { Entry[] oldTab = table; int oldLen = oldTab.length; int newLen = oldLen * 2; Entry[] newTab = new Entry[newLen]; int count = 0; for (int j = 0; j < oldLen; ++j) { Entry e = oldTab[j]; if (e != null) ...
[ "private", "void", "resize", "(", ")", "{", "Entry", "[", "]", "oldTab", "=", "table", ";", "int", "oldLen", "=", "oldTab", ".", "length", ";", "int", "newLen", "=", "oldLen", "*", "2", ";", "Entry", "[", "]", "newTab", "=", "new", "Entry", "[", ...
Double the capacity of the table.
[ "Double", "the", "capacity", "of", "the", "table", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java#L250-L274
31,261
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/portal/MithraTransactionalPortal.java
MithraTransactionalPortal.applyOperationAndCheck
private List applyOperationAndCheck(Operation op, MithraTransaction tx) { boolean oldEvaluationMode = tx.zIsInOperationEvaluationMode(); List resultList = null; try { tx.zSetOperationEvaluationMode(true); if (this.isPureHome() || (!this.isOperationParti...
java
private List applyOperationAndCheck(Operation op, MithraTransaction tx) { boolean oldEvaluationMode = tx.zIsInOperationEvaluationMode(); List resultList = null; try { tx.zSetOperationEvaluationMode(true); if (this.isPureHome() || (!this.isOperationParti...
[ "private", "List", "applyOperationAndCheck", "(", "Operation", "op", ",", "MithraTransaction", "tx", ")", "{", "boolean", "oldEvaluationMode", "=", "tx", ".", "zIsInOperationEvaluationMode", "(", ")", ";", "List", "resultList", "=", "null", ";", "try", "{", "tx"...
the transaction is getting 100% correct data
[ "the", "transaction", "is", "getting", "100%", "correct", "data" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/portal/MithraTransactionalPortal.java#L257-L289
31,262
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/CacheIndexBasedFilter.java
CacheIndexBasedFilter.timestampToAsofAttributeRelationiship
private static boolean timestampToAsofAttributeRelationiship(Map.Entry<Attribute, Attribute> each) { return (each.getValue() != null && each.getValue().isAsOfAttribute()) && !each.getKey().isAsOfAttribute(); }
java
private static boolean timestampToAsofAttributeRelationiship(Map.Entry<Attribute, Attribute> each) { return (each.getValue() != null && each.getValue().isAsOfAttribute()) && !each.getKey().isAsOfAttribute(); }
[ "private", "static", "boolean", "timestampToAsofAttributeRelationiship", "(", "Map", ".", "Entry", "<", "Attribute", ",", "Attribute", ">", "each", ")", "{", "return", "(", "each", ".", "getValue", "(", ")", "!=", "null", "&&", "each", ".", "getValue", "(", ...
unsupported combination of businessDate timestamp -> businessDate asOf mapping. requires custom index
[ "unsupported", "combination", "of", "businessDate", "timestamp", "-", ">", "businessDate", "asOf", "mapping", ".", "requires", "custom", "index" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/CacheIndexBasedFilter.java#L84-L87
31,263
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/MithraBusinessException.java
MithraBusinessException.ifRetriableWaitElseThrow
public int ifRetriableWaitElseThrow(String msg, int retriesLeft, Logger logger) { if (this.isRetriable() && --retriesLeft > 0) { logger.warn(msg+ " " + this.getMessage()); if (logger.isDebugEnabled()) { logger.debug("find failed with retriab...
java
public int ifRetriableWaitElseThrow(String msg, int retriesLeft, Logger logger) { if (this.isRetriable() && --retriesLeft > 0) { logger.warn(msg+ " " + this.getMessage()); if (logger.isDebugEnabled()) { logger.debug("find failed with retriab...
[ "public", "int", "ifRetriableWaitElseThrow", "(", "String", "msg", ",", "int", "retriesLeft", ",", "Logger", "logger", ")", "{", "if", "(", "this", ".", "isRetriable", "(", ")", "&&", "--", "retriesLeft", ">", "0", ")", "{", "logger", ".", "warn", "(", ...
must not be called from within a transaction, unless the work is being done async in a non-tx thread.
[ "must", "not", "be", "called", "from", "within", "a", "transaction", "unless", "the", "work", "is", "being", "done", "async", "in", "a", "non", "-", "tx", "thread", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraBusinessException.java#L53-L67
31,264
goldmansachs/reladomo
samples/reladomo-sample-simple/src/main/java/sample/util/H2ConnectionManager.java
H2ConnectionManager.prepareTables
public void prepareTables() throws Exception { Path ddlPath = Paths.get(ClassLoader.getSystemResource("sql").toURI()); try (Connection conn = xaConnectionManager.getConnection();) { Files.walk(ddlPath, 1) .filter(path -> !Files.isDirectory(path) ...
java
public void prepareTables() throws Exception { Path ddlPath = Paths.get(ClassLoader.getSystemResource("sql").toURI()); try (Connection conn = xaConnectionManager.getConnection();) { Files.walk(ddlPath, 1) .filter(path -> !Files.isDirectory(path) ...
[ "public", "void", "prepareTables", "(", ")", "throws", "Exception", "{", "Path", "ddlPath", "=", "Paths", ".", "get", "(", "ClassLoader", ".", "getSystemResource", "(", "\"sql\"", ")", ".", "toURI", "(", ")", ")", ";", "try", "(", "Connection", "conn", "...
This is not typically done in production app.
[ "This", "is", "not", "typically", "done", "in", "production", "app", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/samples/reladomo-sample-simple/src/main/java/sample/util/H2ConnectionManager.java#L103-L124
31,265
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/list/merge/MergeOptions.java
MergeOptions.doNotUpdate
public MergeOptions<E> doNotUpdate(Attribute... attributes) { if (this.doNotUpdate == null) { this.doNotUpdate = attributes; } else { List<Attribute> all = FastList.newListWith(this.doNotUpdate); for(Attribute a: attributes) all.add(a); ...
java
public MergeOptions<E> doNotUpdate(Attribute... attributes) { if (this.doNotUpdate == null) { this.doNotUpdate = attributes; } else { List<Attribute> all = FastList.newListWith(this.doNotUpdate); for(Attribute a: attributes) all.add(a); ...
[ "public", "MergeOptions", "<", "E", ">", "doNotUpdate", "(", "Attribute", "...", "attributes", ")", "{", "if", "(", "this", ".", "doNotUpdate", "==", "null", ")", "{", "this", ".", "doNotUpdate", "=", "attributes", ";", "}", "else", "{", "List", "<", "...
Do not update these attributes @param attributes @return
[ "Do", "not", "update", "these", "attributes" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/list/merge/MergeOptions.java#L111-L125
31,266
goldmansachs/reladomo
reladomogen/src/main/java/com/gs/fw/common/mithra/generator/MithraObjectTypeWrapper.java
MithraObjectTypeWrapper.extractMithraInterfaces
private void extractMithraInterfaces(Map<String, MithraInterfaceType> mithraInterfaces, List<String> errors) { for (String mithraInterfaceType : this.getWrapped().getMithraInterfaces()) { MithraInterfaceType mithraInterfaceObject = mithraInterfaces.get(mithraInterfaceType); ...
java
private void extractMithraInterfaces(Map<String, MithraInterfaceType> mithraInterfaces, List<String> errors) { for (String mithraInterfaceType : this.getWrapped().getMithraInterfaces()) { MithraInterfaceType mithraInterfaceObject = mithraInterfaces.get(mithraInterfaceType); ...
[ "private", "void", "extractMithraInterfaces", "(", "Map", "<", "String", ",", "MithraInterfaceType", ">", "mithraInterfaces", ",", "List", "<", "String", ">", "errors", ")", "{", "for", "(", "String", "mithraInterfaceType", ":", "this", ".", "getWrapped", "(", ...
For each finder interface validate the
[ "For", "each", "finder", "interface", "validate", "the" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogen/src/main/java/com/gs/fw/common/mithra/generator/MithraObjectTypeWrapper.java#L1457-L1478
31,267
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/util/dbextractor/MithraObjectGraphExtractor.java
MithraObjectGraphExtractor.addRelationshipFilter
public void addRelationshipFilter(RelatedFinder relatedFinder, Operation filter) { Operation existing = this.filters.get(relatedFinder); this.filters.put(relatedFinder, existing == null ? filter : existing.or(filter)); }
java
public void addRelationshipFilter(RelatedFinder relatedFinder, Operation filter) { Operation existing = this.filters.get(relatedFinder); this.filters.put(relatedFinder, existing == null ? filter : existing.or(filter)); }
[ "public", "void", "addRelationshipFilter", "(", "RelatedFinder", "relatedFinder", ",", "Operation", "filter", ")", "{", "Operation", "existing", "=", "this", ".", "filters", ".", "get", "(", "relatedFinder", ")", ";", "this", ".", "filters", ".", "put", "(", ...
Add a filter to be applied to the result of a traversed relationship. @param relatedFinder - the relationship to apply the filter to @param filter - the filter to apply
[ "Add", "a", "filter", "to", "be", "applied", "to", "the", "result", "of", "a", "traversed", "relationship", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/dbextractor/MithraObjectGraphExtractor.java#L117-L121
31,268
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/util/dbextractor/MithraObjectGraphExtractor.java
MithraObjectGraphExtractor.extract
public void extract() { ExecutorService executor = Executors.newFixedThreadPool(this.extractorConfig.getThreadPoolSize()); try { Map<Pair<RelatedFinder, Object>, List<MithraDataObject>> extract = extractData(executor); writeToFiles(executor, extract); }...
java
public void extract() { ExecutorService executor = Executors.newFixedThreadPool(this.extractorConfig.getThreadPoolSize()); try { Map<Pair<RelatedFinder, Object>, List<MithraDataObject>> extract = extractData(executor); writeToFiles(executor, extract); }...
[ "public", "void", "extract", "(", ")", "{", "ExecutorService", "executor", "=", "Executors", ".", "newFixedThreadPool", "(", "this", ".", "extractorConfig", ".", "getThreadPoolSize", "(", ")", ")", ";", "try", "{", "Map", "<", "Pair", "<", "RelatedFinder", "...
Extract data and related data from the root operations added and write extracted data to text files as defined by OutputStrategy. @see com.gs.fw.common.mithra.util.dbextractor.OutputStrategy
[ "Extract", "data", "and", "related", "data", "from", "the", "root", "operations", "added", "and", "write", "extracted", "data", "to", "text", "files", "as", "defined", "by", "OutputStrategy", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/dbextractor/MithraObjectGraphExtractor.java#L156-L176
31,269
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/TransactionalSemiUniqueDatedIndex.java
TransactionalSemiUniqueDatedIndex.getFromSemiUnique
public Object getFromSemiUnique(Object dataHolder, List extractors) { Object result = null; TransactionLocalStorage txStorage = (TransactionLocalStorage) perTransactionStorage.get(MithraManagerProvider.getMithraManager().zGetCurrentTransactionWithNoCheck()); FullSemiUniqueDatedIndex perT...
java
public Object getFromSemiUnique(Object dataHolder, List extractors) { Object result = null; TransactionLocalStorage txStorage = (TransactionLocalStorage) perTransactionStorage.get(MithraManagerProvider.getMithraManager().zGetCurrentTransactionWithNoCheck()); FullSemiUniqueDatedIndex perT...
[ "public", "Object", "getFromSemiUnique", "(", "Object", "dataHolder", ",", "List", "extractors", ")", "{", "Object", "result", "=", "null", ";", "TransactionLocalStorage", "txStorage", "=", "(", "TransactionLocalStorage", ")", "perTransactionStorage", ".", "get", "(...
new to differentiate
[ "new", "to", "differentiate" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/TransactionalSemiUniqueDatedIndex.java#L597-L628
31,270
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/util/execute/Execute.java
Execute.execute
public int execute() throws IOException { Runtime runtime = Runtime.getRuntime(); int exitCode = -1; TerminateProcessThread terminateProcess = null; Process process = null; try { // Execute the command String[] command = (String[])...
java
public int execute() throws IOException { Runtime runtime = Runtime.getRuntime(); int exitCode = -1; TerminateProcessThread terminateProcess = null; Process process = null; try { // Execute the command String[] command = (String[])...
[ "public", "int", "execute", "(", ")", "throws", "IOException", "{", "Runtime", "runtime", "=", "Runtime", ".", "getRuntime", "(", ")", ";", "int", "exitCode", "=", "-", "1", ";", "TerminateProcessThread", "terminateProcess", "=", "null", ";", "Process", "pro...
Executes the process. @return The exit code of the process. @throws IOException if there was a I/O problem whilst executing the process.
[ "Executes", "the", "process", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/execute/Execute.java#L70-L131
31,271
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/offheap/FastUnsafeOffHeapDataStorage.java
FastUnsafeOffHeapDataStorage.scanPagesToSend
protected long scanPagesToSend(long maxClientReplicatedPageVersion, FastUnsafeOffHeapIntList pagesToSend) { long maxPageVersion = 0; boolean upgraded = false; for(int i=0;i<this.pageVersionList.size();i++) { if (pageVersionList.get(i) == 0 && !upgraded) ...
java
protected long scanPagesToSend(long maxClientReplicatedPageVersion, FastUnsafeOffHeapIntList pagesToSend) { long maxPageVersion = 0; boolean upgraded = false; for(int i=0;i<this.pageVersionList.size();i++) { if (pageVersionList.get(i) == 0 && !upgraded) ...
[ "protected", "long", "scanPagesToSend", "(", "long", "maxClientReplicatedPageVersion", ",", "FastUnsafeOffHeapIntList", "pagesToSend", ")", "{", "long", "maxPageVersion", "=", "0", ";", "boolean", "upgraded", "=", "false", ";", "for", "(", "int", "i", "=", "0", ...
Method is protected for testing purposes only
[ "Method", "is", "protected", "for", "testing", "purposes", "only" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/offheap/FastUnsafeOffHeapDataStorage.java#L1277-L1300
31,272
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/LruQueryIndex.java
LruQueryIndex.expungeStaleEntries
private synchronized void expungeStaleEntries() { if (size == 0) return; Object r; while ((r = queue.poll()) != null) { Entry e = (Entry) r; unlink(e); int h = e.hash; int i = indexFor(h, table.length); Entry pre...
java
private synchronized void expungeStaleEntries() { if (size == 0) return; Object r; while ((r = queue.poll()) != null) { Entry e = (Entry) r; unlink(e); int h = e.hash; int i = indexFor(h, table.length); Entry pre...
[ "private", "synchronized", "void", "expungeStaleEntries", "(", ")", "{", "if", "(", "size", "==", "0", ")", "return", ";", "Object", "r", ";", "while", "(", "(", "r", "=", "queue", ".", "poll", "(", ")", ")", "!=", "null", ")", "{", "Entry", "e", ...
Expunge stale entries from the table.
[ "Expunge", "stale", "entries", "from", "the", "table", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/LruQueryIndex.java#L126-L156
31,273
goldmansachs/reladomo
reladomogenutil/src/main/java/com/gs/fw/common/mithra/generator/objectxmlgenerator/ForeignKey.java
ForeignKey.getReverseRelationshipName
public String getReverseRelationshipName() { String ret = ""; if (tableAB == null) { if (multipleRelationsBetweenTables) // foreignKey will be non-null since it applies only to one-to-X relation { ret = concatenateColumnNames(this); ...
java
public String getReverseRelationshipName() { String ret = ""; if (tableAB == null) { if (multipleRelationsBetweenTables) // foreignKey will be non-null since it applies only to one-to-X relation { ret = concatenateColumnNames(this); ...
[ "public", "String", "getReverseRelationshipName", "(", ")", "{", "String", "ret", "=", "\"\"", ";", "if", "(", "tableAB", "==", "null", ")", "{", "if", "(", "multipleRelationsBetweenTables", ")", "// foreignKey will be non-null since it applies only to one-to-X relation\r...
TableA as property name in TableB
[ "TableA", "as", "property", "name", "in", "TableB" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogenutil/src/main/java/com/gs/fw/common/mithra/generator/objectxmlgenerator/ForeignKey.java#L151-L174
31,274
goldmansachs/reladomo
reladomogenutil/src/main/java/com/gs/fw/common/mithra/generator/objectxmlgenerator/ForeignKey.java
ForeignKey.getRelationshipName
public String getRelationshipName() { String ret; if (tableAB == null /* && multipleRelationsBetweenTables */) { ret = concatenateColumnNames(this); ret = ret.substring(1); // remove leading _. } else // Many-to-Many relationship { ...
java
public String getRelationshipName() { String ret; if (tableAB == null /* && multipleRelationsBetweenTables */) { ret = concatenateColumnNames(this); ret = ret.substring(1); // remove leading _. } else // Many-to-Many relationship { ...
[ "public", "String", "getRelationshipName", "(", ")", "{", "String", "ret", ";", "if", "(", "tableAB", "==", "null", "/* && multipleRelationsBetweenTables */", ")", "{", "ret", "=", "concatenateColumnNames", "(", "this", ")", ";", "ret", "=", "ret", ".", "subst...
TableB as property name in TableA
[ "TableB", "as", "property", "name", "in", "TableA" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogenutil/src/main/java/com/gs/fw/common/mithra/generator/objectxmlgenerator/ForeignKey.java#L177-L195
31,275
goldmansachs/reladomo
reladomogenutil/src/main/java/com/gs/fw/common/mithra/generator/objectxmlgenerator/ForeignKey.java
ForeignKey.getTableAMultiplicity
public String getTableAMultiplicity() { String ret = "many"; List<ColumnInfo> tableAPKs = tableA.getPkList(); if (tableAPKs.size() == 0 || tableA.getTableName().equals(tableB.getTableName())) { return ret; } if (tableAB == null) { ...
java
public String getTableAMultiplicity() { String ret = "many"; List<ColumnInfo> tableAPKs = tableA.getPkList(); if (tableAPKs.size() == 0 || tableA.getTableName().equals(tableB.getTableName())) { return ret; } if (tableAB == null) { ...
[ "public", "String", "getTableAMultiplicity", "(", ")", "{", "String", "ret", "=", "\"many\"", ";", "List", "<", "ColumnInfo", ">", "tableAPKs", "=", "tableA", ".", "getPkList", "(", ")", ";", "if", "(", "tableAPKs", ".", "size", "(", ")", "==", "0", "|...
Otherwise, it is a 1-1 relationship.
[ "Otherwise", "it", "is", "a", "1", "-", "1", "relationship", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogenutil/src/main/java/com/gs/fw/common/mithra/generator/objectxmlgenerator/ForeignKey.java#L199-L236
31,276
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/attribute/IntegerAttribute.java
IntegerAttribute.asSet
public MutableIntSet asSet(List<T> list, MutableIntSet setToAppend) { asSet(list, this, setToAppend); return setToAppend; }
java
public MutableIntSet asSet(List<T> list, MutableIntSet setToAppend) { asSet(list, this, setToAppend); return setToAppend; }
[ "public", "MutableIntSet", "asSet", "(", "List", "<", "T", ">", "list", ",", "MutableIntSet", "setToAppend", ")", "{", "asSet", "(", "list", ",", "this", ",", "setToAppend", ")", ";", "return", "setToAppend", ";", "}" ]
extracts the int values represented by this attribute from the list and adds them to the setToAppend. If the int attribute is null, it's ignored. @param list incoming list @param setToAppend the set to append to
[ "extracts", "the", "int", "values", "represented", "by", "this", "attribute", "from", "the", "list", "and", "adds", "them", "to", "the", "setToAppend", ".", "If", "the", "int", "attribute", "is", "null", "it", "s", "ignored", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/attribute/IntegerAttribute.java#L135-L139
31,277
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java
MithraManager.executeTransactionalCommandInSeparateThread
public <R> R executeTransactionalCommandInSeparateThread(final TransactionalCommand<R> command) throws MithraBusinessException { return this.executeTransactionalCommandInSeparateThread(command, this.defaultTransactionStyle); }
java
public <R> R executeTransactionalCommandInSeparateThread(final TransactionalCommand<R> command) throws MithraBusinessException { return this.executeTransactionalCommandInSeparateThread(command, this.defaultTransactionStyle); }
[ "public", "<", "R", ">", "R", "executeTransactionalCommandInSeparateThread", "(", "final", "TransactionalCommand", "<", "R", ">", "command", ")", "throws", "MithraBusinessException", "{", "return", "this", ".", "executeTransactionalCommandInSeparateThread", "(", "command"...
Use this method very carefully. It can easily lead to a deadlock. executes the transactional command in a separate thread. Using a separate thread creates a brand new transactional context and therefore this transaction will not join the context of any outer transactions. For example, if the outer transaction rolls bac...
[ "Use", "this", "method", "very", "carefully", ".", "It", "can", "easily", "lead", "to", "a", "deadlock", ".", "executes", "the", "transactional", "command", "in", "a", "separate", "thread", ".", "Using", "a", "separate", "thread", "creates", "a", "brand", ...
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L450-L454
31,278
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java
MithraManager.executeTransactionalCommand
public <R> R executeTransactionalCommand(final TransactionalCommand<R> command, final int retryCount) throws MithraBusinessException { return this.executeTransactionalCommand(command, new TransactionStyle(this.transactionTimeout, retryCount)); }
java
public <R> R executeTransactionalCommand(final TransactionalCommand<R> command, final int retryCount) throws MithraBusinessException { return this.executeTransactionalCommand(command, new TransactionStyle(this.transactionTimeout, retryCount)); }
[ "public", "<", "R", ">", "R", "executeTransactionalCommand", "(", "final", "TransactionalCommand", "<", "R", ">", "command", ",", "final", "int", "retryCount", ")", "throws", "MithraBusinessException", "{", "return", "this", ".", "executeTransactionalCommand", "(", ...
executes the given transactional command with the custom number of retries @param command @param retryCount number of times to retry if the exception is retriable (e.g. deadlock) @throws MithraBusinessException
[ "executes", "the", "given", "transactional", "command", "with", "the", "custom", "number", "of", "retries" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L512-L516
31,279
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java
MithraManager.executeTransactionalCommand
public <R> R executeTransactionalCommand(final TransactionalCommand<R> command, final TransactionStyle style) throws MithraBusinessException { String commandName = command.getClass().getName(); MithraTransaction tx = this.getCurrentTransaction(); if (tx != null) { ...
java
public <R> R executeTransactionalCommand(final TransactionalCommand<R> command, final TransactionStyle style) throws MithraBusinessException { String commandName = command.getClass().getName(); MithraTransaction tx = this.getCurrentTransaction(); if (tx != null) { ...
[ "public", "<", "R", ">", "R", "executeTransactionalCommand", "(", "final", "TransactionalCommand", "<", "R", ">", "command", ",", "final", "TransactionStyle", "style", ")", "throws", "MithraBusinessException", "{", "String", "commandName", "=", "command", ".", "ge...
executes the given transactional command with the custom transaction style. @param command @param style @throws MithraBusinessException
[ "executes", "the", "given", "transactional", "command", "with", "the", "custom", "transaction", "style", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L524-L566
31,280
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java
MithraManager.zLazyInitObjectsWithCallback
public void zLazyInitObjectsWithCallback(MithraRuntimeType mithraRuntimeType, MithraConfigurationManager.PostInitializeHook hook) { configManager.lazyInitObjectsWithCallback(mithraRuntimeType, hook); }
java
public void zLazyInitObjectsWithCallback(MithraRuntimeType mithraRuntimeType, MithraConfigurationManager.PostInitializeHook hook) { configManager.lazyInitObjectsWithCallback(mithraRuntimeType, hook); }
[ "public", "void", "zLazyInitObjectsWithCallback", "(", "MithraRuntimeType", "mithraRuntimeType", ",", "MithraConfigurationManager", ".", "PostInitializeHook", "hook", ")", "{", "configManager", ".", "lazyInitObjectsWithCallback", "(", "mithraRuntimeType", ",", "hook", ")", ...
only used for MithraTestResource. Do not use. use readConfiguration instead. @param mithraRuntimeType @param hook
[ "only", "used", "for", "MithraTestResource", ".", "Do", "not", "use", ".", "use", "readConfiguration", "instead", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L702-L705
31,281
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/ObjectPoolWithThreadAffinity.java
ObjectPoolWithThreadAffinity.clear
public synchronized void clear() { pool.forEachUntil(new DoUntilProcedure<E>() { public boolean execute(E object) { destroyObject(object); return false; } }); pool.clear(); numActive = 0; ...
java
public synchronized void clear() { pool.forEachUntil(new DoUntilProcedure<E>() { public boolean execute(E object) { destroyObject(object); return false; } }); pool.clear(); numActive = 0; ...
[ "public", "synchronized", "void", "clear", "(", ")", "{", "pool", ".", "forEachUntil", "(", "new", "DoUntilProcedure", "<", "E", ">", "(", ")", "{", "public", "boolean", "execute", "(", "E", "object", ")", "{", "destroyObject", "(", "object", ")", ";", ...
Clears any objects sitting idle in the pool.
[ "Clears", "any", "objects", "sitting", "idle", "in", "the", "pool", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/ObjectPoolWithThreadAffinity.java#L719-L732
31,282
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/ObjectPoolWithThreadAffinity.java
ObjectPoolWithThreadAffinity.evict
public void evict() throws Exception { assertOpen(); boolean isEmpty; synchronized (this) { isEmpty = pool.isEmpty(); } if (!isEmpty) { if (softMinEvictableIdleTimeMillis > 0) { int numToEvict =...
java
public void evict() throws Exception { assertOpen(); boolean isEmpty; synchronized (this) { isEmpty = pool.isEmpty(); } if (!isEmpty) { if (softMinEvictableIdleTimeMillis > 0) { int numToEvict =...
[ "public", "void", "evict", "(", ")", "throws", "Exception", "{", "assertOpen", "(", ")", ";", "boolean", "isEmpty", ";", "synchronized", "(", "this", ")", "{", "isEmpty", "=", "pool", ".", "isEmpty", "(", ")", ";", "}", "if", "(", "!", "isEmpty", ")"...
Make one pass of the idle object evictor. @throws Exception if the pool is closed or eviction fails.
[ "Make", "one", "pass", "of", "the", "idle", "object", "evictor", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/ObjectPoolWithThreadAffinity.java#L826-L848
31,283
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/AbstractDatedCache.java
AbstractDatedCache.convertToBusinessObjectAndWrapInList
protected List convertToBusinessObjectAndWrapInList(Object o, Extractor[] extractors, Timestamp[] asOfDates, boolean weak, boolean isLocked) { if (!(o instanceof List)) { if (o == null) { return ListFactory.EMPTY_LIST; } MithraD...
java
protected List convertToBusinessObjectAndWrapInList(Object o, Extractor[] extractors, Timestamp[] asOfDates, boolean weak, boolean isLocked) { if (!(o instanceof List)) { if (o == null) { return ListFactory.EMPTY_LIST; } MithraD...
[ "protected", "List", "convertToBusinessObjectAndWrapInList", "(", "Object", "o", ",", "Extractor", "[", "]", "extractors", ",", "Timestamp", "[", "]", "asOfDates", ",", "boolean", "weak", ",", "boolean", "isLocked", ")", "{", "if", "(", "!", "(", "o", "insta...
if o is a list, we do the conversion in place
[ "if", "o", "is", "a", "list", "we", "do", "the", "conversion", "in", "place" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/AbstractDatedCache.java#L1747-L1778
31,284
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/util/TimestampPool.java
TimestampPool.getOrAddToCache
public Timestamp getOrAddToCache(Timestamp newValue, boolean hard) { if (newValue == null || newValue instanceof CachedImmutableTimestamp || newValue == NullDataTimestamp.getInstance()) { return newValue; } return (Timestamp) weakPool.getIfAbsentPut(newValue, hard);...
java
public Timestamp getOrAddToCache(Timestamp newValue, boolean hard) { if (newValue == null || newValue instanceof CachedImmutableTimestamp || newValue == NullDataTimestamp.getInstance()) { return newValue; } return (Timestamp) weakPool.getIfAbsentPut(newValue, hard);...
[ "public", "Timestamp", "getOrAddToCache", "(", "Timestamp", "newValue", ",", "boolean", "hard", ")", "{", "if", "(", "newValue", "==", "null", "||", "newValue", "instanceof", "CachedImmutableTimestamp", "||", "newValue", "==", "NullDataTimestamp", ".", "getInstance"...
return the pooled value @param newValue the value to look up in the pool and add if not there @return the pooled value
[ "return", "the", "pooled", "value" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/TimestampPool.java#L59-L66
31,285
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialPrimaryKeyIndex.java
PartialPrimaryKeyIndex.clear
public void clear() { // clear out ref queue. We don't need to expunge entries // since gc'ed entries won't get copied. emptyReferenceQueue(); for (int i = 0; i < table.length; i++) { Entry e = table[i]; Entry first = null; Entry...
java
public void clear() { // clear out ref queue. We don't need to expunge entries // since gc'ed entries won't get copied. emptyReferenceQueue(); for (int i = 0; i < table.length; i++) { Entry e = table[i]; Entry first = null; Entry...
[ "public", "void", "clear", "(", ")", "{", "// clear out ref queue. We don't need to expunge entries\r", "// since gc'ed entries won't get copied.\r", "emptyReferenceQueue", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "table", ".", "length", ";", ...
we don't actually clear anything, just make things weak and dirty
[ "we", "don", "t", "actually", "clear", "anything", "just", "make", "things", "weak", "and", "dirty" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialPrimaryKeyIndex.java#L889-L933
31,286
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/notification/MithraNotificationEventManagerImpl.java
MithraNotificationEventManagerImpl.addMithraNotificationEventForUpdate
public void addMithraNotificationEventForUpdate(String databaseIdentifier, String classname, byte databaseOperation, MithraDataObject mithraDataObject, List updateWrappers, Object sourceAttribute) { M...
java
public void addMithraNotificationEventForUpdate(String databaseIdentifier, String classname, byte databaseOperation, MithraDataObject mithraDataObject, List updateWrappers, Object sourceAttribute) { M...
[ "public", "void", "addMithraNotificationEventForUpdate", "(", "String", "databaseIdentifier", ",", "String", "classname", ",", "byte", "databaseOperation", ",", "MithraDataObject", "mithraDataObject", ",", "List", "updateWrappers", ",", "Object", "sourceAttribute", ")", "...
This is called from single insert, update or delete.
[ "This", "is", "called", "from", "single", "insert", "update", "or", "delete", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/notification/MithraNotificationEventManagerImpl.java#L360-L367
31,287
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/notification/MithraNotificationEventManagerImpl.java
MithraNotificationEventManagerImpl.getRegistrationEntryList
private RegistrationEntryList getRegistrationEntryList(String subject, RelatedFinder finder) { RegistrationEntryList registrationEntryList; RegistrationKey key = new RegistrationKey(subject, finder.getFinderClassName()); if (logger.isDebugEnabled()) { logger.debug("...
java
private RegistrationEntryList getRegistrationEntryList(String subject, RelatedFinder finder) { RegistrationEntryList registrationEntryList; RegistrationKey key = new RegistrationKey(subject, finder.getFinderClassName()); if (logger.isDebugEnabled()) { logger.debug("...
[ "private", "RegistrationEntryList", "getRegistrationEntryList", "(", "String", "subject", ",", "RelatedFinder", "finder", ")", "{", "RegistrationEntryList", "registrationEntryList", ";", "RegistrationKey", "key", "=", "new", "RegistrationKey", "(", "subject", ",", "finder...
Must only be called from the thread which is used for registration
[ "Must", "only", "be", "called", "from", "the", "thread", "which", "is", "used", "for", "registration" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/notification/MithraNotificationEventManagerImpl.java#L486-L501
31,288
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/MithraPoolableConnectionFactory.java
MithraPoolableConnectionFactory.makeObject
@Override public Connection makeObject(ObjectPoolWithThreadAffinity<Connection> pool) throws Exception { Connection conn = connectionFactory.createConnection(); return new PooledConnection(conn, pool, this.statementsToPool); }
java
@Override public Connection makeObject(ObjectPoolWithThreadAffinity<Connection> pool) throws Exception { Connection conn = connectionFactory.createConnection(); return new PooledConnection(conn, pool, this.statementsToPool); }
[ "@", "Override", "public", "Connection", "makeObject", "(", "ObjectPoolWithThreadAffinity", "<", "Connection", ">", "pool", ")", "throws", "Exception", "{", "Connection", "conn", "=", "connectionFactory", ".", "createConnection", "(", ")", ";", "return", "new", "P...
overriding to remove synchronized. We never mutate any state that affects this method
[ "overriding", "to", "remove", "synchronized", ".", "We", "never", "mutate", "any", "state", "that", "affects", "this", "method" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/MithraPoolableConnectionFactory.java#L41-L46
31,289
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java
AbstractConnectionManager.initialisePool
public void initialisePool() { Properties loginProperties = createLoginProperties(); if (logger.isDebugEnabled()) { logger.debug("about to create pool with user-id : " + this.getJdbcUser()); } ConnectionFactory connectionFactory = createConnectionFactor...
java
public void initialisePool() { Properties loginProperties = createLoginProperties(); if (logger.isDebugEnabled()) { logger.debug("about to create pool with user-id : " + this.getJdbcUser()); } ConnectionFactory connectionFactory = createConnectionFactor...
[ "public", "void", "initialisePool", "(", ")", "{", "Properties", "loginProperties", "=", "createLoginProperties", "(", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"about to create pool with user-id : \""...
This method must be called after all the connection pool properties have been set.
[ "This", "method", "must", "be", "called", "after", "all", "the", "connection", "pool", "properties", "have", "been", "set", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java#L107-L136
31,290
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java
AbstractConnectionManager.setDriverClassName
public void setDriverClassName(String driver) { try { this.driver = (Driver) Class.forName(driver).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to load driver: " + driver, e); } }
java
public void setDriverClassName(String driver) { try { this.driver = (Driver) Class.forName(driver).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to load driver: " + driver, e); } }
[ "public", "void", "setDriverClassName", "(", "String", "driver", ")", "{", "try", "{", "this", ".", "driver", "=", "(", "Driver", ")", "Class", ".", "forName", "(", "driver", ")", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "Exception", "e", ...
sets the driver class name. This is used in conjunction with the JDBC connection string @param driver the driver class name, for example "com.sybase.jdbc4.jdbc.SybDriver"
[ "sets", "the", "driver", "class", "name", ".", "This", "is", "used", "in", "conjunction", "with", "the", "JDBC", "connection", "string" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java#L434-L444
31,291
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/util/SingleQueueExecutor.java
SingleQueueExecutor.setMaxRetriesBeforeRequeue
public void setMaxRetriesBeforeRequeue(int maxRetriesBeforeRequeue) { this.maxRetriesBeforeRequeue = maxRetriesBeforeRequeue; this.transactionStyle = new TransactionStyle(MithraManagerProvider.getMithraManager().getTransactionTimeout(), maxRetriesBeforeRequeue, this.retryOnTimeout); }
java
public void setMaxRetriesBeforeRequeue(int maxRetriesBeforeRequeue) { this.maxRetriesBeforeRequeue = maxRetriesBeforeRequeue; this.transactionStyle = new TransactionStyle(MithraManagerProvider.getMithraManager().getTransactionTimeout(), maxRetriesBeforeRequeue, this.retryOnTimeout); }
[ "public", "void", "setMaxRetriesBeforeRequeue", "(", "int", "maxRetriesBeforeRequeue", ")", "{", "this", ".", "maxRetriesBeforeRequeue", "=", "maxRetriesBeforeRequeue", ";", "this", ".", "transactionStyle", "=", "new", "TransactionStyle", "(", "MithraManagerProvider", "."...
default value is 3. @param maxRetriesBeforeRequeue the number of retries before the particular chunk of work is requeued at the end of the queue
[ "default", "value", "is", "3", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/SingleQueueExecutor.java#L208-L212
31,292
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/AggregateList.java
AggregateList.validateOrderByAttribute
private void validateOrderByAttribute(String attributeName) { if ((!nameToAggregateAttributeMap.containsKey(attributeName)) && (!nameToGroupByAttributeMap.containsKey(attributeName))) { throw new MithraBusinessException("Aggregate list cannot be order by attribute with name: " + a...
java
private void validateOrderByAttribute(String attributeName) { if ((!nameToAggregateAttributeMap.containsKey(attributeName)) && (!nameToGroupByAttributeMap.containsKey(attributeName))) { throw new MithraBusinessException("Aggregate list cannot be order by attribute with name: " + a...
[ "private", "void", "validateOrderByAttribute", "(", "String", "attributeName", ")", "{", "if", "(", "(", "!", "nameToAggregateAttributeMap", ".", "containsKey", "(", "attributeName", ")", ")", "&&", "(", "!", "nameToGroupByAttributeMap", ".", "containsKey", "(", "...
The attribute to group by should be either a aggregate attribute or a group by attribute. @param attributeName
[ "The", "attribute", "to", "group", "by", "should", "be", "either", "a", "aggregate", "attribute", "or", "a", "group", "by", "attribute", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/AggregateList.java#L302-L311
31,293
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/util/MithraConfigurationManager.java
MithraConfigurationManager.parseConfiguration
public MithraRuntimeType parseConfiguration(InputStream mithraFileIs) { if(mithraFileIs == null) { throw new MithraBusinessException("Could not parse Mithra configuration, because the input stream is null."); } try { MithraRuntimeUnmarshaller u...
java
public MithraRuntimeType parseConfiguration(InputStream mithraFileIs) { if(mithraFileIs == null) { throw new MithraBusinessException("Could not parse Mithra configuration, because the input stream is null."); } try { MithraRuntimeUnmarshaller u...
[ "public", "MithraRuntimeType", "parseConfiguration", "(", "InputStream", "mithraFileIs", ")", "{", "if", "(", "mithraFileIs", "==", "null", ")", "{", "throw", "new", "MithraBusinessException", "(", "\"Could not parse Mithra configuration, because the input stream is null.\"", ...
Parses the configuration file. Should only be called by MithraTestResource. Use readConfiguration to parse and initialize the configuration. @param mithraFileIs input stream containing the runtime configuration. @return the parsed configuration
[ "Parses", "the", "configuration", "file", ".", "Should", "only", "be", "called", "by", "MithraTestResource", ".", "Use", "readConfiguration", "to", "parse", "and", "initialize", "the", "configuration", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/MithraConfigurationManager.java#L1101-L1128
31,294
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialSemiUniqueDatedIndex.java
PartialSemiUniqueDatedIndex.expungeStaleEntries
private synchronized boolean expungeStaleEntries() { if (this.size == 0) return false; Object r; boolean result = false; while ( (r = queue.poll()) != null) { result = true; SingleEntry e = (SingleEntry)r; this.size -= e.cleanupPkT...
java
private synchronized boolean expungeStaleEntries() { if (this.size == 0) return false; Object r; boolean result = false; while ( (r = queue.poll()) != null) { result = true; SingleEntry e = (SingleEntry)r; this.size -= e.cleanupPkT...
[ "private", "synchronized", "boolean", "expungeStaleEntries", "(", ")", "{", "if", "(", "this", ".", "size", "==", "0", ")", "return", "false", ";", "Object", "r", ";", "boolean", "result", "=", "false", ";", "while", "(", "(", "r", "=", "queue", ".", ...
Expunge stale entries from the nonDatedTable.
[ "Expunge", "stale", "entries", "from", "the", "nonDatedTable", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialSemiUniqueDatedIndex.java#L295-L308
31,295
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialSemiUniqueDatedIndex.java
PartialSemiUniqueDatedIndex.resizeSemiUnique
private void resizeSemiUnique(int newCapacity) { SemiUniqueEntry[] oldTable = getNonDatedTable(); int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { semiUniqueThreshold = Integer.MAX_VALUE; return; } SemiUniqueEntry[] n...
java
private void resizeSemiUnique(int newCapacity) { SemiUniqueEntry[] oldTable = getNonDatedTable(); int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { semiUniqueThreshold = Integer.MAX_VALUE; return; } SemiUniqueEntry[] n...
[ "private", "void", "resizeSemiUnique", "(", "int", "newCapacity", ")", "{", "SemiUniqueEntry", "[", "]", "oldTable", "=", "getNonDatedTable", "(", ")", ";", "int", "oldCapacity", "=", "oldTable", ".", "length", ";", "if", "(", "oldCapacity", "==", "MAXIMUM_CAP...
Rehashes the contents of this map into a new array with a larger capacity. This method is called automatically when the number of keys in this map reaches its semiUniqueThreshold. If current capacity is MAXIMUM_CAPACITY, this method does not resize the map, but but sets semiUniqueThreshold to Integer.MAX_VALUE. This ...
[ "Rehashes", "the", "contents", "of", "this", "map", "into", "a", "new", "array", "with", "a", "larger", "capacity", ".", "This", "method", "is", "called", "automatically", "when", "the", "number", "of", "keys", "in", "this", "map", "reaches", "its", "semiU...
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/PartialSemiUniqueDatedIndex.java#L1045-L1070
31,296
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/ConcurrentFullUniqueIndex.java
ConcurrentFullUniqueIndex.resize
private void resize(Object[] oldTable, int newSize) { int oldCapacity = oldTable.length; int end = oldCapacity - 1; Object last = arrayAt(oldTable, end); if (this.size() < ((end*3) >> 2) && last == RESIZE_SENTINEL) { return; } if (oldCapac...
java
private void resize(Object[] oldTable, int newSize) { int oldCapacity = oldTable.length; int end = oldCapacity - 1; Object last = arrayAt(oldTable, end); if (this.size() < ((end*3) >> 2) && last == RESIZE_SENTINEL) { return; } if (oldCapac...
[ "private", "void", "resize", "(", "Object", "[", "]", "oldTable", ",", "int", "newSize", ")", "{", "int", "oldCapacity", "=", "oldTable", ".", "length", ";", "int", "end", "=", "oldCapacity", "-", "1", ";", "Object", "last", "=", "arrayAt", "(", "oldTa...
newSize must be a power of 2 + 1
[ "newSize", "must", "be", "a", "power", "of", "2", "+", "1" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/ConcurrentFullUniqueIndex.java#L472-L518
31,297
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/ConcurrentFullUniqueIndex.java
ConcurrentFullUniqueIndex.forAllInParallel
public void forAllInParallel(final ParallelProcedure procedure) { MithraCpuBoundThreadPool pool = MithraCpuBoundThreadPool.getInstance(); final Object[] set = this.table; ThreadChunkSize threadChunkSize = new ThreadChunkSize(pool.getThreads(), set.length - 2, 1); final ArrayBase...
java
public void forAllInParallel(final ParallelProcedure procedure) { MithraCpuBoundThreadPool pool = MithraCpuBoundThreadPool.getInstance(); final Object[] set = this.table; ThreadChunkSize threadChunkSize = new ThreadChunkSize(pool.getThreads(), set.length - 2, 1); final ArrayBase...
[ "public", "void", "forAllInParallel", "(", "final", "ParallelProcedure", "procedure", ")", "{", "MithraCpuBoundThreadPool", "pool", "=", "MithraCpuBoundThreadPool", ".", "getInstance", "(", ")", ";", "final", "Object", "[", "]", "set", "=", "this", ".", "table", ...
does not allow concurrent iteration with additions to the index
[ "does", "not", "allow", "concurrent", "iteration", "with", "additions", "to", "the", "index" ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/ConcurrentFullUniqueIndex.java#L839-L873
31,298
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/DependentLoadingTaskSpawner.java
DependentLoadingTaskSpawner.createDependentKeyIndex
public DependentKeyIndex createDependentKeyIndex(CacheLoaderEngine cacheLoaderEngine, Extractor[] keyExtractors, Operation ownerObjectFilter) { DependentKeyIndex dependentKeyIndex = null; for (DependentKeyIndex each : this.dependentKeyIndexes) { if (Arrays.equals(each.getK...
java
public DependentKeyIndex createDependentKeyIndex(CacheLoaderEngine cacheLoaderEngine, Extractor[] keyExtractors, Operation ownerObjectFilter) { DependentKeyIndex dependentKeyIndex = null; for (DependentKeyIndex each : this.dependentKeyIndexes) { if (Arrays.equals(each.getK...
[ "public", "DependentKeyIndex", "createDependentKeyIndex", "(", "CacheLoaderEngine", "cacheLoaderEngine", ",", "Extractor", "[", "]", "keyExtractors", ",", "Operation", "ownerObjectFilter", ")", "{", "DependentKeyIndex", "dependentKeyIndex", "=", "null", ";", "for", "(", ...
executed from a single thread during the cacheloader startup.
[ "executed", "from", "a", "single", "thread", "during", "the", "cacheloader", "startup", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/DependentLoadingTaskSpawner.java#L163-L194
31,299
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/finder/DeepFetchNode.java
DeepFetchNode.createMappedOperationForDeepFetch
public Operation createMappedOperationForDeepFetch(Mapper mapper) { Operation rootOperation = this.getRootOperation(); if (rootOperation == null) return null; return mapper.createMappedOperationForDeepFetch(rootOperation); }
java
public Operation createMappedOperationForDeepFetch(Mapper mapper) { Operation rootOperation = this.getRootOperation(); if (rootOperation == null) return null; return mapper.createMappedOperationForDeepFetch(rootOperation); }
[ "public", "Operation", "createMappedOperationForDeepFetch", "(", "Mapper", "mapper", ")", "{", "Operation", "rootOperation", "=", "this", ".", "getRootOperation", "(", ")", ";", "if", "(", "rootOperation", "==", "null", ")", "return", "null", ";", "return", "map...
mapper is not necessarily this.relatedFinder.mapper. chained mapper and linked mapper's callbacks.
[ "mapper", "is", "not", "necessarily", "this", ".", "relatedFinder", ".", "mapper", ".", "chained", "mapper", "and", "linked", "mapper", "s", "callbacks", "." ]
e9a069452eece7a6ef9551caf81a69d3d9a3d990
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/finder/DeepFetchNode.java#L876-L881