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
39,300
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.allParametersHaveDefaults
public static boolean allParametersHaveDefaults(Map<String, QueryParameter> map) { for (QueryParameter qp : map.values()) { if ((qp.getDefaultValues() == null) || (qp.getDefaultValues().size() == 0)) { if ((qp.getDefaultSource() == null) || "".equals(qp.getDefaultSource().trim())) { ...
java
public static boolean allParametersHaveDefaults(Map<String, QueryParameter> map) { for (QueryParameter qp : map.values()) { if ((qp.getDefaultValues() == null) || (qp.getDefaultValues().size() == 0)) { if ((qp.getDefaultSource() == null) || "".equals(qp.getDefaultSource().trim())) { ...
[ "public", "static", "boolean", "allParametersHaveDefaults", "(", "Map", "<", "String", ",", "QueryParameter", ">", "map", ")", "{", "for", "(", "QueryParameter", "qp", ":", "map", ".", "values", "(", ")", ")", "{", "if", "(", "(", "qp", ".", "getDefaultV...
See if all parameters have default values @param map map of parameters @return true if all parameters have default values
[ "See", "if", "all", "parameters", "have", "default", "values" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L816-L825
39,301
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.initAllRuntimeParameterValues
public static void initAllRuntimeParameterValues(QueryParameter param, List<IdName> values, Map<String, Object> parameterValues) throws QueryException { if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) { parameterValues.put(param.ge...
java
public static void initAllRuntimeParameterValues(QueryParameter param, List<IdName> values, Map<String, Object> parameterValues) throws QueryException { if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) { parameterValues.put(param.ge...
[ "public", "static", "void", "initAllRuntimeParameterValues", "(", "QueryParameter", "param", ",", "List", "<", "IdName", ">", "values", ",", "Map", "<", "String", ",", "Object", ">", "parameterValues", ")", "throws", "QueryException", "{", "if", "(", "param", ...
Init parameter values map with all the values @param param parameter @param values all parameter values @param parameterValues map of parameter values @throws QueryException if could not get parameter values
[ "Init", "parameter", "values", "map", "with", "all", "the", "values" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L835-L847
39,302
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.initDefaultParameterValues
public static void initDefaultParameterValues(QueryParameter param, List<Serializable> defValues, Map<String, Object> parameterValues) throws QueryException { if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) { parameterValues.put(pa...
java
public static void initDefaultParameterValues(QueryParameter param, List<Serializable> defValues, Map<String, Object> parameterValues) throws QueryException { if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) { parameterValues.put(pa...
[ "public", "static", "void", "initDefaultParameterValues", "(", "QueryParameter", "param", ",", "List", "<", "Serializable", ">", "defValues", ",", "Map", "<", "String", ",", "Object", ">", "parameterValues", ")", "throws", "QueryException", "{", "if", "(", "para...
Init parameter values map with the default values @param param parameter @param defValues default values @param parameterValues map of parameter values @throws QueryException if could not get default parameter values
[ "Init", "parameter", "values", "map", "with", "the", "default", "values" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L857-L869
39,303
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.initStaticDefaultParameterValues
public static void initStaticDefaultParameterValues(QueryParameter param, Map<String, Object> parameterValues) throws QueryException { List<Serializable> defValues; if ((param.getDefaultValues() != null) && (param.getDefaultValues().size() > 0)) { ...
java
public static void initStaticDefaultParameterValues(QueryParameter param, Map<String, Object> parameterValues) throws QueryException { List<Serializable> defValues; if ((param.getDefaultValues() != null) && (param.getDefaultValues().size() > 0)) { ...
[ "public", "static", "void", "initStaticDefaultParameterValues", "(", "QueryParameter", "param", ",", "Map", "<", "String", ",", "Object", ">", "parameterValues", ")", "throws", "QueryException", "{", "List", "<", "Serializable", ">", "defValues", ";", "if", "(", ...
Init parameter values map with the static default values of a parameter @param param parameter @param parameterValues map of parameter values @throws QueryException if could not get default parameter values
[ "Init", "parameter", "values", "map", "with", "the", "static", "default", "values", "of", "a", "parameter" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L900-L911
39,304
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.initAllRuntimeParameterValues
public static void initAllRuntimeParameterValues(Connection conn, QueryParameter param, Map<String,QueryParameter> map, Map<String, Object> parameterValues) throws QueryException { List<IdName> allValues = new ArrayList<IdName>(); if ((param.getSou...
java
public static void initAllRuntimeParameterValues(Connection conn, QueryParameter param, Map<String,QueryParameter> map, Map<String, Object> parameterValues) throws QueryException { List<IdName> allValues = new ArrayList<IdName>(); if ((param.getSou...
[ "public", "static", "void", "initAllRuntimeParameterValues", "(", "Connection", "conn", ",", "QueryParameter", "param", ",", "Map", "<", "String", ",", "QueryParameter", ">", "map", ",", "Map", "<", "String", ",", "Object", ">", "parameterValues", ")", "throws",...
Init parameter values map with all the values from select source of a parameter at runtime @param conn database connection @param param parameter @param map report map of parameters @param parameterValues map of parameter values @throws QueryException if could not get parameter values
[ "Init", "parameter", "values", "map", "with", "all", "the", "values", "from", "select", "source", "of", "a", "parameter", "at", "runtime" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L945-L957
39,305
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.initStaticNotHiddenDefaultParameterValues
public static void initStaticNotHiddenDefaultParameterValues(Report report, Map<String, Object> parameterValues) throws QueryException { Map<String, QueryParameter> params = getUsedParametersMap(report); for (QueryParameter qp : params.values())...
java
public static void initStaticNotHiddenDefaultParameterValues(Report report, Map<String, Object> parameterValues) throws QueryException { Map<String, QueryParameter> params = getUsedParametersMap(report); for (QueryParameter qp : params.values())...
[ "public", "static", "void", "initStaticNotHiddenDefaultParameterValues", "(", "Report", "report", ",", "Map", "<", "String", ",", "Object", ">", "parameterValues", ")", "throws", "QueryException", "{", "Map", "<", "String", ",", "QueryParameter", ">", "params", "=...
Init parameter values map with the static default values for all not-hidden parameters of a report @param report report @param parameterValues map of parameter values @throws QueryException if could not get default parameter values
[ "Init", "parameter", "values", "map", "with", "the", "static", "default", "values", "for", "all", "not", "-", "hidden", "parameters", "of", "a", "report" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L989-L997
39,306
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.toMap
public static Map<String, QueryParameter> toMap(List<QueryParameter> parameters) { Map<String, QueryParameter> map = new HashMap<String, QueryParameter>(); for (QueryParameter qp : parameters) { map.put(qp.getName(), qp); } return map; }
java
public static Map<String, QueryParameter> toMap(List<QueryParameter> parameters) { Map<String, QueryParameter> map = new HashMap<String, QueryParameter>(); for (QueryParameter qp : parameters) { map.put(qp.getName(), qp); } return map; }
[ "public", "static", "Map", "<", "String", ",", "QueryParameter", ">", "toMap", "(", "List", "<", "QueryParameter", ">", "parameters", ")", "{", "Map", "<", "String", ",", "QueryParameter", ">", "map", "=", "new", "HashMap", "<", "String", ",", "QueryParame...
Convert a list of QueryParameter object to a map where the key is the parameter name and the value is the parameter @param parameters list of parameters @return map of parameters
[ "Convert", "a", "list", "of", "QueryParameter", "object", "to", "a", "map", "where", "the", "key", "is", "the", "parameter", "name", "and", "the", "value", "is", "the", "parameter" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1040-L1046
39,307
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.getParameterValueFromStringWithPattern
public static Object getParameterValueFromStringWithPattern(String parameterClass, String value, String pattern) throws Exception { if (pattern == null) { return getParameterValueFromString(parameterClass, value); } else { if (QueryParameter.DATE_VALUE.equals(parameterClass) || QueryParameter.TIME...
java
public static Object getParameterValueFromStringWithPattern(String parameterClass, String value, String pattern) throws Exception { if (pattern == null) { return getParameterValueFromString(parameterClass, value); } else { if (QueryParameter.DATE_VALUE.equals(parameterClass) || QueryParameter.TIME...
[ "public", "static", "Object", "getParameterValueFromStringWithPattern", "(", "String", "parameterClass", ",", "String", "value", ",", "String", "pattern", ")", "throws", "Exception", "{", "if", "(", "pattern", "==", "null", ")", "{", "return", "getParameterValueFrom...
Get parameter value from a string represenation using a pattern @param parameterClass parameter class @param value string value representation @param pattern value pattern @return parameter value from string representation using pattern @throws Exception if string value cannot be parse
[ "Get", "parameter", "value", "from", "a", "string", "represenation", "using", "a", "pattern" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1067-L1081
39,308
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ParameterUtil.java
ParameterUtil.intersectParametersMap
public static Map<String, QueryParameter> intersectParametersMap(List<Report> reports) { Map<String, QueryParameter> map = new LinkedHashMap<String, QueryParameter>(); if ((reports == null) || (reports.size() == 0)) { return map; } if (reports.size() == 1) { return getUsedParametersMap(r...
java
public static Map<String, QueryParameter> intersectParametersMap(List<Report> reports) { Map<String, QueryParameter> map = new LinkedHashMap<String, QueryParameter>(); if ((reports == null) || (reports.size() == 0)) { return map; } if (reports.size() == 1) { return getUsedParametersMap(r...
[ "public", "static", "Map", "<", "String", ",", "QueryParameter", ">", "intersectParametersMap", "(", "List", "<", "Report", ">", "reports", ")", "{", "Map", "<", "String", ",", "QueryParameter", ">", "map", "=", "new", "LinkedHashMap", "<", "String", ",", ...
Get a map with all the identical parameters for a list of reports @param reports list of reports @return a map with all the identical parameters for a list of reports see QueryParameter.compare(Object o)
[ "Get", "a", "map", "with", "all", "the", "identical", "parameters", "for", "a", "list", "of", "reports" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1158-L1178
39,309
samskivert/samskivert
src/main/java/com/samskivert/swing/CollapsibleList.java
CollapsibleList.addSection
public int addSection (String label, ListModel model) { add(new JLabel(label)); add(new JList(model)); return getSectionCount()-1; }
java
public int addSection (String label, ListModel model) { add(new JLabel(label)); add(new JList(model)); return getSectionCount()-1; }
[ "public", "int", "addSection", "(", "String", "label", ",", "ListModel", "model", ")", "{", "add", "(", "new", "JLabel", "(", "label", ")", ")", ";", "add", "(", "new", "JList", "(", "model", ")", ")", ";", "return", "getSectionCount", "(", ")", "-",...
Adds a section to this collapsible list. @param label the title of the section. @param model the list model to use for the new section. @return the index of the newly added section.
[ "Adds", "a", "section", "to", "this", "collapsible", "list", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsibleList.java#L64-L69
39,310
samskivert/samskivert
src/main/java/com/samskivert/swing/CollapsibleList.java
CollapsibleList.getSectionList
public JList getSectionList (int index) { @SuppressWarnings("unchecked") JList list = (JList)getComponent(index*2+1); return list; }
java
public JList getSectionList (int index) { @SuppressWarnings("unchecked") JList list = (JList)getComponent(index*2+1); return list; }
[ "public", "JList", "getSectionList", "(", "int", "index", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "JList", "list", "=", "(", "JList", ")", "getComponent", "(", "index", "*", "2", "+", "1", ")", ";", "return", "list", ";", "}" ]
Returns the list object associated with the specified section.
[ "Returns", "the", "list", "object", "associated", "with", "the", "specified", "section", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsibleList.java#L83-L87
39,311
samskivert/samskivert
src/main/java/com/samskivert/swing/CollapsibleList.java
CollapsibleList.toggleCollapsed
public void toggleCollapsed (int index) { JList list = getSectionList(index); list.setVisible(!list.isVisible()); }
java
public void toggleCollapsed (int index) { JList list = getSectionList(index); list.setVisible(!list.isVisible()); }
[ "public", "void", "toggleCollapsed", "(", "int", "index", ")", "{", "JList", "list", "=", "getSectionList", "(", "index", ")", ";", "list", ".", "setVisible", "(", "!", "list", ".", "isVisible", "(", ")", ")", ";", "}" ]
Toggles the collapsed state of the specified section.
[ "Toggles", "the", "collapsed", "state", "of", "the", "specified", "section", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsibleList.java#L92-L96
39,312
samskivert/samskivert
src/main/java/com/samskivert/util/MethodFinder.java
MethodFinder.findConstructor
public Constructor<?> findConstructor (Class<?>[] parameterTypes) throws NoSuchMethodException { // make sure the constructor list is loaded maybeLoadConstructors(); if (parameterTypes == null) { parameterTypes = new Class<?>[0]; } return (Constructor<?>...
java
public Constructor<?> findConstructor (Class<?>[] parameterTypes) throws NoSuchMethodException { // make sure the constructor list is loaded maybeLoadConstructors(); if (parameterTypes == null) { parameterTypes = new Class<?>[0]; } return (Constructor<?>...
[ "public", "Constructor", "<", "?", ">", "findConstructor", "(", "Class", "<", "?", ">", "[", "]", "parameterTypes", ")", "throws", "NoSuchMethodException", "{", "// make sure the constructor list is loaded", "maybeLoadConstructors", "(", ")", ";", "if", "(", "parame...
Returns the most specific public constructor in my target class that accepts the number and type of parameters in the given Class array in a reflective invocation. <p> A null value or Void.TYPE parameterTypes matches a corresponding Object or array reference in a constructor's formal parameter list, but not a primitiv...
[ "Returns", "the", "most", "specific", "public", "constructor", "in", "my", "target", "class", "that", "accepts", "the", "number", "and", "type", "of", "parameters", "in", "the", "given", "Class", "array", "in", "a", "reflective", "invocation", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L80-L91
39,313
samskivert/samskivert
src/main/java/com/samskivert/util/MethodFinder.java
MethodFinder.findMethod
public Method findMethod (String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException { // make sure the constructor list is loaded maybeLoadMethods(); List<Member> methodList = _methodMap.get(methodName); if (methodList == null) { throw new NoSuch...
java
public Method findMethod (String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException { // make sure the constructor list is loaded maybeLoadMethods(); List<Member> methodList = _methodMap.get(methodName); if (methodList == null) { throw new NoSuch...
[ "public", "Method", "findMethod", "(", "String", "methodName", ",", "Class", "<", "?", ">", "[", "]", "parameterTypes", ")", "throws", "NoSuchMethodException", "{", "// make sure the constructor list is loaded", "maybeLoadMethods", "(", ")", ";", "List", "<", "Membe...
Returns the most specific public method in my target class that has the given name and accepts the number and type of parameters in the given Class array in a reflective invocation. <p> A null value or Void.TYPE in parameterTypes will match a corresponding Object or array reference in a method's formal parameter list,...
[ "Returns", "the", "most", "specific", "public", "method", "in", "my", "target", "class", "that", "has", "the", "given", "name", "and", "accepts", "the", "number", "and", "type", "of", "parameters", "in", "the", "given", "Class", "array", "in", "a", "reflec...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L110-L127
39,314
samskivert/samskivert
src/main/java/com/samskivert/util/MethodFinder.java
MethodFinder.maybeLoadConstructors
protected void maybeLoadConstructors () { if (_ctorList == null) { _ctorList = new ArrayList<Member>(); Constructor<?>[] ctors = _clazz.getConstructors(); for (int i = 0; i < ctors.length; ++i) { _ctorList.add(ctors[i]); _paramMap.put(ctors...
java
protected void maybeLoadConstructors () { if (_ctorList == null) { _ctorList = new ArrayList<Member>(); Constructor<?>[] ctors = _clazz.getConstructors(); for (int i = 0; i < ctors.length; ++i) { _ctorList.add(ctors[i]); _paramMap.put(ctors...
[ "protected", "void", "maybeLoadConstructors", "(", ")", "{", "if", "(", "_ctorList", "==", "null", ")", "{", "_ctorList", "=", "new", "ArrayList", "<", "Member", ">", "(", ")", ";", "Constructor", "<", "?", ">", "[", "]", "ctors", "=", "_clazz", ".", ...
Loads up the data structures for my target class's constructors.
[ "Loads", "up", "the", "data", "structures", "for", "my", "target", "class", "s", "constructors", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L241-L251
39,315
samskivert/samskivert
src/main/java/com/samskivert/util/MethodFinder.java
MethodFinder.maybeLoadMethods
protected void maybeLoadMethods () { if (_methodMap == null) { _methodMap = new HashMap<String,List<Member>>(); Method[] methods = _clazz.getMethods(); for (int i = 0; i < methods.length; ++i) { Method m = methods[i]; String methodName = m...
java
protected void maybeLoadMethods () { if (_methodMap == null) { _methodMap = new HashMap<String,List<Member>>(); Method[] methods = _clazz.getMethods(); for (int i = 0; i < methods.length; ++i) { Method m = methods[i]; String methodName = m...
[ "protected", "void", "maybeLoadMethods", "(", ")", "{", "if", "(", "_methodMap", "==", "null", ")", "{", "_methodMap", "=", "new", "HashMap", "<", "String", ",", "List", "<", "Member", ">", ">", "(", ")", ";", "Method", "[", "]", "methods", "=", "_cl...
Loads up the data structures for my target class's methods.
[ "Loads", "up", "the", "data", "structures", "for", "my", "target", "class", "s", "methods", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L256-L283
39,316
samskivert/samskivert
src/main/java/com/samskivert/util/Folds.java
Folds.foldLeft
public static <A, B> B foldLeft (F<B,A> func, B zero, Iterable<? extends A> values) { for (A value : values) { zero = func.apply(zero, value); } return zero; }
java
public static <A, B> B foldLeft (F<B,A> func, B zero, Iterable<? extends A> values) { for (A value : values) { zero = func.apply(zero, value); } return zero; }
[ "public", "static", "<", "A", ",", "B", ">", "B", "foldLeft", "(", "F", "<", "B", ",", "A", ">", "func", ",", "B", "zero", ",", "Iterable", "<", "?", "extends", "A", ">", "values", ")", "{", "for", "(", "A", "value", ":", "values", ")", "{", ...
Left folds the supplied function over the supplied values using the supplied starting value.
[ "Left", "folds", "the", "supplied", "function", "over", "the", "supplied", "values", "using", "the", "supplied", "starting", "value", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L30-L36
39,317
samskivert/samskivert
src/main/java/com/samskivert/util/Folds.java
Folds.reduceLeft
public static <A> A reduceLeft (F<A,A> func, Iterable<? extends A> values) { Iterator<? extends A> iter = values.iterator(); A zero = iter.next(); while (iter.hasNext()) { zero = func.apply(zero, iter.next()); } return zero; }
java
public static <A> A reduceLeft (F<A,A> func, Iterable<? extends A> values) { Iterator<? extends A> iter = values.iterator(); A zero = iter.next(); while (iter.hasNext()) { zero = func.apply(zero, iter.next()); } return zero; }
[ "public", "static", "<", "A", ">", "A", "reduceLeft", "(", "F", "<", "A", ",", "A", ">", "func", ",", "Iterable", "<", "?", "extends", "A", ">", "values", ")", "{", "Iterator", "<", "?", "extends", "A", ">", "iter", "=", "values", ".", "iterator"...
Reduces the supplied values using the supplied function with a left fold. @exception NoSuchElementException thrown if values does not contain at least one element.
[ "Reduces", "the", "supplied", "values", "using", "the", "supplied", "function", "with", "a", "left", "fold", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L43-L51
39,318
samskivert/samskivert
src/main/java/com/samskivert/util/Folds.java
Folds.sum
public static int sum (int zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.intValue(); } return zero; }
java
public static int sum (int zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.intValue(); } return zero; }
[ "public", "static", "int", "sum", "(", "int", "zero", ",", "Iterable", "<", "?", "extends", "Number", ">", "values", ")", "{", "for", "(", "Number", "value", ":", "values", ")", "{", "zero", "+=", "value", ".", "intValue", "(", ")", ";", "}", "retu...
Sums the supplied collection of numbers to an int with a left to right fold.
[ "Sums", "the", "supplied", "collection", "of", "numbers", "to", "an", "int", "with", "a", "left", "to", "right", "fold", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L56-L62
39,319
samskivert/samskivert
src/main/java/com/samskivert/util/Folds.java
Folds.sum
public static long sum (long zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.longValue(); } return zero; }
java
public static long sum (long zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.longValue(); } return zero; }
[ "public", "static", "long", "sum", "(", "long", "zero", ",", "Iterable", "<", "?", "extends", "Number", ">", "values", ")", "{", "for", "(", "Number", "value", ":", "values", ")", "{", "zero", "+=", "value", ".", "longValue", "(", ")", ";", "}", "r...
Sums the supplied collection of numbers to a long with a left to right fold.
[ "Sums", "the", "supplied", "collection", "of", "numbers", "to", "a", "long", "with", "a", "left", "to", "right", "fold", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L67-L73
39,320
samskivert/samskivert
src/main/java/com/samskivert/util/Folds.java
Folds.sum
public static float sum (float zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.floatValue(); } return zero; }
java
public static float sum (float zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.floatValue(); } return zero; }
[ "public", "static", "float", "sum", "(", "float", "zero", ",", "Iterable", "<", "?", "extends", "Number", ">", "values", ")", "{", "for", "(", "Number", "value", ":", "values", ")", "{", "zero", "+=", "value", ".", "floatValue", "(", ")", ";", "}", ...
Sums the supplied collection of numbers to a float with a left to right fold.
[ "Sums", "the", "supplied", "collection", "of", "numbers", "to", "a", "float", "with", "a", "left", "to", "right", "fold", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L78-L84
39,321
samskivert/samskivert
src/main/java/com/samskivert/util/Folds.java
Folds.sum
public static double sum (double zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.doubleValue(); } return zero; }
java
public static double sum (double zero, Iterable<? extends Number> values) { for (Number value : values) { zero += value.doubleValue(); } return zero; }
[ "public", "static", "double", "sum", "(", "double", "zero", ",", "Iterable", "<", "?", "extends", "Number", ">", "values", ")", "{", "for", "(", "Number", "value", ":", "values", ")", "{", "zero", "+=", "value", ".", "doubleValue", "(", ")", ";", "}"...
Sums the supplied collection of numbers to a double with a left to right fold.
[ "Sums", "the", "supplied", "collection", "of", "numbers", "to", "a", "double", "with", "a", "left", "to", "right", "fold", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L89-L95
39,322
samskivert/samskivert
src/main/java/com/samskivert/util/Folds.java
Folds.sum
public static BigInteger sum (BigInteger zero, Iterable<? extends BigInteger> values) { for (BigInteger value : values) { zero = zero.add(value); } return zero; }
java
public static BigInteger sum (BigInteger zero, Iterable<? extends BigInteger> values) { for (BigInteger value : values) { zero = zero.add(value); } return zero; }
[ "public", "static", "BigInteger", "sum", "(", "BigInteger", "zero", ",", "Iterable", "<", "?", "extends", "BigInteger", ">", "values", ")", "{", "for", "(", "BigInteger", "value", ":", "values", ")", "{", "zero", "=", "zero", ".", "add", "(", "value", ...
Sums the supplied collection of numbers to a bigint with a left to right fold.
[ "Sums", "the", "supplied", "collection", "of", "numbers", "to", "a", "bigint", "with", "a", "left", "to", "right", "fold", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L100-L106
39,323
samskivert/samskivert
src/main/java/com/samskivert/velocity/StringTool.java
StringTool.truncate
public static String truncate (String text, int length, String append) { return StringUtil.truncate(text, length, append); }
java
public static String truncate (String text, int length, String append) { return StringUtil.truncate(text, length, append); }
[ "public", "static", "String", "truncate", "(", "String", "text", ",", "int", "length", ",", "String", "append", ")", "{", "return", "StringUtil", ".", "truncate", "(", "text", ",", "length", ",", "append", ")", ";", "}" ]
Truncates the supplied text at the specified length, appending the specified "elipsis" indicator to the text if truncated.
[ "Truncates", "the", "supplied", "text", "at", "the", "specified", "length", "appending", "the", "specified", "elipsis", "indicator", "to", "the", "text", "if", "truncated", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/StringTool.java#L97-L100
39,324
samskivert/samskivert
src/main/java/com/samskivert/velocity/StringTool.java
StringTool.join
public static String join (String[] values, String sep) { return StringUtil.join(values, sep); }
java
public static String join (String[] values, String sep) { return StringUtil.join(values, sep); }
[ "public", "static", "String", "join", "(", "String", "[", "]", "values", ",", "String", "sep", ")", "{", "return", "StringUtil", ".", "join", "(", "values", ",", "sep", ")", ";", "}" ]
Joins the supplied strings with the given separator.
[ "Joins", "the", "supplied", "strings", "with", "the", "given", "separator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/StringTool.java#L113-L116
39,325
samskivert/samskivert
src/main/java/com/samskivert/velocity/StringTool.java
StringTool.copyright
public static String copyright (String holder, int startYear) { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); return "&copy; " + holder + " " + startYear + "-" + year; }
java
public static String copyright (String holder, int startYear) { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); return "&copy; " + holder + " " + startYear + "-" + year; }
[ "public", "static", "String", "copyright", "(", "String", "holder", ",", "int", "startYear", ")", "{", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "int", "year", "=", "cal", ".", "get", "(", "Calendar", ".", "YEAR", ")", ";",...
Generates a copyright string for the specified copyright holder from the specified first year to the current year.
[ "Generates", "a", "copyright", "string", "for", "the", "specified", "copyright", "holder", "from", "the", "specified", "first", "year", "to", "the", "current", "year", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/StringTool.java#L122-L127
39,326
samskivert/samskivert
src/main/java/com/samskivert/swing/RadialMenuItem.java
RadialMenuItem.render
public void render (Component host, RadialMenu menu, Graphics2D gfx, int x, int y) { paint(gfx, x, y, menu); }
java
public void render (Component host, RadialMenu menu, Graphics2D gfx, int x, int y) { paint(gfx, x, y, menu); }
[ "public", "void", "render", "(", "Component", "host", ",", "RadialMenu", "menu", ",", "Graphics2D", "gfx", ",", "int", "x", ",", "int", "y", ")", "{", "paint", "(", "gfx", ",", "x", ",", "y", ",", "menu", ")", ";", "}" ]
Renders this menu item at the specified location.
[ "Renders", "this", "menu", "item", "at", "the", "specified", "location", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialMenuItem.java#L75-L78
39,327
samskivert/samskivert
src/main/java/com/samskivert/swing/util/ProximityTracker.java
ProximityTracker.addObject
public void addObject (int x, int y, Object object) { Record record = new Record(x, y, object); // if this is the very first element, we have to insert it // straight away because our binary search algorithm doesn't work // on empty arrays if (_size == 0) { _reco...
java
public void addObject (int x, int y, Object object) { Record record = new Record(x, y, object); // if this is the very first element, we have to insert it // straight away because our binary search algorithm doesn't work // on empty arrays if (_size == 0) { _reco...
[ "public", "void", "addObject", "(", "int", "x", ",", "int", "y", ",", "Object", "object", ")", "{", "Record", "record", "=", "new", "Record", "(", "x", ",", "y", ",", "object", ")", ";", "// if this is the very first element, we have to insert it", "// straigh...
Adds an object to the tracker.
[ "Adds", "an", "object", "to", "the", "tracker", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/ProximityTracker.java#L41-L73
39,328
samskivert/samskivert
src/main/java/com/samskivert/swing/util/ProximityTracker.java
ProximityTracker.distance
public static int distance (int x1, int y1, int x2, int y2) { int dx = x1-x2, dy = y1-y2; return (int)Math.sqrt(dx*dx+dy*dy); }
java
public static int distance (int x1, int y1, int x2, int y2) { int dx = x1-x2, dy = y1-y2; return (int)Math.sqrt(dx*dx+dy*dy); }
[ "public", "static", "int", "distance", "(", "int", "x1", ",", "int", "y1", ",", "int", "x2", ",", "int", "y2", ")", "{", "int", "dx", "=", "x1", "-", "x2", ",", "dy", "=", "y1", "-", "y2", ";", "return", "(", "int", ")", "Math", ".", "sqrt", ...
Computes the geometric distance between the supplied two points.
[ "Computes", "the", "geometric", "distance", "between", "the", "supplied", "two", "points", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/ProximityTracker.java#L205-L209
39,329
samskivert/samskivert
src/main/java/com/samskivert/swing/util/ProximityTracker.java
ProximityTracker.binarySearch
protected int binarySearch (int x) { // copied from java.util.Arrays which I wouldn't have to have done had the provided a // means by which to binarySearch in a subset of an array. alas. int low = 0; int high = _size-1; while (low <= high) { int mid = (low + hig...
java
protected int binarySearch (int x) { // copied from java.util.Arrays which I wouldn't have to have done had the provided a // means by which to binarySearch in a subset of an array. alas. int low = 0; int high = _size-1; while (low <= high) { int mid = (low + hig...
[ "protected", "int", "binarySearch", "(", "int", "x", ")", "{", "// copied from java.util.Arrays which I wouldn't have to have done had the provided a", "// means by which to binarySearch in a subset of an array. alas.", "int", "low", "=", "0", ";", "int", "high", "=", "_size", ...
Returns the index of a record with the specified x coordinate, or a value representing the index where such a record would be inserted while preserving the sort order of the array. Doesn't work if the records array contains zero elements.
[ "Returns", "the", "index", "of", "a", "record", "with", "the", "specified", "x", "coordinate", "or", "a", "value", "representing", "the", "index", "where", "such", "a", "record", "would", "be", "inserted", "while", "preserving", "the", "sort", "order", "of",...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/ProximityTracker.java#L217-L238
39,330
samskivert/samskivert
src/main/java/com/samskivert/text/MessageUtil.java
MessageUtil.compose
public static String compose (String key, Object... args) { StringBuilder buf = new StringBuilder(); buf.append(key); buf.append('|'); for (int i = 0; i < args.length; i++) { if (i > 0) { buf.append('|'); } // escape the string whil...
java
public static String compose (String key, Object... args) { StringBuilder buf = new StringBuilder(); buf.append(key); buf.append('|'); for (int i = 0; i < args.length; i++) { if (i > 0) { buf.append('|'); } // escape the string whil...
[ "public", "static", "String", "compose", "(", "String", "key", ",", "Object", "...", "args", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "buf", ".", "append", "(", "key", ")", ";", "buf", ".", "append", "(", "'", "'"...
Composes a message key with an array of arguments. The message can subsequently be decomposed and translated without prior knowledge of how many arguments were provided.
[ "Composes", "a", "message", "key", "with", "an", "array", "of", "arguments", ".", "The", "message", "can", "subsequently", "be", "decomposed", "and", "translated", "without", "prior", "knowledge", "of", "how", "many", "arguments", "were", "provided", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/text/MessageUtil.java#L52-L76
39,331
samskivert/samskivert
src/main/java/com/samskivert/text/MessageUtil.java
MessageUtil.unescape
public static String unescape (String value) { int bsidx = value.indexOf('\\'); if (bsidx == -1) { return value; } StringBuilder buf = new StringBuilder(); int vlength = value.length(); for (int ii = 0; ii < vlength; ii++) { char ch = value.ch...
java
public static String unescape (String value) { int bsidx = value.indexOf('\\'); if (bsidx == -1) { return value; } StringBuilder buf = new StringBuilder(); int vlength = value.length(); for (int ii = 0; ii < vlength; ii++) { char ch = value.ch...
[ "public", "static", "String", "unescape", "(", "String", "value", ")", "{", "int", "bsidx", "=", "value", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "bsidx", "==", "-", "1", ")", "{", "return", "value", ";", "}", "StringBuilder", "buf", "=...
Unescapes characters that are escaped in a call to compose.
[ "Unescapes", "characters", "that", "are", "escaped", "in", "a", "call", "to", "compose", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/text/MessageUtil.java#L102-L123
39,332
samskivert/samskivert
src/main/java/com/samskivert/text/MessageUtil.java
MessageUtil.decompose
public static String[] decompose (String compoundKey) { String[] args = compoundKey.split("\\|"); for (int ii = 0; ii < args.length; ii++) { args[ii] = unescape(args[ii]); } return args; }
java
public static String[] decompose (String compoundKey) { String[] args = compoundKey.split("\\|"); for (int ii = 0; ii < args.length; ii++) { args[ii] = unescape(args[ii]); } return args; }
[ "public", "static", "String", "[", "]", "decompose", "(", "String", "compoundKey", ")", "{", "String", "[", "]", "args", "=", "compoundKey", ".", "split", "(", "\"\\\\|\"", ")", ";", "for", "(", "int", "ii", "=", "0", ";", "ii", "<", "args", ".", "...
Decomposes a compound key into its constituent parts. Arguments that were tainted during composition will remain tainted.
[ "Decomposes", "a", "compound", "key", "into", "its", "constituent", "parts", ".", "Arguments", "that", "were", "tainted", "during", "composition", "will", "remain", "tainted", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/text/MessageUtil.java#L155-L162
39,333
samskivert/samskivert
src/main/java/com/samskivert/text/MessageUtil.java
MessageUtil.qualify
public static String qualify (String bundle, String key) { // sanity check if (bundle.indexOf(QUAL_PREFIX) != -1 || bundle.indexOf(QUAL_SEP) != -1) { String errmsg = "Message bundle may not contain '" + QUAL_PREFIX + "' or '" + QUAL_SEP + "' [bundle=" + bundle...
java
public static String qualify (String bundle, String key) { // sanity check if (bundle.indexOf(QUAL_PREFIX) != -1 || bundle.indexOf(QUAL_SEP) != -1) { String errmsg = "Message bundle may not contain '" + QUAL_PREFIX + "' or '" + QUAL_SEP + "' [bundle=" + bundle...
[ "public", "static", "String", "qualify", "(", "String", "bundle", ",", "String", "key", ")", "{", "// sanity check", "if", "(", "bundle", ".", "indexOf", "(", "QUAL_PREFIX", ")", "!=", "-", "1", "||", "bundle", ".", "indexOf", "(", "QUAL_SEP", ")", "!=",...
Returns a fully qualified message key which, when translated by some other bundle, will know to resolve and utilize the supplied bundle to translate this particular key.
[ "Returns", "a", "fully", "qualified", "message", "key", "which", "when", "translated", "by", "some", "other", "bundle", "will", "know", "to", "resolve", "and", "utilize", "the", "supplied", "bundle", "to", "translate", "this", "particular", "key", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/text/MessageUtil.java#L168-L179
39,334
samskivert/samskivert
src/main/java/com/samskivert/text/MessageUtil.java
MessageUtil.getBundle
public static String getBundle (String qualifiedKey) { if (!qualifiedKey.startsWith(QUAL_PREFIX)) { throw new IllegalArgumentException( qualifiedKey + " is not a fully qualified message key."); } int qsidx = qualifiedKey.indexOf(QUAL_SEP); if (qsidx == -1...
java
public static String getBundle (String qualifiedKey) { if (!qualifiedKey.startsWith(QUAL_PREFIX)) { throw new IllegalArgumentException( qualifiedKey + " is not a fully qualified message key."); } int qsidx = qualifiedKey.indexOf(QUAL_SEP); if (qsidx == -1...
[ "public", "static", "String", "getBundle", "(", "String", "qualifiedKey", ")", "{", "if", "(", "!", "qualifiedKey", ".", "startsWith", "(", "QUAL_PREFIX", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "qualifiedKey", "+", "\" is not a fully quali...
Returns the bundle name from a fully qualified message key. @see #qualify
[ "Returns", "the", "bundle", "name", "from", "a", "fully", "qualified", "message", "key", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/text/MessageUtil.java#L186-L200
39,335
samskivert/samskivert
src/main/java/com/samskivert/text/MessageUtil.java
MessageUtil.getUnqualifiedKey
public static String getUnqualifiedKey (String qualifiedKey) { if (!qualifiedKey.startsWith(QUAL_PREFIX)) { throw new IllegalArgumentException( qualifiedKey + " is not a fully qualified message key."); } int qsidx = qualifiedKey.indexOf(QUAL_SEP); if (qsi...
java
public static String getUnqualifiedKey (String qualifiedKey) { if (!qualifiedKey.startsWith(QUAL_PREFIX)) { throw new IllegalArgumentException( qualifiedKey + " is not a fully qualified message key."); } int qsidx = qualifiedKey.indexOf(QUAL_SEP); if (qsi...
[ "public", "static", "String", "getUnqualifiedKey", "(", "String", "qualifiedKey", ")", "{", "if", "(", "!", "qualifiedKey", ".", "startsWith", "(", "QUAL_PREFIX", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "qualifiedKey", "+", "\" is not a ful...
Returns the unqualified portion of the key from a fully qualified message key. @see #qualify
[ "Returns", "the", "unqualified", "portion", "of", "the", "key", "from", "a", "fully", "qualified", "message", "key", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/text/MessageUtil.java#L207-L221
39,336
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.createUser
public int createUser ( Username username, Password password, String realname, String email, int siteId) throws UserExistsException, PersistenceException { // create a new user object... User user = new User(); user.setDirtyMask(_utable.getFieldMask()); // ...configu...
java
public int createUser ( Username username, Password password, String realname, String email, int siteId) throws UserExistsException, PersistenceException { // create a new user object... User user = new User(); user.setDirtyMask(_utable.getFieldMask()); // ...configu...
[ "public", "int", "createUser", "(", "Username", "username", ",", "Password", "password", ",", "String", "realname", ",", "String", "email", ",", "int", "siteId", ")", "throws", "UserExistsException", ",", "PersistenceException", "{", "// create a new user object...", ...
Requests that a new user be created in the repository. @param username the username of the new user to create. @param password the password for the new user. @param realname the user's real name. @param email the user's email address. @param siteId the unique identifier of the site through which this account is being ...
[ "Requests", "that", "a", "new", "user", "be", "created", "in", "the", "repository", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L67-L79
39,337
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.loadUserBySession
public User loadUserBySession (String sessionKey) throws PersistenceException { User user = load(_utable, "sessions", "where authcode = '" + sessionKey + "' " + "AND sessions.userId = users.userId"); if (user != null) { user.setDirtyMask(_utable.getFieldM...
java
public User loadUserBySession (String sessionKey) throws PersistenceException { User user = load(_utable, "sessions", "where authcode = '" + sessionKey + "' " + "AND sessions.userId = users.userId"); if (user != null) { user.setDirtyMask(_utable.getFieldM...
[ "public", "User", "loadUserBySession", "(", "String", "sessionKey", ")", "throws", "PersistenceException", "{", "User", "user", "=", "load", "(", "_utable", ",", "\"sessions\"", ",", "\"where authcode = '\"", "+", "sessionKey", "+", "\"' \"", "+", "\"AND sessions.us...
Looks up a user by a session identifier. @return the user associated with the specified session or null of no session exists with the supplied identifier.
[ "Looks", "up", "a", "user", "by", "a", "session", "identifier", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L109-L118
39,338
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.loadUsersFromId
public HashIntMap<User> loadUsersFromId (int[] userIds) throws PersistenceException { HashIntMap<User> data = new HashIntMap<User>(); if (userIds.length > 0) { String query = "where userId in (" + genIdString(userIds) + ")"; for (User user : loadAll(_utable, query)) {...
java
public HashIntMap<User> loadUsersFromId (int[] userIds) throws PersistenceException { HashIntMap<User> data = new HashIntMap<User>(); if (userIds.length > 0) { String query = "where userId in (" + genIdString(userIds) + ")"; for (User user : loadAll(_utable, query)) {...
[ "public", "HashIntMap", "<", "User", ">", "loadUsersFromId", "(", "int", "[", "]", "userIds", ")", "throws", "PersistenceException", "{", "HashIntMap", "<", "User", ">", "data", "=", "new", "HashIntMap", "<", "User", ">", "(", ")", ";", "if", "(", "userI...
Looks up users by userid @return the users whom have a user id in the userIds array.
[ "Looks", "up", "users", "by", "userid" ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L125-L137
39,339
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.lookupUsersByEmail
public ArrayList<User> lookupUsersByEmail (String email) throws PersistenceException { return loadAll(_utable, "where email = " + JDBCUtil.escape(email)); }
java
public ArrayList<User> lookupUsersByEmail (String email) throws PersistenceException { return loadAll(_utable, "where email = " + JDBCUtil.escape(email)); }
[ "public", "ArrayList", "<", "User", ">", "lookupUsersByEmail", "(", "String", "email", ")", "throws", "PersistenceException", "{", "return", "loadAll", "(", "_utable", ",", "\"where email = \"", "+", "JDBCUtil", ".", "escape", "(", "email", ")", ")", ";", "}" ...
Lookup a user by email address, something that is not efficient and should really only be done by site admins attempting to look up a user record. @return the user with the specified user id or null if no user with that id exists.
[ "Lookup", "a", "user", "by", "email", "address", "something", "that", "is", "not", "efficient", "and", "should", "really", "only", "be", "done", "by", "site", "admins", "attempting", "to", "look", "up", "a", "user", "record", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L145-L149
39,340
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.lookupUsersWhere
public ArrayList<User> lookupUsersWhere (final String where) throws PersistenceException { ArrayList<User> users = loadAll(_utable, where); for (User user : users) { // configure the user record with its field mask user.setDirtyMask(_utable.getFieldMask()); } ...
java
public ArrayList<User> lookupUsersWhere (final String where) throws PersistenceException { ArrayList<User> users = loadAll(_utable, where); for (User user : users) { // configure the user record with its field mask user.setDirtyMask(_utable.getFieldMask()); } ...
[ "public", "ArrayList", "<", "User", ">", "lookupUsersWhere", "(", "final", "String", "where", ")", "throws", "PersistenceException", "{", "ArrayList", "<", "User", ">", "users", "=", "loadAll", "(", "_utable", ",", "where", ")", ";", "for", "(", "User", "u...
Looks up a list of users that match an arbitrary query. Care should be taken in constructing these queries as the user table is likely to be large and a query that does not make use of indices could be very slow. @return the users matching the specified query or an empty list if there are no matches.
[ "Looks", "up", "a", "list", "of", "users", "that", "match", "an", "arbitrary", "query", ".", "Care", "should", "be", "taken", "in", "constructing", "these", "queries", "as", "the", "user", "table", "is", "likely", "to", "be", "large", "and", "a", "query"...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L158-L167
39,341
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.updateUser
public boolean updateUser (final User user) throws PersistenceException { if (!user.getDirtyMask().isModified()) { // nothing doing! return false; } update(_utable, user, user.getDirtyMask()); return true; }
java
public boolean updateUser (final User user) throws PersistenceException { if (!user.getDirtyMask().isModified()) { // nothing doing! return false; } update(_utable, user, user.getDirtyMask()); return true; }
[ "public", "boolean", "updateUser", "(", "final", "User", "user", ")", "throws", "PersistenceException", "{", "if", "(", "!", "user", ".", "getDirtyMask", "(", ")", ".", "isModified", "(", ")", ")", "{", "// nothing doing!", "return", "false", ";", "}", "up...
Updates a user that was previously fetched from the repository. Only fields that have been modified since it was loaded will be written to the database and those fields will subsequently be marked clean once again. @return true if the record was updated, false if the update was skipped because no fields in the user r...
[ "Updates", "a", "user", "that", "was", "previously", "fetched", "from", "the", "repository", ".", "Only", "fields", "that", "have", "been", "modified", "since", "it", "was", "loaded", "will", "be", "written", "to", "the", "database", "and", "those", "fields"...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L177-L186
39,342
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.deleteUser
public void deleteUser (final User user) throws PersistenceException { if (user.isDeleted()) { return; } executeUpdate(new Operation<Object>() { public Object invoke (Connection conn, DatabaseLiaison liaison) throws PersistenceException, SQLEx...
java
public void deleteUser (final User user) throws PersistenceException { if (user.isDeleted()) { return; } executeUpdate(new Operation<Object>() { public Object invoke (Connection conn, DatabaseLiaison liaison) throws PersistenceException, SQLEx...
[ "public", "void", "deleteUser", "(", "final", "User", "user", ")", "throws", "PersistenceException", "{", "if", "(", "user", ".", "isDeleted", "(", ")", ")", "{", "return", ";", "}", "executeUpdate", "(", "new", "Operation", "<", "Object", ">", "(", ")",...
'Delete' the users account such that they can no longer access it, however we do not delete the record from the db. The name is changed such that the original name has XX=FOO if the name were FOO originally. If we have to lop off any of the name to get our prefix to fit we use a minus sign instead of a equals side. ...
[ "Delete", "the", "users", "account", "such", "that", "they", "can", "no", "longer", "access", "it", "however", "we", "do", "not", "delete", "the", "record", "from", "the", "db", ".", "The", "name", "is", "changed", "such", "that", "the", "original", "nam...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L200-L241
39,343
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.registerSession
public String registerSession (User user, int expireDays) throws PersistenceException { // look for an existing session for this user final String query = "select authcode from sessions where userId = " + user.userId; String authcode = execute(new Operation<String>() { pu...
java
public String registerSession (User user, int expireDays) throws PersistenceException { // look for an existing session for this user final String query = "select authcode from sessions where userId = " + user.userId; String authcode = execute(new Operation<String>() { pu...
[ "public", "String", "registerSession", "(", "User", "user", ",", "int", "expireDays", ")", "throws", "PersistenceException", "{", "// look for an existing session for this user", "final", "String", "query", "=", "\"select authcode from sessions where userId = \"", "+", "user"...
Creates a new session for the specified user and returns the randomly generated session identifier for that session. If a session entry already exists for the specified user it will be reused. @param expireDays the number of days in which the session token should expire.
[ "Creates", "a", "new", "session", "for", "the", "specified", "user", "and", "returns", "the", "randomly", "generated", "session", "identifier", "for", "that", "session", ".", "If", "a", "session", "entry", "already", "exists", "for", "the", "specified", "user"...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L250-L289
39,344
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.refreshSession
public boolean refreshSession (String sessionKey, int expireDays) throws PersistenceException { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, expireDays); Date expires = new Date(cal.getTime().getTime()); // attempt to update an existing session row, returnin...
java
public boolean refreshSession (String sessionKey, int expireDays) throws PersistenceException { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, expireDays); Date expires = new Date(cal.getTime().getTime()); // attempt to update an existing session row, returnin...
[ "public", "boolean", "refreshSession", "(", "String", "sessionKey", ",", "int", "expireDays", ")", "throws", "PersistenceException", "{", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "cal", ".", "add", "(", "Calendar", ".", "DATE", ...
Validates that the supplied session key is still valid and if so, refreshes it for the specified number of days. @return true if the session was located and refreshed, false if it no longer exists.
[ "Validates", "that", "the", "supplied", "session", "key", "is", "still", "valid", "and", "if", "so", "refreshes", "it", "for", "the", "specified", "number", "of", "days", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L297-L307
39,345
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.loadAllRealNames
public String[] loadAllRealNames () throws PersistenceException { final ArrayList<String> names = new ArrayList<String>(); // do the query execute(new Operation<Object>() { public Object invoke (Connection conn, DatabaseLiaison liaison) throws Persistence...
java
public String[] loadAllRealNames () throws PersistenceException { final ArrayList<String> names = new ArrayList<String>(); // do the query execute(new Operation<Object>() { public Object invoke (Connection conn, DatabaseLiaison liaison) throws Persistence...
[ "public", "String", "[", "]", "loadAllRealNames", "(", ")", "throws", "PersistenceException", "{", "final", "ArrayList", "<", "String", ">", "names", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "// do the query", "execute", "(", "new", "Opera...
Returns an array with the real names of every user in the system.
[ "Returns", "an", "array", "with", "the", "real", "names", "of", "every", "user", "in", "the", "system", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L341-L370
39,346
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.populateUser
protected void populateUser ( User user, Username name, Password pass, String realname, String email, int siteId) { user.username = name.getUsername(); user.setPassword(pass); user.setRealName(realname); user.setEmail(email); user.created = new Date(System.currentTime...
java
protected void populateUser ( User user, Username name, Password pass, String realname, String email, int siteId) { user.username = name.getUsername(); user.setPassword(pass); user.setRealName(realname); user.setEmail(email); user.created = new Date(System.currentTime...
[ "protected", "void", "populateUser", "(", "User", "user", ",", "Username", "name", ",", "Password", "pass", ",", "String", "realname", ",", "String", "email", ",", "int", "siteId", ")", "{", "user", ".", "username", "=", "name", ".", "getUsername", "(", ...
Configures the supplied user record with the provided information in preparation for inserting the record into the database for the first time.
[ "Configures", "the", "supplied", "user", "record", "with", "the", "provided", "information", "in", "preparation", "for", "inserting", "the", "record", "into", "the", "database", "for", "the", "first", "time", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L376-L385
39,347
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.insertUser
protected int insertUser (final User user) throws UserExistsException, PersistenceException { executeUpdate(new Operation<Object>() { public Object invoke (Connection conn, DatabaseLiaison liaison) throws PersistenceException, SQLException { tr...
java
protected int insertUser (final User user) throws UserExistsException, PersistenceException { executeUpdate(new Operation<Object>() { public Object invoke (Connection conn, DatabaseLiaison liaison) throws PersistenceException, SQLException { tr...
[ "protected", "int", "insertUser", "(", "final", "User", "user", ")", "throws", "UserExistsException", ",", "PersistenceException", "{", "executeUpdate", "(", "new", "Operation", "<", "Object", ">", "(", ")", "{", "public", "Object", "invoke", "(", "Connection", ...
Inserts the supplied user record into the user database, assigning it a userid in the process, which is returned.
[ "Inserts", "the", "supplied", "user", "record", "into", "the", "user", "database", "assigning", "it", "a", "userid", "in", "the", "process", "which", "is", "returned", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L391-L416
39,348
samskivert/samskivert
src/main/java/com/samskivert/servlet/user/UserRepository.java
UserRepository.loadUserWhere
protected User loadUserWhere (String where) throws PersistenceException { User user = load(_utable, where); if (user != null) { user.setDirtyMask(_utable.getFieldMask()); } return user; }
java
protected User loadUserWhere (String where) throws PersistenceException { User user = load(_utable, where); if (user != null) { user.setDirtyMask(_utable.getFieldMask()); } return user; }
[ "protected", "User", "loadUserWhere", "(", "String", "where", ")", "throws", "PersistenceException", "{", "User", "user", "=", "load", "(", "_utable", ",", "where", ")", ";", "if", "(", "user", "!=", "null", ")", "{", "user", ".", "setDirtyMask", "(", "_...
Loads up a user record that matches the specified where clause. Returns null if no record matches.
[ "Loads", "up", "a", "user", "record", "that", "matches", "the", "specified", "where", "clause", ".", "Returns", "null", "if", "no", "record", "matches", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L422-L430
39,349
samskivert/samskivert
src/main/java/com/samskivert/swing/util/ButtonUtil.java
ButtonUtil.setToggling
public static synchronized void setToggling (AbstractButton b) { if (_toggler == null) { _toggler = new ActionListener () { public void actionPerformed (ActionEvent event) { AbstractButton but = (AbstractButton) event.getSource(); ...
java
public static synchronized void setToggling (AbstractButton b) { if (_toggler == null) { _toggler = new ActionListener () { public void actionPerformed (ActionEvent event) { AbstractButton but = (AbstractButton) event.getSource(); ...
[ "public", "static", "synchronized", "void", "setToggling", "(", "AbstractButton", "b", ")", "{", "if", "(", "_toggler", "==", "null", ")", "{", "_toggler", "=", "new", "ActionListener", "(", ")", "{", "public", "void", "actionPerformed", "(", "ActionEvent", ...
Set the specified button such that it alternates between being selected and not whenever it is pushed.
[ "Set", "the", "specified", "button", "such", "that", "it", "alternates", "between", "being", "selected", "and", "not", "whenever", "it", "is", "pushed", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/ButtonUtil.java#L33-L46
39,350
samskivert/samskivert
src/main/java/com/samskivert/swing/util/ButtonUtil.java
ButtonUtil.cycleToProperty
public static ActionListener cycleToProperty ( final String property, final PrefsConfig config, AbstractButton button, final int[] values) { ActionListener al = new ActionListener() { public void actionPerformed (ActionEvent event) { // get the current...
java
public static ActionListener cycleToProperty ( final String property, final PrefsConfig config, AbstractButton button, final int[] values) { ActionListener al = new ActionListener() { public void actionPerformed (ActionEvent event) { // get the current...
[ "public", "static", "ActionListener", "cycleToProperty", "(", "final", "String", "property", ",", "final", "PrefsConfig", "config", ",", "AbstractButton", "button", ",", "final", "int", "[", "]", "values", ")", "{", "ActionListener", "al", "=", "new", "ActionLis...
Configure the specified button to cause the specified property to cycle through the specified values whenever the button is pressed.
[ "Configure", "the", "specified", "button", "to", "cause", "the", "specified", "property", "to", "cycle", "through", "the", "specified", "values", "whenever", "the", "button", "is", "pressed", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/ButtonUtil.java#L66-L83
39,351
samskivert/samskivert
src/main/java/com/samskivert/jdbc/HsqldbLiaison.java
HsqldbLiaison.createTableIfMissing
@Override // from DatabaseLiaison public boolean createTableIfMissing (Connection conn, String table, List<String> columns, List<ColumnDefinition> defns, List<List<String>> uniqueColumns, List<String> pkColumns) throws SQLExce...
java
@Override // from DatabaseLiaison public boolean createTableIfMissing (Connection conn, String table, List<String> columns, List<ColumnDefinition> defns, List<List<String>> uniqueColumns, List<String> pkColumns) throws SQLExce...
[ "@", "Override", "// from DatabaseLiaison", "public", "boolean", "createTableIfMissing", "(", "Connection", "conn", ",", "String", "table", ",", "List", "<", "String", ">", "columns", ",", "List", "<", "ColumnDefinition", ">", "defns", ",", "List", "<", "List", ...
it may be that uniqueness should be removed from ColumnDefinition.
[ "it", "may", "be", "that", "uniqueness", "should", "be", "removed", "from", "ColumnDefinition", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/HsqldbLiaison.java#L117-L168
39,352
nextreports/nextreports-engine
src/ro/nextreports/engine/querybuilder/sql/SelectQuery.java
SelectQuery.canAddTableToFromClause
private boolean canAddTableToFromClause(Table table, Map<Table, List<JoinCriteria>> destMap, List<Table> allTables) { if ((table == null) || allTables.contains(table)) { return false; } if ((destMap.get(table) != null) && (destMap.get(table).size() > 0)) { List<JoinCriteria> list = destMap.ge...
java
private boolean canAddTableToFromClause(Table table, Map<Table, List<JoinCriteria>> destMap, List<Table> allTables) { if ((table == null) || allTables.contains(table)) { return false; } if ((destMap.get(table) != null) && (destMap.get(table).size() > 0)) { List<JoinCriteria> list = destMap.ge...
[ "private", "boolean", "canAddTableToFromClause", "(", "Table", "table", ",", "Map", "<", "Table", ",", "List", "<", "JoinCriteria", ">", ">", "destMap", ",", "List", "<", "Table", ">", "allTables", ")", "{", "if", "(", "(", "table", "==", "null", ")", ...
outer joins are written in Table class
[ "outer", "joins", "are", "written", "in", "Table", "class" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/querybuilder/sql/SelectQuery.java#L789-L802
39,353
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.sort
public static <T> void sort (T[] a, Comparator<? super T> comp) { sort(a, 0, a.length - 1, comp); }
java
public static <T> void sort (T[] a, Comparator<? super T> comp) { sort(a, 0, a.length - 1, comp); }
[ "public", "static", "<", "T", ">", "void", "sort", "(", "T", "[", "]", "a", ",", "Comparator", "<", "?", "super", "T", ">", "comp", ")", "{", "sort", "(", "a", ",", "0", ",", "a", ".", "length", "-", "1", ",", "comp", ")", ";", "}" ]
Sorts the supplied array of objects from least to greatest, using the supplied comparator.
[ "Sorts", "the", "supplied", "array", "of", "objects", "from", "least", "to", "greatest", "using", "the", "supplied", "comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L20-L23
39,354
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.sort
public static <T extends Comparable<? super T>> void sort (T[] a) { sort(a, 0, a.length - 1); }
java
public static <T extends Comparable<? super T>> void sort (T[] a) { sort(a, 0, a.length - 1); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "void", "sort", "(", "T", "[", "]", "a", ")", "{", "sort", "(", "a", ",", "0", ",", "a", ".", "length", "-", "1", ")", ";", "}" ]
Sorts the supplied array of comparable objects from least to greatest.
[ "Sorts", "the", "supplied", "array", "of", "comparable", "objects", "from", "least", "to", "greatest", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L28-L31
39,355
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.rsort
public static <T> void rsort (T[] a, Comparator<? super T> comp) { rsort(a, 0, a.length - 1, comp); }
java
public static <T> void rsort (T[] a, Comparator<? super T> comp) { rsort(a, 0, a.length - 1, comp); }
[ "public", "static", "<", "T", ">", "void", "rsort", "(", "T", "[", "]", "a", ",", "Comparator", "<", "?", "super", "T", ">", "comp", ")", "{", "rsort", "(", "a", ",", "0", ",", "a", ".", "length", "-", "1", ",", "comp", ")", ";", "}" ]
Sorts the supplied array of objects from greatest to least, using the supplied comparator.
[ "Sorts", "the", "supplied", "array", "of", "objects", "from", "greatest", "to", "least", "using", "the", "supplied", "comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L36-L39
39,356
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.rsort
public static <T extends Comparable<? super T>> void rsort (T[] a) { rsort(a, 0, a.length - 1); }
java
public static <T extends Comparable<? super T>> void rsort (T[] a) { rsort(a, 0, a.length - 1); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "void", "rsort", "(", "T", "[", "]", "a", ")", "{", "rsort", "(", "a", ",", "0", ",", "a", ".", "length", "-", "1", ")", ";", "}" ]
Sorts the supplied array of comparable objects from greatest to least.
[ "Sorts", "the", "supplied", "array", "of", "comparable", "objects", "from", "greatest", "to", "least", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L44-L47
39,357
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.sort
public static <T> void sort (T[] a, int lo0, int hi0, Comparator<? super T> comp) { // bail out if we're already done if (hi0 <= lo0) { return; } T t; // if this is a two element file, do a simple sort on it if (hi0 - lo0 == 1) { // if they'r...
java
public static <T> void sort (T[] a, int lo0, int hi0, Comparator<? super T> comp) { // bail out if we're already done if (hi0 <= lo0) { return; } T t; // if this is a two element file, do a simple sort on it if (hi0 - lo0 == 1) { // if they'r...
[ "public", "static", "<", "T", ">", "void", "sort", "(", "T", "[", "]", "a", ",", "int", "lo0", ",", "int", "hi0", ",", "Comparator", "<", "?", "super", "T", ">", "comp", ")", "{", "// bail out if we're already done", "if", "(", "hi0", "<=", "lo0", ...
Sorts the specified subset of the supplied array from least to greatest, using the supplied comparator. @param a the array of objects to be sorted. @param lo0 the index of the lowest element to be included in the sort. @param hi0 the index of the highest element to be included in the sort. @param comp the comparator t...
[ "Sorts", "the", "specified", "subset", "of", "the", "supplied", "array", "from", "least", "to", "greatest", "using", "the", "supplied", "comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L58-L111
39,358
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.sort
public static <T extends Comparable<? super T>> void sort (T[] a, int lo0, int hi0) { // bail out if we're already done if (hi0 <= lo0) { return; } T t; // if this is a two element file, do a simple sort on it if (hi0 - lo0 == 1) { // if they...
java
public static <T extends Comparable<? super T>> void sort (T[] a, int lo0, int hi0) { // bail out if we're already done if (hi0 <= lo0) { return; } T t; // if this is a two element file, do a simple sort on it if (hi0 - lo0 == 1) { // if they...
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "void", "sort", "(", "T", "[", "]", "a", ",", "int", "lo0", ",", "int", "hi0", ")", "{", "// bail out if we're already done", "if", "(", "hi0", "<=", "lo0", ")",...
Sorts the specified subset of the supplied array of comparables from least to greatest, using the supplied comparator. @param a the array of objects to be sorted. @param lo0 the index of the lowest element to be included in the sort. @param hi0 the index of the highest element to be included in the sort.
[ "Sorts", "the", "specified", "subset", "of", "the", "supplied", "array", "of", "comparables", "from", "least", "to", "greatest", "using", "the", "supplied", "comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L185-L238
39,359
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.sort
public static <T extends Comparable<? super T>> void sort (List<T> a) { sort(a, new Comparator<T>() { public int compare (T o1, T o2) { if (o1 == o2) { // catches null == null return 0; } else if (o1 == null) { return 1; ...
java
public static <T extends Comparable<? super T>> void sort (List<T> a) { sort(a, new Comparator<T>() { public int compare (T o1, T o2) { if (o1 == o2) { // catches null == null return 0; } else if (o1 == null) { return 1; ...
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "void", "sort", "(", "List", "<", "T", ">", "a", ")", "{", "sort", "(", "a", ",", "new", "Comparator", "<", "T", ">", "(", ")", "{", "public", "int", "comp...
Sort the elements in the specified List according to their natural order.
[ "Sort", "the", "elements", "in", "the", "specified", "List", "according", "to", "their", "natural", "order", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L306-L320
39,360
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.sort
public static <T> void sort (List<T> a, Comparator<? super T> comp) { sort(a, 0, a.size() - 1, comp); }
java
public static <T> void sort (List<T> a, Comparator<? super T> comp) { sort(a, 0, a.size() - 1, comp); }
[ "public", "static", "<", "T", ">", "void", "sort", "(", "List", "<", "T", ">", "a", ",", "Comparator", "<", "?", "super", "T", ">", "comp", ")", "{", "sort", "(", "a", ",", "0", ",", "a", ".", "size", "(", ")", "-", "1", ",", "comp", ")", ...
Sort the elements in the specified List according to the ordering imposed by the specified Comparator.
[ "Sort", "the", "elements", "in", "the", "specified", "List", "according", "to", "the", "ordering", "imposed", "by", "the", "specified", "Comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L326-L329
39,361
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.rsort
public static <T> void rsort (List<T> a, Comparator<? super T> comp) { sort(a, Collections.reverseOrder(comp)); }
java
public static <T> void rsort (List<T> a, Comparator<? super T> comp) { sort(a, Collections.reverseOrder(comp)); }
[ "public", "static", "<", "T", ">", "void", "rsort", "(", "List", "<", "T", ">", "a", ",", "Comparator", "<", "?", "super", "T", ">", "comp", ")", "{", "sort", "(", "a", ",", "Collections", ".", "reverseOrder", "(", "comp", ")", ")", ";", "}" ]
Sort the elements in the specified List according to the reverse ordering imposed by the specified Comparator.
[ "Sort", "the", "elements", "in", "the", "specified", "List", "according", "to", "the", "reverse", "ordering", "imposed", "by", "the", "specified", "Comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L354-L357
39,362
samskivert/samskivert
src/main/java/com/samskivert/util/QuickSort.java
QuickSort.sort
public static <T> void sort (List<T> a, int lo0, int hi0, Comparator<? super T> comp) { // bail out if we're already done if (hi0 <= lo0) { return; } T e1, e2; // if this is a two element file, do a simple sort on it if (hi0 - lo0 == 1) { // ...
java
public static <T> void sort (List<T> a, int lo0, int hi0, Comparator<? super T> comp) { // bail out if we're already done if (hi0 <= lo0) { return; } T e1, e2; // if this is a two element file, do a simple sort on it if (hi0 - lo0 == 1) { // ...
[ "public", "static", "<", "T", ">", "void", "sort", "(", "List", "<", "T", ">", "a", ",", "int", "lo0", ",", "int", "hi0", ",", "Comparator", "<", "?", "super", "T", ">", "comp", ")", "{", "// bail out if we're already done", "if", "(", "hi0", "<=", ...
Sort a subset of the elements in the specified List according to the ordering imposed by the specified Comparator.
[ "Sort", "a", "subset", "of", "the", "elements", "in", "the", "specified", "List", "according", "to", "the", "ordering", "imposed", "by", "the", "specified", "Comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/QuickSort.java#L363-L424
39,363
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getMetaIterator
@ReplacedBy("com.google.common.collect.Iterators#concat() or com.google.common.collect.Iterables#concat()") public static <T> Iterator<T> getMetaIterator (Iterable<Iterator<T>> metaIterable) { return new MetaIterator<T>(metaIterable); }
java
@ReplacedBy("com.google.common.collect.Iterators#concat() or com.google.common.collect.Iterables#concat()") public static <T> Iterator<T> getMetaIterator (Iterable<Iterator<T>> metaIterable) { return new MetaIterator<T>(metaIterable); }
[ "@", "ReplacedBy", "(", "\"com.google.common.collect.Iterators#concat() or com.google.common.collect.Iterables#concat()\"", ")", "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "getMetaIterator", "(", "Iterable", "<", "Iterator", "<", "T", ">", ">", "metaI...
Returns an Iterator that iterates over all the elements contained within the Iterators within the specified Iterable. @param metaIterable an iterable of Iterators.
[ "Returns", "an", "Iterator", "that", "iterates", "over", "all", "the", "elements", "contained", "within", "the", "Iterators", "within", "the", "specified", "Iterable", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L26-L30
39,364
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getSortedIterator
public static <T extends Comparable<? super T>> Iterator<T> getSortedIterator (Iterable<T> coll) { return getSortedIterator(coll.iterator(), new Comparator<T>() { public int compare (T o1, T o2) { if (o1 == o2) { // catches null == null return 0; ...
java
public static <T extends Comparable<? super T>> Iterator<T> getSortedIterator (Iterable<T> coll) { return getSortedIterator(coll.iterator(), new Comparator<T>() { public int compare (T o1, T o2) { if (o1 == o2) { // catches null == null return 0; ...
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "Iterator", "<", "T", ">", "getSortedIterator", "(", "Iterable", "<", "T", ">", "coll", ")", "{", "return", "getSortedIterator", "(", "coll", ".", "iterator", "(", ...
Get an Iterator over the supplied Collection that returns the elements in their natural order.
[ "Get", "an", "Iterator", "over", "the", "supplied", "Collection", "that", "returns", "the", "elements", "in", "their", "natural", "order", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L36-L50
39,365
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getSortedIterator
public static <T> Iterator<T> getSortedIterator (Iterable<T> coll, Comparator<T> comparator) { return getSortedIterator(coll.iterator(), comparator); }
java
public static <T> Iterator<T> getSortedIterator (Iterable<T> coll, Comparator<T> comparator) { return getSortedIterator(coll.iterator(), comparator); }
[ "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "getSortedIterator", "(", "Iterable", "<", "T", ">", "coll", ",", "Comparator", "<", "T", ">", "comparator", ")", "{", "return", "getSortedIterator", "(", "coll", ".", "iterator", "(", ")", ...
Get an Iterator over the supplied Collection that returns the elements in the order dictated by the supplied Comparator.
[ "Get", "an", "Iterator", "over", "the", "supplied", "Collection", "that", "returns", "the", "elements", "in", "the", "order", "dictated", "by", "the", "supplied", "Comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L56-L59
39,366
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getSortedIterator
public static <T extends Comparable<? super T>> Iterator<T> getSortedIterator (Iterator<T> itr) { return getSortedIterator(itr, new Comparator<T>() { public int compare (T o1, T o2) { if (o1 == o2) { // catches null == null return 0; } else if ...
java
public static <T extends Comparable<? super T>> Iterator<T> getSortedIterator (Iterator<T> itr) { return getSortedIterator(itr, new Comparator<T>() { public int compare (T o1, T o2) { if (o1 == o2) { // catches null == null return 0; } else if ...
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "Iterator", "<", "T", ">", "getSortedIterator", "(", "Iterator", "<", "T", ">", "itr", ")", "{", "return", "getSortedIterator", "(", "itr", ",", "new", "Comparator",...
Get an Iterator that returns the same elements returned by the supplied Iterator, but in their natural order.
[ "Get", "an", "Iterator", "that", "returns", "the", "same", "elements", "returned", "by", "the", "supplied", "Iterator", "but", "in", "their", "natural", "order", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L65-L79
39,367
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getSortedIterator
public static <T> Iterator<T> getSortedIterator (Iterator<T> itr, Comparator<T> comparator) { SortableArrayList<T> list = new SortableArrayList<T>(); CollectionUtil.addAll(list, itr); list.sort(comparator); return getUnmodifiableIterator(list); }
java
public static <T> Iterator<T> getSortedIterator (Iterator<T> itr, Comparator<T> comparator) { SortableArrayList<T> list = new SortableArrayList<T>(); CollectionUtil.addAll(list, itr); list.sort(comparator); return getUnmodifiableIterator(list); }
[ "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "getSortedIterator", "(", "Iterator", "<", "T", ">", "itr", ",", "Comparator", "<", "T", ">", "comparator", ")", "{", "SortableArrayList", "<", "T", ">", "list", "=", "new", "SortableArrayList...
Get an Iterator that returns the same elements returned by the supplied Iterator, but in the order dictated by the supplied Comparator.
[ "Get", "an", "Iterator", "that", "returns", "the", "same", "elements", "returned", "by", "the", "supplied", "Iterator", "but", "in", "the", "order", "dictated", "by", "the", "supplied", "Comparator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L85-L91
39,368
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getRandomIterator
public static <T> Iterator<T> getRandomIterator (Iterable<T> c) { return getRandomIterator(c.iterator()); }
java
public static <T> Iterator<T> getRandomIterator (Iterable<T> c) { return getRandomIterator(c.iterator()); }
[ "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "getRandomIterator", "(", "Iterable", "<", "T", ">", "c", ")", "{", "return", "getRandomIterator", "(", "c", ".", "iterator", "(", ")", ")", ";", "}" ]
Get an Iterator over the supplied Iterable that returns the elements in a completely random order. Normally Iterators return elements in an undefined order, but it is usually the same between different invocations as long as the underlying Iterable has not changed. This method mixes things up.
[ "Get", "an", "Iterator", "over", "the", "supplied", "Iterable", "that", "returns", "the", "elements", "in", "a", "completely", "random", "order", ".", "Normally", "Iterators", "return", "elements", "in", "an", "undefined", "order", "but", "it", "is", "usually"...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L99-L102
39,369
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getRandomIterator
public static <T> Iterator<T> getRandomIterator (Iterator<T> itr) { ArrayList<T> list = new ArrayList<T>(); CollectionUtil.addAll(list, itr); java.util.Collections.shuffle(list); return getUnmodifiableIterator(list); }
java
public static <T> Iterator<T> getRandomIterator (Iterator<T> itr) { ArrayList<T> list = new ArrayList<T>(); CollectionUtil.addAll(list, itr); java.util.Collections.shuffle(list); return getUnmodifiableIterator(list); }
[ "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "getRandomIterator", "(", "Iterator", "<", "T", ">", "itr", ")", "{", "ArrayList", "<", "T", ">", "list", "=", "new", "ArrayList", "<", "T", ">", "(", ")", ";", "CollectionUtil", ".", "a...
Get an Iterator that returns the same elements returned by the supplied Iterator, but in a completely random order.
[ "Get", "an", "Iterator", "that", "returns", "the", "same", "elements", "returned", "by", "the", "supplied", "Iterator", "but", "in", "a", "completely", "random", "order", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L108-L114
39,370
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getUnmodifiableIterator
public static <T> Iterator<T> getUnmodifiableIterator (Iterable<T> c) { return getUnmodifiableIterator(c.iterator()); }
java
public static <T> Iterator<T> getUnmodifiableIterator (Iterable<T> c) { return getUnmodifiableIterator(c.iterator()); }
[ "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "getUnmodifiableIterator", "(", "Iterable", "<", "T", ">", "c", ")", "{", "return", "getUnmodifiableIterator", "(", "c", ".", "iterator", "(", ")", ")", ";", "}" ]
Get an Iterator that returns the elements in the supplied Iterable but blocks removal.
[ "Get", "an", "Iterator", "that", "returns", "the", "elements", "in", "the", "supplied", "Iterable", "but", "blocks", "removal", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L119-L122
39,371
samskivert/samskivert
src/main/java/com/samskivert/util/Collections.java
Collections.getUnmodifiableIterator
@ReplacedBy("com.google.common.collect.Iterators#unmodifiableIterator()") public static <T> Iterator<T> getUnmodifiableIterator (final Iterator<T> itr) { return new Iterator<T>() { public boolean hasNext () { return itr.hasNext(); } public T next () { ...
java
@ReplacedBy("com.google.common.collect.Iterators#unmodifiableIterator()") public static <T> Iterator<T> getUnmodifiableIterator (final Iterator<T> itr) { return new Iterator<T>() { public boolean hasNext () { return itr.hasNext(); } public T next () { ...
[ "@", "ReplacedBy", "(", "\"com.google.common.collect.Iterators#unmodifiableIterator()\"", ")", "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "getUnmodifiableIterator", "(", "final", "Iterator", "<", "T", ">", "itr", ")", "{", "return", "new", "Iter...
Get an iterator that returns the same elements as the supplied iterator but blocks removal.
[ "Get", "an", "iterator", "that", "returns", "the", "same", "elements", "as", "the", "supplied", "iterator", "but", "blocks", "removal", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Collections.java#L127-L142
39,372
samskivert/samskivert
src/main/java/com/samskivert/util/ValueMarshaller.java
ValueMarshaller.unmarshal
public static Object unmarshal (Class<?> type, String source) throws Exception { if (type.isEnum()) { // we need to use a dummy enum type here as there's no way to ask Enum.valueOf to // execute on an existentially typed enum; it all works out under the hood @Supp...
java
public static Object unmarshal (Class<?> type, String source) throws Exception { if (type.isEnum()) { // we need to use a dummy enum type here as there's no way to ask Enum.valueOf to // execute on an existentially typed enum; it all works out under the hood @Supp...
[ "public", "static", "Object", "unmarshal", "(", "Class", "<", "?", ">", "type", ",", "String", "source", ")", "throws", "Exception", "{", "if", "(", "type", ".", "isEnum", "(", ")", ")", "{", "// we need to use a dummy enum type here as there's no way to ask Enum....
Attempts to convert the specified value to an instance of the specified object type. @exception Exception thrown if no field parser exists for the target type or if an error occurs while parsing the value.
[ "Attempts", "to", "convert", "the", "specified", "value", "to", "an", "instance", "of", "the", "specified", "object", "type", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ValueMarshaller.java#L27-L43
39,373
samskivert/samskivert
src/main/java/com/samskivert/util/BaseArrayList.java
BaseArrayList.rangeCheck
protected final void rangeCheck (int index, boolean insert) { if ((index < 0) || (insert ? (index > _size) : (index >= _size))) { throw new IndexOutOfBoundsException( "Index: " + index + ", Size: " + _size); } }
java
protected final void rangeCheck (int index, boolean insert) { if ((index < 0) || (insert ? (index > _size) : (index >= _size))) { throw new IndexOutOfBoundsException( "Index: " + index + ", Size: " + _size); } }
[ "protected", "final", "void", "rangeCheck", "(", "int", "index", ",", "boolean", "insert", ")", "{", "if", "(", "(", "index", "<", "0", ")", "||", "(", "insert", "?", "(", "index", ">", "_size", ")", ":", "(", "index", ">=", "_size", ")", ")", ")...
Check the range of a passed-in index to make sure it's valid. @param insert if true, an index equal to our size is valid.
[ "Check", "the", "range", "of", "a", "passed", "-", "in", "index", "to", "make", "sure", "it", "s", "valid", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/BaseArrayList.java#L153-L159
39,374
nextreports/nextreports-engine
src/ro/nextreports/engine/queryexec/QueryParameter.java
QueryParameter.getValueClass
public Class getValueClass() { if (valueClass == null) { if (valueClassName != null) { try { valueClass = Class.forName(valueClassName); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } } return valueClass; }
java
public Class getValueClass() { if (valueClass == null) { if (valueClassName != null) { try { valueClass = Class.forName(valueClassName); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } } return valueClass; }
[ "public", "Class", "getValueClass", "(", ")", "{", "if", "(", "valueClass", "==", "null", ")", "{", "if", "(", "valueClassName", "!=", "null", ")", "{", "try", "{", "valueClass", "=", "Class", ".", "forName", "(", "valueClassName", ")", ";", "}", "catc...
Get java class object for the parameter value @return java class object for the parameter value
[ "Get", "java", "class", "object", "for", "the", "parameter", "value" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/queryexec/QueryParameter.java#L229-L241
39,375
nextreports/nextreports-engine
src/ro/nextreports/engine/queryexec/QueryParameter.java
QueryParameter.setPreviewValue
public void setPreviewValue(String previewValue) { if (!isProcedureParameter && (previewValue != null)) { throw new IllegalArgumentException("Parameter '" + name + "' is not a procedure parameter."); } this.previewValue = previewValue; }
java
public void setPreviewValue(String previewValue) { if (!isProcedureParameter && (previewValue != null)) { throw new IllegalArgumentException("Parameter '" + name + "' is not a procedure parameter."); } this.previewValue = previewValue; }
[ "public", "void", "setPreviewValue", "(", "String", "previewValue", ")", "{", "if", "(", "!", "isProcedureParameter", "&&", "(", "previewValue", "!=", "null", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Parameter '\"", "+", "name", "+", ...
Set preview value for procedure parameter Allows to set null for any type @param previewValue preview value for procedure parameter
[ "Set", "preview", "value", "for", "procedure", "parameter", "Allows", "to", "set", "null", "for", "any", "type" ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/queryexec/QueryParameter.java#L470-L475
39,376
samskivert/samskivert
src/main/java/com/samskivert/util/Config.java
Config.getValue
public String getValue (String name, String defval) { return _props.getProperty(name, defval); }
java
public String getValue (String name, String defval) { return _props.getProperty(name, defval); }
[ "public", "String", "getValue", "(", "String", "name", ",", "String", "defval", ")", "{", "return", "_props", ".", "getProperty", "(", "name", ",", "defval", ")", ";", "}" ]
Fetches and returns the value for the specified configuration property. If the value is not specified in the associated properties file, the supplied default value is returned instead. @param name the name of the property to be fetched. @param defval the value to return if the property is not specified in the config f...
[ "Fetches", "and", "returns", "the", "value", "for", "the", "specified", "configuration", "property", ".", "If", "the", "value", "is", "not", "specified", "in", "the", "associated", "properties", "file", "the", "supplied", "default", "value", "is", "returned", ...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Config.java#L202-L205
39,377
samskivert/samskivert
src/main/java/com/samskivert/util/Config.java
Config.instantiateValue
public Object instantiateValue (String name, String defcname) throws Exception { return Class.forName(getValue(name, defcname)).newInstance(); }
java
public Object instantiateValue (String name, String defcname) throws Exception { return Class.forName(getValue(name, defcname)).newInstance(); }
[ "public", "Object", "instantiateValue", "(", "String", "name", ",", "String", "defcname", ")", "throws", "Exception", "{", "return", "Class", ".", "forName", "(", "getValue", "(", "name", ",", "defcname", ")", ")", ".", "newInstance", "(", ")", ";", "}" ]
Looks up the specified string-valued configuration entry, loads the class with that name and instantiates a new instance of that class, which is returned. @param name the name of the property to be fetched. @param defcname the class name to use if the property is not specified in the config file. @exception Exception...
[ "Looks", "up", "the", "specified", "string", "-", "valued", "configuration", "entry", "loads", "the", "class", "with", "that", "name", "and", "instantiates", "a", "new", "instance", "of", "that", "class", "which", "is", "returned", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Config.java#L336-L340
39,378
samskivert/samskivert
src/main/java/com/samskivert/util/Config.java
Config.keys
public Iterator<String> keys () { HashSet<String> matches = new HashSet<String>(); enumerateKeys(matches); return matches.iterator(); }
java
public Iterator<String> keys () { HashSet<String> matches = new HashSet<String>(); enumerateKeys(matches); return matches.iterator(); }
[ "public", "Iterator", "<", "String", ">", "keys", "(", ")", "{", "HashSet", "<", "String", ">", "matches", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "enumerateKeys", "(", "matches", ")", ";", "return", "matches", ".", "iterator", "(", ...
Returns an iterator that returns all of the configuration keys in this config object.
[ "Returns", "an", "iterator", "that", "returns", "all", "of", "the", "configuration", "keys", "in", "this", "config", "object", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Config.java#L383-L388
39,379
nextreports/nextreports-engine
src/ro/nextreports/engine/exporter/TxtExporter.java
TxtExporter.put
private void put(PrintStream p, String s, int column, int colSpan, BandElement bandElement) { if (s == null) { // nl(); put(p, "", column, colSpan, bandElement); return; } int size = 0; if (colSpan > 1) { for (int i=column; i<c...
java
private void put(PrintStream p, String s, int column, int colSpan, BandElement bandElement) { if (s == null) { // nl(); put(p, "", column, colSpan, bandElement); return; } int size = 0; if (colSpan > 1) { for (int i=column; i<c...
[ "private", "void", "put", "(", "PrintStream", "p", ",", "String", "s", ",", "int", "column", ",", "int", "colSpan", ",", "BandElement", "bandElement", ")", "{", "if", "(", "s", "==", "null", ")", "{", "// nl();", "put", "(", "p", ",", "\"\"", ",", ...
Write one tsv field to the file, followed by a separator unless it is the last field on the line. Lead and trailing blanks will be removed. @param p print stream @param s The string to write. Any additional quotes or embedded quotes will be provided by put. Null means start a new line.
[ "Write", "one", "tsv", "field", "to", "the", "file", "followed", "by", "a", "separator", "unless", "it", "is", "the", "last", "field", "on", "the", "line", ".", "Lead", "and", "trailing", "blanks", "will", "be", "removed", "." ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/TxtExporter.java#L159-L180
39,380
samskivert/samskivert
src/main/java/com/samskivert/util/ConfigUtil.java
ConfigUtil.parseMetaData
protected static PropRecord parseMetaData (String path, URL sourceURL) throws IOException { InputStream input = sourceURL.openStream(); BufferedReader bin = new BufferedReader(new InputStreamReader(input)); try { PropRecord record = new PropRecord(path, sourceURL); ...
java
protected static PropRecord parseMetaData (String path, URL sourceURL) throws IOException { InputStream input = sourceURL.openStream(); BufferedReader bin = new BufferedReader(new InputStreamReader(input)); try { PropRecord record = new PropRecord(path, sourceURL); ...
[ "protected", "static", "PropRecord", "parseMetaData", "(", "String", "path", ",", "URL", "sourceURL", ")", "throws", "IOException", "{", "InputStream", "input", "=", "sourceURL", ".", "openStream", "(", ")", ";", "BufferedReader", "bin", "=", "new", "BufferedRea...
Performs simple processing of the supplied input stream to obtain inheritance metadata from the properties file.
[ "Performs", "simple", "processing", "of", "the", "supplied", "input", "stream", "to", "obtain", "inheritance", "metadata", "from", "the", "properties", "file", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ConfigUtil.java#L410-L437
39,381
samskivert/samskivert
src/main/java/com/samskivert/util/ConfigUtil.java
ConfigUtil.getStream
public static InputStream getStream (String path, ClassLoader loader) { // first try the supplied class loader InputStream in = getResourceAsStream(path, loader); if (in != null) { return in; } // if that didn't work, try the system class loader (but only if it's...
java
public static InputStream getStream (String path, ClassLoader loader) { // first try the supplied class loader InputStream in = getResourceAsStream(path, loader); if (in != null) { return in; } // if that didn't work, try the system class loader (but only if it's...
[ "public", "static", "InputStream", "getStream", "(", "String", "path", ",", "ClassLoader", "loader", ")", "{", "// first try the supplied class loader", "InputStream", "in", "=", "getResourceAsStream", "(", "path", ",", "loader", ")", ";", "if", "(", "in", "!=", ...
Returns an input stream referencing a file that exists somewhere in the classpath. <p> The supplied classloader is searched first, followed by the system classloader. @param path The path to the file, relative to the root of the classpath directory from which it will be loaded (e.g. <code>com/foo/bar/foo.gif</code>).
[ "Returns", "an", "input", "stream", "referencing", "a", "file", "that", "exists", "somewhere", "in", "the", "classpath", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ConfigUtil.java#L484-L503
39,382
samskivert/samskivert
src/main/java/com/samskivert/util/ServiceWaiter.java
ServiceWaiter.waitForResponse
public boolean waitForResponse () throws TimeoutException { if (_success == 0) { synchronized (this) { try { // wait for the response, timing out after a while if (_timeout == NO_TIMEOUT) { wait(); ...
java
public boolean waitForResponse () throws TimeoutException { if (_success == 0) { synchronized (this) { try { // wait for the response, timing out after a while if (_timeout == NO_TIMEOUT) { wait(); ...
[ "public", "boolean", "waitForResponse", "(", ")", "throws", "TimeoutException", "{", "if", "(", "_success", "==", "0", ")", "{", "synchronized", "(", "this", ")", "{", "try", "{", "// wait for the response, timing out after a while", "if", "(", "_timeout", "==", ...
Blocks waiting for the response. @return true if a success response was posted, false if a failure response was posted.
[ "Blocks", "waiting", "for", "the", "response", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ServiceWaiter.java#L119-L145
39,383
nextreports/nextreports-engine
src/ro/nextreports/engine/util/ObjectCloner.java
ObjectCloner.silenceDeepCopy
public static final <T> T silenceDeepCopy(T object) { try { return deepCopy(object); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
java
public static final <T> T silenceDeepCopy(T object) { try { return deepCopy(object); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
[ "public", "static", "final", "<", "T", ">", "T", "silenceDeepCopy", "(", "T", "object", ")", "{", "try", "{", "return", "deepCopy", "(", "object", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", ...
Throws a RuntimeException if an exception occurs.
[ "Throws", "a", "RuntimeException", "if", "an", "exception", "occurs", "." ]
a847575a9298b5fce63b88961190c5b83ddccc44
https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ObjectCloner.java#L71-L78
39,384
samskivert/samskivert
src/main/java/com/samskivert/jdbc/jora/FieldMask.java
FieldMask.isModified
public final boolean isModified () { int mcount = _modified.length; for (int ii = 0; ii < mcount; ii++) { if (_modified[ii]) { return true; } } return false; }
java
public final boolean isModified () { int mcount = _modified.length; for (int ii = 0; ii < mcount; ii++) { if (_modified[ii]) { return true; } } return false; }
[ "public", "final", "boolean", "isModified", "(", ")", "{", "int", "mcount", "=", "_modified", ".", "length", ";", "for", "(", "int", "ii", "=", "0", ";", "ii", "<", "mcount", ";", "ii", "++", ")", "{", "if", "(", "_modified", "[", "ii", "]", ")",...
Returns true if any of the fields in this mask are modified.
[ "Returns", "true", "if", "any", "of", "the", "fields", "in", "this", "mask", "are", "modified", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/FieldMask.java#L55-L64
39,385
samskivert/samskivert
src/main/java/com/samskivert/jdbc/jora/FieldMask.java
FieldMask.isModified
public final boolean isModified (String fieldName) { Integer index = _descripMap.get(fieldName); if (index == null) { throw new IllegalArgumentException("Field not in mask: " + fieldName); } return _modified[index.intValue()]; }
java
public final boolean isModified (String fieldName) { Integer index = _descripMap.get(fieldName); if (index == null) { throw new IllegalArgumentException("Field not in mask: " + fieldName); } return _modified[index.intValue()]; }
[ "public", "final", "boolean", "isModified", "(", "String", "fieldName", ")", "{", "Integer", "index", "=", "_descripMap", ".", "get", "(", "fieldName", ")", ";", "if", "(", "index", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "...
Returns true if the field with the specified name is modifed.
[ "Returns", "true", "if", "the", "field", "with", "the", "specified", "name", "is", "modifed", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/FieldMask.java#L77-L84
39,386
samskivert/samskivert
src/main/java/com/samskivert/jdbc/jora/FieldMask.java
FieldMask.onlySubsetModified
public final boolean onlySubsetModified (Set<String> fieldSet) { for (String field : _descripMap.keySet()) { if (isModified(field) && (!fieldSet.contains(field))) { return false; } } return true; }
java
public final boolean onlySubsetModified (Set<String> fieldSet) { for (String field : _descripMap.keySet()) { if (isModified(field) && (!fieldSet.contains(field))) { return false; } } return true; }
[ "public", "final", "boolean", "onlySubsetModified", "(", "Set", "<", "String", ">", "fieldSet", ")", "{", "for", "(", "String", "field", ":", "_descripMap", ".", "keySet", "(", ")", ")", "{", "if", "(", "isModified", "(", "field", ")", "&&", "(", "!", ...
Returns true only if the set of modified fields is a subset of the fields specified.
[ "Returns", "true", "only", "if", "the", "set", "of", "modified", "fields", "is", "a", "subset", "of", "the", "fields", "specified", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/FieldMask.java#L90-L98
39,387
samskivert/samskivert
src/main/java/com/samskivert/jdbc/jora/FieldMask.java
FieldMask.setModified
public void setModified (String fieldName) { Integer index = _descripMap.get(fieldName); if (index == null) { throw new IllegalArgumentException("Field not in mask: " + fieldName); } _modified[index.intValue()] = true; }
java
public void setModified (String fieldName) { Integer index = _descripMap.get(fieldName); if (index == null) { throw new IllegalArgumentException("Field not in mask: " + fieldName); } _modified[index.intValue()] = true; }
[ "public", "void", "setModified", "(", "String", "fieldName", ")", "{", "Integer", "index", "=", "_descripMap", ".", "get", "(", "fieldName", ")", ";", "if", "(", "index", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Field not i...
Marks the specified field as modified.
[ "Marks", "the", "specified", "field", "as", "modified", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/FieldMask.java#L103-L110
39,388
samskivert/samskivert
src/main/java/com/samskivert/util/Histogram.java
Histogram.addValue
public void addValue (int value) { if (value < _minValue) { _buckets[0]++; } else if (value >= _maxValue) { _buckets[_buckets.length-1]++; } else { _buckets[(value-_minValue)/_bucketWidth]++; } _count++; }
java
public void addValue (int value) { if (value < _minValue) { _buckets[0]++; } else if (value >= _maxValue) { _buckets[_buckets.length-1]++; } else { _buckets[(value-_minValue)/_bucketWidth]++; } _count++; }
[ "public", "void", "addValue", "(", "int", "value", ")", "{", "if", "(", "value", "<", "_minValue", ")", "{", "_buckets", "[", "0", "]", "++", ";", "}", "else", "if", "(", "value", ">=", "_maxValue", ")", "{", "_buckets", "[", "_buckets", ".", "leng...
Registers a value with this histogram.
[ "Registers", "a", "value", "with", "this", "histogram", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Histogram.java#L32-L42
39,389
samskivert/samskivert
src/main/java/com/samskivert/util/Histogram.java
Histogram.summarize
public String summarize () { StringBuilder buf = new StringBuilder(); buf.append(_count).append(":"); for (int ii = 0; ii < _buckets.length; ii++) { if (ii > 0) { buf.append(","); } buf.append(_buckets[ii]); } return buf.toS...
java
public String summarize () { StringBuilder buf = new StringBuilder(); buf.append(_count).append(":"); for (int ii = 0; ii < _buckets.length; ii++) { if (ii > 0) { buf.append(","); } buf.append(_buckets[ii]); } return buf.toS...
[ "public", "String", "summarize", "(", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "buf", ".", "append", "(", "_count", ")", ".", "append", "(", "\":\"", ")", ";", "for", "(", "int", "ii", "=", "0", ";", "ii", "<", ...
Generates a terse summary of the count and contents of the values in this histogram.
[ "Generates", "a", "terse", "summary", "of", "the", "count", "and", "contents", "of", "the", "values", "in", "this", "histogram", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Histogram.java#L74-L85
39,390
samskivert/samskivert
src/main/java/com/samskivert/util/Predicate.java
Predicate.filter
public <E extends T> Iterator<E> filter (final Iterator<E> input) { return new Iterator<E>() { // from Iterator public boolean hasNext () { return _found || findNext(); } // from Iterator public E next () { ...
java
public <E extends T> Iterator<E> filter (final Iterator<E> input) { return new Iterator<E>() { // from Iterator public boolean hasNext () { return _found || findNext(); } // from Iterator public E next () { ...
[ "public", "<", "E", "extends", "T", ">", "Iterator", "<", "E", ">", "filter", "(", "final", "Iterator", "<", "E", ">", "input", ")", "{", "return", "new", "Iterator", "<", "E", ">", "(", ")", "{", "// from Iterator", "public", "boolean", "hasNext", "...
Return a new iterator that contains only matching elements from the input iterator.
[ "Return", "a", "new", "iterator", "that", "contains", "only", "matching", "elements", "from", "the", "input", "iterator", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Predicate.java#L164-L218
39,391
samskivert/samskivert
src/main/java/com/samskivert/util/Predicate.java
Predicate.filter
public <E extends T> void filter (Collection<E> coll) { for (Iterator<E> itr = coll.iterator(); itr.hasNext(); ) { if (!isMatch(itr.next())) { itr.remove(); } } }
java
public <E extends T> void filter (Collection<E> coll) { for (Iterator<E> itr = coll.iterator(); itr.hasNext(); ) { if (!isMatch(itr.next())) { itr.remove(); } } }
[ "public", "<", "E", "extends", "T", ">", "void", "filter", "(", "Collection", "<", "E", ">", "coll", ")", "{", "for", "(", "Iterator", "<", "E", ">", "itr", "=", "coll", ".", "iterator", "(", ")", ";", "itr", ".", "hasNext", "(", ")", ";", ")",...
Remove non-matching elements from the specified collection.
[ "Remove", "non", "-", "matching", "elements", "from", "the", "specified", "collection", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Predicate.java#L223-L230
39,392
samskivert/samskivert
src/main/java/com/samskivert/util/Predicate.java
Predicate.createView
public <E extends T> Iterable<E> createView (final Iterable<E> input) { return new Iterable<E>() { public Iterator<E> iterator() { return filter(input.iterator()); } }; }
java
public <E extends T> Iterable<E> createView (final Iterable<E> input) { return new Iterable<E>() { public Iterator<E> iterator() { return filter(input.iterator()); } }; }
[ "public", "<", "E", "extends", "T", ">", "Iterable", "<", "E", ">", "createView", "(", "final", "Iterable", "<", "E", ">", "input", ")", "{", "return", "new", "Iterable", "<", "E", ">", "(", ")", "{", "public", "Iterator", "<", "E", ">", "iterator"...
Create an Iterable view of the specified Iterable that only contains elements that match the predicate. This Iterable can be iterated over at any time in the future to view the current predicate-matching elements of the input Iterable.
[ "Create", "an", "Iterable", "view", "of", "the", "specified", "Iterable", "that", "only", "contains", "elements", "that", "match", "the", "predicate", ".", "This", "Iterable", "can", "be", "iterated", "over", "at", "any", "time", "in", "the", "future", "to",...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Predicate.java#L238-L245
39,393
samskivert/samskivert
src/main/java/com/samskivert/util/Predicate.java
Predicate.createView
public <E extends T> Collection<E> createView (final Collection<E> input) { // TODO: create a collection of the same type? return new AbstractCollection<E>() { @Override public int size () { // oh god, oh god: we iterate and count int size = 0;...
java
public <E extends T> Collection<E> createView (final Collection<E> input) { // TODO: create a collection of the same type? return new AbstractCollection<E>() { @Override public int size () { // oh god, oh god: we iterate and count int size = 0;...
[ "public", "<", "E", "extends", "T", ">", "Collection", "<", "E", ">", "createView", "(", "final", "Collection", "<", "E", ">", "input", ")", "{", "// TODO: create a collection of the same type?", "return", "new", "AbstractCollection", "<", "E", ">", "(", ")", ...
Create a view of the specified collection that only contains elements that match the predicate. This collection can be examined at any time in the future to view the current predicate-matching elements of the input collection. Note that the view is not modifiable and currently has poor implementations of some methods.
[ "Create", "a", "view", "of", "the", "specified", "collection", "that", "only", "contains", "elements", "that", "match", "the", "predicate", ".", "This", "collection", "can", "be", "examined", "at", "any", "time", "in", "the", "future", "to", "view", "the", ...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Predicate.java#L256-L299
39,394
samskivert/samskivert
src/main/java/com/samskivert/util/Calendars.java
Calendars.at
public static Builder at (long millis) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(millis); return with(calendar); }
java
public static Builder at (long millis) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(millis); return with(calendar); }
[ "public", "static", "Builder", "at", "(", "long", "millis", ")", "{", "Calendar", "calendar", "=", "Calendar", ".", "getInstance", "(", ")", ";", "calendar", ".", "setTimeInMillis", "(", "millis", ")", ";", "return", "with", "(", "calendar", ")", ";", "}...
Returns a fluent wrapper around a calendar configured with the specified time.
[ "Returns", "a", "fluent", "wrapper", "around", "a", "calendar", "configured", "with", "the", "specified", "time", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Calendars.java#L184-L189
39,395
samskivert/samskivert
src/main/java/com/samskivert/util/Calendars.java
Calendars.at
public static Builder at (int year, int month, int day) { Calendar calendar = Calendar.getInstance(); calendar.set(year, month, day); return with(calendar).zeroTime(); }
java
public static Builder at (int year, int month, int day) { Calendar calendar = Calendar.getInstance(); calendar.set(year, month, day); return with(calendar).zeroTime(); }
[ "public", "static", "Builder", "at", "(", "int", "year", ",", "int", "month", ",", "int", "day", ")", "{", "Calendar", "calendar", "=", "Calendar", ".", "getInstance", "(", ")", ";", "calendar", ".", "set", "(", "year", ",", "month", ",", "day", ")",...
Returns a fluent wrapper around a calendar configured to zero milliseconds after midnight on the specified day in the specified month and year. @param year a regular year value, like 1900 @param month a 0-based month value, like {@link Calendar#JANUARY} @param day a regular day of the month value, like 31
[ "Returns", "a", "fluent", "wrapper", "around", "a", "calendar", "configured", "to", "zero", "milliseconds", "after", "midnight", "on", "the", "specified", "day", "in", "the", "specified", "month", "and", "year", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Calendars.java#L199-L204
39,396
samskivert/samskivert
src/main/java/com/samskivert/util/Calendars.java
Calendars.in
public static Builder in (TimeZone zone, Locale locale) { return with(Calendar.getInstance(zone, locale)); }
java
public static Builder in (TimeZone zone, Locale locale) { return with(Calendar.getInstance(zone, locale)); }
[ "public", "static", "Builder", "in", "(", "TimeZone", "zone", ",", "Locale", "locale", ")", "{", "return", "with", "(", "Calendar", ".", "getInstance", "(", "zone", ",", "locale", ")", ")", ";", "}" ]
Returns a fluent wrapper around a calendar for the specifed time zone and locale.
[ "Returns", "a", "fluent", "wrapper", "around", "a", "calendar", "for", "the", "specifed", "time", "zone", "and", "locale", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Calendars.java#L233-L236
39,397
samskivert/samskivert
src/main/java/com/samskivert/swing/RadialMenu.java
RadialMenu.addMenuItem
public RadialMenuItem addMenuItem (String command, String label, Image icon, Predicate predicate) { RadialMenuItem item = new RadialMenuItem(command, label, new ImageIcon(icon), predicate); addMenuItem(item); return item; }
java
public RadialMenuItem addMenuItem (String command, String label, Image icon, Predicate predicate) { RadialMenuItem item = new RadialMenuItem(command, label, new ImageIcon(icon), predicate); addMenuItem(item); return item; }
[ "public", "RadialMenuItem", "addMenuItem", "(", "String", "command", ",", "String", "label", ",", "Image", "icon", ",", "Predicate", "predicate", ")", "{", "RadialMenuItem", "item", "=", "new", "RadialMenuItem", "(", "command", ",", "label", ",", "new", "Image...
Adds a menu item to the menu. The menu should not currently be active. @param command the command to be issued when the item is selected. @param label the textual label to be displayed with the menu item. @param icon the icon to display next to the menu text or null if no icon is desired. @param predicate a predicate ...
[ "Adds", "a", "menu", "item", "to", "the", "menu", ".", "The", "menu", "should", "not", "currently", "be", "active", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialMenu.java#L123-L128
39,398
samskivert/samskivert
src/main/java/com/samskivert/swing/RadialMenu.java
RadialMenu.removeMenuItem
public boolean removeMenuItem (String command) { int icount = _items.size(); for (int i = 0; i < icount; i++) { RadialMenuItem item = _items.get(i); if (item.command.equals(command)) { _items.remove(i); return true; } } ...
java
public boolean removeMenuItem (String command) { int icount = _items.size(); for (int i = 0; i < icount; i++) { RadialMenuItem item = _items.get(i); if (item.command.equals(command)) { _items.remove(i); return true; } } ...
[ "public", "boolean", "removeMenuItem", "(", "String", "command", ")", "{", "int", "icount", "=", "_items", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "icount", ";", "i", "++", ")", "{", "RadialMenuItem", "item", "=...
Removes the first menu item that matches the specified command from this menu. @return true if a matching menu item was removed, false if not.
[ "Removes", "the", "first", "menu", "item", "that", "matches", "the", "specified", "command", "from", "this", "menu", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialMenu.java#L166-L178
39,399
samskivert/samskivert
src/main/java/com/samskivert/swing/RadialMenu.java
RadialMenu.deactivate
public void deactivate () { if (_host != null) { // unwire ourselves from the host component Component comp = _host.getComponent(); comp.removeMouseListener(this); comp.removeMouseMotionListener(this); // reinstate the previous mouse listeners ...
java
public void deactivate () { if (_host != null) { // unwire ourselves from the host component Component comp = _host.getComponent(); comp.removeMouseListener(this); comp.removeMouseMotionListener(this); // reinstate the previous mouse listeners ...
[ "public", "void", "deactivate", "(", ")", "{", "if", "(", "_host", "!=", "null", ")", "{", "// unwire ourselves from the host component", "Component", "comp", "=", "_host", ".", "getComponent", "(", ")", ";", "comp", ".", "removeMouseListener", "(", "this", ")...
Deactivates the menu.
[ "Deactivates", "the", "menu", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialMenu.java#L273-L301