id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
42,600
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.spread
public Binder spread(Class<?>... spreadTypes) { if (spreadTypes.length == 0) { return dropLast(); } return new Binder(this, new Spread(type(), spreadTypes)); }
java
public Binder spread(Class<?>... spreadTypes) { if (spreadTypes.length == 0) { return dropLast(); } return new Binder(this, new Spread(type(), spreadTypes)); }
[ "public", "Binder", "spread", "(", "Class", "<", "?", ">", "...", "spreadTypes", ")", "{", "if", "(", "spreadTypes", ".", "length", "==", "0", ")", "{", "return", "dropLast", "(", ")", ";", "}", "return", "new", "Binder", "(", "this", ",", "new", "...
Spread a trailing array argument into the specified argument types. @param spreadTypes the types into which to spread the incoming Object[] @return a new Binder
[ "Spread", "a", "trailing", "array", "argument", "into", "the", "specified", "argument", "types", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L842-L848
42,601
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.spread
public Binder spread(int count) { if (count == 0) { return dropLast(); } Class<?> aryType = type().parameterType(type().parameterCount() - 1); assert aryType.isArray(); Class<?>[] spreadTypes = new Class[count]; Arrays.fill(spreadTypes, aryType.getComponent...
java
public Binder spread(int count) { if (count == 0) { return dropLast(); } Class<?> aryType = type().parameterType(type().parameterCount() - 1); assert aryType.isArray(); Class<?>[] spreadTypes = new Class[count]; Arrays.fill(spreadTypes, aryType.getComponent...
[ "public", "Binder", "spread", "(", "int", "count", ")", "{", "if", "(", "count", "==", "0", ")", "{", "return", "dropLast", "(", ")", ";", "}", "Class", "<", "?", ">", "aryType", "=", "type", "(", ")", ".", "parameterType", "(", "type", "(", ")",...
Spread a trailing array argument into the given number of arguments of the type of the array. @param count the new count of arguments to spread from the trailing array @return a new Binder
[ "Spread", "a", "trailing", "array", "argument", "into", "the", "given", "number", "of", "arguments", "of", "the", "type", "of", "the", "array", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L857-L870
42,602
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.collect
public Binder collect(int index, Class<?> type) { return new Binder(this, new Collect(type(), index, type)); }
java
public Binder collect(int index, Class<?> type) { return new Binder(this, new Collect(type(), index, type)); }
[ "public", "Binder", "collect", "(", "int", "index", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Collect", "(", "type", "(", ")", ",", "index", ",", "type", ")", ")", ";", "}" ]
Box all incoming arguments from the given position onward into the given array type. @param index the index from which to start boxing args @param type the array type into which the args will be boxed @return a new Binder
[ "Box", "all", "incoming", "arguments", "from", "the", "given", "position", "onward", "into", "the", "given", "array", "type", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L879-L881
42,603
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.varargs
public Binder varargs(int index, Class<?> type) { return new Binder(this, new Varargs(type(), index, type)); }
java
public Binder varargs(int index, Class<?> type) { return new Binder(this, new Varargs(type(), index, type)); }
[ "public", "Binder", "varargs", "(", "int", "index", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Varargs", "(", "type", "(", ")", ",", "index", ",", "type", ")", ")", ";", "}" ]
Box all incoming arguments from the given position onward into the given array type. This version accepts a variable number of incoming arguments. @param index the index from which to start boxing args @param type the array type into which the args will be boxed @return a new Binder
[ "Box", "all", "incoming", "arguments", "from", "the", "given", "position", "onward", "into", "the", "given", "array", "type", ".", "This", "version", "accepts", "a", "variable", "number", "of", "incoming", "arguments", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L903-L905
42,604
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.foldVoid
public Binder foldVoid(MethodHandle function) { if (type().returnType() == void.class) { return fold(function); } else { return fold(function.asType(function.type().changeReturnType(void.class))); } }
java
public Binder foldVoid(MethodHandle function) { if (type().returnType() == void.class) { return fold(function); } else { return fold(function.asType(function.type().changeReturnType(void.class))); } }
[ "public", "Binder", "foldVoid", "(", "MethodHandle", "function", ")", "{", "if", "(", "type", "(", ")", ".", "returnType", "(", ")", "==", "void", ".", "class", ")", "{", "return", "fold", "(", "function", ")", ";", "}", "else", "{", "return", "fold"...
Process the incoming arguments using the given handle, leaving the argument list unmodified. @param function the function that will process the incoming arguments. Its signature must match the current signature's arguments exactly. @return a new Binder
[ "Process", "the", "incoming", "arguments", "using", "the", "given", "handle", "leaving", "the", "argument", "list", "unmodified", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L939-L945
42,605
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.foldVirtual
public Binder foldVirtual(MethodHandles.Lookup lookup, String method) { return fold(Binder.from(type()).invokeVirtualQuiet(lookup, method)); }
java
public Binder foldVirtual(MethodHandles.Lookup lookup, String method) { return fold(Binder.from(type()).invokeVirtualQuiet(lookup, method)); }
[ "public", "Binder", "foldVirtual", "(", "MethodHandles", ".", "Lookup", "lookup", ",", "String", "method", ")", "{", "return", "fold", "(", "Binder", ".", "from", "(", "type", "(", ")", ")", ".", "invokeVirtualQuiet", "(", "lookup", ",", "method", ")", "...
Process the incoming arguments by calling the given method on the first argument, inserting the result as the first argument. @param lookup the java.lang.invoke.MethodHandles.Lookup to use @param method the method to invoke on the first argument @return a new Binder
[ "Process", "the", "incoming", "arguments", "by", "calling", "the", "given", "method", "on", "the", "first", "argument", "inserting", "the", "result", "as", "the", "first", "argument", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L980-L982
42,606
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.filterForward
public Binder filterForward(int index, MethodHandle... functions) { Binder filtered = this; for (int i = 0; i < functions.length; i++) { filtered = filtered.filter(index + i, functions[i]); } return filtered; }
java
public Binder filterForward(int index, MethodHandle... functions) { Binder filtered = this; for (int i = 0; i < functions.length; i++) { filtered = filtered.filter(index + i, functions[i]); } return filtered; }
[ "public", "Binder", "filterForward", "(", "int", "index", ",", "MethodHandle", "...", "functions", ")", "{", "Binder", "filtered", "=", "this", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "functions", ".", "length", ";", "i", "++", ")", "{"...
Filter incoming arguments, from the given index, replacing each with the result of calling the associated function in the given list. This version guarantees left-to-right evaluation of filter functions, potentially at the cost of a more complex handle tree. @param index the index of the first argument to filter @...
[ "Filter", "incoming", "arguments", "from", "the", "given", "index", "replacing", "each", "with", "the", "result", "of", "calling", "the", "associated", "function", "in", "the", "given", "list", ".", "This", "version", "guarantees", "left", "-", "to", "-", "r...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1021-L1029
42,607
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.catchException
public Binder catchException(Class<? extends Throwable> throwable, MethodHandle function) { return new Binder(this, new Catch(throwable, function)); }
java
public Binder catchException(Class<? extends Throwable> throwable, MethodHandle function) { return new Binder(this, new Catch(throwable, function)); }
[ "public", "Binder", "catchException", "(", "Class", "<", "?", "extends", "Throwable", ">", "throwable", ",", "MethodHandle", "function", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Catch", "(", "throwable", ",", "function", ")", ")", ";"...
Catch the given exception type from the downstream chain and handle it with the given function. @param throwable the exception type to catch @param function the function to use for handling the exception @return a new Binder
[ "Catch", "the", "given", "exception", "type", "from", "the", "downstream", "chain", "and", "handle", "it", "with", "the", "given", "function", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1073-L1075
42,608
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.nop
public MethodHandle nop() { if (type().returnType() != void.class) { throw new InvalidTransformException("must have void return type to nop: " + type()); } return invoke(Binder .from(type()) .drop(0, type().parameterCount()) .cast(Objec...
java
public MethodHandle nop() { if (type().returnType() != void.class) { throw new InvalidTransformException("must have void return type to nop: " + type()); } return invoke(Binder .from(type()) .drop(0, type().parameterCount()) .cast(Objec...
[ "public", "MethodHandle", "nop", "(", ")", "{", "if", "(", "type", "(", ")", ".", "returnType", "(", ")", "!=", "void", ".", "class", ")", "{", "throw", "new", "InvalidTransformException", "(", "\"must have void return type to nop: \"", "+", "type", "(", ")"...
Apply all transforms to an endpoint that does absolutely nothing. Useful for creating exception handlers in void methods that simply ignore the exception. @return a handle that has all transforms applied and does nothing at its endpoint
[ "Apply", "all", "transforms", "to", "an", "endpoint", "that", "does", "absolutely", "nothing", ".", "Useful", "for", "creating", "exception", "handlers", "in", "void", "methods", "that", "simply", "ignore", "the", "exception", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1083-L1092
42,609
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.throwException
public MethodHandle throwException() { if (type().parameterCount() != 1 || !Throwable.class.isAssignableFrom(type().parameterType(0))) { throw new InvalidTransformException("incoming signature must have one Throwable type as its sole argument: " + type()); } return invoke(MethodHandl...
java
public MethodHandle throwException() { if (type().parameterCount() != 1 || !Throwable.class.isAssignableFrom(type().parameterType(0))) { throw new InvalidTransformException("incoming signature must have one Throwable type as its sole argument: " + type()); } return invoke(MethodHandl...
[ "public", "MethodHandle", "throwException", "(", ")", "{", "if", "(", "type", "(", ")", ".", "parameterCount", "(", ")", "!=", "1", "||", "!", "Throwable", ".", "class", ".", "isAssignableFrom", "(", "type", "(", ")", ".", "parameterType", "(", "0", ")...
Throw the current signature's sole Throwable argument. Return type does not matter, since it will never return. @return a handle that has all transforms applied and which will eventually throw an exception
[ "Throw", "the", "current", "signature", "s", "sole", "Throwable", "argument", ".", "Return", "type", "does", "not", "matter", "since", "it", "will", "never", "return", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1100-L1105
42,610
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.constant
public MethodHandle constant(Object value) { return invoke(MethodHandles.constant(type().returnType(), value)); }
java
public MethodHandle constant(Object value) { return invoke(MethodHandles.constant(type().returnType(), value)); }
[ "public", "MethodHandle", "constant", "(", "Object", "value", ")", "{", "return", "invoke", "(", "MethodHandles", ".", "constant", "(", "type", "(", ")", ".", "returnType", "(", ")", ",", "value", ")", ")", ";", "}" ]
Apply the tranforms, binding them to a constant value that will propagate back through the chain. The chain's expected return type at that point must be compatible with the given value's type. @param value the constant value to put at the end of the chain @return a handle that has all transforms applied in sequence up...
[ "Apply", "the", "tranforms", "binding", "them", "to", "a", "constant", "value", "that", "will", "propagate", "back", "through", "the", "chain", ".", "The", "chain", "s", "expected", "return", "type", "at", "that", "point", "must", "be", "compatible", "with",...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1115-L1117
42,611
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.invoke
public MethodHandle invoke(MethodHandle target) { MethodHandle current = target; for (Transform t : transforms) { current = t.up(current); } // if resulting handle's type does not match start, attempt one more cast current = MethodHandles.explicitCastArguments(curren...
java
public MethodHandle invoke(MethodHandle target) { MethodHandle current = target; for (Transform t : transforms) { current = t.up(current); } // if resulting handle's type does not match start, attempt one more cast current = MethodHandles.explicitCastArguments(curren...
[ "public", "MethodHandle", "invoke", "(", "MethodHandle", "target", ")", "{", "MethodHandle", "current", "=", "target", ";", "for", "(", "Transform", "t", ":", "transforms", ")", "{", "current", "=", "t", ".", "up", "(", "current", ")", ";", "}", "// if r...
Apply the chain of transforms with the target method handle as the final endpoint. Produces a handle that has the transforms in given sequence. If the final handle's type does not exactly match the initial type for this Binder, an additional cast will be attempted. @param target the endpoint handle to bind to @return...
[ "Apply", "the", "chain", "of", "transforms", "with", "the", "target", "method", "handle", "as", "the", "final", "endpoint", ".", "Produces", "a", "handle", "that", "has", "the", "transforms", "in", "given", "sequence", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1140-L1150
42,612
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.arrayAccess
public MethodHandle arrayAccess(VarHandle.AccessMode mode) { return invoke(MethodHandles.arrayElementVarHandle(type().parameterType(0)).toMethodHandle(mode)); }
java
public MethodHandle arrayAccess(VarHandle.AccessMode mode) { return invoke(MethodHandles.arrayElementVarHandle(type().parameterType(0)).toMethodHandle(mode)); }
[ "public", "MethodHandle", "arrayAccess", "(", "VarHandle", ".", "AccessMode", "mode", ")", "{", "return", "invoke", "(", "MethodHandles", ".", "arrayElementVarHandle", "(", "type", "(", ")", ".", "parameterType", "(", "0", ")", ")", ".", "toMethodHandle", "(",...
Apply the chain of transforms and bind them to an array varhandle operation. The signature at the endpoint must match the VarHandle access type passed in.
[ "Apply", "the", "chain", "of", "transforms", "and", "bind", "them", "to", "an", "array", "varhandle", "operation", ".", "The", "signature", "at", "the", "endpoint", "must", "match", "the", "VarHandle", "access", "type", "passed", "in", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1636-L1638
42,613
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.branch
public MethodHandle branch(MethodHandle test, MethodHandle truePath, MethodHandle falsePath) { return invoke(MethodHandles.guardWithTest(test, truePath, falsePath)); }
java
public MethodHandle branch(MethodHandle test, MethodHandle truePath, MethodHandle falsePath) { return invoke(MethodHandles.guardWithTest(test, truePath, falsePath)); }
[ "public", "MethodHandle", "branch", "(", "MethodHandle", "test", ",", "MethodHandle", "truePath", ",", "MethodHandle", "falsePath", ")", "{", "return", "invoke", "(", "MethodHandles", ".", "guardWithTest", "(", "test", ",", "truePath", ",", "falsePath", ")", ")"...
Apply the chain of transforms and bind them to a boolean branch as from java.lang.invoke.MethodHandles.guardWithTest. As with GWT, the current endpoint signature must match the given target and fallback signatures. @param test the test handle @param truePath the target handle @param falsePath the fallback handle...
[ "Apply", "the", "chain", "of", "transforms", "and", "bind", "them", "to", "a", "boolean", "branch", "as", "from", "java", ".", "lang", ".", "invoke", ".", "MethodHandles", ".", "guardWithTest", ".", "As", "with", "GWT", "the", "current", "endpoint", "signa...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1650-L1652
42,614
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.toJava
public String toJava(MethodType incoming) { StringBuilder builder = new StringBuilder(); boolean second = false; for (Transform transform : transforms) { if (second) builder.append('\n'); second = true; builder.append(transform.toJava(incoming)); } ...
java
public String toJava(MethodType incoming) { StringBuilder builder = new StringBuilder(); boolean second = false; for (Transform transform : transforms) { if (second) builder.append('\n'); second = true; builder.append(transform.toJava(incoming)); } ...
[ "public", "String", "toJava", "(", "MethodType", "incoming", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "second", "=", "false", ";", "for", "(", "Transform", "transform", ":", "transforms", ")", "{", "if", ...
Produce Java code that would perform equivalent operations to this binder. @return Java code for the handle adaptations this Binder would produce.
[ "Produce", "Java", "code", "that", "would", "perform", "equivalent", "operations", "to", "this", "binder", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1669-L1678
42,615
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/GraphRequestBuilder.java
GraphRequestBuilder.execute
@Override public HttpResponse execute() throws IOException { if (this.method == HttpMethod.GET) { String url = this.toString(); if (url.length() > this.cutoff) { if (log.isLoggable(Level.FINER)) log.finer("URL length " + url.length() + " too long, converting GET to POST: " + url); Str...
java
@Override public HttpResponse execute() throws IOException { if (this.method == HttpMethod.GET) { String url = this.toString(); if (url.length() > this.cutoff) { if (log.isLoggable(Level.FINER)) log.finer("URL length " + url.length() + " too long, converting GET to POST: " + url); Str...
[ "@", "Override", "public", "HttpResponse", "execute", "(", ")", "throws", "IOException", "{", "if", "(", "this", ".", "method", "==", "HttpMethod", ".", "GET", ")", "{", "String", "url", "=", "this", ".", "toString", "(", ")", ";", "if", "(", "url", ...
Replace excessively-long GET requests with a POST.
[ "Replace", "excessively", "-", "long", "GET", "requests", "with", "a", "POST", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/GraphRequestBuilder.java#L82-L96
42,616
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/Batch.java
Batch.graph
private <T> GraphRequest<T> graph(String object, JavaType type, Param... params) { this.checkForBatchExecution(); // The data is transformed through a chain of wrappers GraphRequest<T> req = new GraphRequest<T>(object, params, this.mapper, this.<T>createMappingChain(type)); this.graphRequests.ad...
java
private <T> GraphRequest<T> graph(String object, JavaType type, Param... params) { this.checkForBatchExecution(); // The data is transformed through a chain of wrappers GraphRequest<T> req = new GraphRequest<T>(object, params, this.mapper, this.<T>createMappingChain(type)); this.graphRequests.ad...
[ "private", "<", "T", ">", "GraphRequest", "<", "T", ">", "graph", "(", "String", "object", ",", "JavaType", "type", ",", "Param", "...", "params", ")", "{", "this", ".", "checkForBatchExecution", "(", ")", ";", "// The data is transformed through a chain of wrap...
The actual implementation of this, after we've converted to proper Jackson JavaType
[ "The", "actual", "implementation", "of", "this", "after", "we", "ve", "converted", "to", "proper", "Jackson", "JavaType" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L187-L196
42,617
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/Batch.java
Batch.query
private <T> QueryRequest<T> query(String fql, JavaType type) { this.checkForBatchExecution(); if (this.multiqueryRequest == null) { this.multiqueryRequest = new MultiqueryRequest(mapper, this.createUnmappedChain()); this.graphRequests.add(this.multiqueryRequest); } // There is a circular ref...
java
private <T> QueryRequest<T> query(String fql, JavaType type) { this.checkForBatchExecution(); if (this.multiqueryRequest == null) { this.multiqueryRequest = new MultiqueryRequest(mapper, this.createUnmappedChain()); this.graphRequests.add(this.multiqueryRequest); } // There is a circular ref...
[ "private", "<", "T", ">", "QueryRequest", "<", "T", ">", "query", "(", "String", "fql", ",", "JavaType", "type", ")", "{", "this", ".", "checkForBatchExecution", "(", ")", ";", "if", "(", "this", ".", "multiqueryRequest", "==", "null", ")", "{", "this"...
Implementation now that we have chosen a Jackson JavaType for the return value
[ "Implementation", "now", "that", "we", "have", "chosen", "a", "Jackson", "JavaType", "for", "the", "return", "value" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L233-L255
42,618
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/Batch.java
Batch.createMappingChain
private <T> MapperWrapper<T> createMappingChain(JavaType type) { return new MapperWrapper<T>(type, this.mapper, this.createUnmappedChain()); }
java
private <T> MapperWrapper<T> createMappingChain(JavaType type) { return new MapperWrapper<T>(type, this.mapper, this.createUnmappedChain()); }
[ "private", "<", "T", ">", "MapperWrapper", "<", "T", ">", "createMappingChain", "(", "JavaType", "type", ")", "{", "return", "new", "MapperWrapper", "<", "T", ">", "(", "type", ",", "this", ".", "mapper", ",", "this", ".", "createUnmappedChain", "(", ")"...
Adds mapping to the basic unmapped chain.
[ "Adds", "mapping", "to", "the", "basic", "unmapped", "chain", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L332-L334
42,619
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/Batch.java
Batch.createUnmappedChain
private ErrorDetectingWrapper createUnmappedChain() { int nextIndex = this.graphRequests.size(); return new ErrorDetectingWrapper( new GraphNodeExtractor(nextIndex, this.mapper, new ErrorDetectingWrapper(this))); }
java
private ErrorDetectingWrapper createUnmappedChain() { int nextIndex = this.graphRequests.size(); return new ErrorDetectingWrapper( new GraphNodeExtractor(nextIndex, this.mapper, new ErrorDetectingWrapper(this))); }
[ "private", "ErrorDetectingWrapper", "createUnmappedChain", "(", ")", "{", "int", "nextIndex", "=", "this", ".", "graphRequests", ".", "size", "(", ")", ";", "return", "new", "ErrorDetectingWrapper", "(", "new", "GraphNodeExtractor", "(", "nextIndex", ",", "this", ...
Creates the common chain of wrappers that will select out one graph request from the batch and error check it both at the batch level and at the individual request level. Result will be an unmapped JsonNode.
[ "Creates", "the", "common", "chain", "of", "wrappers", "that", "will", "select", "out", "one", "graph", "request", "from", "the", "batch", "and", "error", "check", "it", "both", "at", "the", "batch", "level", "and", "at", "the", "individual", "request", "l...
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L341-L348
42,620
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/Batch.java
Batch.getRawBatchResult
private Later<JsonNode> getRawBatchResult() { if (this.rawBatchResult == null) { // Use LaterWrapper to cache the result so we don't fetch over and over this.rawBatchResult = new LaterWrapper<JsonNode, JsonNode>(this.createFetcher()); // Also let the master know it's time to kick off any other batch...
java
private Later<JsonNode> getRawBatchResult() { if (this.rawBatchResult == null) { // Use LaterWrapper to cache the result so we don't fetch over and over this.rawBatchResult = new LaterWrapper<JsonNode, JsonNode>(this.createFetcher()); // Also let the master know it's time to kick off any other batch...
[ "private", "Later", "<", "JsonNode", ">", "getRawBatchResult", "(", ")", "{", "if", "(", "this", ".", "rawBatchResult", "==", "null", ")", "{", "// Use LaterWrapper to cache the result so we don't fetch over and over\r", "this", ".", "rawBatchResult", "=", "new", "Lat...
Get the batch result, firing it off if necessary
[ "Get", "the", "batch", "result", "firing", "it", "off", "if", "necessary" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L370-L383
42,621
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/Batch.java
Batch.createFetcher
private Later<JsonNode> createFetcher() { final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retries); // This actually creates the correct JSON structure as an array String batchValue = JSONUtils.toJSON(this.graphRequests, this.mapper); if (log.i...
java
private Later<JsonNode> createFetcher() { final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retries); // This actually creates the correct JSON structure as an array String batchValue = JSONUtils.toJSON(this.graphRequests, this.mapper); if (log.i...
[ "private", "Later", "<", "JsonNode", ">", "createFetcher", "(", ")", "{", "final", "RequestBuilder", "call", "=", "new", "GraphRequestBuilder", "(", "getGraphEndpoint", "(", ")", ",", "HttpMethod", ".", "POST", ",", "this", ".", "timeout", ",", "this", ".", ...
Constructs the batch query and executes it, possibly asynchronously. @return an asynchronous handle to the raw batch result, whatever it may be.
[ "Constructs", "the", "batch", "query", "and", "executes", "it", "possibly", "asynchronously", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L398-L442
42,622
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java
ErrorDetectingWrapper.throwPageMigratedException
private void throwPageMigratedException(String msg, int code, int subcode, String userTitle, String userMsg) { // This SUCKS ASS. Messages look like: // (#21) Page ID 114267748588304 was migrated to page ID 111013272313096. Please update your API calls to the new ID Matcher matcher = ID_PATTERN.matcher(msg...
java
private void throwPageMigratedException(String msg, int code, int subcode, String userTitle, String userMsg) { // This SUCKS ASS. Messages look like: // (#21) Page ID 114267748588304 was migrated to page ID 111013272313096. Please update your API calls to the new ID Matcher matcher = ID_PATTERN.matcher(msg...
[ "private", "void", "throwPageMigratedException", "(", "String", "msg", ",", "int", "code", ",", "int", "subcode", ",", "String", "userTitle", ",", "String", "userMsg", ")", "{", "// This SUCKS ASS. Messages look like:\r", "// (#21) Page ID 114267748588304 was migrated to p...
Builds the proper exception and throws it. @throws PageMigratedException always
[ "Builds", "the", "proper", "exception", "and", "throws", "it", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java#L138-L148
42,623
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java
ErrorDetectingWrapper.extractNextId
private long extractNextId(Matcher matcher, String msg) { if (!matcher.find()) throw new IllegalStateException("Facebook changed the error msg for page migration to something unfamiliar. The new msg is: " + msg); String idStr = matcher.group().substring("ID ".length()); return Long.parseLong(idStr); }
java
private long extractNextId(Matcher matcher, String msg) { if (!matcher.find()) throw new IllegalStateException("Facebook changed the error msg for page migration to something unfamiliar. The new msg is: " + msg); String idStr = matcher.group().substring("ID ".length()); return Long.parseLong(idStr); }
[ "private", "long", "extractNextId", "(", "Matcher", "matcher", ",", "String", "msg", ")", "{", "if", "(", "!", "matcher", ".", "find", "(", ")", ")", "throw", "new", "IllegalStateException", "(", "\"Facebook changed the error msg for page migration to something unfami...
Gets the next id out of the matcher
[ "Gets", "the", "next", "id", "out", "of", "the", "matcher" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java#L153-L159
42,624
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java
ErrorDetectingWrapper.throwCodeAndMessage
protected void throwCodeAndMessage(int code, String msg) { switch (code) { case 0: case 101: case 102: case 190: throw new OAuthException(msg, "OAuthException", code, null, null, null); default: throw new ErrorFacebookException(msg + " (code " + code +")", null, code, null, null, null); }...
java
protected void throwCodeAndMessage(int code, String msg) { switch (code) { case 0: case 101: case 102: case 190: throw new OAuthException(msg, "OAuthException", code, null, null, null); default: throw new ErrorFacebookException(msg + " (code " + code +")", null, code, null, null, null); }...
[ "protected", "void", "throwCodeAndMessage", "(", "int", "code", ",", "String", "msg", ")", "{", "switch", "(", "code", ")", "{", "case", "0", ":", "case", "101", ":", "case", "102", ":", "case", "190", ":", "throw", "new", "OAuthException", "(", "msg",...
Throw the appropriate exception for the given legacy code and message. Always throws, never returns.
[ "Throw", "the", "appropriate", "exception", "for", "the", "given", "legacy", "code", "and", "message", ".", "Always", "throws", "never", "returns", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/ErrorDetectingWrapper.java#L227-L236
42,625
premium-minds/pm-wicket-utils
src/main/java/com/premiumminds/webapp/wicket/repeaters/AjaxListSetView.java
AjaxListSetView.newItem
protected ListSetItem<T> newItem(IModel<T> itemModel) { ListSetItem<T> item = new ListSetItem<T>(Integer.toString(counter++), itemModel); populateItem(item); return item; }
java
protected ListSetItem<T> newItem(IModel<T> itemModel) { ListSetItem<T> item = new ListSetItem<T>(Integer.toString(counter++), itemModel); populateItem(item); return item; }
[ "protected", "ListSetItem", "<", "T", ">", "newItem", "(", "IModel", "<", "T", ">", "itemModel", ")", "{", "ListSetItem", "<", "T", ">", "item", "=", "new", "ListSetItem", "<", "T", ">", "(", "Integer", ".", "toString", "(", "counter", "++", ")", ","...
Create a new ListSetItem for list item. @param itemModel object in the list that the item represents @return ListSetItem
[ "Create", "a", "new", "ListSetItem", "for", "list", "item", "." ]
ed28f4bfb2084dfb2649d9fa283754cb76894d2d
https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/repeaters/AjaxListSetView.java#L175-L180
42,626
premium-minds/pm-wicket-utils
src/main/java/com/premiumminds/webapp/wicket/bootstrap/BootstrapDatePicker.java
BootstrapDatePicker.getDateTextField
public DateTextField getDateTextField(){ DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() { @Override public void component(DateTextField arg0, IVisit<DateTextField> arg1) { arg1.stop(arg0); } }); if (component == null) throw new WicketRunt...
java
public DateTextField getDateTextField(){ DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() { @Override public void component(DateTextField arg0, IVisit<DateTextField> arg1) { arg1.stop(arg0); } }); if (component == null) throw new WicketRunt...
[ "public", "DateTextField", "getDateTextField", "(", ")", "{", "DateTextField", "component", "=", "visitChildren", "(", "DateTextField", ".", "class", ",", "new", "IVisitor", "<", "DateTextField", ",", "DateTextField", ">", "(", ")", "{", "@", "Override", "public...
Gets the DateTextField inside this datepicker wrapper. @return the date field
[ "Gets", "the", "DateTextField", "inside", "this", "datepicker", "wrapper", "." ]
ed28f4bfb2084dfb2649d9fa283754cb76894d2d
https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/bootstrap/BootstrapDatePicker.java#L85-L97
42,627
davidmarquis/fluent-interface-proxy
src/main/java/com/fluentinterface/proxy/internal/BestMatchingConstructor.java
BestMatchingConstructor.typesAreCompatible
private boolean typesAreCompatible(Class<?>[] paramTypes, Class<?>[] constructorParamTypes) { boolean matches = true; for (int i = 0; i < paramTypes.length; i++) { Class<?> paramType = paramTypes[i]; if (paramType != null) { Class<?> inputParamType = translateFro...
java
private boolean typesAreCompatible(Class<?>[] paramTypes, Class<?>[] constructorParamTypes) { boolean matches = true; for (int i = 0; i < paramTypes.length; i++) { Class<?> paramType = paramTypes[i]; if (paramType != null) { Class<?> inputParamType = translateFro...
[ "private", "boolean", "typesAreCompatible", "(", "Class", "<", "?", ">", "[", "]", "paramTypes", ",", "Class", "<", "?", ">", "[", "]", "constructorParamTypes", ")", "{", "boolean", "matches", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", ...
Checks if a set of types are compatible with the given set of constructor parameter types. If an input type is null, then it is considered as a wildcard for matching purposes, and always matches. @param paramTypes A set of input types that are to be matched against constructor parameters. @param constructor...
[ "Checks", "if", "a", "set", "of", "types", "are", "compatible", "with", "the", "given", "set", "of", "constructor", "parameter", "types", ".", "If", "an", "input", "type", "is", "null", "then", "it", "is", "considered", "as", "a", "wildcard", "for", "mat...
8e72fff6cd1f496c76a01773269caead994fea65
https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/proxy/internal/BestMatchingConstructor.java#L112-L132
42,628
rbuck/java-retry
src/main/java/com/github/rbuck/retry/RetryPolicy.java
RetryPolicy.action
public V action(Callable<V> callable) throws Exception { Exception re; RetryState retryState = retryStrategy.getRetryState(); do { try { return callable.call(); } catch (Exception e) { re = e; if (Thread.interrupted() || isI...
java
public V action(Callable<V> callable) throws Exception { Exception re; RetryState retryState = retryStrategy.getRetryState(); do { try { return callable.call(); } catch (Exception e) { re = e; if (Thread.interrupted() || isI...
[ "public", "V", "action", "(", "Callable", "<", "V", ">", "callable", ")", "throws", "Exception", "{", "Exception", "re", ";", "RetryState", "retryState", "=", "retryStrategy", ".", "getRetryState", "(", ")", ";", "do", "{", "try", "{", "return", "callable"...
Perform the specified action under the defined retry semantics. @param callable the action to perform under retry @return the result of the action @throws Exception inspect cause to determine reason, or interrupt status
[ "Perform", "the", "specified", "action", "under", "the", "defined", "retry", "semantics", "." ]
660137ac6226bc3dd1ee6544efa4a02be27aaa66
https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/RetryPolicy.java#L35-L55
42,629
rbuck/java-retry
src/main/java/com/github/rbuck/retry/RetryPolicy.java
RetryPolicy.isInterruptTransitively
private boolean isInterruptTransitively(Throwable e) { do { if (e instanceof InterruptedException) { return true; } e = e.getCause(); } while (e != null); return false; }
java
private boolean isInterruptTransitively(Throwable e) { do { if (e instanceof InterruptedException) { return true; } e = e.getCause(); } while (e != null); return false; }
[ "private", "boolean", "isInterruptTransitively", "(", "Throwable", "e", ")", "{", "do", "{", "if", "(", "e", "instanceof", "InterruptedException", ")", "{", "return", "true", ";", "}", "e", "=", "e", ".", "getCause", "(", ")", ";", "}", "while", "(", "...
Special case during shutdown. @param e possible instance of, or has cause for, an InterruptedException @return true if it is transitively an InterruptedException
[ "Special", "case", "during", "shutdown", "." ]
660137ac6226bc3dd1ee6544efa4a02be27aaa66
https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/RetryPolicy.java#L63-L71
42,630
knightliao/apollo
src/main/java/com/github/knightliao/apollo/redis/RedisClient.java
RedisClient.getSet
public Object getSet(String key, Object value, Integer expiration) throws Exception { Jedis jedis = null; try { jedis = this.jedisPool.getResource(); long begin = System.currentTimeMillis(); // 操作expire成功返回1,失败返回0,仅当均返回1时,实际操作成功 byte[] val = jedis.getSet...
java
public Object getSet(String key, Object value, Integer expiration) throws Exception { Jedis jedis = null; try { jedis = this.jedisPool.getResource(); long begin = System.currentTimeMillis(); // 操作expire成功返回1,失败返回0,仅当均返回1时,实际操作成功 byte[] val = jedis.getSet...
[ "public", "Object", "getSet", "(", "String", "key", ",", "Object", "value", ",", "Integer", "expiration", ")", "throws", "Exception", "{", "Jedis", "jedis", "=", "null", ";", "try", "{", "jedis", "=", "this", ".", "jedisPool", ".", "getResource", "(", ")...
get old value and set new value @param key @param value @param expiration @return false if redis did not execute the option @throws Exception @author wangchongjie
[ "get", "old", "value", "and", "set", "new", "value" ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L162-L197
42,631
knightliao/apollo
src/main/java/com/github/knightliao/apollo/redis/RedisClient.java
RedisClient.add
public boolean add(String key, Object value, Integer expiration) throws Exception { Jedis jedis = null; try { jedis = this.jedisPool.getResource(); long begin = System.currentTimeMillis(); // 操作setnx与expire成功返回1,失败返回0,仅当均返回1时,实际操作成功 Long result = jedis.s...
java
public boolean add(String key, Object value, Integer expiration) throws Exception { Jedis jedis = null; try { jedis = this.jedisPool.getResource(); long begin = System.currentTimeMillis(); // 操作setnx与expire成功返回1,失败返回0,仅当均返回1时,实际操作成功 Long result = jedis.s...
[ "public", "boolean", "add", "(", "String", "key", ",", "Object", "value", ",", "Integer", "expiration", ")", "throws", "Exception", "{", "Jedis", "jedis", "=", "null", ";", "try", "{", "jedis", "=", "this", ".", "jedisPool", ".", "getResource", "(", ")",...
add if not exists @param key @param value @param expiration @return false if redis did not execute the option @throws Exception
[ "add", "if", "not", "exists" ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L293-L322
42,632
knightliao/apollo
src/main/java/com/github/knightliao/apollo/redis/RedisClient.java
RedisClient.exists
public boolean exists(String key) throws Exception { boolean isExist = false; Jedis jedis = null; try { jedis = this.jedisPool.getResource(); isExist = jedis.exists(SafeEncoder.encode(key)); } catch (Exception e) { logger.error(e.getMessage(), e); ...
java
public boolean exists(String key) throws Exception { boolean isExist = false; Jedis jedis = null; try { jedis = this.jedisPool.getResource(); isExist = jedis.exists(SafeEncoder.encode(key)); } catch (Exception e) { logger.error(e.getMessage(), e); ...
[ "public", "boolean", "exists", "(", "String", "key", ")", "throws", "Exception", "{", "boolean", "isExist", "=", "false", ";", "Jedis", "jedis", "=", "null", ";", "try", "{", "jedis", "=", "this", ".", "jedisPool", ".", "getResource", "(", ")", ";", "i...
Test if the specified key exists. @param key @return @throws Exception
[ "Test", "if", "the", "specified", "key", "exists", "." ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L347-L364
42,633
knightliao/apollo
src/main/java/com/github/knightliao/apollo/redis/RedisClient.java
RedisClient.delete
public boolean delete(String key) { Jedis jedis = null; try { jedis = this.jedisPool.getResource(); jedis.del(SafeEncoder.encode(key)); logger.info("delete key:" + key); return true; } catch (Exception e) { logger.error(e.getMessage(),...
java
public boolean delete(String key) { Jedis jedis = null; try { jedis = this.jedisPool.getResource(); jedis.del(SafeEncoder.encode(key)); logger.info("delete key:" + key); return true; } catch (Exception e) { logger.error(e.getMessage(),...
[ "public", "boolean", "delete", "(", "String", "key", ")", "{", "Jedis", "jedis", "=", "null", ";", "try", "{", "jedis", "=", "this", ".", "jedisPool", ".", "getResource", "(", ")", ";", "jedis", ".", "del", "(", "SafeEncoder", ".", "encode", "(", "ke...
Remove the specified keys. @param key @return false if redis did not execute the option
[ "Remove", "the", "specified", "keys", "." ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L373-L390
42,634
knightliao/apollo
src/main/java/com/github/knightliao/apollo/redis/RedisClient.java
RedisClient.flushall
public boolean flushall() { String result = ""; Jedis jedis = null; try { jedis = this.jedisPool.getResource(); result = jedis.flushAll(); logger.info("redis client name: " + this.getCacheName() + " flushall."); } catch (Exception e) { log...
java
public boolean flushall() { String result = ""; Jedis jedis = null; try { jedis = this.jedisPool.getResource(); result = jedis.flushAll(); logger.info("redis client name: " + this.getCacheName() + " flushall."); } catch (Exception e) { log...
[ "public", "boolean", "flushall", "(", ")", "{", "String", "result", "=", "\"\"", ";", "Jedis", "jedis", "=", "null", ";", "try", "{", "jedis", "=", "this", ".", "jedisPool", ".", "getResource", "(", ")", ";", "result", "=", "jedis", ".", "flushAll", ...
Delete all the keys of all the existing databases, not just the currently selected one. @return false if redis did not execute the option
[ "Delete", "all", "the", "keys", "of", "all", "the", "existing", "databases", "not", "just", "the", "currently", "selected", "one", "." ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/RedisClient.java#L423-L440
42,635
davidmarquis/fluent-interface-proxy
src/main/java/com/fluentinterface/beans/reflect/Property.java
Property.get
public Object get(Object obj) throws ReflectionException { try { if (isPublic(readMethod)) { return readMethod.invoke(obj); } else { throw new ReflectionException("Cannot get the value of " + this + ", as it is write-only."); } } catch ...
java
public Object get(Object obj) throws ReflectionException { try { if (isPublic(readMethod)) { return readMethod.invoke(obj); } else { throw new ReflectionException("Cannot get the value of " + this + ", as it is write-only."); } } catch ...
[ "public", "Object", "get", "(", "Object", "obj", ")", "throws", "ReflectionException", "{", "try", "{", "if", "(", "isPublic", "(", "readMethod", ")", ")", "{", "return", "readMethod", ".", "invoke", "(", "obj", ")", ";", "}", "else", "{", "throw", "ne...
Returns the value of the representation of this property from the specified object. <p> The underlying property's value is obtained trying to invoke the {@code readMethod}. <p> If this {@link Property} object has no public {@code readMethod}, it is considered write-only, and the action will be prevented throwing a {@...
[ "Returns", "the", "value", "of", "the", "representation", "of", "this", "property", "from", "the", "specified", "object", "." ]
8e72fff6cd1f496c76a01773269caead994fea65
https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/reflect/Property.java#L403-L413
42,636
davidmarquis/fluent-interface-proxy
src/main/java/com/fluentinterface/beans/reflect/Property.java
Property.set
public void set(Object obj, Object value) throws ReflectionException { try { if (isPublic(writeMethod)) { writeMethod.invoke(obj, value); } else { throw new ReflectionException("Cannot set the value of " + this + ", as it is read-only."); } ...
java
public void set(Object obj, Object value) throws ReflectionException { try { if (isPublic(writeMethod)) { writeMethod.invoke(obj, value); } else { throw new ReflectionException("Cannot set the value of " + this + ", as it is read-only."); } ...
[ "public", "void", "set", "(", "Object", "obj", ",", "Object", "value", ")", "throws", "ReflectionException", "{", "try", "{", "if", "(", "isPublic", "(", "writeMethod", ")", ")", "{", "writeMethod", ".", "invoke", "(", "obj", ",", "value", ")", ";", "}...
Sets a new value to the representation of this property on the specified object. <p> The underlying property's value will be updated trying to invoke the {@code writeMethod}. <p> If this {@link Property} object has no public {@code writeMethod}, it is considered read-only, and the action will be prevented throwing a ...
[ "Sets", "a", "new", "value", "to", "the", "representation", "of", "this", "property", "on", "the", "specified", "object", "." ]
8e72fff6cd1f496c76a01773269caead994fea65
https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/reflect/Property.java#L431-L441
42,637
premium-minds/pm-wicket-utils
src/main/java/com/premiumminds/webapp/wicket/TemporalTextField.java
TemporalTextField.getConverter
@SuppressWarnings("unchecked") @Override public <C> IConverter<C> getConverter(final Class<C> type) { if (Temporal.class.isAssignableFrom(type)) { return (IConverter<C>)converter; } else { return super.getConverter(type); } }
java
@SuppressWarnings("unchecked") @Override public <C> IConverter<C> getConverter(final Class<C> type) { if (Temporal.class.isAssignableFrom(type)) { return (IConverter<C>)converter; } else { return super.getConverter(type); } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "<", "C", ">", "IConverter", "<", "C", ">", "getConverter", "(", "final", "Class", "<", "C", ">", "type", ")", "{", "if", "(", "Temporal", ".", "class", ".", "isAssignableFrom...
Returns the default converter if created without pattern; otherwise it returns a pattern-specific converter. @param type The type for which the convertor should work @return A pattern-specific converter @see org.apache.wicket.markup.html.form.TextField
[ "Returns", "the", "default", "converter", "if", "created", "without", "pattern", ";", "otherwise", "it", "returns", "a", "pattern", "-", "specific", "converter", "." ]
ed28f4bfb2084dfb2649d9fa283754cb76894d2d
https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/TemporalTextField.java#L111-L123
42,638
rbuck/java-retry
src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java
SqlTransientExceptionDetector.isSqlStateDuplicateValueInUniqueIndex
public static boolean isSqlStateDuplicateValueInUniqueIndex(SQLException se) { String sqlState = se.getSQLState(); return sqlState != null && (sqlState.equals("23505") || se.getMessage().contains("duplicate value in unique index")); }
java
public static boolean isSqlStateDuplicateValueInUniqueIndex(SQLException se) { String sqlState = se.getSQLState(); return sqlState != null && (sqlState.equals("23505") || se.getMessage().contains("duplicate value in unique index")); }
[ "public", "static", "boolean", "isSqlStateDuplicateValueInUniqueIndex", "(", "SQLException", "se", ")", "{", "String", "sqlState", "=", "se", ".", "getSQLState", "(", ")", ";", "return", "sqlState", "!=", "null", "&&", "(", "sqlState", ".", "equals", "(", "\"2...
Determines if the SQL exception a duplicate value in unique index. @param se the exception @return true if it is a code 23505, otherwise false
[ "Determines", "if", "the", "SQL", "exception", "a", "duplicate", "value", "in", "unique", "index", "." ]
660137ac6226bc3dd1ee6544efa4a02be27aaa66
https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java#L51-L54
42,639
rbuck/java-retry
src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java
SqlTransientExceptionDetector.isSqlStateConnectionException
public static boolean isSqlStateConnectionException(SQLException se) { String sqlState = se.getSQLState(); return sqlState != null && sqlState.startsWith("08"); }
java
public static boolean isSqlStateConnectionException(SQLException se) { String sqlState = se.getSQLState(); return sqlState != null && sqlState.startsWith("08"); }
[ "public", "static", "boolean", "isSqlStateConnectionException", "(", "SQLException", "se", ")", "{", "String", "sqlState", "=", "se", ".", "getSQLState", "(", ")", ";", "return", "sqlState", "!=", "null", "&&", "sqlState", ".", "startsWith", "(", "\"08\"", ")"...
Determines if the SQL exception is a connection exception @param se the exception @return true if it is a code 08nnn, otherwise false
[ "Determines", "if", "the", "SQL", "exception", "is", "a", "connection", "exception" ]
660137ac6226bc3dd1ee6544efa4a02be27aaa66
https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java#L62-L65
42,640
rbuck/java-retry
src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java
SqlTransientExceptionDetector.isSqlStateRollbackException
public static boolean isSqlStateRollbackException(SQLException se) { String sqlState = se.getSQLState(); return sqlState != null && sqlState.startsWith("40"); }
java
public static boolean isSqlStateRollbackException(SQLException se) { String sqlState = se.getSQLState(); return sqlState != null && sqlState.startsWith("40"); }
[ "public", "static", "boolean", "isSqlStateRollbackException", "(", "SQLException", "se", ")", "{", "String", "sqlState", "=", "se", ".", "getSQLState", "(", ")", ";", "return", "sqlState", "!=", "null", "&&", "sqlState", ".", "startsWith", "(", "\"40\"", ")", ...
Determines if the SQL exception is a rollback exception @param se the exception @return true if it is a code 40nnn, otherwise false
[ "Determines", "if", "the", "SQL", "exception", "is", "a", "rollback", "exception" ]
660137ac6226bc3dd1ee6544efa4a02be27aaa66
https://github.com/rbuck/java-retry/blob/660137ac6226bc3dd1ee6544efa4a02be27aaa66/src/main/java/com/github/rbuck/retry/SqlTransientExceptionDetector.java#L73-L76
42,641
knightliao/apollo
src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java
DateUtils.getPreviousDay
public static Date getPreviousDay(Date dt) { if (dt == null) { return dt; } Calendar cal = Calendar.getInstance(); cal.setTime(dt); cal.add(Calendar.DAY_OF_YEAR, -1); return cal.getTime(); }
java
public static Date getPreviousDay(Date dt) { if (dt == null) { return dt; } Calendar cal = Calendar.getInstance(); cal.setTime(dt); cal.add(Calendar.DAY_OF_YEAR, -1); return cal.getTime(); }
[ "public", "static", "Date", "getPreviousDay", "(", "Date", "dt", ")", "{", "if", "(", "dt", "==", "null", ")", "{", "return", "dt", ";", "}", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "cal", ".", "setTime", "(", "dt", "...
added by zhuqian 2009-03-25
[ "added", "by", "zhuqian", "2009", "-", "03", "-", "25" ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java#L559-L568
42,642
knightliao/apollo
src/main/java/com/github/knightliao/apollo/redis/eviction/EvictionTimer.java
EvictionTimer.cancel
public static synchronized void cancel(TimerTask task) { if (task == null) { return; } task.cancel(); usageCount.decrementAndGet(); if (usageCount.get() == 0) { timer.cancel(); timer = null; } }
java
public static synchronized void cancel(TimerTask task) { if (task == null) { return; } task.cancel(); usageCount.decrementAndGet(); if (usageCount.get() == 0) { timer.cancel(); timer = null; } }
[ "public", "static", "synchronized", "void", "cancel", "(", "TimerTask", "task", ")", "{", "if", "(", "task", "==", "null", ")", "{", "return", ";", "}", "task", ".", "cancel", "(", ")", ";", "usageCount", ".", "decrementAndGet", "(", ")", ";", "if", ...
Remove the specified eviction task from the timer. @param task Task to be scheduled
[ "Remove", "the", "specified", "eviction", "task", "from", "the", "timer", "." ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/redis/eviction/EvictionTimer.java#L45-L55
42,643
premium-minds/pm-wicket-utils
src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java
DrawerManager.push
public void push(AbstractDrawer drawer, AjaxRequestTarget target, String cssClass) { ListItem item = new ListItem("next", drawer, this, cssClass); drawers.push(item); if (first == null) { first = item; addOrReplace(first); } else { ListItem iter = first; while (iter.next != null) { iter = iter....
java
public void push(AbstractDrawer drawer, AjaxRequestTarget target, String cssClass) { ListItem item = new ListItem("next", drawer, this, cssClass); drawers.push(item); if (first == null) { first = item; addOrReplace(first); } else { ListItem iter = first; while (iter.next != null) { iter = iter....
[ "public", "void", "push", "(", "AbstractDrawer", "drawer", ",", "AjaxRequestTarget", "target", ",", "String", "cssClass", ")", "{", "ListItem", "item", "=", "new", "ListItem", "(", "\"next\"", ",", "drawer", ",", "this", ",", "cssClass", ")", ";", "drawers",...
Push and display a drawer on the page during an AJAX request, and inject an optional CSS class onto the drawer's immediate container. @param drawer The drawer to be pushed. Cannot be null. @param target The current AJAX target. @param cssClass The name of the class to be injected.
[ "Push", "and", "display", "a", "drawer", "on", "the", "page", "during", "an", "AJAX", "request", "and", "inject", "an", "optional", "CSS", "class", "onto", "the", "drawer", "s", "immediate", "container", "." ]
ed28f4bfb2084dfb2649d9fa283754cb76894d2d
https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java#L158-L184
42,644
premium-minds/pm-wicket-utils
src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java
DrawerManager.replaceLast
public void replaceLast(AbstractDrawer newDrawer, AjaxRequestTarget target) { if (!drawers.isEmpty()) { ListItem last = drawers.getFirst(); last.drawer.replaceWith(newDrawer); last.drawer = newDrawer; newDrawer.setManager(this); target.add(newDrawer); } }
java
public void replaceLast(AbstractDrawer newDrawer, AjaxRequestTarget target) { if (!drawers.isEmpty()) { ListItem last = drawers.getFirst(); last.drawer.replaceWith(newDrawer); last.drawer = newDrawer; newDrawer.setManager(this); target.add(newDrawer); } }
[ "public", "void", "replaceLast", "(", "AbstractDrawer", "newDrawer", ",", "AjaxRequestTarget", "target", ")", "{", "if", "(", "!", "drawers", ".", "isEmpty", "(", ")", ")", "{", "ListItem", "last", "=", "drawers", ".", "getFirst", "(", ")", ";", "last", ...
Replaces the topmost open drawer with a new one. If there is no open drawer, this method does nothing. This method requires an AJAX request. DrawerManager does not support swapping drawers during page construction. @param newDrawer The new drawer to open. Cannot be null. @param target The current AJAX target. Cannot b...
[ "Replaces", "the", "topmost", "open", "drawer", "with", "a", "new", "one", ".", "If", "there", "is", "no", "open", "drawer", "this", "method", "does", "nothing", ".", "This", "method", "requires", "an", "AJAX", "request", ".", "DrawerManager", "does", "not...
ed28f4bfb2084dfb2649d9fa283754cb76894d2d
https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java#L220-L228
42,645
premium-minds/pm-wicket-utils
src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java
DrawerManager.renderHead
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(DRAWER_JAVASCRIPT)); response.render(JavaScriptHeaderItem.forReference(MANAGER_JAVASCRIPT)); response.render(CssHeaderItem.forReference(DRAWER_CSS)); Iterator<ListItem>...
java
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(DRAWER_JAVASCRIPT)); response.render(JavaScriptHeaderItem.forReference(MANAGER_JAVASCRIPT)); response.render(CssHeaderItem.forReference(DRAWER_CSS)); Iterator<ListItem>...
[ "@", "Override", "public", "void", "renderHead", "(", "IHeaderResponse", "response", ")", "{", "super", ".", "renderHead", "(", "response", ")", ";", "response", ".", "render", "(", "JavaScriptHeaderItem", ".", "forReference", "(", "DRAWER_JAVASCRIPT", ")", ")",...
pressing the Back button and landing on a page with open drawers.
[ "pressing", "the", "Back", "button", "and", "landing", "on", "a", "page", "with", "open", "drawers", "." ]
ed28f4bfb2084dfb2649d9fa283754cb76894d2d
https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java#L309-L330
42,646
davidmarquis/fluent-interface-proxy
src/main/java/com/fluentinterface/beans/ObjectWrapper.java
ObjectWrapper.setWrappedObject
public void setWrappedObject(Object obj) { if (obj == null) { throw new IllegalArgumentException("Cannot warp a 'null' object."); } this.object = obj; this.bean = Bean.forClass(obj.getClass()); }
java
public void setWrappedObject(Object obj) { if (obj == null) { throw new IllegalArgumentException("Cannot warp a 'null' object."); } this.object = obj; this.bean = Bean.forClass(obj.getClass()); }
[ "public", "void", "setWrappedObject", "(", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Cannot warp a 'null' object.\"", ")", ";", "}", "this", ".", "object", "=", "obj", ";", "this"...
Changes, at any time, the wrapped object with a new object. @param obj the new object to wrap @throws IllegalArgumentException if the obj parameter is {@code null}
[ "Changes", "at", "any", "time", "the", "wrapped", "object", "with", "a", "new", "object", "." ]
8e72fff6cd1f496c76a01773269caead994fea65
https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L91-L98
42,647
davidmarquis/fluent-interface-proxy
src/main/java/com/fluentinterface/beans/ObjectWrapper.java
ObjectWrapper.getIndexedValue
public Object getIndexedValue(String propertyName, int index) { return getIndexedValue(object, getPropertyOrThrow(bean, propertyName), index, this); }
java
public Object getIndexedValue(String propertyName, int index) { return getIndexedValue(object, getPropertyOrThrow(bean, propertyName), index, this); }
[ "public", "Object", "getIndexedValue", "(", "String", "propertyName", ",", "int", "index", ")", "{", "return", "getIndexedValue", "(", "object", ",", "getPropertyOrThrow", "(", "bean", ",", "propertyName", ")", ",", "index", ",", "this", ")", ";", "}" ]
Returns the value of the specified indexed property from the wrapped object. @param propertyName the name of the indexed property whose value is to be extracted, cannot be {@code null} @param index the index of the property value to be extracted @return the indexed property value @throws ReflectionException ...
[ "Returns", "the", "value", "of", "the", "specified", "indexed", "property", "from", "the", "wrapped", "object", "." ]
8e72fff6cd1f496c76a01773269caead994fea65
https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L237-L239
42,648
davidmarquis/fluent-interface-proxy
src/main/java/com/fluentinterface/beans/ObjectWrapper.java
ObjectWrapper.setSimpleValue
public void setSimpleValue(String propertyName, Object value) { setSimpleValue(object, getPropertyOrThrow(bean, propertyName), value); }
java
public void setSimpleValue(String propertyName, Object value) { setSimpleValue(object, getPropertyOrThrow(bean, propertyName), value); }
[ "public", "void", "setSimpleValue", "(", "String", "propertyName", ",", "Object", "value", ")", "{", "setSimpleValue", "(", "object", ",", "getPropertyOrThrow", "(", "bean", ",", "propertyName", ")", ",", "value", ")", ";", "}" ]
Sets the value of the specified property in the wrapped object. @param propertyName the name of the simple property whose value is to be updated, cannot be {@code null} @param value the value to set, can be {@code null} @throws IllegalArgumentException if the property parameter is {@code null} @throws NullPoint...
[ "Sets", "the", "value", "of", "the", "specified", "property", "in", "the", "wrapped", "object", "." ]
8e72fff6cd1f496c76a01773269caead994fea65
https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L314-L316
42,649
davidmarquis/fluent-interface-proxy
src/main/java/com/fluentinterface/utils/TypeConversionUtils.java
TypeConversionUtils.translateFromPrimitive
public static Class<?> translateFromPrimitive(Class<?> paramType) { if (paramType == int.class) { return Integer.class; } else if (paramType == char.class) { return Character.class; } else if (paramType == byte.class) { return Byte.class; } else if (p...
java
public static Class<?> translateFromPrimitive(Class<?> paramType) { if (paramType == int.class) { return Integer.class; } else if (paramType == char.class) { return Character.class; } else if (paramType == byte.class) { return Byte.class; } else if (p...
[ "public", "static", "Class", "<", "?", ">", "translateFromPrimitive", "(", "Class", "<", "?", ">", "paramType", ")", "{", "if", "(", "paramType", "==", "int", ".", "class", ")", "{", "return", "Integer", ".", "class", ";", "}", "else", "if", "(", "pa...
From a primitive type class, tries to return the corresponding wrapper class. @param paramType a primitive type (ex: int, short, float, etc.) to convert @return the corresponding wrapper class for the type, or the type itself if not a known primitive.
[ "From", "a", "primitive", "type", "class", "tries", "to", "return", "the", "corresponding", "wrapper", "class", "." ]
8e72fff6cd1f496c76a01773269caead994fea65
https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/utils/TypeConversionUtils.java#L10-L31
42,650
premium-minds/pm-wicket-utils
src/main/java/com/premiumminds/webapp/wicket/repeaters/AbstractRepeater2.java
AbstractRepeater2.onRender
@Override protected final void onRender() { Iterator<? extends Component> it = renderIterator(); while (it.hasNext()) { Component child = it.next(); if (child == null) { throw new IllegalStateException( "The render iterator returned null for a child. Container: " + this.toString() + "; I...
java
@Override protected final void onRender() { Iterator<? extends Component> it = renderIterator(); while (it.hasNext()) { Component child = it.next(); if (child == null) { throw new IllegalStateException( "The render iterator returned null for a child. Container: " + this.toString() + "; I...
[ "@", "Override", "protected", "final", "void", "onRender", "(", ")", "{", "Iterator", "<", "?", "extends", "Component", ">", "it", "=", "renderIterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Component", "child", "=", ...
Renders all child items in no specified order
[ "Renders", "all", "child", "items", "in", "no", "specified", "order" ]
ed28f4bfb2084dfb2649d9fa283754cb76894d2d
https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/repeaters/AbstractRepeater2.java#L81-L96
42,651
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java
TSDataScanDir.metadata_end_cmp_
private static int metadata_end_cmp_(MetaData x, MetaData y) { return x.getEnd().compareTo(y.getEnd()); }
java
private static int metadata_end_cmp_(MetaData x, MetaData y) { return x.getEnd().compareTo(y.getEnd()); }
[ "private", "static", "int", "metadata_end_cmp_", "(", "MetaData", "x", ",", "MetaData", "y", ")", "{", "return", "x", ".", "getEnd", "(", ")", ".", "compareTo", "(", "y", ".", "getEnd", "(", ")", ")", ";", "}" ]
Comparator, in order to sort MetaData based on the end timestamp. @param x One of the MetaData to compare. @param y Another one of the MetaData to compare. @return Comparator result.
[ "Comparator", "in", "order", "to", "sort", "MetaData", "based", "on", "the", "end", "timestamp", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java#L186-L188
42,652
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java
TSDataScanDir.file_listing_
private static List<Path> file_listing_(Path dir) throws IOException { try (Stream<Path> files = Files.list(dir)) { return files.collect(Collectors.toList()); } }
java
private static List<Path> file_listing_(Path dir) throws IOException { try (Stream<Path> files = Files.list(dir)) { return files.collect(Collectors.toList()); } }
[ "private", "static", "List", "<", "Path", ">", "file_listing_", "(", "Path", "dir", ")", "throws", "IOException", "{", "try", "(", "Stream", "<", "Path", ">", "files", "=", "Files", ".", "list", "(", "dir", ")", ")", "{", "return", "files", ".", "col...
Scan a directory for files. This method reads the entire stream and closes it immediately. @param dir The directory to scan for files. @throws IOException if the directory cannot be listed.
[ "Scan", "a", "directory", "for", "files", ".", "This", "method", "reads", "the", "entire", "stream", "and", "closes", "it", "immediately", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java#L208-L212
42,653
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java
TSDataScanDir.filterUpgradable
public TSDataScanDir filterUpgradable() { return new TSDataScanDir(getDir(), getFiles().stream().filter(MetaData::isUpgradable).collect(Collectors.toList())); }
java
public TSDataScanDir filterUpgradable() { return new TSDataScanDir(getDir(), getFiles().stream().filter(MetaData::isUpgradable).collect(Collectors.toList())); }
[ "public", "TSDataScanDir", "filterUpgradable", "(", ")", "{", "return", "new", "TSDataScanDir", "(", "getDir", "(", ")", ",", "getFiles", "(", ")", ".", "stream", "(", ")", ".", "filter", "(", "MetaData", "::", "isUpgradable", ")", ".", "collect", "(", "...
Filter the list of files to contain only upgradable files. Note that the current instance is untouched and a new instance is returned. @return A new instance of TSDataScanDir, describing only files that are upgradable.
[ "Filter", "the", "list", "of", "files", "to", "contain", "only", "upgradable", "files", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataScanDir.java#L251-L253
42,654
threerings/nenya
core/src/main/java/com/threerings/media/animation/ExplodeAnimation.java
ExplodeAnimation.init
protected void init (ExplodeInfo info, int x, int y, int width, int height) { _info = info; _ox = x; _oy = y; _owid = width; _ohei = height; _info.rvel = (float)((2.0f * Math.PI) * _info.rvel); _chunkcount = (_info.xchunk * _info.ychunk); _cxpos = new...
java
protected void init (ExplodeInfo info, int x, int y, int width, int height) { _info = info; _ox = x; _oy = y; _owid = width; _ohei = height; _info.rvel = (float)((2.0f * Math.PI) * _info.rvel); _chunkcount = (_info.xchunk * _info.ychunk); _cxpos = new...
[ "protected", "void", "init", "(", "ExplodeInfo", "info", ",", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ")", "{", "_info", "=", "info", ";", "_ox", "=", "x", ";", "_oy", "=", "y", ";", "_owid", "=", "width", ";", "...
Initializes the animation with the attributes of the given explode info object.
[ "Initializes", "the", "animation", "with", "the", "attributes", "of", "the", "given", "explode", "info", "object", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/ExplodeAnimation.java#L112-L149
42,655
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/MetricValue.java
MetricValue.fromNumberValue
public static MetricValue fromNumberValue(Number number) { if (number == null) { return EMPTY; } else if (number instanceof Float || number instanceof Double) { return fromDblValue(number.doubleValue()); } else if (number instanceof Byte || number instanceof Short || numb...
java
public static MetricValue fromNumberValue(Number number) { if (number == null) { return EMPTY; } else if (number instanceof Float || number instanceof Double) { return fromDblValue(number.doubleValue()); } else if (number instanceof Byte || number instanceof Short || numb...
[ "public", "static", "MetricValue", "fromNumberValue", "(", "Number", "number", ")", "{", "if", "(", "number", "==", "null", ")", "{", "return", "EMPTY", ";", "}", "else", "if", "(", "number", "instanceof", "Float", "||", "number", "instanceof", "Double", "...
Construct a metric value from a Number implementation. @param number A floating point or integral type. @return a MetricValue holding the specified number. @throws IllegalArgumentException if the derived type of Number is not recognized.
[ "Construct", "a", "metric", "value", "from", "a", "Number", "implementation", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/MetricValue.java#L75-L85
42,656
threerings/nenya
core/src/main/java/com/threerings/media/animation/AnimationArranger.java
AnimationArranger.positionAvoidAnimation
public void positionAvoidAnimation (Animation anim, Rectangle viewBounds) { Rectangle abounds = new Rectangle(anim.getBounds()); @SuppressWarnings("unchecked") ArrayList<Animation> avoidables = (ArrayList<Animation>) _avoidAnims.clone(); // if we are able to place it somewhere, d...
java
public void positionAvoidAnimation (Animation anim, Rectangle viewBounds) { Rectangle abounds = new Rectangle(anim.getBounds()); @SuppressWarnings("unchecked") ArrayList<Animation> avoidables = (ArrayList<Animation>) _avoidAnims.clone(); // if we are able to place it somewhere, d...
[ "public", "void", "positionAvoidAnimation", "(", "Animation", "anim", ",", "Rectangle", "viewBounds", ")", "{", "Rectangle", "abounds", "=", "new", "Rectangle", "(", "anim", ".", "getBounds", "(", ")", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", "...
Position the specified animation so that it is not overlapping any still-running animations previously passed to this method.
[ "Position", "the", "specified", "animation", "so", "that", "it", "is", "not", "overlapping", "any", "still", "-", "running", "animations", "previously", "passed", "to", "this", "method", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/AnimationArranger.java#L41-L55
42,657
threerings/nenya
core/src/main/java/com/threerings/media/RegionManager.java
RegionManager.invalidateRegion
public void invalidateRegion (int x, int y, int width, int height) { if (isValidSize(width, height)) { addDirtyRegion(new Rectangle(x, y, width, height)); } }
java
public void invalidateRegion (int x, int y, int width, int height) { if (isValidSize(width, height)) { addDirtyRegion(new Rectangle(x, y, width, height)); } }
[ "public", "void", "invalidateRegion", "(", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ")", "{", "if", "(", "isValidSize", "(", "width", ",", "height", ")", ")", "{", "addDirtyRegion", "(", "new", "Rectangle", "(", "x", ",...
Invalidates the specified region.
[ "Invalidates", "the", "specified", "region", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/RegionManager.java#L40-L45
42,658
threerings/nenya
core/src/main/java/com/threerings/media/RegionManager.java
RegionManager.isValidSize
protected final boolean isValidSize (int width, int height) { if (width < 0 || height < 0) { log.warning("Attempt to add invalid dirty region?!", "size", (width + "x" + height), new Exception()); return false; } else if (width == 0 || height == 0) { ...
java
protected final boolean isValidSize (int width, int height) { if (width < 0 || height < 0) { log.warning("Attempt to add invalid dirty region?!", "size", (width + "x" + height), new Exception()); return false; } else if (width == 0 || height == 0) { ...
[ "protected", "final", "boolean", "isValidSize", "(", "int", "width", ",", "int", "height", ")", "{", "if", "(", "width", "<", "0", "||", "height", "<", "0", ")", "{", "log", ".", "warning", "(", "\"Attempt to add invalid dirty region?!\"", ",", "\"size\"", ...
Used to ensure our dirty regions are not invalid.
[ "Used", "to", "ensure", "our", "dirty", "regions", "are", "not", "invalid", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/RegionManager.java#L90-L104
42,659
threerings/nenya
core/src/main/java/com/threerings/media/RegionManager.java
RegionManager.getDirtyRegions
public Rectangle[] getDirtyRegions () { List<Rectangle> merged = Lists.newArrayList(); for (int ii = _dirty.size() - 1; ii >= 0; ii--) { // pop the next rectangle from the dirty list Rectangle mr = _dirty.remove(ii); // merge in any overlapping rectangles ...
java
public Rectangle[] getDirtyRegions () { List<Rectangle> merged = Lists.newArrayList(); for (int ii = _dirty.size() - 1; ii >= 0; ii--) { // pop the next rectangle from the dirty list Rectangle mr = _dirty.remove(ii); // merge in any overlapping rectangles ...
[ "public", "Rectangle", "[", "]", "getDirtyRegions", "(", ")", "{", "List", "<", "Rectangle", ">", "merged", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "(", "int", "ii", "=", "_dirty", ".", "size", "(", ")", "-", "1", ";", "ii", ">=", ...
Merges all outstanding dirty regions into a single list of rectangles and returns that to the caller. Internally, the list of accumulated dirty regions is cleared out and prepared for the next frame.
[ "Merges", "all", "outstanding", "dirty", "regions", "into", "a", "single", "list", "of", "rectangles", "and", "returns", "that", "to", "the", "caller", ".", "Internally", "the", "list", "of", "accumulated", "dirty", "regions", "is", "cleared", "out", "and", ...
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/RegionManager.java#L130-L155
42,660
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/lib/StringTemplate.java
StringTemplate.getArguments
public List<Any2<Integer, String>> getArguments() { final List<Any2<Integer, String>> result = new ArrayList<>(); elements_.forEach(elem -> elem.keys(result::add)); return result; }
java
public List<Any2<Integer, String>> getArguments() { final List<Any2<Integer, String>> result = new ArrayList<>(); elements_.forEach(elem -> elem.keys(result::add)); return result; }
[ "public", "List", "<", "Any2", "<", "Integer", ",", "String", ">", ">", "getArguments", "(", ")", "{", "final", "List", "<", "Any2", "<", "Integer", ",", "String", ">", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "elements_", ".", ...
Retrieve the variables used to render this string. @return The list of variables used to render this string.
[ "Retrieve", "the", "variables", "used", "to", "render", "this", "string", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/lib/StringTemplate.java#L210-L214
42,661
threerings/nenya
core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java
TrimmedObjectTileSet.hasConstraint
public boolean hasConstraint (int tileIdx, String constraint) { return (_bits == null || _bits[tileIdx].constraints == null) ? false : ListUtil.contains(_bits[tileIdx].constraints, constraint); }
java
public boolean hasConstraint (int tileIdx, String constraint) { return (_bits == null || _bits[tileIdx].constraints == null) ? false : ListUtil.contains(_bits[tileIdx].constraints, constraint); }
[ "public", "boolean", "hasConstraint", "(", "int", "tileIdx", ",", "String", "constraint", ")", "{", "return", "(", "_bits", "==", "null", "||", "_bits", "[", "tileIdx", "]", ".", "constraints", "==", "null", ")", "?", "false", ":", "ListUtil", ".", "cont...
Checks whether the tile at the specified index has the given constraint.
[ "Checks", "whether", "the", "tile", "at", "the", "specified", "index", "has", "the", "given", "constraint", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java#L96-L100
42,662
threerings/nenya
core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java
TrimmedObjectTileSet.trimObjectTileSet
public static TrimmedObjectTileSet trimObjectTileSet ( ObjectTileSet source, OutputStream destImage) throws IOException { return trimObjectTileSet(source, destImage, FastImageIO.FILE_SUFFIX); }
java
public static TrimmedObjectTileSet trimObjectTileSet ( ObjectTileSet source, OutputStream destImage) throws IOException { return trimObjectTileSet(source, destImage, FastImageIO.FILE_SUFFIX); }
[ "public", "static", "TrimmedObjectTileSet", "trimObjectTileSet", "(", "ObjectTileSet", "source", ",", "OutputStream", "destImage", ")", "throws", "IOException", "{", "return", "trimObjectTileSet", "(", "source", ",", "destImage", ",", "FastImageIO", ".", "FILE_SUFFIX", ...
Convenience function to trim the tile set to a file using FastImageIO.
[ "Convenience", "function", "to", "trim", "the", "tile", "set", "to", "a", "file", "using", "FastImageIO", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java#L174-L179
42,663
threerings/nenya
core/src/main/java/com/threerings/media/AbstractMedia.java
AbstractMedia.renderCompareTo
public int renderCompareTo (AbstractMedia other) { int result = Ints.compare(_renderOrder, other._renderOrder); return (result != 0) ? result : naturalCompareTo(other); }
java
public int renderCompareTo (AbstractMedia other) { int result = Ints.compare(_renderOrder, other._renderOrder); return (result != 0) ? result : naturalCompareTo(other); }
[ "public", "int", "renderCompareTo", "(", "AbstractMedia", "other", ")", "{", "int", "result", "=", "Ints", ".", "compare", "(", "_renderOrder", ",", "other", ".", "_renderOrder", ")", ";", "return", "(", "result", "!=", "0", ")", "?", "result", ":", "nat...
Compares this media to the specified media by render order.
[ "Compares", "this", "media", "to", "the", "specified", "media", "by", "render", "order", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMedia.java#L167-L171
42,664
threerings/nenya
core/src/main/java/com/threerings/media/AbstractMedia.java
AbstractMedia.queueNotification
public void queueNotification (ObserverList.ObserverOp<Object> amop) { if (_observers != null) { if (_mgr != null) { _mgr.queueNotification(_observers, amop); } else { log.warning("Have no manager, dropping notification", "media", this, "op", amop); ...
java
public void queueNotification (ObserverList.ObserverOp<Object> amop) { if (_observers != null) { if (_mgr != null) { _mgr.queueNotification(_observers, amop); } else { log.warning("Have no manager, dropping notification", "media", this, "op", amop); ...
[ "public", "void", "queueNotification", "(", "ObserverList", ".", "ObserverOp", "<", "Object", ">", "amop", ")", "{", "if", "(", "_observers", "!=", "null", ")", "{", "if", "(", "_mgr", "!=", "null", ")", "{", "_mgr", ".", "queueNotification", "(", "_obse...
Queues the supplied notification up to be dispatched to this abstract media's observers.
[ "Queues", "the", "supplied", "notification", "up", "to", "be", "dispatched", "to", "this", "abstract", "media", "s", "observers", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMedia.java#L205-L214
42,665
threerings/nenya
core/src/main/java/com/threerings/media/AbstractMedia.java
AbstractMedia.addObserver
protected void addObserver (Object obs) { if (_observers == null) { _observers = ObserverList.newFastUnsafe(); } _observers.add(obs); }
java
protected void addObserver (Object obs) { if (_observers == null) { _observers = ObserverList.newFastUnsafe(); } _observers.add(obs); }
[ "protected", "void", "addObserver", "(", "Object", "obs", ")", "{", "if", "(", "_observers", "==", "null", ")", "{", "_observers", "=", "ObserverList", ".", "newFastUnsafe", "(", ")", ";", "}", "_observers", ".", "add", "(", "obs", ")", ";", "}" ]
Add the specified observer to this media element.
[ "Add", "the", "specified", "observer", "to", "this", "media", "element", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMedia.java#L314-L320
42,666
kaazing/java.client
bridge/src/main/java/org/kaazing/gateway/bridge/CrossOriginProxy.java
CrossOriginProxy.dispatchEvent
private void dispatchEvent(XoaEvent event) { LOG.entering(CLASS_NAME, "dispatchEvent", event); try { Integer handlerId = event.getHandlerId(); XoaEventKind eventKind = event.getEvent(); if (LOG.isLoggable(Level.FINEST)) { LOG.fine...
java
private void dispatchEvent(XoaEvent event) { LOG.entering(CLASS_NAME, "dispatchEvent", event); try { Integer handlerId = event.getHandlerId(); XoaEventKind eventKind = event.getEvent(); if (LOG.isLoggable(Level.FINEST)) { LOG.fine...
[ "private", "void", "dispatchEvent", "(", "XoaEvent", "event", ")", "{", "LOG", ".", "entering", "(", "CLASS_NAME", ",", "\"dispatchEvent\"", ",", "event", ")", ";", "try", "{", "Integer", "handlerId", "=", "event", ".", "getHandlerId", "(", ")", ";", "XoaE...
Dispatch an event to Source Origin @param event
[ "Dispatch", "an", "event", "to", "Source", "Origin" ]
25ad2ae5bb24aa9d6b79400fce649b518dcfbe26
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/bridge/src/main/java/org/kaazing/gateway/bridge/CrossOriginProxy.java#L140-L171
42,667
threerings/nenya
core/src/main/java/com/threerings/media/util/BobblePath.java
BobblePath.setVariance
public void setVariance (int dx, int dy) { if ((dx < 0) || (dy < 0) || ((dx == 0) && (dy == 0))) { throw new IllegalArgumentException( "Variance values must be positive, and at least one must be non-zero."); } else { _dx = dx; _dy = dy; } ...
java
public void setVariance (int dx, int dy) { if ((dx < 0) || (dy < 0) || ((dx == 0) && (dy == 0))) { throw new IllegalArgumentException( "Variance values must be positive, and at least one must be non-zero."); } else { _dx = dx; _dy = dy; } ...
[ "public", "void", "setVariance", "(", "int", "dx", ",", "int", "dy", ")", "{", "if", "(", "(", "dx", "<", "0", ")", "||", "(", "dy", "<", "0", ")", "||", "(", "(", "dx", "==", "0", ")", "&&", "(", "dy", "==", "0", ")", ")", ")", "{", "t...
Set the variance of bobblin' in each direction.
[ "Set", "the", "variance", "of", "bobblin", "in", "each", "direction", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/BobblePath.java#L62-L71
42,668
threerings/nenya
core/src/main/java/com/threerings/media/util/BobblePath.java
BobblePath.updatePositionTo
protected boolean updatePositionTo (Pathable pable, int x, int y) { if ((pable.getX() == x) && (pable.getY() == y)) { return false; } else { pable.setLocation(x, y); return true; } }
java
protected boolean updatePositionTo (Pathable pable, int x, int y) { if ((pable.getX() == x) && (pable.getY() == y)) { return false; } else { pable.setLocation(x, y); return true; } }
[ "protected", "boolean", "updatePositionTo", "(", "Pathable", "pable", ",", "int", "x", ",", "int", "y", ")", "{", "if", "(", "(", "pable", ".", "getX", "(", ")", "==", "x", ")", "&&", "(", "pable", ".", "getY", "(", ")", "==", "y", ")", ")", "{...
Update the position of the pathable or return false if it's already there.
[ "Update", "the", "position", "of", "the", "pathable", "or", "return", "false", "if", "it", "s", "already", "there", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/BobblePath.java#L156-L164
42,669
threerings/nenya
core/src/main/java/com/threerings/media/util/ModeUtil.java
ModeUtil.getDisplayMode
public static DisplayMode getDisplayMode ( GraphicsDevice gd, int width, int height, int desiredDepth, int minimumDepth) { DisplayMode[] modes = gd.getDisplayModes(); final int ddepth = desiredDepth; // we sort modes in order of desirability Comparator<DisplayMode> mcomp = n...
java
public static DisplayMode getDisplayMode ( GraphicsDevice gd, int width, int height, int desiredDepth, int minimumDepth) { DisplayMode[] modes = gd.getDisplayModes(); final int ddepth = desiredDepth; // we sort modes in order of desirability Comparator<DisplayMode> mcomp = n...
[ "public", "static", "DisplayMode", "getDisplayMode", "(", "GraphicsDevice", "gd", ",", "int", "width", ",", "int", "height", ",", "int", "desiredDepth", ",", "int", "minimumDepth", ")", "{", "DisplayMode", "[", "]", "modes", "=", "gd", ".", "getDisplayModes", ...
Gets a display mode that matches the specified parameters. The screen resolution must match the specified resolution exactly, the specified desired depth will be used if it is available, and if not, the highest depth greater than or equal to the specified minimum depth is used. The highest refresh rate available for th...
[ "Gets", "a", "display", "mode", "that", "matches", "the", "specified", "parameters", ".", "The", "screen", "resolution", "must", "match", "the", "specified", "resolution", "exactly", "the", "specified", "desired", "depth", "will", "be", "used", "if", "it", "is...
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/ModeUtil.java#L41-L82
42,670
threerings/nenya
core/src/main/java/com/threerings/cast/util/CastUtil.java
CastUtil.getRandomDescriptor
public static CharacterDescriptor getRandomDescriptor ( ComponentRepository crepo, String gender, String[] COMP_CLASSES, ColorPository cpos, String[] COLOR_CLASSES) { // get all available classes ArrayList<ComponentClass> classes = Lists.newArrayList(); for (String element : ...
java
public static CharacterDescriptor getRandomDescriptor ( ComponentRepository crepo, String gender, String[] COMP_CLASSES, ColorPository cpos, String[] COLOR_CLASSES) { // get all available classes ArrayList<ComponentClass> classes = Lists.newArrayList(); for (String element : ...
[ "public", "static", "CharacterDescriptor", "getRandomDescriptor", "(", "ComponentRepository", "crepo", ",", "String", "gender", ",", "String", "[", "]", "COMP_CLASSES", ",", "ColorPository", "cpos", ",", "String", "[", "]", "COLOR_CLASSES", ")", "{", "// get all ava...
Returns a new character descriptor populated with a random set of components.
[ "Returns", "a", "new", "character", "descriptor", "populated", "with", "a", "random", "set", "of", "components", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/util/CastUtil.java#L47-L104
42,671
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java
TSDataOptimizerTask.run
public CompletableFuture<NewFile> run() { LOG.log(Level.FINE, "starting optimized file creation for {0} files", files.size()); CompletableFuture<NewFile> fileCreation = new CompletableFuture<>(); final List<TSData> fjpFiles = this.files; // We clear out files below, which makes createTmpFile se...
java
public CompletableFuture<NewFile> run() { LOG.log(Level.FINE, "starting optimized file creation for {0} files", files.size()); CompletableFuture<NewFile> fileCreation = new CompletableFuture<>(); final List<TSData> fjpFiles = this.files; // We clear out files below, which makes createTmpFile se...
[ "public", "CompletableFuture", "<", "NewFile", ">", "run", "(", ")", "{", "LOG", ".", "log", "(", "Level", ".", "FINE", ",", "\"starting optimized file creation for {0} files\"", ",", "files", ".", "size", "(", ")", ")", ";", "CompletableFuture", "<", "NewFile...
Start creating the optimized file. This operation resets the state of the optimizer task, so it can be re-used for subsequent invocations. @return A completeable future that yields the newly created file.
[ "Start", "creating", "the", "optimized", "file", ".", "This", "operation", "resets", "the", "state", "of", "the", "optimizer", "task", "so", "it", "can", "be", "re", "-", "used", "for", "subsequent", "invocations", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L186-L196
42,672
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java
TSDataOptimizerTask.createTmpFile
private static void createTmpFile(CompletableFuture<NewFile> fileCreation, Path destDir, List<TSData> files, Compression compression) { LOG.log(Level.FINE, "starting temporary file creation..."); try { Collections.sort(files, Comparator.comparing(TSData::getBegin)); final FileC...
java
private static void createTmpFile(CompletableFuture<NewFile> fileCreation, Path destDir, List<TSData> files, Compression compression) { LOG.log(Level.FINE, "starting temporary file creation..."); try { Collections.sort(files, Comparator.comparing(TSData::getBegin)); final FileC...
[ "private", "static", "void", "createTmpFile", "(", "CompletableFuture", "<", "NewFile", ">", "fileCreation", ",", "Path", "destDir", ",", "List", "<", "TSData", ">", "files", ",", "Compression", "compression", ")", "{", "LOG", ".", "log", "(", "Level", ".", ...
The fork-join task that creates a new file. This function creates a temporary file with the result contents, then passes it on to the install thread which will put the final file in place. @param fileCreation the future that is to be completed after the operation. @param destDir the destination directory for the resul...
[ "The", "fork", "-", "join", "task", "that", "creates", "a", "new", "file", ".", "This", "function", "creates", "a", "temporary", "file", "with", "the", "result", "contents", "then", "passes", "it", "on", "to", "the", "install", "thread", "which", "will", ...
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L209-L251
42,673
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java
TSDataOptimizerTask.install
private static void install(CompletableFuture<NewFile> fileCreation, Path destDir, FileChannel tmpFile, DateTime begin) { try { try { synchronized (OUTSTANDING) { OUTSTANDING.remove(fileCreation); } if (fileCreation.isCancelled()) ...
java
private static void install(CompletableFuture<NewFile> fileCreation, Path destDir, FileChannel tmpFile, DateTime begin) { try { try { synchronized (OUTSTANDING) { OUTSTANDING.remove(fileCreation); } if (fileCreation.isCancelled()) ...
[ "private", "static", "void", "install", "(", "CompletableFuture", "<", "NewFile", ">", "fileCreation", ",", "Path", "destDir", ",", "FileChannel", "tmpFile", ",", "DateTime", "begin", ")", "{", "try", "{", "try", "{", "synchronized", "(", "OUTSTANDING", ")", ...
Installs the newly created file. This function runs on the install thread and essentially performs a copy-operation from the temporary file to the final file. @param fileCreation the completeable future that receives the newly created file. @param destDir the destination directory in which to install the result file. ...
[ "Installs", "the", "newly", "created", "file", ".", "This", "function", "runs", "on", "the", "install", "thread", "and", "essentially", "performs", "a", "copy", "-", "operation", "from", "the", "temporary", "file", "to", "the", "final", "file", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L267-L306
42,674
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java
TSDataOptimizerTask.prefixForTimestamp
private static String prefixForTimestamp(DateTime timestamp) { return String.format("monsoon-%04d%02d%02d-%02d%02d", timestamp.getYear(), timestamp.getMonthOfYear(), timestamp.getDayOfMonth(), timestamp.getHourOfDay(), timestamp.getMinuteOfHour()); }
java
private static String prefixForTimestamp(DateTime timestamp) { return String.format("monsoon-%04d%02d%02d-%02d%02d", timestamp.getYear(), timestamp.getMonthOfYear(), timestamp.getDayOfMonth(), timestamp.getHourOfDay(), timestamp.getMinuteOfHour()); }
[ "private", "static", "String", "prefixForTimestamp", "(", "DateTime", "timestamp", ")", "{", "return", "String", ".", "format", "(", "\"monsoon-%04d%02d%02d-%02d%02d\"", ",", "timestamp", ".", "getYear", "(", ")", ",", "timestamp", ".", "getMonthOfYear", "(", ")",...
Compute a prefix for a to-be-installed file. @param timestamp the timestamp on which to base the prefix. @return a file prefix that represents the timestamp in its name.
[ "Compute", "a", "prefix", "for", "a", "to", "-", "be", "-", "installed", "file", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/TSDataOptimizerTask.java#L314-L316
42,675
jboss/jboss-jsp-api_spec
src/main/java/javax/servlet/jsp/PageContext.java
PageContext.getErrorData
public ErrorData getErrorData() { return new ErrorData( (Throwable)getRequest().getAttribute( "javax.servlet.error.exception" ), ((Integer)getRequest().getAttribute( "javax.servlet.error.status_code" )).intValue(), (String)getRequest().getAttribute( "javax.servlet.error.request_uri" ), (String)...
java
public ErrorData getErrorData() { return new ErrorData( (Throwable)getRequest().getAttribute( "javax.servlet.error.exception" ), ((Integer)getRequest().getAttribute( "javax.servlet.error.status_code" )).intValue(), (String)getRequest().getAttribute( "javax.servlet.error.request_uri" ), (String)...
[ "public", "ErrorData", "getErrorData", "(", ")", "{", "return", "new", "ErrorData", "(", "(", "Throwable", ")", "getRequest", "(", ")", ".", "getAttribute", "(", "\"javax.servlet.error.exception\"", ")", ",", "(", "(", "Integer", ")", "getRequest", "(", ")", ...
Provides convenient access to error information. @return an ErrorData instance containing information about the error, as obtained from the request attributes, as per the Servlet specification. If this is not an error page (that is, if the isErrorPage attribute of the page directive is not set to "true"), the informa...
[ "Provides", "convenient", "access", "to", "error", "information", "." ]
da53166619f33a5134dc3315a3264990cc1f541f
https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/PageContext.java#L551-L558
42,676
groupon/robo-remote
RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Device.java
Device.storeLogs
public static void storeLogs(String sourceLogFileName, String destLogFileName) throws Exception { // assumes eventmanager is running // store logs String tmpdir = System.getProperty("java.io.tmpdir"); if (tmpdir == null || tmpdir == "null") { tmpdir = "/tmp"; } F...
java
public static void storeLogs(String sourceLogFileName, String destLogFileName) throws Exception { // assumes eventmanager is running // store logs String tmpdir = System.getProperty("java.io.tmpdir"); if (tmpdir == null || tmpdir == "null") { tmpdir = "/tmp"; } F...
[ "public", "static", "void", "storeLogs", "(", "String", "sourceLogFileName", ",", "String", "destLogFileName", ")", "throws", "Exception", "{", "// assumes eventmanager is running", "// store logs", "String", "tmpdir", "=", "System", ".", "getProperty", "(", "\"java.io....
Stores the specified log for this test @throws Exception
[ "Stores", "the", "specified", "log", "for", "this", "test" ]
12d242faad50bf90f98657ca9a0c0c3ae1993f07
https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Device.java#L61-L72
42,677
threerings/nenya
core/src/main/java/com/threerings/cast/builder/ClassEditor.java
ClassEditor.setSelectedComponent
protected void setSelectedComponent (int idx) { int cid = _components.get(idx).intValue(); _model.setSelectedComponent(_cclass, cid); }
java
protected void setSelectedComponent (int idx) { int cid = _components.get(idx).intValue(); _model.setSelectedComponent(_cclass, cid); }
[ "protected", "void", "setSelectedComponent", "(", "int", "idx", ")", "{", "int", "cid", "=", "_components", ".", "get", "(", "idx", ")", ".", "intValue", "(", ")", ";", "_model", ".", "setSelectedComponent", "(", "_cclass", ",", "cid", ")", ";", "}" ]
Sets the selected component in the builder model for the component class associated with this editor to the component at the given index in this editor's list of available components.
[ "Sets", "the", "selected", "component", "in", "the", "builder", "model", "for", "the", "component", "class", "associated", "with", "this", "editor", "to", "the", "component", "at", "the", "given", "index", "in", "this", "editor", "s", "list", "of", "availabl...
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/builder/ClassEditor.java#L91-L95
42,678
kaazing/java.client
amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/ChannelEvent.java
ChannelEvent.isFlowActive
public boolean isFlowActive() { Object val = this.getArgument("active"); if (val instanceof Integer) { return ((Integer)val).intValue() == 1; } else { throw new IllegalStateException("ChannelEvent does not contain the 'active' argument"); } }
java
public boolean isFlowActive() { Object val = this.getArgument("active"); if (val instanceof Integer) { return ((Integer)val).intValue() == 1; } else { throw new IllegalStateException("ChannelEvent does not contain the 'active' argument"); } }
[ "public", "boolean", "isFlowActive", "(", ")", "{", "Object", "val", "=", "this", ".", "getArgument", "(", "\"active\"", ")", ";", "if", "(", "val", "instanceof", "Integer", ")", "{", "return", "(", "(", "Integer", ")", "val", ")", ".", "intValue", "("...
Returns For flow events, returns true if flow is active @return boolean true if event specifies flow is active @throws IllegalStateException if this event is not a flow event
[ "Returns", "For", "flow", "events", "returns", "true", "if", "flow", "is", "active" ]
25ad2ae5bb24aa9d6b79400fce649b518dcfbe26
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/ChannelEvent.java#L219-L227
42,679
stephenc/redmine-java-api
src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
RedmineJSONBuilder.writeTracker
static void writeTracker(JSONWriter writer, Tracker tracker) throws JSONException { writer.key("id"); writer.value(tracker.getId()); writer.key("name"); writer.value(tracker.getName()); }
java
static void writeTracker(JSONWriter writer, Tracker tracker) throws JSONException { writer.key("id"); writer.value(tracker.getId()); writer.key("name"); writer.value(tracker.getName()); }
[ "static", "void", "writeTracker", "(", "JSONWriter", "writer", ",", "Tracker", "tracker", ")", "throws", "JSONException", "{", "writer", ".", "key", "(", "\"id\"", ")", ";", "writer", ".", "value", "(", "tracker", ".", "getId", "(", ")", ")", ";", "write...
Writes a tracker. @param writer used writer. @param tracker tracker to writer. @throws JSONException if error occurs.
[ "Writes", "a", "tracker", "." ]
7e5270c84aba32d74a506260ec47ff86ab6c9d84
https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java#L161-L167
42,680
stephenc/redmine-java-api
src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
RedmineJSONBuilder.addFull
public static void addFull(JSONWriter writer, String field, Date value) throws JSONException { final SimpleDateFormat format = RedmineDateUtils.FULL_DATE_FORMAT.get(); JsonOutput.add(writer, field, value, format); }
java
public static void addFull(JSONWriter writer, String field, Date value) throws JSONException { final SimpleDateFormat format = RedmineDateUtils.FULL_DATE_FORMAT.get(); JsonOutput.add(writer, field, value, format); }
[ "public", "static", "void", "addFull", "(", "JSONWriter", "writer", ",", "String", "field", ",", "Date", "value", ")", "throws", "JSONException", "{", "final", "SimpleDateFormat", "format", "=", "RedmineDateUtils", ".", "FULL_DATE_FORMAT", ".", "get", "(", ")", ...
Adds a value to a writer. @param writer writer to add object to. @param field field name to set. @param value field value. @throws JSONException if io error occurs.
[ "Adds", "a", "value", "to", "a", "writer", "." ]
7e5270c84aba32d74a506260ec47ff86ab6c9d84
https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java#L383-L387
42,681
groupon/monsoon
lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java
MemoidOne.match_
private Optional<Data<Input, Output>> match_(Input input) { return Optional.ofNullable(recent_.get()) .filter((Data<Input, Output> data) -> equality_.test(data.getInput(), input)); }
java
private Optional<Data<Input, Output>> match_(Input input) { return Optional.ofNullable(recent_.get()) .filter((Data<Input, Output> data) -> equality_.test(data.getInput(), input)); }
[ "private", "Optional", "<", "Data", "<", "Input", ",", "Output", ">", ">", "match_", "(", "Input", "input", ")", "{", "return", "Optional", ".", "ofNullable", "(", "recent_", ".", "get", "(", ")", ")", ".", "filter", "(", "(", "Data", "<", "Input", ...
Try to match an input against the most recent calculation. @param input The most recent input. @return An optional Data object, if the input matches the remembered calculation.
[ "Try", "to", "match", "an", "input", "against", "the", "most", "recent", "calculation", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java#L93-L96
42,682
groupon/monsoon
lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java
MemoidOne.derive_
private Data<Input, Output> derive_(Input input) { Data<Input, Output> result = new Data<>(input, fn_.apply(input)); recent_.set(result); return result; }
java
private Data<Input, Output> derive_(Input input) { Data<Input, Output> result = new Data<>(input, fn_.apply(input)); recent_.set(result); return result; }
[ "private", "Data", "<", "Input", ",", "Output", ">", "derive_", "(", "Input", "input", ")", "{", "Data", "<", "Input", ",", "Output", ">", "result", "=", "new", "Data", "<>", "(", "input", ",", "fn_", ".", "apply", "(", "input", ")", ")", ";", "r...
Derive and remember a calculation. Future invocations of match_(input) will return the returned Data instance. @param input The input for the calculation. @return A data object, holding the result of the calculation.
[ "Derive", "and", "remember", "a", "calculation", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java#L105-L109
42,683
groupon/monsoon
lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java
MemoidOne.apply
@Override public Output apply(Input input) { if (input == null) return fn_.apply(input); return match_(input) .orElseGet(() -> derive_(input)) .getOutput(); }
java
@Override public Output apply(Input input) { if (input == null) return fn_.apply(input); return match_(input) .orElseGet(() -> derive_(input)) .getOutput(); }
[ "@", "Override", "public", "Output", "apply", "(", "Input", "input", ")", "{", "if", "(", "input", "==", "null", ")", "return", "fn_", ".", "apply", "(", "input", ")", ";", "return", "match_", "(", "input", ")", ".", "orElseGet", "(", "(", ")", "->...
Functional implementation. The actual calculation will only be performed if the input doesn't match the input from the most recent invocation. Null inputs are never remembered. @param input Argument to the calculation. @return The output of the calculation.
[ "Functional", "implementation", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/lib/src/main/java/com/groupon/lex/metrics/lib/MemoidOne.java#L121-L127
42,684
threerings/nenya
core/src/main/java/com/threerings/media/TimerView.java
TimerView.setWarning
public void setWarning (float warnPercent, ResultListener<TimerView> warner) { // This warning hasn't triggered yet _warned = false; // Here are the details _warnPercent = warnPercent; _warner = warner; }
java
public void setWarning (float warnPercent, ResultListener<TimerView> warner) { // This warning hasn't triggered yet _warned = false; // Here are the details _warnPercent = warnPercent; _warner = warner; }
[ "public", "void", "setWarning", "(", "float", "warnPercent", ",", "ResultListener", "<", "TimerView", ">", "warner", ")", "{", "// This warning hasn't triggered yet", "_warned", "=", "false", ";", "// Here are the details", "_warnPercent", "=", "warnPercent", ";", "_w...
Setup a warning to trigger after the timer is "warnPercent" or more completed. If "warner" is non-null, it will be called at that time.
[ "Setup", "a", "warning", "to", "trigger", "after", "the", "timer", "is", "warnPercent", "or", "more", "completed", ".", "If", "warner", "is", "non", "-", "null", "it", "will", "be", "called", "at", "that", "time", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L93-L101
42,685
threerings/nenya
core/src/main/java/com/threerings/media/TimerView.java
TimerView.start
public void start (float startPercent, long duration, ResultListener<TimerView> finisher) { // Sanity check input arguments if (startPercent < 0.0f || startPercent >= 1.0f) { throw new IllegalArgumentException( "Invalid starting percent " + startPercent); } ...
java
public void start (float startPercent, long duration, ResultListener<TimerView> finisher) { // Sanity check input arguments if (startPercent < 0.0f || startPercent >= 1.0f) { throw new IllegalArgumentException( "Invalid starting percent " + startPercent); } ...
[ "public", "void", "start", "(", "float", "startPercent", ",", "long", "duration", ",", "ResultListener", "<", "TimerView", ">", "finisher", ")", "{", "// Sanity check input arguments", "if", "(", "startPercent", "<", "0.0f", "||", "startPercent", ">=", "1.0f", "...
Start the timer running from the specified percentage complete, to expire at the specified time. @param startPercent a value in [0f, 1f) indicating how much hourglass time has already elapsed when the timer starts. @param duration The time interval over which the timer would run if it started at 0%. @param finisher a ...
[ "Start", "the", "timer", "running", "from", "the", "specified", "percentage", "complete", "to", "expire", "at", "the", "specified", "time", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L131-L162
42,686
threerings/nenya
core/src/main/java/com/threerings/media/TimerView.java
TimerView.unpause
public void unpause () { // Don't unpause the timer if it wasn't paused to begin with if (_lastUpdate == Long.MIN_VALUE || _start == Long.MIN_VALUE) { return; } // Adjust the starting time when the timer next ticks _processUnpause = true; // Start things...
java
public void unpause () { // Don't unpause the timer if it wasn't paused to begin with if (_lastUpdate == Long.MIN_VALUE || _start == Long.MIN_VALUE) { return; } // Adjust the starting time when the timer next ticks _processUnpause = true; // Start things...
[ "public", "void", "unpause", "(", ")", "{", "// Don't unpause the timer if it wasn't paused to begin with", "if", "(", "_lastUpdate", "==", "Long", ".", "MIN_VALUE", "||", "_start", "==", "Long", ".", "MIN_VALUE", ")", "{", "return", ";", "}", "// Adjust the startin...
Unpause the timer.
[ "Unpause", "the", "timer", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L200-L212
42,687
threerings/nenya
core/src/main/java/com/threerings/media/TimerView.java
TimerView.changeComplete
public void changeComplete (float complete) { // Store the new state _complete = complete; // Determine the percentage difference between the "actual" // completion state and the completion amount to render during // the smooth interpolation _renderOffset = _renderCo...
java
public void changeComplete (float complete) { // Store the new state _complete = complete; // Determine the percentage difference between the "actual" // completion state and the completion amount to render during // the smooth interpolation _renderOffset = _renderCo...
[ "public", "void", "changeComplete", "(", "float", "complete", ")", "{", "// Store the new state", "_complete", "=", "complete", ";", "// Determine the percentage difference between the \"actual\"", "// completion state and the completion amount to render during", "// the smooth interpo...
Generate an unexpected change in the timer's completion and set up the necessary details to render interpolation from the old to new states
[ "Generate", "an", "unexpected", "change", "in", "the", "timer", "s", "completion", "and", "set", "up", "the", "necessary", "details", "to", "render", "interpolation", "from", "the", "old", "to", "new", "states" ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L219-L232
42,688
threerings/nenya
core/src/main/java/com/threerings/media/TimerView.java
TimerView.invalidate
protected void invalidate () { // Schedule the timer's location on screen to get repainted _invalidated = true; _host.repaint(_bounds.x, _bounds.y, _bounds.width, _bounds.height); }
java
protected void invalidate () { // Schedule the timer's location on screen to get repainted _invalidated = true; _host.repaint(_bounds.x, _bounds.y, _bounds.width, _bounds.height); }
[ "protected", "void", "invalidate", "(", ")", "{", "// Schedule the timer's location on screen to get repainted", "_invalidated", "=", "true", ";", "_host", ".", "repaint", "(", "_bounds", ".", "x", ",", "_bounds", ".", "y", ",", "_bounds", ".", "width", ",", "_b...
Invalidates this view's bounds via the host component.
[ "Invalidates", "this", "view", "s", "bounds", "via", "the", "host", "component", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L294-L299
42,689
threerings/nenya
core/src/main/java/com/threerings/media/TimerView.java
TimerView.checkFrameParticipation
public void checkFrameParticipation () { // Determine whether or not the timer should participate in // media ticks boolean participate = _host.isShowing(); // Start participating if necessary if (participate && !_participating) { _fmgr.registerFrameParti...
java
public void checkFrameParticipation () { // Determine whether or not the timer should participate in // media ticks boolean participate = _host.isShowing(); // Start participating if necessary if (participate && !_participating) { _fmgr.registerFrameParti...
[ "public", "void", "checkFrameParticipation", "(", ")", "{", "// Determine whether or not the timer should participate in", "// media ticks", "boolean", "participate", "=", "_host", ".", "isShowing", "(", ")", ";", "// Start participating if necessary", "if", "(", "participate...
Check that the frame knows about the timer.
[ "Check", "that", "the", "frame", "knows", "about", "the", "timer", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/TimerView.java#L418-L437
42,690
threerings/nenya
core/src/main/java/com/threerings/media/tile/TileUtil.java
TileUtil.getTileHash
public static int getTileHash (int x, int y) { long seed = (((x << 2) ^ y) ^ MULTIPLIER) & MASK; long hash = (seed * MULTIPLIER + ADDEND) & MASK; return (int) (hash >>> 30); }
java
public static int getTileHash (int x, int y) { long seed = (((x << 2) ^ y) ^ MULTIPLIER) & MASK; long hash = (seed * MULTIPLIER + ADDEND) & MASK; return (int) (hash >>> 30); }
[ "public", "static", "int", "getTileHash", "(", "int", "x", ",", "int", "y", ")", "{", "long", "seed", "=", "(", "(", "(", "x", "<<", "2", ")", "^", "y", ")", "^", "MULTIPLIER", ")", "&", "MASK", ";", "long", "hash", "=", "(", "seed", "*", "MU...
Compute some hash value for "randomizing" tileset picks based on x and y coordinates. @return a positive, seemingly random number based on x and y.
[ "Compute", "some", "hash", "value", "for", "randomizing", "tileset", "picks", "based", "on", "x", "and", "y", "coordinates", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileUtil.java#L58-L63
42,691
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java
Util.fixSequence
public static ObjectSequence<TimeSeriesCollection> fixSequence(ObjectSequence<TimeSeriesCollection> seq) { seq = seq.sort(); // Does nothing if already sorted. if (!seq.isDistinct() && !seq.isEmpty()) { List<ObjectSequence<TimeSeriesCollection>> toConcat = new ArrayList<>(); in...
java
public static ObjectSequence<TimeSeriesCollection> fixSequence(ObjectSequence<TimeSeriesCollection> seq) { seq = seq.sort(); // Does nothing if already sorted. if (!seq.isDistinct() && !seq.isEmpty()) { List<ObjectSequence<TimeSeriesCollection>> toConcat = new ArrayList<>(); in...
[ "public", "static", "ObjectSequence", "<", "TimeSeriesCollection", ">", "fixSequence", "(", "ObjectSequence", "<", "TimeSeriesCollection", ">", "seq", ")", "{", "seq", "=", "seq", ".", "sort", "(", ")", ";", "// Does nothing if already sorted.", "if", "(", "!", ...
Fix a sequence to contain only distinct, sorted elements.
[ "Fix", "a", "sequence", "to", "contain", "only", "distinct", "sorted", "elements", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java#L92-L129
42,692
groupon/monsoon
history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java
Util.mergeSequences
public static ObjectSequence<TimeSeriesCollection> mergeSequences(ObjectSequence<TimeSeriesCollection>... tsSeq) { if (tsSeq.length == 0) return ObjectSequence.empty(); if (tsSeq.length == 1) return tsSeq[0]; // Sort sequences and remove any that are empty. final...
java
public static ObjectSequence<TimeSeriesCollection> mergeSequences(ObjectSequence<TimeSeriesCollection>... tsSeq) { if (tsSeq.length == 0) return ObjectSequence.empty(); if (tsSeq.length == 1) return tsSeq[0]; // Sort sequences and remove any that are empty. final...
[ "public", "static", "ObjectSequence", "<", "TimeSeriesCollection", ">", "mergeSequences", "(", "ObjectSequence", "<", "TimeSeriesCollection", ">", "...", "tsSeq", ")", "{", "if", "(", "tsSeq", ".", "length", "==", "0", ")", "return", "ObjectSequence", ".", "empt...
Given zero or more sequences, that are all sorted and distinct, merge them together. @param tsSeq Zero or more sequences to process. @return A merged sequence.
[ "Given", "zero", "or", "more", "sequences", "that", "are", "all", "sorted", "and", "distinct", "merge", "them", "together", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/v2/xdr/Util.java#L138-L198
42,693
threerings/nenya
core/src/main/java/com/threerings/openal/ResourceStream.java
ResourceStream.queueResource
public void queueResource (String bundle, String resource, boolean loop) { try { queueURL(new URL("resource://" + bundle + "/" + resource), loop); } catch (MalformedURLException e) { log.warning("Invalid resource url.", "resource", resource, e); } }
java
public void queueResource (String bundle, String resource, boolean loop) { try { queueURL(new URL("resource://" + bundle + "/" + resource), loop); } catch (MalformedURLException e) { log.warning("Invalid resource url.", "resource", resource, e); } }
[ "public", "void", "queueResource", "(", "String", "bundle", ",", "String", "resource", ",", "boolean", "loop", ")", "{", "try", "{", "queueURL", "(", "new", "URL", "(", "\"resource://\"", "+", "bundle", "+", "\"/\"", "+", "resource", ")", ",", "loop", ")...
Adds a resource to the queue of files to play. @param loop if true, play this file in a loop if there's nothing else on the queue
[ "Adds", "a", "resource", "to", "the", "queue", "of", "files", "to", "play", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/ResourceStream.java#L76-L83
42,694
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java
MoreInetAddresses.isMappedIPv4Address
public static boolean isMappedIPv4Address(Inet6Address ip) { byte bytes[] = ip.getAddress(); return ((bytes[0] == 0x00) && (bytes[1] == 0x00) && (bytes[2] == 0x00) && (bytes[3] == 0x00) && (bytes[4] == 0x00) && (bytes[5] == 0x00) && (bytes[6] == 0x00) && (...
java
public static boolean isMappedIPv4Address(Inet6Address ip) { byte bytes[] = ip.getAddress(); return ((bytes[0] == 0x00) && (bytes[1] == 0x00) && (bytes[2] == 0x00) && (bytes[3] == 0x00) && (bytes[4] == 0x00) && (bytes[5] == 0x00) && (bytes[6] == 0x00) && (...
[ "public", "static", "boolean", "isMappedIPv4Address", "(", "Inet6Address", "ip", ")", "{", "byte", "bytes", "[", "]", "=", "ip", ".", "getAddress", "(", ")", ";", "return", "(", "(", "bytes", "[", "0", "]", "==", "0x00", ")", "&&", "(", "bytes", "[",...
Evaluates whether the argument is an IPv6 "mapped" address. <p>An "IPv4 mapped", or "mapped", address is one with 80 leading bits of zero followed by 16 bits of 1, with the remaining 32 bits interpreted as an IPv4 address. These are conventionally represented in string literals as {@code "::ffff:192.168.0.1"}, though...
[ "Evaluates", "whether", "the", "argument", "is", "an", "IPv6", "mapped", "address", "." ]
a95aa5e77af9aa0e629787228d80806560023452
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java#L167-L175
42,695
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java
MoreInetAddresses.getMappedIPv4Address
public static Inet4Address getMappedIPv4Address(Inet6Address ip) { if (!isMappedIPv4Address(ip)) throw new IllegalArgumentException(String.format("Address '%s' is not IPv4-mapped.", toAddrString(ip))); return getInet4Address(copyOfRange(ip.getAddress(), 12, 16)); }
java
public static Inet4Address getMappedIPv4Address(Inet6Address ip) { if (!isMappedIPv4Address(ip)) throw new IllegalArgumentException(String.format("Address '%s' is not IPv4-mapped.", toAddrString(ip))); return getInet4Address(copyOfRange(ip.getAddress(), 12, 16)); }
[ "public", "static", "Inet4Address", "getMappedIPv4Address", "(", "Inet6Address", "ip", ")", "{", "if", "(", "!", "isMappedIPv4Address", "(", "ip", ")", ")", "throw", "new", "IllegalArgumentException", "(", "String", ".", "format", "(", "\"Address '%s' is not IPv4-ma...
Returns the IPv4 address embedded in an IPv4 mapped address. @param ip {@link Inet6Address} to be examined for an embedded IPv4 address @return {@link Inet4Address} of the embedded IPv4 address @throws IllegalArgumentException if the argument is not a valid IPv4 mapped address
[ "Returns", "the", "IPv4", "address", "embedded", "in", "an", "IPv4", "mapped", "address", "." ]
a95aa5e77af9aa0e629787228d80806560023452
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java#L184-L189
42,696
threerings/nenya
core/src/main/java/com/threerings/util/IdleTracker.java
IdleTracker.checkIdle
protected void checkIdle () { long now = getTimeStamp(); switch (_state) { case ACTIVE: // check whether they've idled out if (now >= (_lastEvent + _toIdleTime)) { log.info("User idle for " + (now-_lastEvent) + "ms."); _state = IDLE; ...
java
protected void checkIdle () { long now = getTimeStamp(); switch (_state) { case ACTIVE: // check whether they've idled out if (now >= (_lastEvent + _toIdleTime)) { log.info("User idle for " + (now-_lastEvent) + "ms."); _state = IDLE; ...
[ "protected", "void", "checkIdle", "(", ")", "{", "long", "now", "=", "getTimeStamp", "(", ")", ";", "switch", "(", "_state", ")", "{", "case", "ACTIVE", ":", "// check whether they've idled out", "if", "(", "now", ">=", "(", "_lastEvent", "+", "_toIdleTime",...
Checks the last user event time and posts a command to idle them out if they've been inactive for too long, or log them out if they've been idle for too long.
[ "Checks", "the", "last", "user", "event", "time", "and", "posts", "a", "command", "to", "idle", "them", "out", "if", "they", "ve", "been", "inactive", "for", "too", "long", "or", "log", "them", "out", "if", "they", "ve", "been", "idle", "for", "too", ...
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/IdleTracker.java#L144-L168
42,697
groupon/monsoon
impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java
PushProcessorPipeline.run_implementation_
private void run_implementation_(PushProcessor p) throws Exception { final Map<GroupName, Alert> alerts = registry_.getCollectionAlerts(); final TimeSeriesCollection tsdata = registry_.getCollectionData(); p.accept(tsdata, unmodifiableMap(alerts), registry_.getFailedCollections()); }
java
private void run_implementation_(PushProcessor p) throws Exception { final Map<GroupName, Alert> alerts = registry_.getCollectionAlerts(); final TimeSeriesCollection tsdata = registry_.getCollectionData(); p.accept(tsdata, unmodifiableMap(alerts), registry_.getFailedCollections()); }
[ "private", "void", "run_implementation_", "(", "PushProcessor", "p", ")", "throws", "Exception", "{", "final", "Map", "<", "GroupName", ",", "Alert", ">", "alerts", "=", "registry_", ".", "getCollectionAlerts", "(", ")", ";", "final", "TimeSeriesCollection", "ts...
Run the implementation of uploading the values and alerts. @throws java.lang.Exception thrown by implementation.
[ "Run", "the", "implementation", "of", "uploading", "the", "values", "and", "alerts", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java#L81-L85
42,698
groupon/monsoon
impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java
PushProcessorPipeline.run
@Override public final void run() { try { registry_.updateCollection(); final long t0 = System.nanoTime(); processors_.forEach(p -> { try { run_implementation_(p); } catch (Exception ex) { logger.lo...
java
@Override public final void run() { try { registry_.updateCollection(); final long t0 = System.nanoTime(); processors_.forEach(p -> { try { run_implementation_(p); } catch (Exception ex) { logger.lo...
[ "@", "Override", "public", "final", "void", "run", "(", ")", "{", "try", "{", "registry_", ".", "updateCollection", "(", ")", ";", "final", "long", "t0", "=", "System", ".", "nanoTime", "(", ")", ";", "processors_", ".", "forEach", "(", "p", "->", "{...
Run the collection cycle.
[ "Run", "the", "collection", "cycle", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/PushProcessorPipeline.java#L90-L115
42,699
threerings/nenya
core/src/main/java/com/threerings/miso/client/SceneBlockResolver.java
SceneBlockResolver.resolveBlock
public void resolveBlock (SceneBlock block, boolean hipri) { log.debug("Queueing block for resolution", "block", block, "hipri", hipri); if (hipri) { _queue.prepend(block); } else { _queue.append(block); } }
java
public void resolveBlock (SceneBlock block, boolean hipri) { log.debug("Queueing block for resolution", "block", block, "hipri", hipri); if (hipri) { _queue.prepend(block); } else { _queue.append(block); } }
[ "public", "void", "resolveBlock", "(", "SceneBlock", "block", ",", "boolean", "hipri", ")", "{", "log", ".", "debug", "(", "\"Queueing block for resolution\"", ",", "\"block\"", ",", "block", ",", "\"hipri\"", ",", "hipri", ")", ";", "if", "(", "hipri", ")",...
Queues up a scene block for resolution.
[ "Queues", "up", "a", "scene", "block", "for", "resolution", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlockResolver.java#L43-L51