repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/FileUtil.java
FileUtil.mkdir
private static void mkdir(@NonNull final File directory, final boolean createParents) throws IOException { Condition.INSTANCE.ensureNotNull(directory, "The directory may not be null"); boolean result = createParents ? directory.mkdirs() : directory.mkdir(); if (!result && !directory...
java
private static void mkdir(@NonNull final File directory, final boolean createParents) throws IOException { Condition.INSTANCE.ensureNotNull(directory, "The directory may not be null"); boolean result = createParents ? directory.mkdirs() : directory.mkdir(); if (!result && !directory...
[ "private", "static", "void", "mkdir", "(", "@", "NonNull", "final", "File", "directory", ",", "final", "boolean", "createParents", ")", "throws", "IOException", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "directory", ",", "\"The directory may no...
Creates a specific directory, if it does not already exist. @param directory The directory, which should be created, as an instance of the class {@link File}. The directory may not be null @param createParents True, if the parent directories should also be created, if necessary, false otherwise @throws IOException The...
[ "Creates", "a", "specific", "directory", "if", "it", "does", "not", "already", "exist", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/FileUtil.java#L42-L50
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/FileUtil.java
FileUtil.deleteRecursively
public static void deleteRecursively(@NonNull final File file) throws IOException { Condition.INSTANCE.ensureNotNull(file, "The file or directory may not be null"); if (file.isDirectory()) { for (File child : file.listFiles()) { deleteRecursively(child); } ...
java
public static void deleteRecursively(@NonNull final File file) throws IOException { Condition.INSTANCE.ensureNotNull(file, "The file or directory may not be null"); if (file.isDirectory()) { for (File child : file.listFiles()) { deleteRecursively(child); } ...
[ "public", "static", "void", "deleteRecursively", "(", "@", "NonNull", "final", "File", "file", ")", "throws", "IOException", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "file", ",", "\"The file or directory may not be null\"", ")", ";", "if", "("...
Deletes a specific file or directory. If the file is a directory, all contained files and subdirectories are deleted recursively. @param file The file or directory, which should be deleted, as an instance of the class {@link File}. The file or directory may not be null @throws IOException The exception, which is throw...
[ "Deletes", "a", "specific", "file", "or", "directory", ".", "If", "the", "file", "is", "a", "directory", "all", "contained", "files", "and", "subdirectories", "are", "deleted", "recursively", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/FileUtil.java#L124-L134
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/FileUtil.java
FileUtil.createNewFile
public static void createNewFile(@NonNull final File file, final boolean overwrite) throws IOException { Condition.INSTANCE.ensureNotNull(file, "The file may not be null"); boolean result = file.createNewFile(); if (!result) { if (overwrite) { try { ...
java
public static void createNewFile(@NonNull final File file, final boolean overwrite) throws IOException { Condition.INSTANCE.ensureNotNull(file, "The file may not be null"); boolean result = file.createNewFile(); if (!result) { if (overwrite) { try { ...
[ "public", "static", "void", "createNewFile", "(", "@", "NonNull", "final", "File", "file", ",", "final", "boolean", "overwrite", ")", "throws", "IOException", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "file", ",", "\"The file may not be null\""...
Creates a new, empty file. @param file The file, which should be created, as an instance of the class {@link File}. The file may not be null. If the file is a directory, an {@link IllegalArgumentException} will be thrown @param overwrite True, if the file should be overwritten, if it does already exist, false otherwis...
[ "Creates", "a", "new", "empty", "file", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/FileUtil.java#L162-L181
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/driver/Driver.java
Driver.maybeDoOffset
public void maybeDoOffset(){ long seen = tuplesSeen; if (offsetCommitInterval > 0 && seen % offsetCommitInterval == 0 && offsetStorage != null && fp.supportsOffsetManagement()){ doOffsetInternal(); } }
java
public void maybeDoOffset(){ long seen = tuplesSeen; if (offsetCommitInterval > 0 && seen % offsetCommitInterval == 0 && offsetStorage != null && fp.supportsOffsetManagement()){ doOffsetInternal(); } }
[ "public", "void", "maybeDoOffset", "(", ")", "{", "long", "seen", "=", "tuplesSeen", ";", "if", "(", "offsetCommitInterval", ">", "0", "&&", "seen", "%", "offsetCommitInterval", "==", "0", "&&", "offsetStorage", "!=", "null", "&&", "fp", ".", "supportsOffset...
To do offset storage we let the topology drain itself out. Then we commit.
[ "To", "do", "offset", "storage", "we", "let", "the", "topology", "drain", "itself", "out", ".", "Then", "we", "commit", "." ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/driver/Driver.java#L144-L149
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.obtainStyledAttributes
private static TypedArray obtainStyledAttributes(@NonNull final Context context, @StyleRes final int themeResourceId, @AttrRes final int resourceId) { Condition.INSTANCE.ensureNotNull(context, "The context ...
java
private static TypedArray obtainStyledAttributes(@NonNull final Context context, @StyleRes final int themeResourceId, @AttrRes final int resourceId) { Condition.INSTANCE.ensureNotNull(context, "The context ...
[ "private", "static", "TypedArray", "obtainStyledAttributes", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "StyleRes", "final", "int", "themeResourceId", ",", "@", "AttrRes", "final", "int", "resourceId", ")", "{", "Condition", ".", "INSTANCE", "...
Obtains the attribute, which corresponds to a specific resource id, from a theme. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param themeResourceId The resource id of the theme, the attribute should be obtained from, as an {@link Integer} ...
[ "Obtains", "the", "attribute", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "theme", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L54-L66
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.getBoolean
public static boolean getBoolean(@NonNull final Context context, @StyleRes final int themeResourceId, @AttrRes final int resourceId) { TypedArray typedArray = null; try { typedArray = obtainStyledAttributes(context, t...
java
public static boolean getBoolean(@NonNull final Context context, @StyleRes final int themeResourceId, @AttrRes final int resourceId) { TypedArray typedArray = null; try { typedArray = obtainStyledAttributes(context, t...
[ "public", "static", "boolean", "getBoolean", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "StyleRes", "final", "int", "themeResourceId", ",", "@", "AttrRes", "final", "int", "resourceId", ")", "{", "TypedArray", "typedArray", "=", "null", ";",...
Obtains the boolean value, which corresponds to a specific resource id, from a specific theme. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param themeResourceId The resource id of the theme, the attribute should be obtained from, as an {@l...
[ "Obtains", "the", "boolean", "value", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "specific", "theme", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L670-L683
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.getBoolean
public static boolean getBoolean(@NonNull final Context context, @AttrRes final int resourceId, final boolean defaultValue) { return getBoolean(context, -1, resourceId, defaultValue); }
java
public static boolean getBoolean(@NonNull final Context context, @AttrRes final int resourceId, final boolean defaultValue) { return getBoolean(context, -1, resourceId, defaultValue); }
[ "public", "static", "boolean", "getBoolean", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "AttrRes", "final", "int", "resourceId", ",", "final", "boolean", "defaultValue", ")", "{", "return", "getBoolean", "(", "context", ",", "-", "1", ",",...
Obtains the boolean value, which corresponds to a specific resource id, from a context's theme. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resource id of the attribute, which should be obtained, as an {@link Integer} ...
[ "Obtains", "the", "boolean", "value", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "context", "s", "theme", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L701-L704
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.getInt
public static int getInt(@NonNull final Context context, @AttrRes final int resourceId, final int defaultValue) { return getInt(context, -1, resourceId, defaultValue); }
java
public static int getInt(@NonNull final Context context, @AttrRes final int resourceId, final int defaultValue) { return getInt(context, -1, resourceId, defaultValue); }
[ "public", "static", "int", "getInt", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "AttrRes", "final", "int", "resourceId", ",", "final", "int", "defaultValue", ")", "{", "return", "getInt", "(", "context", ",", "-", "1", ",", "resourceId",...
Obtains the integer value, which corresponds to a specific resource id, from a context's theme. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resource id of the attribute, which should be obtained, as an {@link Integer} ...
[ "Obtains", "the", "integer", "value", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "context", "s", "theme", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L757-L760
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.getFloat
public static float getFloat(@NonNull final Context context, @AttrRes final int resourceId, final float defaultValue) { return getFloat(context, -1, resourceId, defaultValue); }
java
public static float getFloat(@NonNull final Context context, @AttrRes final int resourceId, final float defaultValue) { return getFloat(context, -1, resourceId, defaultValue); }
[ "public", "static", "float", "getFloat", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "AttrRes", "final", "int", "resourceId", ",", "final", "float", "defaultValue", ")", "{", "return", "getFloat", "(", "context", ",", "-", "1", ",", "reso...
Obtains the float value, which corresponds to a specific resource id, from a context's theme. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resource id of the attribute, which should be obtained, as an {@link Integer} va...
[ "Obtains", "the", "float", "value", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "context", "s", "theme", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L812-L815
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.getResId
public static int getResId(@NonNull final Context context, @AttrRes final int resourceId, final int defaultValue) { return getResId(context, -1, resourceId, defaultValue); }
java
public static int getResId(@NonNull final Context context, @AttrRes final int resourceId, final int defaultValue) { return getResId(context, -1, resourceId, defaultValue); }
[ "public", "static", "int", "getResId", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "AttrRes", "final", "int", "resourceId", ",", "final", "int", "defaultValue", ")", "{", "return", "getResId", "(", "context", ",", "-", "1", ",", "resource...
Obtains the resource id, which corresponds to a specific resource id, from a context's theme. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resource id of the attribute, which should be obtained, as an {@link Integer} va...
[ "Obtains", "the", "resource", "id", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "context", "s", "theme", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L867-L870
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/ProtocolCommand.java
ProtocolCommand.setRequest
void setRequest(HttpUriRequest request) { requestLock.lock(); try { if (this.request != null) { throw new SparqlException("Command is already executing a request."); } this.request = request; } finally { requestLock.unlock(); } }
java
void setRequest(HttpUriRequest request) { requestLock.lock(); try { if (this.request != null) { throw new SparqlException("Command is already executing a request."); } this.request = request; } finally { requestLock.unlock(); } }
[ "void", "setRequest", "(", "HttpUriRequest", "request", ")", "{", "requestLock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "this", ".", "request", "!=", "null", ")", "{", "throw", "new", "SparqlException", "(", "\"Command is already executing a reques...
Sets the currently executing request.
[ "Sets", "the", "currently", "executing", "request", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/ProtocolCommand.java#L131-L141
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/ProtocolCommand.java
ProtocolCommand.execute
private Result execute(ResultType cmdType) throws SparqlException { String mimeType = contentType; // Validate the user-supplied MIME type. if (mimeType != null && !ResultFactory.supports(mimeType, cmdType)) { logger.warn("Requested MIME content type '{}' does not support expected response type: ...
java
private Result execute(ResultType cmdType) throws SparqlException { String mimeType = contentType; // Validate the user-supplied MIME type. if (mimeType != null && !ResultFactory.supports(mimeType, cmdType)) { logger.warn("Requested MIME content type '{}' does not support expected response type: ...
[ "private", "Result", "execute", "(", "ResultType", "cmdType", ")", "throws", "SparqlException", "{", "String", "mimeType", "=", "contentType", ";", "// Validate the user-supplied MIME type.", "if", "(", "mimeType", "!=", "null", "&&", "!", "ResultFactory", ".", "sup...
Executes the request, and parses the response.
[ "Executes", "the", "request", "and", "parses", "the", "response", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/ProtocolCommand.java#L144-L169
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/ProtocolCommand.java
ProtocolCommand.logRequest
private void logRequest(ResultType cmdType, String mimeType) { StringBuilder sb = new StringBuilder("Executing SPARQL protocol request "); sb.append("to endpoint <").append(((ProtocolDataSource)getConnection().getDataSource()).getUrl()).append("> "); if (mimeType != null) { sb.append("for content type...
java
private void logRequest(ResultType cmdType, String mimeType) { StringBuilder sb = new StringBuilder("Executing SPARQL protocol request "); sb.append("to endpoint <").append(((ProtocolDataSource)getConnection().getDataSource()).getUrl()).append("> "); if (mimeType != null) { sb.append("for content type...
[ "private", "void", "logRequest", "(", "ResultType", "cmdType", ",", "String", "mimeType", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "\"Executing SPARQL protocol request \"", ")", ";", "sb", ".", "append", "(", "\"to endpoint <\"", ")", "."...
Log the enpoint URL and request parameters.
[ "Log", "the", "enpoint", "URL", "and", "request", "parameters", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/ProtocolCommand.java#L172-L186
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/driver/DriverNode.java
DriverNode.initialize
public void initialize(){ thread = new Thread(collectorProcessor); thread.start(); for (DriverNode dn : this.children){ dn.initialize(); } }
java
public void initialize(){ thread = new Thread(collectorProcessor); thread.start(); for (DriverNode dn : this.children){ dn.initialize(); } }
[ "public", "void", "initialize", "(", ")", "{", "thread", "=", "new", "Thread", "(", "collectorProcessor", ")", ";", "thread", ".", "start", "(", ")", ";", "for", "(", "DriverNode", "dn", ":", "this", ".", "children", ")", "{", "dn", ".", "initialize", ...
initialize driver node and all children of the node
[ "initialize", "driver", "node", "and", "all", "children", "of", "the", "node" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/driver/DriverNode.java#L45-L51
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/driver/DriverNode.java
DriverNode.addChild
public void addChild(DriverNode dn){ collectorProcessor.getChildren().add(dn.operator); children.add(dn); }
java
public void addChild(DriverNode dn){ collectorProcessor.getChildren().add(dn.operator); children.add(dn); }
[ "public", "void", "addChild", "(", "DriverNode", "dn", ")", "{", "collectorProcessor", ".", "getChildren", "(", ")", ".", "add", "(", "dn", ".", "operator", ")", ";", "children", ".", "add", "(", "dn", ")", ";", "}" ]
Method adds a child data node and binds the collect processor of this node to the operator of the next node @param dn a child driver node
[ "Method", "adds", "a", "child", "data", "node", "and", "binds", "the", "collect", "processor", "of", "this", "node", "to", "the", "operator", "of", "the", "next", "node" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/driver/DriverNode.java#L58-L61
train
galan/verjson
src/main/java/de/galan/verjson/util/MetaWrapper.java
MetaWrapper.getNamespace
public static String getNamespace(JsonNode node) { JsonNode nodeNs = obj(node).get(ID_NAMESPACE); return (nodeNs != null) ? nodeNs.asText() : null; }
java
public static String getNamespace(JsonNode node) { JsonNode nodeNs = obj(node).get(ID_NAMESPACE); return (nodeNs != null) ? nodeNs.asText() : null; }
[ "public", "static", "String", "getNamespace", "(", "JsonNode", "node", ")", "{", "JsonNode", "nodeNs", "=", "obj", "(", "node", ")", ".", "get", "(", "ID_NAMESPACE", ")", ";", "return", "(", "nodeNs", "!=", "null", ")", "?", "nodeNs", ".", "asText", "(...
Returns the namespace from a wrapped JsonNode
[ "Returns", "the", "namespace", "from", "a", "wrapped", "JsonNode" ]
4db610fb5198fde913114ed628234f957e1c19d5
https://github.com/galan/verjson/blob/4db610fb5198fde913114ed628234f957e1c19d5/src/main/java/de/galan/verjson/util/MetaWrapper.java#L58-L61
train
galan/verjson
src/main/java/de/galan/verjson/util/MetaWrapper.java
MetaWrapper.setVersion
public static void setVersion(JsonNode node, Long version) { obj(node).put(ID_VERSION, version); }
java
public static void setVersion(JsonNode node, Long version) { obj(node).put(ID_VERSION, version); }
[ "public", "static", "void", "setVersion", "(", "JsonNode", "node", ",", "Long", "version", ")", "{", "obj", "(", "node", ")", ".", "put", "(", "ID_VERSION", ",", "version", ")", ";", "}" ]
Sets the version on a wrapped JsonNode
[ "Sets", "the", "version", "on", "a", "wrapped", "JsonNode" ]
4db610fb5198fde913114ed628234f957e1c19d5
https://github.com/galan/verjson/blob/4db610fb5198fde913114ed628234f957e1c19d5/src/main/java/de/galan/verjson/util/MetaWrapper.java#L71-L73
train
galan/verjson
src/main/java/de/galan/verjson/util/MetaWrapper.java
MetaWrapper.getTimestamp
public static Date getTimestamp(JsonNode node) { String text = obj(node).get(ID_TIMESTAMP).asText(); return isNotBlank(text) ? from(instantUtc(text)).toDate() : null; }
java
public static Date getTimestamp(JsonNode node) { String text = obj(node).get(ID_TIMESTAMP).asText(); return isNotBlank(text) ? from(instantUtc(text)).toDate() : null; }
[ "public", "static", "Date", "getTimestamp", "(", "JsonNode", "node", ")", "{", "String", "text", "=", "obj", "(", "node", ")", ".", "get", "(", "ID_TIMESTAMP", ")", ".", "asText", "(", ")", ";", "return", "isNotBlank", "(", "text", ")", "?", "from", ...
Returns the timestamp from a wrapped JsonNode
[ "Returns", "the", "timestamp", "from", "a", "wrapped", "JsonNode" ]
4db610fb5198fde913114ed628234f957e1c19d5
https://github.com/galan/verjson/blob/4db610fb5198fde913114ed628234f957e1c19d5/src/main/java/de/galan/verjson/util/MetaWrapper.java#L77-L80
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java
DragHelper.update
public final void update(final float position) { if (reset) { reset = false; distance = 0; thresholdReachedPosition = -1; dragStartTime = -1; dragStartPosition = position; reachedThreshold = false; minDragDistance = 0; ...
java
public final void update(final float position) { if (reset) { reset = false; distance = 0; thresholdReachedPosition = -1; dragStartTime = -1; dragStartPosition = position; reachedThreshold = false; minDragDistance = 0; ...
[ "public", "final", "void", "update", "(", "final", "float", "position", ")", "{", "if", "(", "reset", ")", "{", "reset", "=", "false", ";", "distance", "=", "0", ";", "thresholdReachedPosition", "=", "-", "1", ";", "dragStartTime", "=", "-", "1", ";", ...
Updates the instance by adding a new position. This will cause all properties to be re-calculated, depending on the new position. @param position The position, which should be added, as a {@link Float} value
[ "Updates", "the", "instance", "by", "adding", "a", "new", "position", ".", "This", "will", "cause", "all", "properties", "to", "be", "re", "-", "calculated", "depending", "on", "the", "new", "position", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java#L163-L196
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java
DragHelper.setMaxDragDistance
public final void setMaxDragDistance(final float maxDragDistance) { if (maxDragDistance != 0) { Condition.INSTANCE.ensureGreater(maxDragDistance, threshold, "The maximum drag distance must be greater than " + threshold); } this.maxDragDistance = maxDragDistance; ...
java
public final void setMaxDragDistance(final float maxDragDistance) { if (maxDragDistance != 0) { Condition.INSTANCE.ensureGreater(maxDragDistance, threshold, "The maximum drag distance must be greater than " + threshold); } this.maxDragDistance = maxDragDistance; ...
[ "public", "final", "void", "setMaxDragDistance", "(", "final", "float", "maxDragDistance", ")", "{", "if", "(", "maxDragDistance", "!=", "0", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureGreater", "(", "maxDragDistance", ",", "threshold", ",", "\"The maxi...
Sets the maximum drag distance. @param maxDragDistance The maximum drag distance, which should be set, in pixels as a {@link Float} value or 0, if no maximum drag distance should be set
[ "Sets", "the", "maximum", "drag", "distance", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java#L215-L222
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java
DragHelper.setMinDragDistance
public final void setMinDragDistance(final float minDragDistance) { if (minDragDistance != 0) { Condition.INSTANCE.ensureSmaller(minDragDistance, -threshold, "The minimum drag distance must be smaller than " + -threshold); } this.minDragDistance = minDragDistance...
java
public final void setMinDragDistance(final float minDragDistance) { if (minDragDistance != 0) { Condition.INSTANCE.ensureSmaller(minDragDistance, -threshold, "The minimum drag distance must be smaller than " + -threshold); } this.minDragDistance = minDragDistance...
[ "public", "final", "void", "setMinDragDistance", "(", "final", "float", "minDragDistance", ")", "{", "if", "(", "minDragDistance", "!=", "0", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureSmaller", "(", "minDragDistance", ",", "-", "threshold", ",", "\"T...
Sets the minimum drag distance. @param minDragDistance The minimum drag distance, which should be set, in pixels as a {@link Float} value or 0, if no minimum drag distance should be set
[ "Sets", "the", "minimum", "drag", "distance", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java#L241-L248
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java
DragHelper.getDragSpeed
public final float getDragSpeed() { if (hasThresholdBeenReached()) { long interval = System.currentTimeMillis() - dragStartTime; return Math.abs(getDragDistance()) / (float) interval; } else { return -1; } }
java
public final float getDragSpeed() { if (hasThresholdBeenReached()) { long interval = System.currentTimeMillis() - dragStartTime; return Math.abs(getDragDistance()) / (float) interval; } else { return -1; } }
[ "public", "final", "float", "getDragSpeed", "(", ")", "{", "if", "(", "hasThresholdBeenReached", "(", ")", ")", "{", "long", "interval", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "dragStartTime", ";", "return", "Math", ".", "abs", "(", "getDr...
Returns the speed of the drag gesture in pixels per millisecond. @return The speed of the drag gesture as a {@link Float} value or -1, if the threshold has not been reached yet
[ "Returns", "the", "speed", "of", "the", "drag", "gesture", "in", "pixels", "per", "millisecond", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/gesture/DragHelper.java#L285-L292
train
michael-rapp/AndroidUtil
example/src/main/java/de/mrapp/android/util/example/MainActivity.java
MainActivity.createSeekBarListener
private OnSeekBarChangeListener createSeekBarListener() { return new OnSeekBarChangeListener() { @Override public void onProgressChanged(final SeekBar seekBar, final int progress, final boolean fromUser) { adaptElevation(progress...
java
private OnSeekBarChangeListener createSeekBarListener() { return new OnSeekBarChangeListener() { @Override public void onProgressChanged(final SeekBar seekBar, final int progress, final boolean fromUser) { adaptElevation(progress...
[ "private", "OnSeekBarChangeListener", "createSeekBarListener", "(", ")", "{", "return", "new", "OnSeekBarChangeListener", "(", ")", "{", "@", "Override", "public", "void", "onProgressChanged", "(", "final", "SeekBar", "seekBar", ",", "final", "int", "progress", ",",...
Creates and returns a listener, which allows to adjust the elevation, when the value of a seek bar has been changed. @return The listener, which has been created, as an instance of the type {@link OnSeekBarChangeListener}
[ "Creates", "and", "returns", "a", "listener", "which", "allows", "to", "adjust", "the", "elevation", "when", "the", "value", "of", "a", "seek", "bar", "has", "been", "changed", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/example/src/main/java/de/mrapp/android/util/example/MainActivity.java#L122-L142
train
michael-rapp/AndroidUtil
example/src/main/java/de/mrapp/android/util/example/MainActivity.java
MainActivity.adaptElevation
private void adaptElevation(final int elevation, final boolean parallelLight) { elevationTextView.setText(String.format(getString(R.string.elevation), elevation)); elevationLeft.setShadowElevation(elevation); elevationLeft.emulateParallelLight(parallelLight); elevationTopLeft.setShadowEl...
java
private void adaptElevation(final int elevation, final boolean parallelLight) { elevationTextView.setText(String.format(getString(R.string.elevation), elevation)); elevationLeft.setShadowElevation(elevation); elevationLeft.emulateParallelLight(parallelLight); elevationTopLeft.setShadowEl...
[ "private", "void", "adaptElevation", "(", "final", "int", "elevation", ",", "final", "boolean", "parallelLight", ")", "{", "elevationTextView", ".", "setText", "(", "String", ".", "format", "(", "getString", "(", "R", ".", "string", ".", "elevation", ")", ",...
Adapts the elevation. @param elevation The elevation, which should be set, in dp as an {@link Integer} value @param parallelLight True, if parallel light should be emulated, false otherwise
[ "Adapts", "the", "elevation", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/example/src/main/java/de/mrapp/android/util/example/MainActivity.java#L163-L181
train
MKLab-ITI/simmo
src/main/java/gr/iti/mklab/simmo/core/segments/SegmentFactory.java
SegmentFactory.getSegment
public Segment getSegment(SEGMENT_TYPE segmentType){ if(segmentType == null){ return null; } if(segmentType == SEGMENT_TYPE.LINEAR){ return new LinearSegment(); } else if(segmentType == SEGMENT_TYPE.SPATIAL){ return new SpatialSegment(); } else if(segmentType == SEGMENT_TYPE.TEMPORAL){ r...
java
public Segment getSegment(SEGMENT_TYPE segmentType){ if(segmentType == null){ return null; } if(segmentType == SEGMENT_TYPE.LINEAR){ return new LinearSegment(); } else if(segmentType == SEGMENT_TYPE.SPATIAL){ return new SpatialSegment(); } else if(segmentType == SEGMENT_TYPE.TEMPORAL){ r...
[ "public", "Segment", "getSegment", "(", "SEGMENT_TYPE", "segmentType", ")", "{", "if", "(", "segmentType", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "segmentType", "==", "SEGMENT_TYPE", ".", "LINEAR", ")", "{", "return", "new", "Linear...
use getShape method to get object of type shape
[ "use", "getShape", "method", "to", "get", "object", "of", "type", "shape" ]
a78436e982e160fb0260746c563c7e4d24736486
https://github.com/MKLab-ITI/simmo/blob/a78436e982e160fb0260746c563c7e4d24736486/src/main/java/gr/iti/mklab/simmo/core/segments/SegmentFactory.java#L10-L30
train
galan/verjson
src/main/java/de/galan/verjson/core/Verjson.java
Verjson.write
public String write(T obj) throws JsonProcessingException { Date ts = includeTimestamp ? Date.from(now()) : null; MetaWrapper wrapper = new MetaWrapper(getHighestSourceVersion(), getNamespace(), obj, ts); return mapper.writeValueAsString(wrapper); }
java
public String write(T obj) throws JsonProcessingException { Date ts = includeTimestamp ? Date.from(now()) : null; MetaWrapper wrapper = new MetaWrapper(getHighestSourceVersion(), getNamespace(), obj, ts); return mapper.writeValueAsString(wrapper); }
[ "public", "String", "write", "(", "T", "obj", ")", "throws", "JsonProcessingException", "{", "Date", "ts", "=", "includeTimestamp", "?", "Date", ".", "from", "(", "now", "(", ")", ")", ":", "null", ";", "MetaWrapper", "wrapper", "=", "new", "MetaWrapper", ...
Serializes the given object to a String
[ "Serializes", "the", "given", "object", "to", "a", "String" ]
4db610fb5198fde913114ed628234f957e1c19d5
https://github.com/galan/verjson/blob/4db610fb5198fde913114ed628234f957e1c19d5/src/main/java/de/galan/verjson/core/Verjson.java#L100-L104
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/ScrimInsetsLayout.java
ScrimInsetsLayout.obtainInsetForeground
private void obtainInsetForeground(@NonNull final TypedArray typedArray) { int color = typedArray.getColor(R.styleable.ScrimInsetsLayout_insetDrawable, -1); if (color == -1) { Drawable drawable = typedArray.getDrawable(R.styleable.ScrimInsetsLayout_insetDrawable); if (drawable ...
java
private void obtainInsetForeground(@NonNull final TypedArray typedArray) { int color = typedArray.getColor(R.styleable.ScrimInsetsLayout_insetDrawable, -1); if (color == -1) { Drawable drawable = typedArray.getDrawable(R.styleable.ScrimInsetsLayout_insetDrawable); if (drawable ...
[ "private", "void", "obtainInsetForeground", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "int", "color", "=", "typedArray", ".", "getColor", "(", "R", ".", "styleable", ".", "ScrimInsetsLayout_insetDrawable", ",", "-", "1", ")", ";", "if...
Obtains the drawable, which should be shown in the layout's insets, from a specific typed array. @param typedArray The typed array, the drawable should be obtained from, as an instance of the class {@link TypedArray}. The typed array may not be null
[ "Obtains", "the", "drawable", "which", "should", "be", "shown", "in", "the", "layout", "s", "insets", "from", "a", "specific", "typed", "array", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/ScrimInsetsLayout.java#L141-L156
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java
RelativeToEasterSundayParser.parse
public void parse (final int nYear, final HolidayMap aHolidayMap, final Holidays aConfig) { for (final RelativeToEasterSunday aDay : aConfig.getRelativeToEasterSunday ()) { if (!isValid (aDay, nYear)) continue; final ChronoLocalDate aEasterSunday = getEasterSunday (nYear, aDay.getChronolog...
java
public void parse (final int nYear, final HolidayMap aHolidayMap, final Holidays aConfig) { for (final RelativeToEasterSunday aDay : aConfig.getRelativeToEasterSunday ()) { if (!isValid (aDay, nYear)) continue; final ChronoLocalDate aEasterSunday = getEasterSunday (nYear, aDay.getChronolog...
[ "public", "void", "parse", "(", "final", "int", "nYear", ",", "final", "HolidayMap", "aHolidayMap", ",", "final", "Holidays", "aConfig", ")", "{", "for", "(", "final", "RelativeToEasterSunday", "aDay", ":", "aConfig", ".", "getRelativeToEasterSunday", "(", ")", ...
Parses relative to Easter Sunday holidays.
[ "Parses", "relative", "to", "Easter", "Sunday", "holidays", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java#L47-L61
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java
RelativeToEasterSundayParser.addChrstianHoliday
protected final void addChrstianHoliday (final ChronoLocalDate aDate, final String sPropertiesKey, final IHolidayType aHolidayType, final HolidayMap holidays) { final LocalDate converte...
java
protected final void addChrstianHoliday (final ChronoLocalDate aDate, final String sPropertiesKey, final IHolidayType aHolidayType, final HolidayMap holidays) { final LocalDate converte...
[ "protected", "final", "void", "addChrstianHoliday", "(", "final", "ChronoLocalDate", "aDate", ",", "final", "String", "sPropertiesKey", ",", "final", "IHolidayType", "aHolidayType", ",", "final", "HolidayMap", "holidays", ")", "{", "final", "LocalDate", "convertedDate...
Adds the given day to the list of holidays. @param aDate The day @param sPropertiesKey a {@link java.lang.String} object. @param aHolidayType a {@link HolidayType} object. @param holidays a {@link java.util.Set} object.
[ "Adds", "the", "given", "day", "to", "the", "list", "of", "holidays", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java#L75-L82
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java
RelativeToEasterSundayParser.getEasterSunday
public static ChronoLocalDate getEasterSunday (final int nYear) { return nYear <= CPDT.LAST_JULIAN_YEAR ? getJulianEasterSunday (nYear) : getGregorianEasterSunday (nYear); }
java
public static ChronoLocalDate getEasterSunday (final int nYear) { return nYear <= CPDT.LAST_JULIAN_YEAR ? getJulianEasterSunday (nYear) : getGregorianEasterSunday (nYear); }
[ "public", "static", "ChronoLocalDate", "getEasterSunday", "(", "final", "int", "nYear", ")", "{", "return", "nYear", "<=", "CPDT", ".", "LAST_JULIAN_YEAR", "?", "getJulianEasterSunday", "(", "nYear", ")", ":", "getGregorianEasterSunday", "(", "nYear", ")", ";", ...
Returns the easter Sunday for a given year. @param nYear The year to retrieve Easter Sunday date @return Easter Sunday.
[ "Returns", "the", "easter", "Sunday", "for", "a", "given", "year", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java#L91-L94
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java
RelativeToEasterSundayParser.getJulianEasterSunday
public static JulianDate getJulianEasterSunday (final int nYear) { final int a = nYear % 4; final int b = nYear % 7; final int c = nYear % 19; final int d = (19 * c + 15) % 30; final int e = (2 * a + 4 * b - d + 34) % 7; final int x = d + e + 114; final int nMonth = x / 31; final int n...
java
public static JulianDate getJulianEasterSunday (final int nYear) { final int a = nYear % 4; final int b = nYear % 7; final int c = nYear % 19; final int d = (19 * c + 15) % 30; final int e = (2 * a + 4 * b - d + 34) % 7; final int x = d + e + 114; final int nMonth = x / 31; final int n...
[ "public", "static", "JulianDate", "getJulianEasterSunday", "(", "final", "int", "nYear", ")", "{", "final", "int", "a", "=", "nYear", "%", "4", ";", "final", "int", "b", "=", "nYear", "%", "7", ";", "final", "int", "c", "=", "nYear", "%", "19", ";", ...
Returns the easter Sunday within the julian chronology. @param nYear The year to retrieve Julian Easter Sunday date @return julian easter Sunday
[ "Returns", "the", "easter", "Sunday", "within", "the", "julian", "chronology", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java#L108-L119
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java
RelativeToEasterSundayParser.getGregorianEasterSunday
public static LocalDate getGregorianEasterSunday (final int nYear) { final int a = nYear % 19; final int b = nYear / 100; final int c = nYear % 100; final int d = b / 4; final int e = b % 4; final int f = (b + 8) / 25; final int g = (b - f + 1) / 3; final int h = (19 * a + b - d - g + ...
java
public static LocalDate getGregorianEasterSunday (final int nYear) { final int a = nYear % 19; final int b = nYear / 100; final int c = nYear % 100; final int d = b / 4; final int e = b % 4; final int f = (b + 8) / 25; final int g = (b - f + 1) / 3; final int h = (19 * a + b - d - g + ...
[ "public", "static", "LocalDate", "getGregorianEasterSunday", "(", "final", "int", "nYear", ")", "{", "final", "int", "a", "=", "nYear", "%", "19", ";", "final", "int", "b", "=", "nYear", "/", "100", ";", "final", "int", "c", "=", "nYear", "%", "100", ...
Returns the easter Sunday within the gregorian chronology. @param nYear The year to retrieve Gregorian Easter Sunday date @return gregorian easter Sunday.
[ "Returns", "the", "easter", "Sunday", "within", "the", "gregorian", "chronology", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/RelativeToEasterSundayParser.java#L128-L146
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.createEdgeShadow
private static Bitmap createEdgeShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { if (elevation == 0) { return null; } else {...
java
private static Bitmap createEdgeShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { if (elevation == 0) { return null; } else {...
[ "private", "static", "Bitmap", "createEdgeShadow", "(", "@", "NonNull", "final", "Context", "context", ",", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "if", "(", ...
Creates and returns a bitmap, which can be used to emulate a shadow, which is located at a corner of an elevated view on pre-Lollipop devices. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param elevation The elevation, which should be emula...
[ "Creates", "and", "returns", "a", "bitmap", "which", "can", "be", "used", "to", "emulate", "a", "shadow", "which", "is", "located", "at", "a", "corner", "of", "an", "elevated", "view", "on", "pre", "-", "Lollipop", "devices", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L253-L279
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.createCornerShadow
private static Bitmap createCornerShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { if (elevation == 0) { return null; } ...
java
private static Bitmap createCornerShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { if (elevation == 0) { return null; } ...
[ "private", "static", "Bitmap", "createCornerShadow", "(", "@", "NonNull", "final", "Context", "context", ",", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "if", "(", ...
Creates and returns a bitmap, which can be used to emulate a shadow, which is located besides an edge of an elevated view on pre-Lollipop devices. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param elevation The elevation, which should be e...
[ "Creates", "and", "returns", "a", "bitmap", "which", "can", "be", "used", "to", "emulate", "a", "shadow", "which", "is", "located", "besides", "an", "edge", "of", "an", "elevated", "view", "on", "pre", "-", "Lollipop", "devices", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L301-L340
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getCornerBounds
private static RectF getCornerBounds(@NonNull final Orientation orientation, final int size) { switch (orientation) { case TOP_LEFT: return new RectF(0, 0, 2 * size, 2 * size); case TOP_RIGHT: return new RectF(-size, 0, size, 2 * size); case BO...
java
private static RectF getCornerBounds(@NonNull final Orientation orientation, final int size) { switch (orientation) { case TOP_LEFT: return new RectF(0, 0, 2 * size, 2 * size); case TOP_RIGHT: return new RectF(-size, 0, size, 2 * size); case BO...
[ "private", "static", "RectF", "getCornerBounds", "(", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "int", "size", ")", "{", "switch", "(", "orientation", ")", "{", "case", "TOP_LEFT", ":", "return", "new", "RectF", "(", "0", ",", "0...
Returns the bounds, which should be used to draw a shadow, which is located at a corner of an elevated view. @param orientation The orientation of the shadow in relation to the elevated view as a value of the enum {@link Orientation}. The orientation may either be <code>TOP_LEFT</code>, <code>TOP_RIGHT</code>, <code>B...
[ "Returns", "the", "bounds", "which", "should", "be", "used", "to", "draw", "a", "shadow", "which", "is", "located", "at", "a", "corner", "of", "an", "elevated", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L387-L400
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getHorizontalShadowWidth
private static float getHorizontalShadowWidth(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { ...
java
private static float getHorizontalShadowWidth(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { ...
[ "private", "static", "float", "getHorizontalShadowWidth", "(", "@", "NonNull", "final", "Context", "context", ",", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "switch"...
Returns the width of a shadow, which is located next to a corner of an elevated view in horizontal direction. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param elevation The elevation, which should be emulated, in dp as an {@link Integer} ...
[ "Returns", "the", "width", "of", "a", "shadow", "which", "is", "located", "next", "to", "a", "corner", "of", "an", "elevated", "view", "in", "horizontal", "direction", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L421-L435
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getShadowWidth
private static float getShadowWidth(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { float referenceElevationWidth = (float) elevation / (flo...
java
private static float getShadowWidth(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { float referenceElevationWidth = (float) elevation / (flo...
[ "private", "static", "float", "getShadowWidth", "(", "@", "NonNull", "final", "Context", "context", ",", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "float", "refere...
Returns the width of a shadow, which is located besides an edge of an elevated view. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param elevation The elevation, which should be emulated, in dp as an {@link Integer} value. The elevation must...
[ "Returns", "the", "width", "of", "a", "shadow", "which", "is", "located", "besides", "an", "edge", "of", "an", "elevated", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L489-L518
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getHorizontalShadowColor
private static int getHorizontalShadowColor(final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { switch (orientation) { case TOP_LEFT: case TOP_RIGHT: ...
java
private static int getHorizontalShadowColor(final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { switch (orientation) { case TOP_LEFT: case TOP_RIGHT: ...
[ "private", "static", "int", "getHorizontalShadowColor", "(", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "switch", "(", "orientation", ")", "{", "case", "TOP_LEFT", ...
Returns the color of a shadow, which is located next to a corner of an elevated view in horizontal direction. @param elevation The elevation, which should be emulated, in dp as an {@link Integer} value. The elevation must be at least 0 and at maximum the value of the constant <code>MAX_ELEVATION</code> @param orientat...
[ "Returns", "the", "color", "of", "a", "shadow", "which", "is", "located", "next", "to", "a", "corner", "of", "an", "elevated", "view", "in", "horizontal", "direction", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L536-L549
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getVerticalShadowColor
private static int getVerticalShadowColor(final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { switch (orientation) { case TOP_LEFT: case BOTTOM_LEFT: ...
java
private static int getVerticalShadowColor(final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { switch (orientation) { case TOP_LEFT: case BOTTOM_LEFT: ...
[ "private", "static", "int", "getVerticalShadowColor", "(", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "switch", "(", "orientation", ")", "{", "case", "TOP_LEFT", ":...
Returns the color of a shadow, which is located next to a corner of an elevated view in vertical direction. @param elevation The elevation, which should be emulated, in dp as an {@link Integer} value. The elevation must be at least 0 and at maximum the value of the constant <code>MAX_ELEVATION</code> @param orientatio...
[ "Returns", "the", "color", "of", "a", "shadow", "which", "is", "located", "next", "to", "a", "corner", "of", "an", "elevated", "view", "in", "vertical", "direction", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L567-L580
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getShadowColor
private static int getShadowColor(final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { int alpha; if (parallelLight) { alpha = getShadowAlpha(elevation, MIN_BOTTOM_ALPHA, MAX_BOTTOM_ALPHA); } else { ...
java
private static int getShadowColor(final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { int alpha; if (parallelLight) { alpha = getShadowAlpha(elevation, MIN_BOTTOM_ALPHA, MAX_BOTTOM_ALPHA); } else { ...
[ "private", "static", "int", "getShadowColor", "(", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "int", "alpha", ";", "if", "(", "parallelLight", ")", "{", "alpha", ...
Returns the color of a shadow, which is located besides an edge of an elevated view. @param elevation The elevation, which should be emulated, in dp as an {@link Integer} value. The elevation must be at least 0 and at maximum the value of the constant <code>MAX_ELEVATION</code> @param orientation The orientation of th...
[ "Returns", "the", "color", "of", "a", "shadow", "which", "is", "located", "besides", "an", "edge", "of", "an", "elevated", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L597-L623
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getShadowAlpha
private static int getShadowAlpha(final int elevation, final int minTransparency, final int maxTransparency) { float ratio = (float) elevation / (float) MAX_ELEVATION; int range = maxTransparency - minTransparency; return Math.round(minTransparency + ratio *...
java
private static int getShadowAlpha(final int elevation, final int minTransparency, final int maxTransparency) { float ratio = (float) elevation / (float) MAX_ELEVATION; int range = maxTransparency - minTransparency; return Math.round(minTransparency + ratio *...
[ "private", "static", "int", "getShadowAlpha", "(", "final", "int", "elevation", ",", "final", "int", "minTransparency", ",", "final", "int", "maxTransparency", ")", "{", "float", "ratio", "=", "(", "float", ")", "elevation", "/", "(", "float", ")", "MAX_ELEV...
Returns the alpha value of a shadow by interpolating between a minimum and maximum alpha value, depending on a specific elevation. @param elevation The elevation, which should be emulated, in dp as an {@link Integer} value. The elevation must be at least 0 and at maximum the value of the constant <code>MAX_ELEVATION</...
[ "Returns", "the", "alpha", "value", "of", "a", "shadow", "by", "interpolating", "between", "a", "minimum", "and", "maximum", "alpha", "value", "depending", "on", "a", "specific", "elevation", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L641-L646
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.createLinearGradient
private static Shader createLinearGradient(@NonNull final Orientation orientation, final int bitmapWidth, final int bitmapHeight, final float shadowWidth, @ColorInt final int shad...
java
private static Shader createLinearGradient(@NonNull final Orientation orientation, final int bitmapWidth, final int bitmapHeight, final float shadowWidth, @ColorInt final int shad...
[ "private", "static", "Shader", "createLinearGradient", "(", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "int", "bitmapWidth", ",", "final", "int", "bitmapHeight", ",", "final", "float", "shadowWidth", ",", "@", "ColorInt", "final", "int", ...
Creates and returns a shader, which can be used to draw a shadow, which located besides an edge of an elevated view. @param orientation The orientation of the shadow in relation to the elevated view as a value of the enum {@link Orientation}. The orientation may either be <code>LEFT</code>, <code>TOP</code>, <code>RIG...
[ "Creates", "and", "returns", "a", "shader", "which", "can", "be", "used", "to", "draw", "a", "shadow", "which", "located", "besides", "an", "edge", "of", "an", "elevated", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L668-L695
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.createRadialGradient
private static Shader createRadialGradient(@NonNull final Orientation orientation, final int bitmapSize, final float radius) { PointF center = new PointF(); switch (orientation) { case TOP_LEFT: center.x = bitmapSize; ...
java
private static Shader createRadialGradient(@NonNull final Orientation orientation, final int bitmapSize, final float radius) { PointF center = new PointF(); switch (orientation) { case TOP_LEFT: center.x = bitmapSize; ...
[ "private", "static", "Shader", "createRadialGradient", "(", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "int", "bitmapSize", ",", "final", "float", "radius", ")", "{", "PointF", "center", "=", "new", "PointF", "(", ")", ";", "switch", ...
Creates and returns a shader, which can be used to draw a shadow, which located at a corner of an elevated view. @param orientation The orientation of the shadow in relation to the elevated view as a value of the enum {@link Orientation}. The orientation may either be <code>TOP_LEFT</code>, <code>TOP_RIGHT</code>, <co...
[ "Creates", "and", "returns", "a", "shader", "which", "can", "be", "used", "to", "draw", "a", "shadow", "which", "located", "at", "a", "corner", "of", "an", "elevated", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L713-L736
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.getCornerAngle
private static float getCornerAngle(@NonNull final Orientation orientation) { switch (orientation) { case TOP_LEFT: return QUARTER_ARC_DEGRESS * 2; case TOP_RIGHT: return QUARTER_ARC_DEGRESS * 3; case BOTTOM_LEFT: return QUARTER...
java
private static float getCornerAngle(@NonNull final Orientation orientation) { switch (orientation) { case TOP_LEFT: return QUARTER_ARC_DEGRESS * 2; case TOP_RIGHT: return QUARTER_ARC_DEGRESS * 3; case BOTTOM_LEFT: return QUARTER...
[ "private", "static", "float", "getCornerAngle", "(", "@", "NonNull", "final", "Orientation", "orientation", ")", "{", "switch", "(", "orientation", ")", "{", "case", "TOP_LEFT", ":", "return", "QUARTER_ARC_DEGRESS", "*", "2", ";", "case", "TOP_RIGHT", ":", "re...
Returns the angle, which should be used to draw a shadow, which is located at a corner of an elevated view. @param orientation The orientation of the shadow in relation to the elevated view as a value of the enum {@link Orientation}. The orientation may either be <code>TOP_LEFT</code>, <code>TOP_RIGHT</code>, <code>BO...
[ "Returns", "the", "angle", "which", "should", "be", "used", "to", "draw", "a", "shadow", "which", "is", "located", "at", "a", "corner", "of", "an", "elevated", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L748-L761
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.createElevationShadow
public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation) { return createElevationShadow(context, elevation, orientation, false); }
java
public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation) { return createElevationShadow(context, elevation, orientation, false); }
[ "public", "static", "Bitmap", "createElevationShadow", "(", "@", "NonNull", "final", "Context", "context", ",", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ")", "{", "return", "createElevationShadow", "(", "context", ",...
Creates and returns a bitmap, which can be used to emulate a shadow of an elevated view on pre-Lollipop devices. By default a non-parallel illumination of the view is emulated, which causes the shadow at its bottom to appear a bit more intense than the shadows to its left and right and a lot more intense than the shado...
[ "Creates", "and", "returns", "a", "bitmap", "which", "can", "be", "used", "to", "emulate", "a", "shadow", "of", "an", "elevated", "view", "on", "pre", "-", "Lollipop", "devices", ".", "By", "default", "a", "non", "-", "parallel", "illumination", "of", "t...
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L792-L795
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.createElevationShadow
public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { Condition.INSTANCE.ensureNotNull(context, "The cont...
java
public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { Condition.INSTANCE.ensureNotNull(context, "The cont...
[ "public", "static", "Bitmap", "createElevationShadow", "(", "@", "NonNull", "final", "Context", "context", ",", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "Condition"...
Creates and returns a bitmap, which can be used to emulate a shadow of an elevated view on pre-Lollipop devices. This method furthermore allows to specify, whether parallel illumination of the view should be emulated, which causes the shadows at all of its sides to appear identically. @param context The context, which...
[ "Creates", "and", "returns", "a", "bitmap", "which", "can", "be", "used", "to", "emulate", "a", "shadow", "of", "an", "elevated", "view", "on", "pre", "-", "Lollipop", "devices", ".", "This", "method", "furthermore", "allows", "to", "specify", "whether", "...
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L820-L843
train
sosandstrom/mardao
mardao-maven-plugin/src/main/java/net/sf/mardao/plugin/AbstractMardaoMojo.java
AbstractMardaoMojo.mergeTemplate
private void mergeTemplate(String templateFilename, File folder, String javaFilename, boolean overwrite) { final File javaFile = new File(folder, javaFilename); // create destination folder? File destinationFolder = javaFile.getParentFile(); if (false == destinationFo...
java
private void mergeTemplate(String templateFilename, File folder, String javaFilename, boolean overwrite) { final File javaFile = new File(folder, javaFilename); // create destination folder? File destinationFolder = javaFile.getParentFile(); if (false == destinationFo...
[ "private", "void", "mergeTemplate", "(", "String", "templateFilename", ",", "File", "folder", ",", "String", "javaFilename", ",", "boolean", "overwrite", ")", "{", "final", "File", "javaFile", "=", "new", "File", "(", "folder", ",", "javaFilename", ")", ";", ...
Merges a Velocity template for a specified file, unless it already exists. @param templateFilename @param folder @param javaFilename
[ "Merges", "a", "Velocity", "template", "for", "a", "specified", "file", "unless", "it", "already", "exists", "." ]
b77e3a2ac1d8932e0a3174f3645f71b211dfc055
https://github.com/sosandstrom/mardao/blob/b77e3a2ac1d8932e0a3174f3645f71b211dfc055/mardao-maven-plugin/src/main/java/net/sf/mardao/plugin/AbstractMardaoMojo.java#L402-L437
train
rahulsom/genealogy
src/main/java/com/github/rahulsom/genealogy/DataUtil.java
DataUtil.processResource
private static void processResource(String resourceName, AbstractProcessor processor) { InputStream lastNameStream = NameDbUsa.class.getClassLoader().getResourceAsStream(resourceName); BufferedReader lastNameReader = new BufferedReader(new InputStreamReader(lastNameStream)); try { in...
java
private static void processResource(String resourceName, AbstractProcessor processor) { InputStream lastNameStream = NameDbUsa.class.getClassLoader().getResourceAsStream(resourceName); BufferedReader lastNameReader = new BufferedReader(new InputStreamReader(lastNameStream)); try { in...
[ "private", "static", "void", "processResource", "(", "String", "resourceName", ",", "AbstractProcessor", "processor", ")", "{", "InputStream", "lastNameStream", "=", "NameDbUsa", ".", "class", ".", "getClassLoader", "(", ")", ".", "getResourceAsStream", "(", "resour...
Processes a given resource using provided closure @param resourceName resource to fetch from classpath @param processor how to process the resource
[ "Processes", "a", "given", "resource", "using", "provided", "closure" ]
2beb35ab9c6e03080328aa08b18f0a3c5d3f5c12
https://github.com/rahulsom/genealogy/blob/2beb35ab9c6e03080328aa08b18f0a3c5d3f5c12/src/main/java/com/github/rahulsom/genealogy/DataUtil.java#L97-L109
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/AttachedViewRecycler.java
AttachedViewRecycler.binarySearch
private int binarySearch(@NonNull final List<ItemType> list, @NonNull final ItemType item, @NonNull final Comparator<ItemType> comparator) { int index = Collections.binarySearch(list, item, comparator); if (index < 0) { index = ~index; } return ...
java
private int binarySearch(@NonNull final List<ItemType> list, @NonNull final ItemType item, @NonNull final Comparator<ItemType> comparator) { int index = Collections.binarySearch(list, item, comparator); if (index < 0) { index = ~index; } return ...
[ "private", "int", "binarySearch", "(", "@", "NonNull", "final", "List", "<", "ItemType", ">", "list", ",", "@", "NonNull", "final", "ItemType", "item", ",", "@", "NonNull", "final", "Comparator", "<", "ItemType", ">", "comparator", ")", "{", "int", "index"...
Returns the index, an item should be added at, according to a specific comparator. @param list The list, which should be searched, as an instance of the type {@link List}. The list may not be null @param item The item, whose position should be returned, as an instance of the generic type ItemType. The item may not be ...
[ "Returns", "the", "index", "an", "item", "should", "be", "added", "at", "according", "to", "a", "specific", "comparator", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AttachedViewRecycler.java#L80-L89
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/AttachedViewRecycler.java
AttachedViewRecycler.setComparator
public final void setComparator(@Nullable final Comparator<ItemType> comparator) { this.comparator = comparator; if (comparator != null) { if (items.size() > 0) { List<ItemType> newItems = new ArrayList<>(); List<View> views = new ArrayList<>(); ...
java
public final void setComparator(@Nullable final Comparator<ItemType> comparator) { this.comparator = comparator; if (comparator != null) { if (items.size() > 0) { List<ItemType> newItems = new ArrayList<>(); List<View> views = new ArrayList<>(); ...
[ "public", "final", "void", "setComparator", "(", "@", "Nullable", "final", "Comparator", "<", "ItemType", ">", "comparator", ")", "{", "this", ".", "comparator", "=", "comparator", ";", "if", "(", "comparator", "!=", "null", ")", "{", "if", "(", "items", ...
Sets the comparator, which allows to determine the order, which should be used to add views to the parent. When setting a comparator, which is different from the current one, the currently attached views are reordered. @param comparator The comparator, which allows to determine the order, which should be used to add v...
[ "Sets", "the", "comparator", "which", "allows", "to", "determine", "the", "order", "which", "should", "be", "used", "to", "add", "views", "to", "the", "parent", ".", "When", "setting", "a", "comparator", "which", "is", "different", "from", "the", "current", ...
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AttachedViewRecycler.java#L213-L244
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.httpRequest
public <T> T httpRequest(HttpMethod method, Class<T> cls, Map<String, Object> params, Object data, String... segments) { HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.setAccept(Collections .singletonList(MediaType.APPLICATION_JSON)); if (accessToken !...
java
public <T> T httpRequest(HttpMethod method, Class<T> cls, Map<String, Object> params, Object data, String... segments) { HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.setAccept(Collections .singletonList(MediaType.APPLICATION_JSON)); if (accessToken !...
[ "public", "<", "T", ">", "T", "httpRequest", "(", "HttpMethod", "method", ",", "Class", "<", "T", ">", "cls", ",", "Map", "<", "String", ",", "Object", ">", "params", ",", "Object", "data", ",", "String", "...", "segments", ")", "{", "HttpHeaders", "...
Low-level HTTP request method. Synchronous, blocks till response or timeout. @param method HttpMethod method @param cls class for the return type @param params parameters to encode as querystring or body parameters @param data JSON data to put in body @param segments REST url path segments (i.e. /segment1/segment2/seg...
[ "Low", "-", "level", "HTTP", "request", "method", ".", "Synchronous", "blocks", "till", "response", "or", "timeout", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L291-L327
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.apiRequest
public ApiResponse apiRequest(HttpMethod method, Map<String, Object> params, Object data, String... segments) { ApiResponse response = null; try { response = httpRequest(method, ApiResponse.class, params, data, segments); log.info("Client.apiReques...
java
public ApiResponse apiRequest(HttpMethod method, Map<String, Object> params, Object data, String... segments) { ApiResponse response = null; try { response = httpRequest(method, ApiResponse.class, params, data, segments); log.info("Client.apiReques...
[ "public", "ApiResponse", "apiRequest", "(", "HttpMethod", "method", ",", "Map", "<", "String", ",", "Object", ">", "params", ",", "Object", "data", ",", "String", "...", "segments", ")", "{", "ApiResponse", "response", "=", "null", ";", "try", "{", "respon...
High-level Usergrid API request. @param method @param params @param data @param segments @return
[ "High", "-", "level", "Usergrid", "API", "request", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L338-L359
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.authorizeAppUser
public ApiResponse authorizeAppUser(String email, String password) { validateNonEmptyParam(email, "email"); validateNonEmptyParam(password,"password"); assertValidApplicationId(); loggedInUser = null; accessToken = null; currentOrganization = null; Map<String, Obj...
java
public ApiResponse authorizeAppUser(String email, String password) { validateNonEmptyParam(email, "email"); validateNonEmptyParam(password,"password"); assertValidApplicationId(); loggedInUser = null; accessToken = null; currentOrganization = null; Map<String, Obj...
[ "public", "ApiResponse", "authorizeAppUser", "(", "String", "email", ",", "String", "password", ")", "{", "validateNonEmptyParam", "(", "email", ",", "\"email\"", ")", ";", "validateNonEmptyParam", "(", "password", ",", "\"password\"", ")", ";", "assertValidApplicat...
Log the user in and get a valid access token. @param email @param password @return non-null ApiResponse if request succeeds, check getError() for "invalid_grant" to see if access is denied.
[ "Log", "the", "user", "in", "and", "get", "a", "valid", "access", "token", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L375-L400
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.changePassword
public ApiResponse changePassword(String username, String oldPassword, String newPassword) { Map<String, Object> data = new HashMap<String, Object>(); data.put("newpassword", newPassword); data.put("oldpassword", oldPassword); return apiRequest(HttpMethod.POST, null, data, ...
java
public ApiResponse changePassword(String username, String oldPassword, String newPassword) { Map<String, Object> data = new HashMap<String, Object>(); data.put("newpassword", newPassword); data.put("oldpassword", oldPassword); return apiRequest(HttpMethod.POST, null, data, ...
[ "public", "ApiResponse", "changePassword", "(", "String", "username", ",", "String", "oldPassword", ",", "String", "newPassword", ")", "{", "Map", "<", "String", ",", "Object", ">", "data", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")"...
Change the password for the currently logged in user. You must supply the old password and the new password. @param username @param oldPassword @param newPassword @return
[ "Change", "the", "password", "for", "the", "currently", "logged", "in", "user", ".", "You", "must", "supply", "the", "old", "password", "and", "the", "new", "password", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L411-L421
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.authorizeAppClient
public ApiResponse authorizeAppClient(String clientId, String clientSecret) { validateNonEmptyParam(clientId, "client identifier"); validateNonEmptyParam(clientSecret, "client secret"); assertValidApplicationId(); loggedInUser = null; accessToken = null; currentOrganizati...
java
public ApiResponse authorizeAppClient(String clientId, String clientSecret) { validateNonEmptyParam(clientId, "client identifier"); validateNonEmptyParam(clientSecret, "client secret"); assertValidApplicationId(); loggedInUser = null; accessToken = null; currentOrganizati...
[ "public", "ApiResponse", "authorizeAppClient", "(", "String", "clientId", ",", "String", "clientSecret", ")", "{", "validateNonEmptyParam", "(", "clientId", ",", "\"client identifier\"", ")", ";", "validateNonEmptyParam", "(", "clientSecret", ",", "\"client secret\"", "...
Log the app in with it's client id and client secret key. Not recommended for production apps. @param email @param pin @return non-null ApiResponse if request succeeds, check getError() for "invalid_grant" to see if access is denied.
[ "Log", "the", "app", "in", "with", "it", "s", "client", "id", "and", "client", "secret", "key", ".", "Not", "recommended", "for", "production", "apps", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L502-L528
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.createEntity
public ApiResponse createEntity(Entity entity) { assertValidApplicationId(); if (isEmpty(entity.getType())) { throw new IllegalArgumentException("Missing entity type"); } ApiResponse response = apiRequest(HttpMethod.POST, null, entity, organizationId, applicat...
java
public ApiResponse createEntity(Entity entity) { assertValidApplicationId(); if (isEmpty(entity.getType())) { throw new IllegalArgumentException("Missing entity type"); } ApiResponse response = apiRequest(HttpMethod.POST, null, entity, organizationId, applicat...
[ "public", "ApiResponse", "createEntity", "(", "Entity", "entity", ")", "{", "assertValidApplicationId", "(", ")", ";", "if", "(", "isEmpty", "(", "entity", ".", "getType", "(", ")", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Missing ent...
Create a new entity on the server. @param entity @return an ApiResponse with the new entity in it.
[ "Create", "a", "new", "entity", "on", "the", "server", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L579-L587
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.createEntity
public ApiResponse createEntity(Map<String, Object> properties) { assertValidApplicationId(); if (isEmpty(properties.get("type"))) { throw new IllegalArgumentException("Missing entity type"); } ApiResponse response = apiRequest(HttpMethod.POST, null, properties, ...
java
public ApiResponse createEntity(Map<String, Object> properties) { assertValidApplicationId(); if (isEmpty(properties.get("type"))) { throw new IllegalArgumentException("Missing entity type"); } ApiResponse response = apiRequest(HttpMethod.POST, null, properties, ...
[ "public", "ApiResponse", "createEntity", "(", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "assertValidApplicationId", "(", ")", ";", "if", "(", "isEmpty", "(", "properties", ".", "get", "(", "\"type\"", ")", ")", ")", "{", "throw", ...
Create a new entity on the server from a set of properties. Properties must include a "type" property. @param properties @return an ApiResponse with the new entity in it.
[ "Create", "a", "new", "entity", "on", "the", "server", "from", "a", "set", "of", "properties", ".", "Properties", "must", "include", "a", "type", "property", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L596-L604
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.getGroupsForUser
public Map<String, Group> getGroupsForUser(String userId) { ApiResponse response = apiRequest(HttpMethod.GET, null, null, organizationId, applicationId, "users", userId, "groups"); Map<String, Group> groupMap = new HashMap<String, Group>(); if (response != null) { Lis...
java
public Map<String, Group> getGroupsForUser(String userId) { ApiResponse response = apiRequest(HttpMethod.GET, null, null, organizationId, applicationId, "users", userId, "groups"); Map<String, Group> groupMap = new HashMap<String, Group>(); if (response != null) { Lis...
[ "public", "Map", "<", "String", ",", "Group", ">", "getGroupsForUser", "(", "String", "userId", ")", "{", "ApiResponse", "response", "=", "apiRequest", "(", "HttpMethod", ".", "GET", ",", "null", ",", "null", ",", "organizationId", ",", "applicationId", ",",...
Get the groups for the user. @param userId @return a map with the group path as the key and the Group entity as the value
[ "Get", "the", "groups", "for", "the", "user", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L642-L653
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.queryActivityFeedForUser
public Query queryActivityFeedForUser(String userId) { Query q = queryEntitiesRequest(HttpMethod.GET, null, null, organizationId, applicationId, "users", userId, "feed"); return q; }
java
public Query queryActivityFeedForUser(String userId) { Query q = queryEntitiesRequest(HttpMethod.GET, null, null, organizationId, applicationId, "users", userId, "feed"); return q; }
[ "public", "Query", "queryActivityFeedForUser", "(", "String", "userId", ")", "{", "Query", "q", "=", "queryEntitiesRequest", "(", "HttpMethod", ".", "GET", ",", "null", ",", "null", ",", "organizationId", ",", "applicationId", ",", "\"users\"", ",", "userId", ...
Get a user's activity feed. Returned as a query to ease paging. @param userId @return
[ "Get", "a", "user", "s", "activity", "feed", ".", "Returned", "as", "a", "query", "to", "ease", "paging", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L661-L665
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.postUserActivity
public ApiResponse postUserActivity(String userId, Activity activity) { return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "users", userId, "activities"); }
java
public ApiResponse postUserActivity(String userId, Activity activity) { return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "users", userId, "activities"); }
[ "public", "ApiResponse", "postUserActivity", "(", "String", "userId", ",", "Activity", "activity", ")", "{", "return", "apiRequest", "(", "HttpMethod", ".", "POST", ",", "null", ",", "activity", ",", "organizationId", ",", "applicationId", ",", "\"users\"", ",",...
Posts an activity to a user. Activity must already be created. @param userId @param activity @return
[ "Posts", "an", "activity", "to", "a", "user", ".", "Activity", "must", "already", "be", "created", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L674-L677
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.postUserActivity
public ApiResponse postUserActivity(String verb, String title, String content, String category, User user, Entity object, String objectType, String objectName, String objectContent) { Activity activity = Activity.newActivity(verb, title, content, category, user, object, o...
java
public ApiResponse postUserActivity(String verb, String title, String content, String category, User user, Entity object, String objectType, String objectName, String objectContent) { Activity activity = Activity.newActivity(verb, title, content, category, user, object, o...
[ "public", "ApiResponse", "postUserActivity", "(", "String", "verb", ",", "String", "title", ",", "String", "content", ",", "String", "category", ",", "User", "user", ",", "Entity", "object", ",", "String", "objectType", ",", "String", "objectName", ",", "Strin...
Creates and posts an activity to a user. @param verb @param title @param content @param category @param user @param object @param objectType @param objectName @param objectContent @return
[ "Creates", "and", "posts", "an", "activity", "to", "a", "user", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L693-L699
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.postGroupActivity
public ApiResponse postGroupActivity(String groupId, Activity activity) { return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "groups", groupId, "activities"); }
java
public ApiResponse postGroupActivity(String groupId, Activity activity) { return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "groups", groupId, "activities"); }
[ "public", "ApiResponse", "postGroupActivity", "(", "String", "groupId", ",", "Activity", "activity", ")", "{", "return", "apiRequest", "(", "HttpMethod", ".", "POST", ",", "null", ",", "activity", ",", "organizationId", ",", "applicationId", ",", "\"groups\"", "...
Posts an activity to a group. Activity must already be created. @param userId @param activity @return
[ "Posts", "an", "activity", "to", "a", "group", ".", "Activity", "must", "already", "be", "created", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L708-L711
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.postGroupActivity
public ApiResponse postGroupActivity(String groupId, String verb, String title, String content, String category, User user, Entity object, String objectType, String objectName, String objectContent) { Activity activity = Activity.newActivity(verb, title, content, category...
java
public ApiResponse postGroupActivity(String groupId, String verb, String title, String content, String category, User user, Entity object, String objectType, String objectName, String objectContent) { Activity activity = Activity.newActivity(verb, title, content, category...
[ "public", "ApiResponse", "postGroupActivity", "(", "String", "groupId", ",", "String", "verb", ",", "String", "title", ",", "String", "content", ",", "String", "category", ",", "User", "user", ",", "Entity", "object", ",", "String", "objectType", ",", "String"...
Creates and posts an activity to a group. @param groupId @param verb @param title @param content @param category @param user @param object @param objectType @param objectName @param objectContent @return
[ "Creates", "and", "posts", "an", "activity", "to", "a", "group", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L728-L734
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.queryActivity
public Query queryActivity() { Query q = queryEntitiesRequest(HttpMethod.GET, null, null, organizationId, applicationId, "activities"); return q; }
java
public Query queryActivity() { Query q = queryEntitiesRequest(HttpMethod.GET, null, null, organizationId, applicationId, "activities"); return q; }
[ "public", "Query", "queryActivity", "(", ")", "{", "Query", "q", "=", "queryEntitiesRequest", "(", "HttpMethod", ".", "GET", ",", "null", ",", "null", ",", "organizationId", ",", "applicationId", ",", "\"activities\"", ")", ";", "return", "q", ";", "}" ]
Get a group's activity feed. Returned as a query to ease paging. @param userId @return
[ "Get", "a", "group", "s", "activity", "feed", ".", "Returned", "as", "a", "query", "to", "ease", "paging", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L774-L778
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.queryEntitiesRequest
public Query queryEntitiesRequest(HttpMethod method, Map<String, Object> params, Object data, String... segments) { ApiResponse response = apiRequest(method, params, data, segments); return new EntityQuery(response, method, params, data, segments); }
java
public Query queryEntitiesRequest(HttpMethod method, Map<String, Object> params, Object data, String... segments) { ApiResponse response = apiRequest(method, params, data, segments); return new EntityQuery(response, method, params, data, segments); }
[ "public", "Query", "queryEntitiesRequest", "(", "HttpMethod", "method", ",", "Map", "<", "String", ",", "Object", ">", "params", ",", "Object", "data", ",", "String", "...", "segments", ")", "{", "ApiResponse", "response", "=", "apiRequest", "(", "method", "...
Perform a query request and return a query object. The Query object provides a simple way of dealing with result sets that need to be iterated or paged through. @param method @param params @param data @param segments @return
[ "Perform", "a", "query", "request", "and", "return", "a", "query", "object", ".", "The", "Query", "object", "provides", "a", "simple", "way", "of", "dealing", "with", "result", "sets", "that", "need", "to", "be", "iterated", "or", "paged", "through", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L805-L809
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.queryUsersForGroup
public Query queryUsersForGroup(String groupId) { Query q = queryEntitiesRequest(HttpMethod.GET, null, null, organizationId, applicationId, "groups", groupId, "users"); return q; }
java
public Query queryUsersForGroup(String groupId) { Query q = queryEntitiesRequest(HttpMethod.GET, null, null, organizationId, applicationId, "groups", groupId, "users"); return q; }
[ "public", "Query", "queryUsersForGroup", "(", "String", "groupId", ")", "{", "Query", "q", "=", "queryEntitiesRequest", "(", "HttpMethod", ".", "GET", ",", "null", ",", "null", ",", "organizationId", ",", "applicationId", ",", "\"groups\"", ",", "groupId", ","...
Queries the users for the specified group. @param groupId @return
[ "Queries", "the", "users", "for", "the", "specified", "group", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L863-L867
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.addUserToGroup
public ApiResponse addUserToGroup(String userId, String groupId) { return apiRequest(HttpMethod.POST, null, null, organizationId, applicationId, "groups", groupId, "users", userId); }
java
public ApiResponse addUserToGroup(String userId, String groupId) { return apiRequest(HttpMethod.POST, null, null, organizationId, applicationId, "groups", groupId, "users", userId); }
[ "public", "ApiResponse", "addUserToGroup", "(", "String", "userId", ",", "String", "groupId", ")", "{", "return", "apiRequest", "(", "HttpMethod", ".", "POST", ",", "null", ",", "null", ",", "organizationId", ",", "applicationId", ",", "\"groups\"", ",", "grou...
Adds a user to the specified groups. @param userId @param groupId @return
[ "Adds", "a", "user", "to", "the", "specified", "groups", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L876-L879
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.createGroup
public ApiResponse createGroup(String groupPath, String groupTitle, String groupName){ Map<String, Object> data = new HashMap<String, Object>(); data.put("type", "group"); data.put("path", groupPath); if (groupTitle != null) { data.put("title", groupTitle); }...
java
public ApiResponse createGroup(String groupPath, String groupTitle, String groupName){ Map<String, Object> data = new HashMap<String, Object>(); data.put("type", "group"); data.put("path", groupPath); if (groupTitle != null) { data.put("title", groupTitle); }...
[ "public", "ApiResponse", "createGroup", "(", "String", "groupPath", ",", "String", "groupTitle", ",", "String", "groupName", ")", "{", "Map", "<", "String", ",", "Object", ">", "data", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", "...
Create a group with a path, title and name @param groupPath @param groupTitle @param groupName @return
[ "Create", "a", "group", "with", "a", "path", "title", "and", "name" ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L912-L926
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.connectEntities
public ApiResponse connectEntities(String connectingEntityType, String connectingEntityId, String connectionType, String connectedEntityId) { return apiRequest(HttpMethod.POST, null, null, organizationId, applicationId, connectingEntityType, connectingEntityId, connectio...
java
public ApiResponse connectEntities(String connectingEntityType, String connectingEntityId, String connectionType, String connectedEntityId) { return apiRequest(HttpMethod.POST, null, null, organizationId, applicationId, connectingEntityType, connectingEntityId, connectio...
[ "public", "ApiResponse", "connectEntities", "(", "String", "connectingEntityType", ",", "String", "connectingEntityId", ",", "String", "connectionType", ",", "String", "connectedEntityId", ")", "{", "return", "apiRequest", "(", "HttpMethod", ".", "POST", ",", "null", ...
Connect two entities together. @param connectingEntityType @param connectingEntityId @param connectionType @param connectedEntityId @return
[ "Connect", "two", "entities", "together", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L954-L960
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.disconnectEntities
public ApiResponse disconnectEntities(String connectingEntityType, String connectingEntityId, String connectionType, String connectedEntityId) { return apiRequest(HttpMethod.DELETE, null, null, organizationId, applicationId, connectingEntityType, connectingEntityId, conn...
java
public ApiResponse disconnectEntities(String connectingEntityType, String connectingEntityId, String connectionType, String connectedEntityId) { return apiRequest(HttpMethod.DELETE, null, null, organizationId, applicationId, connectingEntityType, connectingEntityId, conn...
[ "public", "ApiResponse", "disconnectEntities", "(", "String", "connectingEntityType", ",", "String", "connectingEntityId", ",", "String", "connectionType", ",", "String", "connectedEntityId", ")", "{", "return", "apiRequest", "(", "HttpMethod", ".", "DELETE", ",", "nu...
Disconnect two entities. @param connectingEntityType @param connectingEntityId @param connectionType @param connectedEntityId @return
[ "Disconnect", "two", "entities", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L971-L977
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.queryEntityConnections
public Query queryEntityConnections(String connectingEntityType, String connectingEntityId, String connectionType, String ql) { Map<String, Object> params = new HashMap<String, Object>(); params.put("ql", ql); Query q = queryEntitiesRequest(HttpMethod.GET, params, null, ...
java
public Query queryEntityConnections(String connectingEntityType, String connectingEntityId, String connectionType, String ql) { Map<String, Object> params = new HashMap<String, Object>(); params.put("ql", ql); Query q = queryEntitiesRequest(HttpMethod.GET, params, null, ...
[ "public", "Query", "queryEntityConnections", "(", "String", "connectingEntityType", ",", "String", "connectingEntityId", ",", "String", "connectionType", ",", "String", "ql", ")", "{", "Map", "<", "String", ",", "Object", ">", "params", "=", "new", "HashMap", "<...
Query the connected entities. @param connectingEntityType @param connectingEntityId @param connectionType @param ql @return
[ "Query", "the", "connected", "entities", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L988-L996
train
apigee/usergrid-java-sdk
src/main/java/org/usergrid/java/client/Client.java
Client.queryEntityConnectionsWithinLocation
public Query queryEntityConnectionsWithinLocation( String connectingEntityType, String connectingEntityId, String connectionType, float distance, float lattitude, float longitude, String ql) { Map<String, Object> params = new HashMap<String, Object>(); params.put("ql"...
java
public Query queryEntityConnectionsWithinLocation( String connectingEntityType, String connectingEntityId, String connectionType, float distance, float lattitude, float longitude, String ql) { Map<String, Object> params = new HashMap<String, Object>(); params.put("ql"...
[ "public", "Query", "queryEntityConnectionsWithinLocation", "(", "String", "connectingEntityType", ",", "String", "connectingEntityId", ",", "String", "connectionType", ",", "float", "distance", ",", "float", "lattitude", ",", "float", "longitude", ",", "String", "ql", ...
Query the connected entities within distance of a specific point. @param connectingEntityType @param connectingEntityId @param connectionType @param distance @param latitude @param longitude @return
[ "Query", "the", "connected", "entities", "within", "distance", "of", "a", "specific", "point", "." ]
6202745f184754defff13962dfc3d830bc7d8c63
https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L1017-L1027
train
revelytix/spark
spark-spi/src/main/java/spark/spi/Conversions.java
Conversions.toData
public static Object toData(Literal lit) { if (lit == null) throw new IllegalArgumentException("Can't convert null literal"); if (lit instanceof TypedLiteral) return toData((TypedLiteral)lit); // Untyped literals are xsd:string // Note this isn't strictly correct; language tags will be lost here. re...
java
public static Object toData(Literal lit) { if (lit == null) throw new IllegalArgumentException("Can't convert null literal"); if (lit instanceof TypedLiteral) return toData((TypedLiteral)lit); // Untyped literals are xsd:string // Note this isn't strictly correct; language tags will be lost here. re...
[ "public", "static", "Object", "toData", "(", "Literal", "lit", ")", "{", "if", "(", "lit", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Can't convert null literal\"", ")", ";", "if", "(", "lit", "instanceof", "TypedLiteral", ")", "ret...
Convert from RDF literal to native Java object. @param lit RDF literal. @return Java object converted from the literal.
[ "Convert", "from", "RDF", "literal", "to", "native", "Java", "object", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/Conversions.java#L270-L276
train
revelytix/spark
spark-spi/src/main/java/spark/spi/Conversions.java
Conversions.toData
public static Object toData(TypedLiteral lit) { if (lit == null) throw new IllegalArgumentException("Can't convert null literal"); Conversion<?> c = uriConversions.get(lit.getDataType()); if (c == null) throw new IllegalArgumentException("Don't know how to convert literal of type " + lit.getDataType()); ...
java
public static Object toData(TypedLiteral lit) { if (lit == null) throw new IllegalArgumentException("Can't convert null literal"); Conversion<?> c = uriConversions.get(lit.getDataType()); if (c == null) throw new IllegalArgumentException("Don't know how to convert literal of type " + lit.getDataType()); ...
[ "public", "static", "Object", "toData", "(", "TypedLiteral", "lit", ")", "{", "if", "(", "lit", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Can't convert null literal\"", ")", ";", "Conversion", "<", "?", ">", "c", "=", "uriConversio...
Convert from RDF typed literal to native Java object. @param lit RDF typed literal @return Java object converted from the lexical value based on the mappings specified by the literal datatype URI.
[ "Convert", "from", "RDF", "typed", "literal", "to", "native", "Java", "object", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/Conversions.java#L283-L288
train
revelytix/spark
spark-spi/src/main/java/spark/spi/Conversions.java
Conversions.toLiteral
public static TypedLiteral toLiteral(Object value) { if (value == null) throw new IllegalArgumentException("Can't convert null value"); Conversion<?> c = classConversions.get(value.getClass()); if (c != null) return c.literal(value); // The object has an unrecognized type that doesn't translate directly...
java
public static TypedLiteral toLiteral(Object value) { if (value == null) throw new IllegalArgumentException("Can't convert null value"); Conversion<?> c = classConversions.get(value.getClass()); if (c != null) return c.literal(value); // The object has an unrecognized type that doesn't translate directly...
[ "public", "static", "TypedLiteral", "toLiteral", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Can't convert null value\"", ")", ";", "Conversion", "<", "?", ">", "c", "=", "classCo...
Convert from an arbitrary Java object to an RDF typed literal, using an XSD datatype if possible. @param value Object value @return Converted literal
[ "Convert", "from", "an", "arbitrary", "Java", "object", "to", "an", "RDF", "typed", "literal", "using", "an", "XSD", "datatype", "if", "possible", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/Conversions.java#L358-L367
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLSelectResults.java
XMLSelectResults.readNext
protected Map<String,RDFNode> readNext() throws SparqlException { try { // read <result> or </results> int eventType = reader.nextTag(); // if a closing element, then it should be </results> if (eventType == END_ELEMENT) { // already read the final result, so clean up and return noth...
java
protected Map<String,RDFNode> readNext() throws SparqlException { try { // read <result> or </results> int eventType = reader.nextTag(); // if a closing element, then it should be </results> if (eventType == END_ELEMENT) { // already read the final result, so clean up and return noth...
[ "protected", "Map", "<", "String", ",", "RDFNode", ">", "readNext", "(", ")", "throws", "SparqlException", "{", "try", "{", "// read <result> or </results>", "int", "eventType", "=", "reader", ".", "nextTag", "(", ")", ";", "// if a closing element, then it should b...
Parse the input stream to look for a result. @return A new Row based on a single result from the results section. @throws XMLStreamException There was an error reading the XML stream. @throws SparqlException The XML was not valid SPARQL results.
[ "Parse", "the", "input", "stream", "to", "look", "for", "a", "result", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLSelectResults.java#L133-L165
train
revelytix/spark
spark-spi/src/main/java/spark/spi/util/DateTime.java
DateTime.append
private static void append(StringBuilder sb, int val, int width) { String s = Integer.toString(val); for (int i = s.length(); i < width; i++) sb.append('0'); sb.append(s); }
java
private static void append(StringBuilder sb, int val, int width) { String s = Integer.toString(val); for (int i = s.length(); i < width; i++) sb.append('0'); sb.append(s); }
[ "private", "static", "void", "append", "(", "StringBuilder", "sb", ",", "int", "val", ",", "int", "width", ")", "{", "String", "s", "=", "Integer", ".", "toString", "(", "val", ")", ";", "for", "(", "int", "i", "=", "s", ".", "length", "(", ")", ...
Append the given value to the string builder, with leading zeros to result in the given minimum width.
[ "Append", "the", "given", "value", "to", "the", "string", "builder", "with", "leading", "zeros", "to", "result", "in", "the", "given", "minimum", "width", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L231-L235
train
revelytix/spark
spark-spi/src/main/java/spark/spi/util/DateTime.java
DateTime.elapsedDays
private static long elapsedDays(int year) { int y = year - 1; return DAYS_IN_YEAR * (long)y + div(y, 400) - div(y, 100) + div(y, 4); }
java
private static long elapsedDays(int year) { int y = year - 1; return DAYS_IN_YEAR * (long)y + div(y, 400) - div(y, 100) + div(y, 4); }
[ "private", "static", "long", "elapsedDays", "(", "int", "year", ")", "{", "int", "y", "=", "year", "-", "1", ";", "return", "DAYS_IN_YEAR", "*", "(", "long", ")", "y", "+", "div", "(", "y", ",", "400", ")", "-", "div", "(", "y", ",", "100", ")"...
Find the number of elapsed days from the epoch to the beginning of the given year.
[ "Find", "the", "number", "of", "elapsed", "days", "from", "the", "epoch", "to", "the", "beginning", "of", "the", "given", "year", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L324-L327
train
revelytix/spark
spark-spi/src/main/java/spark/spi/util/DateTime.java
DateTime.daysInMonth
private static int daysInMonth(int year, int month) { assert month >= FIRST_MONTH && month <= LAST_MONTH; int d = DAYS_IN_MONTH[month - 1]; if (month == FEBRUARY && isLeapYear(year)) d++; return d; }
java
private static int daysInMonth(int year, int month) { assert month >= FIRST_MONTH && month <= LAST_MONTH; int d = DAYS_IN_MONTH[month - 1]; if (month == FEBRUARY && isLeapYear(year)) d++; return d; }
[ "private", "static", "int", "daysInMonth", "(", "int", "year", ",", "int", "month", ")", "{", "assert", "month", ">=", "FIRST_MONTH", "&&", "month", "<=", "LAST_MONTH", ";", "int", "d", "=", "DAYS_IN_MONTH", "[", "month", "-", "1", "]", ";", "if", "(",...
Find the number of days in the given month, given the year.
[ "Find", "the", "number", "of", "days", "in", "the", "given", "month", "given", "the", "year", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L341-L346
train
revelytix/spark
spark-spi/src/main/java/spark/spi/util/DateTime.java
DateTime.parseMillis
private static int parseMillis(Input s) { if (s.index < s.len && s.getChar() == '.') { int startIndex = ++s.index; int ms = parseInt(s); int len = s.index - startIndex; for (; len < 3; len++) ms *= 10; for (; len > 3; len--) ms /= 10; // truncate because it's easier than rounding. ...
java
private static int parseMillis(Input s) { if (s.index < s.len && s.getChar() == '.') { int startIndex = ++s.index; int ms = parseInt(s); int len = s.index - startIndex; for (; len < 3; len++) ms *= 10; for (; len > 3; len--) ms /= 10; // truncate because it's easier than rounding. ...
[ "private", "static", "int", "parseMillis", "(", "Input", "s", ")", "{", "if", "(", "s", ".", "index", "<", "s", ".", "len", "&&", "s", ".", "getChar", "(", ")", "==", "'", "'", ")", "{", "int", "startIndex", "=", "++", "s", ".", "index", ";", ...
Parse the fractional seconds field from the input, returning the number of milliseconds and truncating extra places.
[ "Parse", "the", "fractional", "seconds", "field", "from", "the", "input", "returning", "the", "number", "of", "milliseconds", "and", "truncating", "extra", "places", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L359-L369
train
revelytix/spark
spark-spi/src/main/java/spark/spi/util/DateTime.java
DateTime.parseTzOffsetMs
private static Integer parseTzOffsetMs(Input s, boolean strict) { if (s.index < s.len) { char c = s.getChar(); s.index++; int sign; if (c == 'Z') { return 0; } else if (c == '+') { sign = 1; } else if (c == '-') { sign = -1; } else { throw ne...
java
private static Integer parseTzOffsetMs(Input s, boolean strict) { if (s.index < s.len) { char c = s.getChar(); s.index++; int sign; if (c == 'Z') { return 0; } else if (c == '+') { sign = 1; } else if (c == '-') { sign = -1; } else { throw ne...
[ "private", "static", "Integer", "parseTzOffsetMs", "(", "Input", "s", ",", "boolean", "strict", ")", "{", "if", "(", "s", ".", "index", "<", "s", ".", "len", ")", "{", "char", "c", "=", "s", ".", "getChar", "(", ")", ";", "s", ".", "index", "++",...
Parse the timezone offset from the input, returning its millisecond value.
[ "Parse", "the", "timezone", "offset", "from", "the", "input", "returning", "its", "millisecond", "value", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L372-L397
train
revelytix/spark
spark-spi/src/main/java/spark/spi/util/DateTime.java
DateTime.parseField
private static int parseField(String field, Input s, Character delim, int minLen, int maxLen, boolean strict) { int startIndex = s.index; int result = parseInt(s); if (startIndex == s.index) throw new DateFormatException("missing value for field '" + field + "'", s.str, startIndex); if (strict) { ...
java
private static int parseField(String field, Input s, Character delim, int minLen, int maxLen, boolean strict) { int startIndex = s.index; int result = parseInt(s); if (startIndex == s.index) throw new DateFormatException("missing value for field '" + field + "'", s.str, startIndex); if (strict) { ...
[ "private", "static", "int", "parseField", "(", "String", "field", ",", "Input", "s", ",", "Character", "delim", ",", "int", "minLen", ",", "int", "maxLen", ",", "boolean", "strict", ")", "{", "int", "startIndex", "=", "s", ".", "index", ";", "int", "re...
Parse a field from input, validating its delimiter and length if requested.
[ "Parse", "a", "field", "from", "input", "validating", "its", "delimiter", "and", "length", "if", "requested", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L400-L415
train
revelytix/spark
spark-spi/src/main/java/spark/spi/util/DateTime.java
DateTime.parseInt
private static int parseInt(Input s) { if (s.index >= s.len) throw new DateFormatException("unexpected end of input", s.str, s.index); int result = 0; while (s.index < s.len) { char c = s.getChar(); if (c >= '0' && c <= '9') { if (result >= Integer.MAX_VALUE / 10) throw new ArithmeticExc...
java
private static int parseInt(Input s) { if (s.index >= s.len) throw new DateFormatException("unexpected end of input", s.str, s.index); int result = 0; while (s.index < s.len) { char c = s.getChar(); if (c >= '0' && c <= '9') { if (result >= Integer.MAX_VALUE / 10) throw new ArithmeticExc...
[ "private", "static", "int", "parseInt", "(", "Input", "s", ")", "{", "if", "(", "s", ".", "index", ">=", "s", ".", "len", ")", "throw", "new", "DateFormatException", "(", "\"unexpected end of input\"", ",", "s", ".", "str", ",", "s", ".", "index", ")",...
Parse an integer from the input, reading up to the first non-numeric character.
[ "Parse", "an", "integer", "from", "the", "input", "reading", "up", "to", "the", "first", "non", "-", "numeric", "character", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-spi/src/main/java/spark/spi/util/DateTime.java#L418-L432
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/AppUtil.java
AppUtil.showAppInfo
public static void showAppInfo(@NonNull final Context context, @NonNull final String packageName) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); Condition.INSTANCE.ensureNotNull(packageName, "The package name may not be null"); Cond...
java
public static void showAppInfo(@NonNull final Context context, @NonNull final String packageName) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); Condition.INSTANCE.ensureNotNull(packageName, "The package name may not be null"); Cond...
[ "public", "static", "void", "showAppInfo", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "NonNull", "final", "String", "packageName", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "context", ",", "\"The context may not be null\...
Starts the settings app in order to show the information about a specific app. @param context The context, the settings app should be started from, as an instance of the class {@link Context}. The context may not be null @param packageName The fully qualified package name of the app, whose information should be shown,...
[ "Starts", "the", "settings", "app", "in", "order", "to", "show", "the", "information", "about", "a", "specific", "app", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/AppUtil.java#L451-L467
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/ObjectsApi.java
ObjectsApi.postPermissionsWithHttpInfo
public ApiResponse<Void> postPermissionsWithHttpInfo(String objectType, PostPermissionsData body) throws ApiException { com.squareup.okhttp.Call call = postPermissionsValidateBeforeCall(objectType, body, null, null); return apiClient.execute(call); }
java
public ApiResponse<Void> postPermissionsWithHttpInfo(String objectType, PostPermissionsData body) throws ApiException { com.squareup.okhttp.Call call = postPermissionsValidateBeforeCall(objectType, body, null, null); return apiClient.execute(call); }
[ "public", "ApiResponse", "<", "Void", ">", "postPermissionsWithHttpInfo", "(", "String", "objectType", ",", "PostPermissionsData", "body", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postPermissionsValidateBe...
Post permissions for a list of objects. Post permissions from Configuration Server for objects identified by their type and DBIDs. @param objectType (required) @param body (optional) @return ApiResponse&lt;Void&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "permissions", "for", "a", "list", "of", "objects", ".", "Post", "permissions", "from", "Configuration", "Server", "for", "objects", "identified", "by", "their", "type", "and", "DBIDs", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/ObjectsApi.java#L491-L494
train
greenjoe/sergeants
src/main/java/pl/joegreen/sergeants/simulator/GameMap.java
GameMap.move
Optional<PlayerKilled> move(Player player) { Move move = player.getMoves().poll(); if (move != null) { Tile from = tiles[move.getFrom()]; boolean armyBigEnough = from.getArmySize() > 1; boolean tileAndPlayerMatching = from.isOwnedBy(player.getPlayerIndex()); ...
java
Optional<PlayerKilled> move(Player player) { Move move = player.getMoves().poll(); if (move != null) { Tile from = tiles[move.getFrom()]; boolean armyBigEnough = from.getArmySize() > 1; boolean tileAndPlayerMatching = from.isOwnedBy(player.getPlayerIndex()); ...
[ "Optional", "<", "PlayerKilled", ">", "move", "(", "Player", "player", ")", "{", "Move", "move", "=", "player", ".", "getMoves", "(", ")", ".", "poll", "(", ")", ";", "if", "(", "move", "!=", "null", ")", "{", "Tile", "from", "=", "tiles", "[", "...
Polls move recursively until it finds a valid move.
[ "Polls", "move", "recursively", "until", "it", "finds", "a", "valid", "move", "." ]
db624bcea8597843210f138b82bc4a26b3ec92ca
https://github.com/greenjoe/sergeants/blob/db624bcea8597843210f138b82bc4a26b3ec92ca/src/main/java/pl/joegreen/sergeants/simulator/GameMap.java#L46-L66
train
greenjoe/sergeants
src/main/java/pl/joegreen/sergeants/framework/model/GameResult.java
GameResult.getPlayerNames
public List<String> getPlayerNames() { return lastGameState.getPlayers().stream().map(Player::getUsername).collect(Collectors.toList()); }
java
public List<String> getPlayerNames() { return lastGameState.getPlayers().stream().map(Player::getUsername).collect(Collectors.toList()); }
[ "public", "List", "<", "String", ">", "getPlayerNames", "(", ")", "{", "return", "lastGameState", ".", "getPlayers", "(", ")", ".", "stream", "(", ")", ".", "map", "(", "Player", "::", "getUsername", ")", ".", "collect", "(", "Collectors", ".", "toList",...
Names of all players that played in the game.
[ "Names", "of", "all", "players", "that", "played", "in", "the", "game", "." ]
db624bcea8597843210f138b82bc4a26b3ec92ca
https://github.com/greenjoe/sergeants/blob/db624bcea8597843210f138b82bc4a26b3ec92ca/src/main/java/pl/joegreen/sergeants/framework/model/GameResult.java#L30-L32
train
Zappos/zappos-json
src/main/java/com/zappos/json/util/Reflections.java
Reflections.getField
public static Field getField(Class<?> clazz, String fieldName) throws NoSuchFieldException { if (clazz == Object.class) { return null; } try { Field field = clazz.getDeclaredField(fieldName); return field; } catch (NoSuchFieldException e) { return getField(clazz.getSupercla...
java
public static Field getField(Class<?> clazz, String fieldName) throws NoSuchFieldException { if (clazz == Object.class) { return null; } try { Field field = clazz.getDeclaredField(fieldName); return field; } catch (NoSuchFieldException e) { return getField(clazz.getSupercla...
[ "public", "static", "Field", "getField", "(", "Class", "<", "?", ">", "clazz", ",", "String", "fieldName", ")", "throws", "NoSuchFieldException", "{", "if", "(", "clazz", "==", "Object", ".", "class", ")", "{", "return", "null", ";", "}", "try", "{", "...
Recursively find the field by name up to the top of class hierarchy. @param clazz the class object @param fieldName declared field name of specified class @return the field object
[ "Recursively", "find", "the", "field", "by", "name", "up", "to", "the", "top", "of", "class", "hierarchy", "." ]
340633f5db75c2e09ce49bfc3e5f67e8823f5a37
https://github.com/Zappos/zappos-json/blob/340633f5db75c2e09ce49bfc3e5f67e8823f5a37/src/main/java/com/zappos/json/util/Reflections.java#L51-L62
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/NotificationsApi.java
NotificationsApi.connectCall
public com.squareup.okhttp.Call connectCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/not...
java
public com.squareup.okhttp.Call connectCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/not...
[ "public", "com", ".", "squareup", ".", "okhttp", ".", "Call", "connectCall", "(", "final", "ProgressResponseBody", ".", "ProgressListener", "progressListener", ",", "final", "ProgressRequestBody", ".", "ProgressRequestListener", "progressRequestListener", ")", "throws", ...
Build call for connect @param progressListener Progress listener @param progressRequestListener Progress request listener @return Call to execute @throws ApiException If fail to serialize the request body object
[ "Build", "call", "for", "connect" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/NotificationsApi.java#L63-L102
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java
DelegatingPortletFilterProxy.invokeDelegate
protected void invokeDelegate( ActionFilter delegate, ActionRequest request, ActionResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
java
protected void invokeDelegate( ActionFilter delegate, ActionRequest request, ActionResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
[ "protected", "void", "invokeDelegate", "(", "ActionFilter", "delegate", ",", "ActionRequest", "request", ",", "ActionResponse", "response", ",", "FilterChain", "filterChain", ")", "throws", "PortletException", ",", "IOException", "{", "delegate", ".", "doFilter", "(",...
Actually invoke the delegate ActionFilter with the given request and response. @param delegate the delegate ActionFilter @param request the current action request @param response the current action response @param filterChain the current FilterChain @throws javax.portlet.PortletException if thrown by the PortletFilter...
[ "Actually", "invoke", "the", "delegate", "ActionFilter", "with", "the", "given", "request", "and", "response", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java#L435-L440
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java
DelegatingPortletFilterProxy.invokeDelegate
protected void invokeDelegate( EventFilter delegate, EventRequest request, EventResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
java
protected void invokeDelegate( EventFilter delegate, EventRequest request, EventResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
[ "protected", "void", "invokeDelegate", "(", "EventFilter", "delegate", ",", "EventRequest", "request", ",", "EventResponse", "response", ",", "FilterChain", "filterChain", ")", "throws", "PortletException", ",", "IOException", "{", "delegate", ".", "doFilter", "(", ...
Actually invoke the delegate EventFilter with the given request and response. @param delegate the delegate EventFilter @param request the current Event request @param response the current Event response @param filterChain the current FilterChain @throws javax.portlet.PortletException if thrown by the PortletFilter @th...
[ "Actually", "invoke", "the", "delegate", "EventFilter", "with", "the", "given", "request", "and", "response", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java#L452-L457
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java
DelegatingPortletFilterProxy.invokeDelegate
protected void invokeDelegate( RenderFilter delegate, RenderRequest request, RenderResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
java
protected void invokeDelegate( RenderFilter delegate, RenderRequest request, RenderResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
[ "protected", "void", "invokeDelegate", "(", "RenderFilter", "delegate", ",", "RenderRequest", "request", ",", "RenderResponse", "response", ",", "FilterChain", "filterChain", ")", "throws", "PortletException", ",", "IOException", "{", "delegate", ".", "doFilter", "(",...
Actually invoke the delegate RenderFilter with the given request and response. @param delegate the delegate RenderFilter @param request the current Render request @param response the current Render response @param filterChain the current FilterChain @throws javax.portlet.PortletException if thrown by the PortletFilter...
[ "Actually", "invoke", "the", "delegate", "RenderFilter", "with", "the", "given", "request", "and", "response", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java#L469-L474
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java
DelegatingPortletFilterProxy.invokeDelegate
protected void invokeDelegate( ResourceFilter delegate, ResourceRequest request, ResourceResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
java
protected void invokeDelegate( ResourceFilter delegate, ResourceRequest request, ResourceResponse response, FilterChain filterChain) throws PortletException, IOException { delegate.doFilter(request, response, filterChain); }
[ "protected", "void", "invokeDelegate", "(", "ResourceFilter", "delegate", ",", "ResourceRequest", "request", ",", "ResourceResponse", "response", ",", "FilterChain", "filterChain", ")", "throws", "PortletException", ",", "IOException", "{", "delegate", ".", "doFilter", ...
Actually invoke the delegate ResourceFilter with the given request and response. @param delegate the delegate ResourceFilter @param request the current Resource request @param response the current Resource response @param filterChain the current FilterChain @throws javax.portlet.PortletException if thrown by the Portl...
[ "Actually", "invoke", "the", "delegate", "ResourceFilter", "with", "the", "given", "request", "and", "response", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/DelegatingPortletFilterProxy.java#L486-L491
train
Jasig/spring-portlet-contrib
spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletPreAuthenticatedAuthenticationDetailsSource.java
PortletPreAuthenticatedAuthenticationDetailsSource.buildDetails
public PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails buildDetails(PortletRequest context) { Collection<? extends GrantedAuthority> userGas = buildGrantedAuthorities(context); PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails result = new PreAuthenticatedGr...
java
public PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails buildDetails(PortletRequest context) { Collection<? extends GrantedAuthority> userGas = buildGrantedAuthorities(context); PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails result = new PreAuthenticatedGr...
[ "public", "PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails", "buildDetails", "(", "PortletRequest", "context", ")", "{", "Collection", "<", "?", "extends", "GrantedAuthority", ">", "userGas", "=", "buildGrantedAuthorities", "(", "context", ")", ";", "PreAuthe...
Builds the authentication details object. @see org.springframework.security.authentication.AuthenticationDetailsSource#buildDetails(Object) @param context a {@link javax.portlet.PortletRequest} object. @return a {@link org.jasig.springframework.security.portlet.authentication.PreAuthenticatedGrantedAuthoritiesPortletA...
[ "Builds", "the", "authentication", "details", "object", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletPreAuthenticatedAuthenticationDetailsSource.java#L93-L101
train
venkatramanm/swf-all
swf-db/src/main/java/com/venky/swf/db/table/Table.java
Table._runDML
private boolean _runDML(DataManupulationStatement q, boolean isDDL){ boolean readOnly = ConnectionManager.instance().isPoolReadOnly(getPool()); Transaction txn = Database.getInstance().getCurrentTransaction(); if (!readOnly) { q.executeUpdate(); if (Database.getJdbcTypeHe...
java
private boolean _runDML(DataManupulationStatement q, boolean isDDL){ boolean readOnly = ConnectionManager.instance().isPoolReadOnly(getPool()); Transaction txn = Database.getInstance().getCurrentTransaction(); if (!readOnly) { q.executeUpdate(); if (Database.getJdbcTypeHe...
[ "private", "boolean", "_runDML", "(", "DataManupulationStatement", "q", ",", "boolean", "isDDL", ")", "{", "boolean", "readOnly", "=", "ConnectionManager", ".", "instance", "(", ")", ".", "isPoolReadOnly", "(", "getPool", "(", ")", ")", ";", "Transaction", "tx...
RReturn true if modification was done.. @param q @param isDDL @return
[ "RReturn", "true", "if", "modification", "was", "done", ".." ]
e6ca342df0645bf1122d81e302575014ad565b69
https://github.com/venkatramanm/swf-all/blob/e6ca342df0645bf1122d81e302575014ad565b69/swf-db/src/main/java/com/venky/swf/db/table/Table.java#L197-L212
train
Jasig/spring-portlet-contrib
spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/PortletFilterChainProxy.java
PortletFilterChainProxy.getFilters
private List<PortletFilter> getFilters(PortletRequest request) { for (PortletSecurityFilterChain chain : filterChains) { if (chain.matches(request)) { return chain.getFilters(); } } return null; }
java
private List<PortletFilter> getFilters(PortletRequest request) { for (PortletSecurityFilterChain chain : filterChains) { if (chain.matches(request)) { return chain.getFilters(); } } return null; }
[ "private", "List", "<", "PortletFilter", ">", "getFilters", "(", "PortletRequest", "request", ")", "{", "for", "(", "PortletSecurityFilterChain", "chain", ":", "filterChains", ")", "{", "if", "(", "chain", ".", "matches", "(", "request", ")", ")", "{", "retu...
Returns the first filter chain matching the supplied URL. @param request the request to match @return an ordered array of Filters defining the filter chain
[ "Returns", "the", "first", "filter", "chain", "matching", "the", "supplied", "URL", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/PortletFilterChainProxy.java#L184-L192
train
Jasig/spring-portlet-contrib
spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/PortletFilterChainProxy.java
PortletFilterChainProxy.setFilterChainMap
@Deprecated public void setFilterChainMap(Map<RequestMatcher, List<PortletFilter>> filterChainMap) { filterChains = new ArrayList<PortletSecurityFilterChain>(filterChainMap.size()); for (Map.Entry<RequestMatcher,List<PortletFilter>> entry : filterChainMap.entrySet()) { filterChains.add(...
java
@Deprecated public void setFilterChainMap(Map<RequestMatcher, List<PortletFilter>> filterChainMap) { filterChains = new ArrayList<PortletSecurityFilterChain>(filterChainMap.size()); for (Map.Entry<RequestMatcher,List<PortletFilter>> entry : filterChainMap.entrySet()) { filterChains.add(...
[ "@", "Deprecated", "public", "void", "setFilterChainMap", "(", "Map", "<", "RequestMatcher", ",", "List", "<", "PortletFilter", ">", ">", "filterChainMap", ")", "{", "filterChains", "=", "new", "ArrayList", "<", "PortletSecurityFilterChain", ">", "(", "filterChain...
Sets the mapping of URL patterns to filter chains. The map keys should be the paths and the values should be arrays of {@code PortletFilter} objects. It's VERY important that the type of map used preserves ordering - the order in which the iterator returns the entries must be the same as the order they were added to t...
[ "Sets", "the", "mapping", "of", "URL", "patterns", "to", "filter", "chains", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/PortletFilterChainProxy.java#L207-L214
train
Jasig/spring-portlet-contrib
spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/PortletFilterChainProxy.java
PortletFilterChainProxy.getFilterChainMap
@Deprecated public Map<RequestMatcher, List<PortletFilter>> getFilterChainMap() { LinkedHashMap<RequestMatcher, List<PortletFilter>> map = new LinkedHashMap<RequestMatcher, List<PortletFilter>>(); for (PortletSecurityFilterChain chain : filterChains) { map.put(((DefaultPortletSecurityF...
java
@Deprecated public Map<RequestMatcher, List<PortletFilter>> getFilterChainMap() { LinkedHashMap<RequestMatcher, List<PortletFilter>> map = new LinkedHashMap<RequestMatcher, List<PortletFilter>>(); for (PortletSecurityFilterChain chain : filterChains) { map.put(((DefaultPortletSecurityF...
[ "@", "Deprecated", "public", "Map", "<", "RequestMatcher", ",", "List", "<", "PortletFilter", ">", ">", "getFilterChainMap", "(", ")", "{", "LinkedHashMap", "<", "RequestMatcher", ",", "List", "<", "PortletFilter", ">", ">", "map", "=", "new", "LinkedHashMap",...
Returns a copy of the underlying filter chain map. Modifications to the map contents will not affect the PortletFilterChainProxy state. @return the map of path pattern Strings to filter chain lists (with ordering guaranteed). @deprecated use the list of {@link org.jasig.springframework.security.portlet.PortletSecurity...
[ "Returns", "a", "copy", "of", "the", "underlying", "filter", "chain", "map", ".", "Modifications", "to", "the", "map", "contents", "will", "not", "affect", "the", "PortletFilterChainProxy", "state", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/PortletFilterChainProxy.java#L223-L232
train
aeshell/aesh-extensions
readline/src/main/java/org/aesh/extensions/manual/page/FileDisplayer.java
FileDisplayer.displaySearchLine
private void displaySearchLine(String line, String searchWord) throws IOException { int start = line.indexOf(searchWord); connection.write(line.substring(0,start)); connection.write(ANSI.INVERT_BACKGROUND); connection.write(searchWord); connection.write(ANSI.RESET); conne...
java
private void displaySearchLine(String line, String searchWord) throws IOException { int start = line.indexOf(searchWord); connection.write(line.substring(0,start)); connection.write(ANSI.INVERT_BACKGROUND); connection.write(searchWord); connection.write(ANSI.RESET); conne...
[ "private", "void", "displaySearchLine", "(", "String", "line", ",", "String", "searchWord", ")", "throws", "IOException", "{", "int", "start", "=", "line", ".", "indexOf", "(", "searchWord", ")", ";", "connection", ".", "write", "(", "line", ".", "substring"...
highlight the specific word thats found in the search
[ "highlight", "the", "specific", "word", "thats", "found", "in", "the", "search" ]
3838ce46ed3771eb2ee6934303500f01a558e9ca
https://github.com/aeshell/aesh-extensions/blob/3838ce46ed3771eb2ee6934303500f01a558e9ca/readline/src/main/java/org/aesh/extensions/manual/page/FileDisplayer.java#L365-L372
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/context/PortletApplicationContextUtils2.java
PortletApplicationContextUtils2.getPortletApplicationContext
public static PortletApplicationContext getPortletApplicationContext(PortletContext pc, String attrName) { Assert.notNull(pc, "PortletContext must not be null"); Object attr = pc.getAttribute(attrName); if (attr == null) { return null; } if (attr instanceof RuntimeExc...
java
public static PortletApplicationContext getPortletApplicationContext(PortletContext pc, String attrName) { Assert.notNull(pc, "PortletContext must not be null"); Object attr = pc.getAttribute(attrName); if (attr == null) { return null; } if (attr instanceof RuntimeExc...
[ "public", "static", "PortletApplicationContext", "getPortletApplicationContext", "(", "PortletContext", "pc", ",", "String", "attrName", ")", "{", "Assert", ".", "notNull", "(", "pc", ",", "\"PortletContext must not be null\"", ")", ";", "Object", "attr", "=", "pc", ...
Find a custom PortletApplicationContext for this web application. @param pc PortletContext to find the web application context for @param attrName the name of the PortletContext attribute to look for @return the desired PortletApplicationContext for this web app, or <code>null</code> if none
[ "Find", "a", "custom", "PortletApplicationContext", "for", "this", "web", "application", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/context/PortletApplicationContextUtils2.java#L118-L137
train