repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
samskivert/samskivert
src/main/java/com/samskivert/swing/RadialMenu.java
RadialMenu.render
public void render (Graphics2D gfx) { Component host = _host.getComponent(); int x = _bounds.x, y = _bounds.y; if (_centerLabel != null) { // render the centerpiece label _centerLabel.paint(gfx, x + _centerLabel.closedBounds.x, y + _ce...
java
public void render (Graphics2D gfx) { Component host = _host.getComponent(); int x = _bounds.x, y = _bounds.y; if (_centerLabel != null) { // render the centerpiece label _centerLabel.paint(gfx, x + _centerLabel.closedBounds.x, y + _ce...
[ "public", "void", "render", "(", "Graphics2D", "gfx", ")", "{", "Component", "host", "=", "_host", ".", "getComponent", "(", ")", ";", "int", "x", "=", "_bounds", ".", "x", ",", "y", "=", "_bounds", ".", "y", ";", "if", "(", "_centerLabel", "!=", "...
Renders the current configuration of this menu.
[ "Renders", "the", "current", "configuration", "of", "this", "menu", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialMenu.java#L306-L341
train
samskivert/samskivert
src/main/java/com/samskivert/swing/RadialMenu.java
RadialMenu.repaint
protected void repaint () { // only repaint the area that we overlap _host.repaintRect(_bounds.x, _bounds.y, _bounds.width+1, _bounds.height+1); }
java
protected void repaint () { // only repaint the area that we overlap _host.repaintRect(_bounds.x, _bounds.y, _bounds.width+1, _bounds.height+1); }
[ "protected", "void", "repaint", "(", ")", "{", "// only repaint the area that we overlap", "_host", ".", "repaintRect", "(", "_bounds", ".", "x", ",", "_bounds", ".", "y", ",", "_bounds", ".", "width", "+", "1", ",", "_bounds", ".", "height", "+", "1", ")"...
Requests that our host component repaint the part of itself that we occupy.
[ "Requests", "that", "our", "host", "component", "repaint", "the", "part", "of", "itself", "that", "we", "occupy", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialMenu.java#L576-L580
train
samskivert/samskivert
src/main/java/com/samskivert/util/CurrencyUtil.java
CurrencyUtil.currency
public static String currency (double value, Locale locale) { return currency(value, NumberFormat.getCurrencyInstance(locale)); }
java
public static String currency (double value, Locale locale) { return currency(value, NumberFormat.getCurrencyInstance(locale)); }
[ "public", "static", "String", "currency", "(", "double", "value", ",", "Locale", "locale", ")", "{", "return", "currency", "(", "value", ",", "NumberFormat", ".", "getCurrencyInstance", "(", "locale", ")", ")", ";", "}" ]
Converts a number representing currency in the specified locale to a displayable string.
[ "Converts", "a", "number", "representing", "currency", "in", "the", "specified", "locale", "to", "a", "displayable", "string", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CurrencyUtil.java#L29-L32
train
samskivert/samskivert
src/main/java/com/samskivert/jdbc/JORARepository.java
JORARepository.update
protected <T> int update (final Table<T> table, final T object, final FieldMask mask) throws PersistenceException { return executeUpdate(new Operation<Integer>() { public Integer invoke (Connection conn, DatabaseLiaison liaison) throws SQLExc...
java
protected <T> int update (final Table<T> table, final T object, final FieldMask mask) throws PersistenceException { return executeUpdate(new Operation<Integer>() { public Integer invoke (Connection conn, DatabaseLiaison liaison) throws SQLExc...
[ "protected", "<", "T", ">", "int", "update", "(", "final", "Table", "<", "T", ">", "table", ",", "final", "T", "object", ",", "final", "FieldMask", "mask", ")", "throws", "PersistenceException", "{", "return", "executeUpdate", "(", "new", "Operation", "<",...
Updates fields specified by the supplied field mask in the supplied object in the specified table. @return the number of rows modified by the update.
[ "Updates", "fields", "specified", "by", "the", "supplied", "field", "mask", "in", "the", "supplied", "object", "in", "the", "specified", "table", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JORARepository.java#L81-L92
train
samskivert/samskivert
src/main/java/com/samskivert/jdbc/JORARepository.java
JORARepository.loadAll
protected <T> ArrayList<T> loadAll (final Table<T> table, final String query) throws PersistenceException { return execute(new Operation<ArrayList<T>>() { public ArrayList<T> invoke ( Connection conn, DatabaseLiaison liaison) ...
java
protected <T> ArrayList<T> loadAll (final Table<T> table, final String query) throws PersistenceException { return execute(new Operation<ArrayList<T>>() { public ArrayList<T> invoke ( Connection conn, DatabaseLiaison liaison) ...
[ "protected", "<", "T", ">", "ArrayList", "<", "T", ">", "loadAll", "(", "final", "Table", "<", "T", ">", "table", ",", "final", "String", "query", ")", "throws", "PersistenceException", "{", "return", "execute", "(", "new", "Operation", "<", "ArrayList", ...
Loads all objects from the specified table that match the supplied query.
[ "Loads", "all", "objects", "from", "the", "specified", "table", "that", "match", "the", "supplied", "query", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JORARepository.java#L98-L110
train
samskivert/samskivert
src/main/java/com/samskivert/jdbc/JORARepository.java
JORARepository.loadAllByExample
protected <T> ArrayList<T> loadAllByExample ( final Table<T> table, final T example) throws PersistenceException { return execute(new Operation<ArrayList<T>>() { public ArrayList<T> invoke ( Connection conn, DatabaseLiaison liaison) throws SQLExcep...
java
protected <T> ArrayList<T> loadAllByExample ( final Table<T> table, final T example) throws PersistenceException { return execute(new Operation<ArrayList<T>>() { public ArrayList<T> invoke ( Connection conn, DatabaseLiaison liaison) throws SQLExcep...
[ "protected", "<", "T", ">", "ArrayList", "<", "T", ">", "loadAllByExample", "(", "final", "Table", "<", "T", ">", "table", ",", "final", "T", "example", ")", "throws", "PersistenceException", "{", "return", "execute", "(", "new", "Operation", "<", "ArrayLi...
Loads all objects from the specified table that match the supplied example.
[ "Loads", "all", "objects", "from", "the", "specified", "table", "that", "match", "the", "supplied", "example", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JORARepository.java#L134-L146
train
samskivert/samskivert
src/main/java/com/samskivert/jdbc/JORARepository.java
JORARepository.store
protected <T> int store (final Table<T> table, final T object) throws PersistenceException { return executeUpdate(new Operation<Integer>() { public Integer invoke (Connection conn, DatabaseLiaison liaison) throws SQLException, PersistenceException { ...
java
protected <T> int store (final Table<T> table, final T object) throws PersistenceException { return executeUpdate(new Operation<Integer>() { public Integer invoke (Connection conn, DatabaseLiaison liaison) throws SQLException, PersistenceException { ...
[ "protected", "<", "T", ">", "int", "store", "(", "final", "Table", "<", "T", ">", "table", ",", "final", "T", "object", ")", "throws", "PersistenceException", "{", "return", "executeUpdate", "(", "new", "Operation", "<", "Integer", ">", "(", ")", "{", ...
First attempts to update the supplied object and if that modifies zero rows, inserts the object into the specified table. The table must be configured to store items of the supplied type. @return -1 if the object was updated, the last inserted id if it was inserted.
[ "First", "attempts", "to", "update", "the", "supplied", "object", "and", "if", "that", "modifies", "zero", "rows", "inserts", "the", "object", "into", "the", "specified", "table", ".", "The", "table", "must", "be", "configured", "to", "store", "items", "of",...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JORARepository.java#L244-L258
train
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.fixedText
public String fixedText (String name, String extra, Object value) { return fixedInput("text", name, value, extra); }
java
public String fixedText (String name, String extra, Object value) { return fixedInput("text", name, value, extra); }
[ "public", "String", "fixedText", "(", "String", "name", ",", "String", "extra", ",", "Object", "value", ")", "{", "return", "fixedInput", "(", "\"text\"", ",", "name", ",", "value", ",", "extra", ")", ";", "}" ]
Creates a text input field with the specified name and the specified extra arguments and the specified value.
[ "Creates", "a", "text", "input", "field", "with", "the", "specified", "name", "and", "the", "specified", "extra", "arguments", "and", "the", "specified", "value", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L90-L93
train
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.submitExtra
public String submitExtra (String name, String text, String extra) { return fixedInput("submit", name, text, extra); }
java
public String submitExtra (String name, String text, String extra) { return fixedInput("submit", name, text, extra); }
[ "public", "String", "submitExtra", "(", "String", "name", ",", "String", "text", ",", "String", "extra", ")", "{", "return", "fixedInput", "(", "\"submit\"", ",", "name", ",", "text", ",", "extra", ")", ";", "}" ]
Constructs a submit element with the specified parameter name and the specified button text with the specified extra text.
[ "Constructs", "a", "submit", "element", "with", "the", "specified", "parameter", "name", "and", "the", "specified", "button", "text", "with", "the", "specified", "extra", "text", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L176-L179
train
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.imageSubmit
public String imageSubmit (String name, String value, String imagePath) { return fixedInput("image", name, value, "src=\"" + imagePath + "\""); }
java
public String imageSubmit (String name, String value, String imagePath) { return fixedInput("image", name, value, "src=\"" + imagePath + "\""); }
[ "public", "String", "imageSubmit", "(", "String", "name", ",", "String", "value", ",", "String", "imagePath", ")", "{", "return", "fixedInput", "(", "\"image\"", ",", "name", ",", "value", ",", "\"src=\\\"\"", "+", "imagePath", "+", "\"\\\"\"", ")", ";", "...
Constructs a image submit element with the specified parameter name and image path.
[ "Constructs", "a", "image", "submit", "element", "with", "the", "specified", "parameter", "name", "and", "image", "path", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L194-L197
train
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.button
public String button (String name, String text, String extra) { return fixedInput("button", name, text, extra); }
java
public String button (String name, String text, String extra) { return fixedInput("button", name, text, extra); }
[ "public", "String", "button", "(", "String", "name", ",", "String", "text", ",", "String", "extra", ")", "{", "return", "fixedInput", "(", "\"button\"", ",", "name", ",", "text", ",", "extra", ")", ";", "}" ]
Constructs a button input element with the specified parameter name, the specified button text, and the specified extra text.
[ "Constructs", "a", "button", "input", "element", "with", "the", "specified", "parameter", "name", "the", "specified", "button", "text", "and", "the", "specified", "extra", "text", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L214-L217
train
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.hidden
public String hidden (String name, Object defaultValue) { return fixedHidden(name, getValue(name, defaultValue)); }
java
public String hidden (String name, Object defaultValue) { return fixedHidden(name, getValue(name, defaultValue)); }
[ "public", "String", "hidden", "(", "String", "name", ",", "Object", "defaultValue", ")", "{", "return", "fixedHidden", "(", "name", ",", "getValue", "(", "name", ",", "defaultValue", ")", ")", ";", "}" ]
Constructs a hidden element with the specified parameter name where the value is extracted from the appropriate request parameter unless there is no value in which case the supplied default value is used.
[ "Constructs", "a", "hidden", "element", "with", "the", "specified", "parameter", "name", "where", "the", "value", "is", "extracted", "from", "the", "appropriate", "request", "parameter", "unless", "there", "is", "no", "value", "in", "which", "case", "the", "su...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L234-L237
train
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.checkbox
public String checkbox (String name, boolean defaultValue) { String value = getParameter(name); return fixedCheckbox( name, (value == null) ? defaultValue : !value.equals("")); }
java
public String checkbox (String name, boolean defaultValue) { String value = getParameter(name); return fixedCheckbox( name, (value == null) ? defaultValue : !value.equals("")); }
[ "public", "String", "checkbox", "(", "String", "name", ",", "boolean", "defaultValue", ")", "{", "String", "value", "=", "getParameter", "(", "name", ")", ";", "return", "fixedCheckbox", "(", "name", ",", "(", "value", "==", "null", ")", "?", "defaultValue...
Constructs a checkbox input field with the specified name and default value.
[ "Constructs", "a", "checkbox", "input", "field", "with", "the", "specified", "name", "and", "default", "value", "." ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L264-L269
train