repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/directmemory/OByteBufferPool.java
OByteBufferPool.acquireDirect
public final OPointer acquireDirect(boolean clear) { OPointer pointer; pointer = pointersPool.poll(); if (pointer != null) { pointersPoolSize.decrementAndGet(); } else { pointer = allocator.allocate(pageSize, -1); } if (clear) { pointer.clear(); } final ByteBuffer b...
java
public final OPointer acquireDirect(boolean clear) { OPointer pointer; pointer = pointersPool.poll(); if (pointer != null) { pointersPoolSize.decrementAndGet(); } else { pointer = allocator.allocate(pageSize, -1); } if (clear) { pointer.clear(); } final ByteBuffer b...
[ "public", "final", "OPointer", "acquireDirect", "(", "boolean", "clear", ")", "{", "OPointer", "pointer", ";", "pointer", "=", "pointersPool", ".", "poll", "(", ")", ";", "if", "(", "pointer", "!=", "null", ")", "{", "pointersPoolSize", ".", "decrementAndGet...
Acquires direct memory buffer with native byte order. If there is free (already released) direct memory page we reuse it, otherwise new memory chunk is allocated from direct memory. @param clear Whether returned buffer should be filled with zeros before return. @return Direct memory buffer instance.
[ "Acquires", "direct", "memory", "buffer", "with", "native", "byte", "order", ".", "If", "there", "is", "free", "(", "already", "released", ")", "direct", "memory", "page", "we", "reuse", "it", "otherwise", "new", "memory", "chunk", "is", "allocated", "from",...
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/directmemory/OByteBufferPool.java#L135-L158
test
Acquires a direct pointer from the pool.
Of course, here is the Java code you requested: ```java public final OPointer acquireDirect(boolean clear) { OPointer pointer; pointer = pointersPool.poll(); if (pointer != null) { pointersPoolSize.decrementAndGet(); } else { pointer = allocator.allocate(pageSize, -1); } if (clea...
real-logic/aeron
aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java
ClusterMember.findMemberIndex
public static int findMemberIndex(final ClusterMember[] clusterMembers, final int memberId) { final int length = clusterMembers.length; int index = ArrayUtil.UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (clusterMembers[i].id() == memberId) { ...
java
public static int findMemberIndex(final ClusterMember[] clusterMembers, final int memberId) { final int length = clusterMembers.length; int index = ArrayUtil.UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (clusterMembers[i].id() == memberId) { ...
[ "public", "static", "int", "findMemberIndex", "(", "final", "ClusterMember", "[", "]", "clusterMembers", ",", "final", "int", "memberId", ")", "{", "final", "int", "length", "=", "clusterMembers", ".", "length", ";", "int", "index", "=", "ArrayUtil", ".", "U...
Find the index at which a member id is present. @param clusterMembers to be searched. @param memberId to search for. @return the index at which the member id is found otherwise {@link ArrayUtil#UNKNOWN_INDEX}.
[ "Find", "the", "index", "at", "which", "a", "member", "id", "is", "present", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java#L1065-L1079
test
Find member index.
Of course, here is the Java code you requested: ```java public static int findMemberIndex(final ClusterMember[] clusterMembers, final int memberId) { final int length = clusterMembers.length; int index = ArrayUtil.UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (cl...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/widget/IndependentWindow.java
IndependentWindow.showIfNotIconified
public void showIfNotIconified() { if (getState() == Frame.ICONIFIED) return; // need to put on event thread SwingUtilities.invokeLater(new Runnable() { public void run() { IndependentWindow.super.show(); } }); }
java
public void showIfNotIconified() { if (getState() == Frame.ICONIFIED) return; // need to put on event thread SwingUtilities.invokeLater(new Runnable() { public void run() { IndependentWindow.super.show(); } }); }
[ "public", "void", "showIfNotIconified", "(", ")", "{", "if", "(", "getState", "(", ")", "==", "Frame", ".", "ICONIFIED", ")", "return", ";", "// need to put on event thread\r", "SwingUtilities", ".", "invokeLater", "(", "new", "Runnable", "(", ")", "{", "publi...
show if not iconified
[ "show", "if", "not", "iconified" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/widget/IndependentWindow.java#L89-L97
test
Show the image if the frame is not iconified
Of course, here is the Java code you requested: ```java public void showIfNotIconified() { if (getState() == Frame.ICONIFIED) return; // need to put on event thread SwingUtilities.invokeLater(new Runnable() { public void run() { IndependentWindow.super.show(); } }); } ``` ...
deeplearning4j/nd4j
nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/ops/executioner/CudaGridExecutioner.java
CudaGridExecutioner.flushQueueBlocking
@Override public void flushQueueBlocking() { flushQueue(); // logger.info("Blocking flush");n ((CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext()).syncOldStream(); ((CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext()).syncSpecialS...
java
@Override public void flushQueueBlocking() { flushQueue(); // logger.info("Blocking flush");n ((CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext()).syncOldStream(); ((CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext()).syncSpecialS...
[ "@", "Override", "public", "void", "flushQueueBlocking", "(", ")", "{", "flushQueue", "(", ")", ";", "// logger.info(\"Blocking flush\");n", "(", "(", "CudaContext", ")", "AtomicAllocator", ".", "getInstance", "(", ")", ".", "getDeviceContext", "(", ")", ".", ...
This method forces all currently enqueued ops to be executed immediately PLEASE NOTE: This call is always blocking, until all queued operations are finished
[ "This", "method", "forces", "all", "currently", "enqueued", "ops", "to", "be", "executed", "immediately" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/ops/executioner/CudaGridExecutioner.java#L934-L942
test
Flushes the queue blocking.
Of course, here is the Java code you requested: ```java @Override public void flushQueueBlocking() { flushQueue(); // logger.info("Blocking flush");n ((CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext()).syncOldStream(); ((CudaContext) AtomicAllocator.ge...
algolia/algoliasearch-client-android
algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java
MirroredIndex.searchForFacetValuesAsync
@Override public Request searchForFacetValuesAsync(@NonNull String facetName, @NonNull String text, @Nullable Query query, @Nullable RequestOptions requestOptions, @NonNull final CompletionHandler completionHandler) { // A non-mirrored index behaves exactly as an online index. if (!mirrored) { ...
java
@Override public Request searchForFacetValuesAsync(@NonNull String facetName, @NonNull String text, @Nullable Query query, @Nullable RequestOptions requestOptions, @NonNull final CompletionHandler completionHandler) { // A non-mirrored index behaves exactly as an online index. if (!mirrored) { ...
[ "@", "Override", "public", "Request", "searchForFacetValuesAsync", "(", "@", "NonNull", "String", "facetName", ",", "@", "NonNull", "String", "text", ",", "@", "Nullable", "Query", "query", ",", "@", "Nullable", "RequestOptions", "requestOptions", ",", "@", "Non...
----------------------------------------------------------------------
[ "----------------------------------------------------------------------" ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java#L1560-L1571
test
Override this method to perform a async search for facet values.
Of course, here is the Java code you requested: ```java @Override public Request searchForFacetValuesAsync(@NonNull String facetName, @NonNull String text, @Nullable Query query, @Nullable RequestOptions requestOptions, @NonNull final CompletionHandler completionHandler) { // A non-mirrored index behaves e...
ReactiveX/RxJava
src/main/java/io/reactivex/plugins/RxJavaPlugins.java
RxJavaPlugins.setOnMaybeAssembly
@SuppressWarnings("rawtypes") public static void setOnMaybeAssembly(@Nullable Function<? super Maybe, ? extends Maybe> onMaybeAssembly) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } RxJavaPlugins.onMaybeAssembly = onMaybeAssembly; }
java
@SuppressWarnings("rawtypes") public static void setOnMaybeAssembly(@Nullable Function<? super Maybe, ? extends Maybe> onMaybeAssembly) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } RxJavaPlugins.onMaybeAssembly = onMaybeAssembly; }
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "void", "setOnMaybeAssembly", "(", "@", "Nullable", "Function", "<", "?", "super", "Maybe", ",", "?", "extends", "Maybe", ">", "onMaybeAssembly", ")", "{", "if", "(", "lockdown", ")", "{"...
Sets the specific hook function. @param onMaybeAssembly the hook function to set, null allowed
[ "Sets", "the", "specific", "hook", "function", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L807-L813
test
Sets the onMaybeAssembly function.
Of course, here is the Java code you requested: ```java @SuppressWarnings("rawtypes") public static void setOnMaybeAssembly(@Nullable Function<? super Maybe, ? extends Maybe> onMaybeAssembly) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } ...
arnohaase/a-foundation
a-foundation/src/main/java/com/ajjpj/afoundation/util/AExceptionFilter.java
AExceptionFilter.forLocalHandling
public static <T extends Throwable> T forLocalHandling (T th) { if (requiresNonLocalHandling (th)) { AUnchecker.throwUnchecked (th); } return th; }
java
public static <T extends Throwable> T forLocalHandling (T th) { if (requiresNonLocalHandling (th)) { AUnchecker.throwUnchecked (th); } return th; }
[ "public", "static", "<", "T", "extends", "Throwable", ">", "T", "forLocalHandling", "(", "T", "th", ")", "{", "if", "(", "requiresNonLocalHandling", "(", "th", ")", ")", "{", "AUnchecker", ".", "throwUnchecked", "(", "th", ")", ";", "}", "return", "th", ...
This method checks if a given Throwable is fit for local handling, returning it if it is and throwing it otherwise.
[ "This", "method", "checks", "if", "a", "given", "Throwable", "is", "fit", "for", "local", "handling", "returning", "it", "if", "it", "is", "and", "throwing", "it", "otherwise", "." ]
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/util/AExceptionFilter.java#L23-L28
test
For local handling throw an exception.
Of course, here is the Java code you requested: ```java public static <T extends Throwable> T forLocalHandling (T th) { if (requiresNonLocalHandling (th)) { AUnchecker.throwUnchecked (th); } return th; } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java
Parser.parseIncludeDirective
private void parseIncludeDirective(Node parent) throws JasperException { Attributes attrs = parseAttributes(); // Included file expanded here Node includeNode = new Node.IncludeDirective(attrs, start, parent); processIncludeDirective(attrs.getValue("file"), includeNode); }
java
private void parseIncludeDirective(Node parent) throws JasperException { Attributes attrs = parseAttributes(); // Included file expanded here Node includeNode = new Node.IncludeDirective(attrs, start, parent); processIncludeDirective(attrs.getValue("file"), includeNode); }
[ "private", "void", "parseIncludeDirective", "(", "Node", "parent", ")", "throws", "JasperException", "{", "Attributes", "attrs", "=", "parseAttributes", "(", ")", ";", "// Included file expanded here", "Node", "includeNode", "=", "new", "Node", ".", "IncludeDirective"...
/* Parses an include directive with the following syntax: IncludeDirective ::= ( S Attribute)*
[ "/", "*", "Parses", "an", "include", "directive", "with", "the", "following", "syntax", ":", "IncludeDirective", "::", "=", "(", "S", "Attribute", ")", "*" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java#L426-L432
test
Parse an include directive.
Of course, here is the Java code you requested: ```java private void parseIncludeDirective(Node parent) throws JasperException { Attributes attrs = parseAttributes(); // Included file expanded here Node includeNode = new Node.IncludeDirective(attrs, start, parent); processIncludeDirective(attrs.getValue("file"), ...
yunify/qingstor-sdk-java
src/main/java/com/qingstor/sdk/upload/UploadManager.java
UploadManager.sign
private void sign(RequestHandler requestHandler) throws QSException { if (callBack != null) { String signed = callBack.onSignature(requestHandler.getStringToSignature()); if (!QSStringUtil.isEmpty(signed)) requestHandler.setSignature(callBack.onAccessKey(), signed); ...
java
private void sign(RequestHandler requestHandler) throws QSException { if (callBack != null) { String signed = callBack.onSignature(requestHandler.getStringToSignature()); if (!QSStringUtil.isEmpty(signed)) requestHandler.setSignature(callBack.onAccessKey(), signed); ...
[ "private", "void", "sign", "(", "RequestHandler", "requestHandler", ")", "throws", "QSException", "{", "if", "(", "callBack", "!=", "null", ")", "{", "String", "signed", "=", "callBack", ".", "onSignature", "(", "requestHandler", ".", "getStringToSignature", "("...
When sending a request will call this method to sign with server. @param requestHandler handler of the request. @throws QSException exception
[ "When", "sending", "a", "request", "will", "call", "this", "method", "to", "sign", "with", "server", "." ]
b44a228a99e60e4d6e5a450b7c05972552ab9962
https://github.com/yunify/qingstor-sdk-java/blob/b44a228a99e60e4d6e5a450b7c05972552ab9962/src/main/java/com/qingstor/sdk/upload/UploadManager.java#L240-L249
test
Sign the request handler.
Of course, here is the Java code you requested: ```java private void sign(RequestHandler requestHandler) throws QSException { if (callBack != null) { String signed = callBack.onSignature(requestHandler.getStringToSignature()); if (!QSStringUtil.isEmpty(signed)) requestHa...
spring-projects/spring-security
core/src/main/java/org/springframework/security/access/intercept/NullRunAsManager.java
NullRunAsManager.buildRunAs
public Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> config) { return null; }
java
public Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> config) { return null; }
[ "public", "Authentication", "buildRunAs", "(", "Authentication", "authentication", ",", "Object", "object", ",", "Collection", "<", "ConfigAttribute", ">", "config", ")", "{", "return", "null", ";", "}" ]
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/access/intercept/NullRunAsManager.java#L36-L39
test
Build RunAs.
Of course, here is the Java code you requested: ```java public Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> config) { return null; } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/geometry/GeometryMath_F64.java
GeometryMath_F64.add
public static void add( double a0, GeoTuple3D_F64 pt0, double a1, GeoTuple3D_F64 pt1, GeoTuple3D_F64 pt2 ) { pt2.x = a0 * pt0.x + a1 * pt1.x; pt2.y = a0 * pt0.y + a1 * pt1.y; pt2.z = a0 * pt0.z + a1 * pt1.z; }
java
public static void add( double a0, GeoTuple3D_F64 pt0, double a1, GeoTuple3D_F64 pt1, GeoTuple3D_F64 pt2 ) { pt2.x = a0 * pt0.x + a1 * pt1.x; pt2.y = a0 * pt0.y + a1 * pt1.y; pt2.z = a0 * pt0.z + a1 * pt1.z; }
[ "public", "static", "void", "add", "(", "double", "a0", ",", "GeoTuple3D_F64", "pt0", ",", "double", "a1", ",", "GeoTuple3D_F64", "pt1", ",", "GeoTuple3D_F64", "pt2", ")", "{", "pt2", ".", "x", "=", "a0", "*", "pt0", ".", "x", "+", "a1", "*", "pt1", ...
<p> Adds two points together while scaling them.<br> <br> pt<sub>2</sub> = a<sub>0</sub> pt<sub>0</sub> + a<sub>1</sub> pt<sub>1</sub> </p> <p/> <p> Point 'c' can be the same instance as 'a' or 'b'. </p> @param a0 Scaling factor for pt0. @param pt0 A point. Not modified. @param a1 Scaling factor for pt1. @param pt1 A ...
[ "<p", ">", "Adds", "two", "points", "together", "while", "scaling", "them", ".", "<br", ">", "<br", ">", "pt<sub", ">", "2<", "/", "sub", ">", "=", "a<sub", ">", "0<", "/", "sub", ">", "pt<sub", ">", "0<", "/", "sub", ">", "+", "a<sub", ">", "1...
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/GeometryMath_F64.java#L207-L211
test
Adds two points.
Of course, here is the Java code you requested: ```java public static void add( double a0, GeoTuple3D_F64 pt0, double a1, GeoTuple3D_F64 pt1, GeoTuple3D_F64 pt2 ) { pt2.x = a0 * pt0.x + a1 * pt1.x; pt2.y = a0 * pt0.y + a1 * pt1.y; pt2.z = a0 * pt0.z + a1 * pt1.z; } ``` Hope this helps!
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java
TileDao.isGoogleTiles
public boolean isGoogleTiles() { // Convert the bounding box to wgs84 BoundingBox boundingBox = tileMatrixSet.getBoundingBox(); BoundingBox wgs84BoundingBox = boundingBox.transform( projection.getTransformation( ProjectionConstants.EPSG_WORLD_GEODETIC_SYS...
java
public boolean isGoogleTiles() { // Convert the bounding box to wgs84 BoundingBox boundingBox = tileMatrixSet.getBoundingBox(); BoundingBox wgs84BoundingBox = boundingBox.transform( projection.getTransformation( ProjectionConstants.EPSG_WORLD_GEODETIC_SYS...
[ "public", "boolean", "isGoogleTiles", "(", ")", "{", "// Convert the bounding box to wgs84", "BoundingBox", "boundingBox", "=", "tileMatrixSet", ".", "getBoundingBox", "(", ")", ";", "BoundingBox", "wgs84BoundingBox", "=", "boundingBox", ".", "transform", "(", "projecti...
Determine if the tiles are in the Google tile coordinate format @return google tiles flag
[ "Determine", "if", "the", "tiles", "are", "in", "the", "Google", "tile", "coordinate", "format" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java#L575-L607
test
Checks if the tile matrix set is a Google Tiles set
Of course, here is the Java code you requested: ```java public boolean isGoogleTiles() { // Convert the bounding box to wgs84 BoundingBox boundingBox = tileMatrixSet.getBoundingBox(); BoundingBox wgs84BoundingBox = boundingBox.transform( projection.getTransformation( ...
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/framing/CloseFrame.java
CloseFrame.validateUtf8
private void validateUtf8(ByteBuffer payload, int mark) throws InvalidDataException { try { payload.position( payload.position() + 2 ); reason = Charsetfunctions.stringUtf8( payload ); } catch ( IllegalArgumentException e ) { throw new InvalidDataException( CloseFrame...
java
private void validateUtf8(ByteBuffer payload, int mark) throws InvalidDataException { try { payload.position( payload.position() + 2 ); reason = Charsetfunctions.stringUtf8( payload ); } catch ( IllegalArgumentException e ) { throw new InvalidDataException( CloseFrame...
[ "private", "void", "validateUtf8", "(", "ByteBuffer", "payload", ",", "int", "mark", ")", "throws", "InvalidDataException", "{", "try", "{", "payload", ".", "position", "(", "payload", ".", "position", "(", ")", "+", "2", ")", ";", "reason", "=", "Charsetf...
Validate the payload to valid utf8 @param mark the current mark @param payload the current payload @throws InvalidDataException the current payload is not a valid utf8
[ "Validate", "the", "payload", "to", "valid", "utf8" ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/framing/CloseFrame.java#L287-L296
test
Validate UTF - 8.
Of course, here is the Java code you requested: ```java private void validateUtf8(ByteBuffer payload, int mark) throws InvalidDataException { try { payload.position( payload.position() + 2 ); reason = Charsetfunctions.stringUtf8( payload ); } catch ( IllegalArgumentException e )...
arnohaase/a-foundation
a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/AThreadPoolImpl.java
AThreadPoolImpl.shutdown
@Override public List<AFuture<Void>> shutdown (ShutdownMode shutdownMode) { if (! shutdown.compareAndSet (false, true)) { throw new IllegalStateException ("pool can be shut down only once"); } if (shutdownMode == ShutdownMode.SkipUnstarted || shutdownMode == ShutdownMode.InterruptRu...
java
@Override public List<AFuture<Void>> shutdown (ShutdownMode shutdownMode) { if (! shutdown.compareAndSet (false, true)) { throw new IllegalStateException ("pool can be shut down only once"); } if (shutdownMode == ShutdownMode.SkipUnstarted || shutdownMode == ShutdownMode.InterruptRu...
[ "@", "Override", "public", "List", "<", "AFuture", "<", "Void", ">", ">", "shutdown", "(", "ShutdownMode", "shutdownMode", ")", "{", "if", "(", "!", "shutdown", ".", "compareAndSet", "(", "false", ",", "true", ")", ")", "{", "throw", "new", "IllegalState...
This method shuts down the thread pool. The method finishes immediately, returning a separate AFuture for every worker thread. In order to combine them into a single AFuture for all worker threads, use {@code AFuture.lift()} on the result.
[ "This", "method", "shuts", "down", "the", "thread", "pool", ".", "The", "method", "finishes", "immediately", "returning", "a", "separate", "AFuture", "for", "every", "worker", "thread", ".", "In", "order", "to", "combine", "them", "into", "a", "single", "AFu...
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/AThreadPoolImpl.java#L201-L240
test
Shutdown the pool.
Of course, here is the Java code you requested: ```java @Override public List<AFuture<Void>> shutdown (ShutdownMode shutdownMode) { if (! shutdown.compareAndSet (false, true)) { throw new IllegalStateException ("pool can be shut down only once"); } if (shutdownMode == ShutdownMode....
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/subsystem/StrictMaxPoolAdd.java
StrictMaxPoolAdd.populateModel
@Override protected void populateModel(ModelNode operation, ModelNode strictMaxPoolModel) throws OperationFailedException { for (AttributeDefinition attr : StrictMaxPoolResourceDefinition.ATTRIBUTES.values()) { attr.validateAndSet(operation, strictMaxPoolModel); } }
java
@Override protected void populateModel(ModelNode operation, ModelNode strictMaxPoolModel) throws OperationFailedException { for (AttributeDefinition attr : StrictMaxPoolResourceDefinition.ATTRIBUTES.values()) { attr.validateAndSet(operation, strictMaxPoolModel); } }
[ "@", "Override", "protected", "void", "populateModel", "(", "ModelNode", "operation", ",", "ModelNode", "strictMaxPoolModel", ")", "throws", "OperationFailedException", "{", "for", "(", "AttributeDefinition", "attr", ":", "StrictMaxPoolResourceDefinition", ".", "ATTRIBUTE...
Populate the <code>strictMaxPoolModel</code> from the <code>operation</code> @param operation the operation @param strictMaxPoolModel strict-max-pool ModelNode @throws OperationFailedException
[ "Populate", "the", "<code", ">", "strictMaxPoolModel<", "/", "code", ">", "from", "the", "<code", ">", "operation<", "/", "code", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/StrictMaxPoolAdd.java#L61-L66
test
Populate the strictMaxPoolModel with the attributes defined in the strictMaxPoolResourceDefinition.
Of course, here is the Java code you requested: ```java @Override protected void populateModel(ModelNode operation, ModelNode strictMaxPoolModel) throws OperationFailedException { for (AttributeDefinition attr : StrictMaxPoolResourceDefinition.ATTRIBUTES.values()) { attr.validateAndSet(operatio...
noties/Storm
library/src/main/java/ru/noties/storm/Storm.java
Storm.registerTypeSerializer
public <T> void registerTypeSerializer(Class<T> who, AbsSerializer<T> serializer) { //noinspection unchecked mSerializers.put(who, (AbsSerializer<Object>) serializer); }
java
public <T> void registerTypeSerializer(Class<T> who, AbsSerializer<T> serializer) { //noinspection unchecked mSerializers.put(who, (AbsSerializer<Object>) serializer); }
[ "public", "<", "T", ">", "void", "registerTypeSerializer", "(", "Class", "<", "T", ">", "who", ",", "AbsSerializer", "<", "T", ">", "serializer", ")", "{", "//noinspection unchecked", "mSerializers", ".", "put", "(", "who", ",", "(", "AbsSerializer", "<", ...
Registers Type serializer (aka not supported SQLite types) {@link ru.noties.storm.sd.AbsSerializer} As a matter of fact {@link ru.noties.storm.sd.AbsSerializer} has only one method that indicates what SQLite type({@link ru.noties.storm.FieldType}) this type will represent. Methods <code>serialize</code> and <code>deser...
[ "Registers", "Type", "serializer", "(", "aka", "not", "supported", "SQLite", "types", ")", "{", "@link", "ru", ".", "noties", ".", "storm", ".", "sd", ".", "AbsSerializer", "}", "As", "a", "matter", "of", "fact", "{", "@link", "ru", ".", "noties", ".",...
6158db54baf243c438f00e036685de19ac509c07
https://github.com/noties/Storm/blob/6158db54baf243c438f00e036685de19ac509c07/library/src/main/java/ru/noties/storm/Storm.java#L160-L163
test
Register a type serializer.
Of course, here is the Java code you requested: ```java public <T> void registerTypeSerializer(Class<T> who, AbsSerializer<T> serializer) { //noinspection unchecked mSerializers.put(who, (AbsSerializer<Object>) serializer); } ``` Hope this helps!
RestComm/jain-slee
container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitRepositoryImpl.java
DeployableUnitRepositoryImpl.getComponentByID
public EventTypeComponent getComponentByID(EventTypeID id) { // get from repository EventTypeComponent component = componentRepository.getComponentByID(id); if (component == null) { // not found in repository, get it from deployable unit component = deployableUnit.getEventTypeComponents().get(id); } ret...
java
public EventTypeComponent getComponentByID(EventTypeID id) { // get from repository EventTypeComponent component = componentRepository.getComponentByID(id); if (component == null) { // not found in repository, get it from deployable unit component = deployableUnit.getEventTypeComponents().get(id); } ret...
[ "public", "EventTypeComponent", "getComponentByID", "(", "EventTypeID", "id", ")", "{", "// get from repository", "EventTypeComponent", "component", "=", "componentRepository", ".", "getComponentByID", "(", "id", ")", ";", "if", "(", "component", "==", "null", ")", ...
/* (non-Javadoc) @see org.mobicents.slee.core.component.ComponentRepository#getComponentByID(javax.slee.EventTypeID)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitRepositoryImpl.java#L74-L82
test
Get the EventTypeComponent by Event Type ID
Of course, here is the Java code you requested: ```java public EventTypeComponent getComponentByID(EventTypeID id) { // get from repository EventTypeComponent component = componentRepository.getComponentByID(id); if (component == null) { // not found in repository, get it from deployable unit component = d...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/http/support/ServletContextAttributeHelper.java
ServletContextAttributeHelper.create
public static ServletContextAttributeHelper create(final FilterConfig filterConfig) { Validate.notNull(filterConfig); final String nameFromParam = filterConfig.getInitParameter(INIT_PARAM_NAME); final String name = nameFromParam != null ? nameFromParam : DEFAULT_NAME; return new ServletContextAttributeH...
java
public static ServletContextAttributeHelper create(final FilterConfig filterConfig) { Validate.notNull(filterConfig); final String nameFromParam = filterConfig.getInitParameter(INIT_PARAM_NAME); final String name = nameFromParam != null ? nameFromParam : DEFAULT_NAME; return new ServletContextAttributeH...
[ "public", "static", "ServletContextAttributeHelper", "create", "(", "final", "FilterConfig", "filterConfig", ")", "{", "Validate", ".", "notNull", "(", "filterConfig", ")", ";", "final", "String", "nameFromParam", "=", "filterConfig", ".", "getInitParameter", "(", "...
Factory method which uses default name for storing/retrieving attributes in {@link ServletContext}.
[ "Factory", "method", "which", "uses", "default", "name", "for", "storing", "/", "retrieving", "attributes", "in", "{" ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/http/support/ServletContextAttributeHelper.java#L115-L120
test
Create a ServletContextAttributeHelper from a filterConfig.
Of course, here is the Java code you requested: ```java public static ServletContextAttributeHelper create(final FilterConfig filterConfig) { Validate.notNull(filterConfig); final String nameFromParam = filterConfig.getInitParameter(INIT_PARAM_NAME); final String name = nameFromParam != null ? nameFromPara...
orientechnologies/orientdb
graphdb/src/main/java/com/orientechnologies/orient/graph/sql/OCommandExecutorSQLDeleteVertex.java
OCommandExecutorSQLDeleteVertex.parseReturn
protected String parseReturn() throws OCommandSQLParsingException { final String returning = parserNextWord(true); if (!returning.equalsIgnoreCase("COUNT") && !returning.equalsIgnoreCase("BEFORE")) throwParsingException("Invalid " + KEYWORD_RETURN + " value set to '" + returning + "' but i...
java
protected String parseReturn() throws OCommandSQLParsingException { final String returning = parserNextWord(true); if (!returning.equalsIgnoreCase("COUNT") && !returning.equalsIgnoreCase("BEFORE")) throwParsingException("Invalid " + KEYWORD_RETURN + " value set to '" + returning + "' but i...
[ "protected", "String", "parseReturn", "(", ")", "throws", "OCommandSQLParsingException", "{", "final", "String", "returning", "=", "parserNextWord", "(", "true", ")", ";", "if", "(", "!", "returning", ".", "equalsIgnoreCase", "(", "\"COUNT\"", ")", "&&", "!", ...
Parses the returning keyword if found.
[ "Parses", "the", "returning", "keyword", "if", "found", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/OCommandExecutorSQLDeleteVertex.java#L295-L303
test
Parses the RETURN keyword.
Of course, here is the Java code you requested: ```java protected String parseReturn() throws OCommandSQLParsingException { final String returning = parserNextWord(true); if (!returning.equalsIgnoreCase("COUNT") && !returning.equalsIgnoreCase("BEFORE")) throwParsingException("Invalid " + KEYWORD_RET...
chenlb/mmseg4j-from-googlecode
src/com/chenlb/mmseg4j/Dictionary.java
Dictionary.search
public int search(CharNode node, char[] sen, int offset, int tailLen) { if(node != null) { return node.indexOf(sen, offset, tailLen); } return -1; }
java
public int search(CharNode node, char[] sen, int offset, int tailLen) { if(node != null) { return node.indexOf(sen, offset, tailLen); } return -1; }
[ "public", "int", "search", "(", "CharNode", "node", ",", "char", "[", "]", "sen", ",", "int", "offset", ",", "int", "tailLen", ")", "{", "if", "(", "node", "!=", "null", ")", "{", "return", "node", ".", "indexOf", "(", "sen", ",", "offset", ",", ...
sen[offset] 后 tailLen 长的词是否存在. @see CharNode#indexOf(char[], int, int) @author chenlb 2009-4-8 下午11:13:49
[ "sen", "[", "offset", "]", "后", "tailLen", "长的词是否存在", "." ]
3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb
https://github.com/chenlb/mmseg4j-from-googlecode/blob/3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb/src/com/chenlb/mmseg4j/Dictionary.java#L395-L400
test
Returns the index of the first occurrence of the specified character array in the specified node.
Of course, here is the Java code you requested: ```java public int search(CharNode node, char[] sen, int offset, int tailLen) { if(node != null) { return node.indexOf(sen, offset, tailLen); } return -1; } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/internal/http/AuthConfig.java
AuthConfig.oauth
public void oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken) { this.builder.client.removeRequestInterceptorByClass(OAuthSigner.class); if (consumerKey != null) { this.builder.client.addRequestInterceptor(new OAuthSigner( ...
java
public void oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken) { this.builder.client.removeRequestInterceptorByClass(OAuthSigner.class); if (consumerKey != null) { this.builder.client.addRequestInterceptor(new OAuthSigner( ...
[ "public", "void", "oauth", "(", "String", "consumerKey", ",", "String", "consumerSecret", ",", "String", "accessToken", ",", "String", "secretToken", ")", "{", "this", ".", "builder", ".", "client", ".", "removeRequestInterceptorByClass", "(", "OAuthSigner", ".", ...
</p>OAuth sign all requests. Note that this currently does <strong>not</strong> wait for a <code>WWW-Authenticate</code> challenge before sending the the OAuth header. All requests to all domains will be signed for this instance.</p> <p/> <p>This assumes you've already generated an <code>accessToken</code> and <code>...
[ "<", "/", "p", ">", "OAuth", "sign", "all", "requests", ".", "Note", "that", "this", "currently", "does", "<strong", ">", "not<", "/", "strong", ">", "wait", "for", "a", "<code", ">", "WWW", "-", "Authenticate<", "/", "code", ">", "challenge", "before"...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/internal/http/AuthConfig.java#L178-L186
test
OAuth request interceptor.
Of course, here is the Java code you requested: ```java public void oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken) { this.builder.client.removeRequestInterceptorByClass(OAuthSigner.class); if (consumerKey != null) { this.builde...
shopping24/solr-jdbc
src/main/java/com/s24/search/solr/analysis/jdbc/JdbcKeepWordFilterFactory.java
JdbcKeepWordFilterFactory.inform
@Override public void inform(ResourceLoader loader) throws IOException { super.inform(new JdbcResourceLoader(loader, reader, StandardCharsets.UTF_8)); }
java
@Override public void inform(ResourceLoader loader) throws IOException { super.inform(new JdbcResourceLoader(loader, reader, StandardCharsets.UTF_8)); }
[ "@", "Override", "public", "void", "inform", "(", "ResourceLoader", "loader", ")", "throws", "IOException", "{", "super", ".", "inform", "(", "new", "JdbcResourceLoader", "(", "loader", ",", "reader", ",", "StandardCharsets", ".", "UTF_8", ")", ")", ";", "}"...
Load words from jdbc
[ "Load", "words", "from", "jdbc" ]
3806370f2a5e26db2194f4f63b98edf2fee5efd8
https://github.com/shopping24/solr-jdbc/blob/3806370f2a5e26db2194f4f63b98edf2fee5efd8/src/main/java/com/s24/search/solr/analysis/jdbc/JdbcKeepWordFilterFactory.java#L38-L41
test
Override this method to inform the underlying resource loader with a JdbcResourceLoader.
Of course, here is the Java code you requested: ```java @Override public void inform(ResourceLoader loader) throws IOException { super.inform(new JdbcResourceLoader(loader, reader, StandardCharsets.UTF_8)); } ``` Hope this helps!
lightcouch/LightCouch
src/main/java/org/lightcouch/CouchDbContext.java
CouchDbContext.compact
public void compact() { HttpResponse response = null; try { response = dbc.post(buildUri(dbc.getDBUri()).path("_compact").build(), ""); } finally { close(response); } }
java
public void compact() { HttpResponse response = null; try { response = dbc.post(buildUri(dbc.getDBUri()).path("_compact").build(), ""); } finally { close(response); } }
[ "public", "void", "compact", "(", ")", "{", "HttpResponse", "response", "=", "null", ";", "try", "{", "response", "=", "dbc", ".", "post", "(", "buildUri", "(", "dbc", ".", "getDBUri", "(", ")", ")", ".", "path", "(", "\"_compact\"", ")", ".", "build...
Triggers a database <i>compact</i> request.
[ "Triggers", "a", "database", "<i", ">", "compact<", "/", "i", ">", "request", "." ]
9646889503475e862fd2158487e1cdd805447f4a
https://github.com/lightcouch/LightCouch/blob/9646889503475e862fd2158487e1cdd805447f4a/src/main/java/org/lightcouch/CouchDbContext.java#L133-L140
test
Compact the database.
Of course, here is the Java code you requested: ```java public void compact() { HttpResponse response = null; try { response = dbc.post(buildUri(dbc.getDBUri()).path("_compact").build(), ""); } finally { close(response); } } ``` Hope this helps!
markhobson/microbrowser
spi/src/main/java/org/hobsoft/microbrowser/spi/DefaultControlGroup.java
DefaultControlGroup.getCheckedValue
private static String getCheckedValue(Control control) { if (control instanceof CheckableControl) { return ((CheckableControl) control).getCheckedValue(); } return control.getValue(); }
java
private static String getCheckedValue(Control control) { if (control instanceof CheckableControl) { return ((CheckableControl) control).getCheckedValue(); } return control.getValue(); }
[ "private", "static", "String", "getCheckedValue", "(", "Control", "control", ")", "{", "if", "(", "control", "instanceof", "CheckableControl", ")", "{", "return", "(", "(", "CheckableControl", ")", "control", ")", ".", "getCheckedValue", "(", ")", ";", "}", ...
----------------------------------------------------------------------------------------------------------------
[ "----------------------------------------------------------------------------------------------------------------" ]
732d2dadc1c3eaad688de31dc09f360df580faf1
https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/spi/src/main/java/org/hobsoft/microbrowser/spi/DefaultControlGroup.java#L129-L137
test
Get the checked value of a control.
Of course, here is the Java code you requested: ```java private static String getCheckedValue(Control control) { if (control instanceof CheckableControl) { return ((CheckableControl) control).getCheckedValue(); } return control.getValue(); } ``` Hope this helps!
rupertlssmith/lojix
lojix/learning/src/main/com/thesett/aima/learning/decisiontree/prototype/ProtoDTMachine.java
ProtoDTMachine.classify
public Map<String, OrdinalAttribute> classify(State state) throws ClassifyingFailureException { // Start at the root of the decision tree. DecisionTree currentNode = dt; // Loop down the decision tree until a leaf node is found. while (true) // !currentNode.isLeaf()) { ...
java
public Map<String, OrdinalAttribute> classify(State state) throws ClassifyingFailureException { // Start at the root of the decision tree. DecisionTree currentNode = dt; // Loop down the decision tree until a leaf node is found. while (true) // !currentNode.isLeaf()) { ...
[ "public", "Map", "<", "String", ",", "OrdinalAttribute", ">", "classify", "(", "State", "state", ")", "throws", "ClassifyingFailureException", "{", "// Start at the root of the decision tree.", "DecisionTree", "currentNode", "=", "dt", ";", "// Loop down the decision tree u...
Classifies a state using the decision tree. @param state The input data point to classify. @return A classification of the data point as an mapping from the output property that the decision tree was trained on to this classifiers belief abouts its value. @throws ClassifyingFailureException If the decision tree is ...
[ "Classifies", "a", "state", "using", "the", "decision", "tree", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/learning/src/main/com/thesett/aima/learning/decisiontree/prototype/ProtoDTMachine.java#L68-L110
test
Classify the state.
Of course, here is the Java code you requested: ```java public Map<String, OrdinalAttribute> classify(State state) throws ClassifyingFailureException { // Start at the root of the decision tree. DecisionTree currentNode = dt; // Loop down the decision tree until a leaf node is found. ...
oblac/jodd
jodd-mail/src/main/java/jodd/mail/RFC2822AddressParser.java
RFC2822AddressParser.parse
public ParsedAddress parse(String email) { email = email.trim(); // match all final Matcher mailboxMatcher = MAILBOX_PATTERN().matcher(email); final boolean mailboxMatcherMatches = mailboxMatcher.matches(); final String[] mailboxMatcherParts = mailboxMatcherMatches ? _calcMatcherParts(mailboxMatcher) : null...
java
public ParsedAddress parse(String email) { email = email.trim(); // match all final Matcher mailboxMatcher = MAILBOX_PATTERN().matcher(email); final boolean mailboxMatcherMatches = mailboxMatcher.matches(); final String[] mailboxMatcherParts = mailboxMatcherMatches ? _calcMatcherParts(mailboxMatcher) : null...
[ "public", "ParsedAddress", "parse", "(", "String", "email", ")", "{", "email", "=", "email", ".", "trim", "(", ")", ";", "// match all", "final", "Matcher", "mailboxMatcher", "=", "MAILBOX_PATTERN", "(", ")", ".", "matcher", "(", "email", ")", ";", "final"...
Parses email address. Returns {@link ParsedAddress parsed address}, that might be valid or not.
[ "Parses", "email", "address", ".", "Returns", "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/RFC2822AddressParser.java#L285-L321
test
Parses the given email string and returns a ParsedAddress object.
Of course, here is the Java code you requested: ```java public ParsedAddress parse(String email) { email = email.trim(); // match all final Matcher mailboxMatcher = MAILBOX_PATTERN().matcher(email); final boolean mailboxMatcherMatches = mailboxMatcher.matches(); final String[] mailboxMatcherParts = mailbox...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Type.java
Type.getMethodDescriptor
public static String getMethodDescriptor(final Method method) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('('); Class<?>[] parameters = method.getParameterTypes(); for (Class<?> parameter : parameters) { appendDescriptor(parameter, stringBuilder); } stringBuil...
java
public static String getMethodDescriptor(final Method method) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('('); Class<?>[] parameters = method.getParameterTypes(); for (Class<?> parameter : parameters) { appendDescriptor(parameter, stringBuilder); } stringBuil...
[ "public", "static", "String", "getMethodDescriptor", "(", "final", "Method", "method", ")", "{", "StringBuilder", "stringBuilder", "=", "new", "StringBuilder", "(", ")", ";", "stringBuilder", ".", "append", "(", "'", "'", ")", ";", "Class", "<", "?", ">", ...
Returns the descriptor corresponding to the given method. @param method a {@link Method} object. @return the descriptor of the given method.
[ "Returns", "the", "descriptor", "corresponding", "to", "the", "given", "method", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Type.java#L570-L580
test
Get the method descriptor.
Of course, here is the Java code you requested: ```java public static String getMethodDescriptor(final Method method) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('('); Class<?>[] parameters = method.getParameterTypes(); for (Class<?> parameter : parameters) { appendD...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasZrotg
public static void cublasZrotg(Pointer host_ca, cuDoubleComplex cb, Pointer host_sc, Pointer host_cs) { cublasZrotgNative(host_ca, cb, host_sc, host_cs); checkResultBLAS(); }
java
public static void cublasZrotg(Pointer host_ca, cuDoubleComplex cb, Pointer host_sc, Pointer host_cs) { cublasZrotgNative(host_ca, cb, host_sc, host_cs); checkResultBLAS(); }
[ "public", "static", "void", "cublasZrotg", "(", "Pointer", "host_ca", ",", "cuDoubleComplex", "cb", ",", "Pointer", "host_sc", ",", "Pointer", "host_cs", ")", "{", "cublasZrotgNative", "(", "host_ca", ",", "cb", ",", "host_sc", ",", "host_cs", ")", ";", "che...
<pre> void cublasZrotg (cuDoubleComplex *host_ca, cuDoubleComplex cb, double *host_sc, double *host_cs) constructs the complex Givens tranformation ( sc cs ) G = ( ) , sc^2 + cabs(cs)^2 = 1, (-cs sc ) which zeros the second entry of the complex 2-vector transpose(ca, cb). The quantity ca/cabs(ca)*norm(ca,...
[ "<pre", ">", "void", "cublasZrotg", "(", "cuDoubleComplex", "*", "host_ca", "cuDoubleComplex", "cb", "double", "*", "host_sc", "double", "*", "host_cs", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L2643-L2647
test
Cublas Zrotg for a symmetric matrix.
Of course, here is the Java code you requested: ```java public static void cublasZrotg(Pointer host_ca, cuDoubleComplex cb, Pointer host_sc, Pointer host_cs) { cublasZrotgNative(host_ca, cb, host_sc, host_cs); checkResultBLAS(); } ``` Hope this helps!
GojaFramework/goja
goja-web/src/main/java/goja/plugins/shiro/ShiroPlugin.java
ShiroPlugin.isClearShiroAnnotationPresent
private boolean isClearShiroAnnotationPresent(Method method) { Annotation a = method.getAnnotation(ClearShiro.class); return a != null; }
java
private boolean isClearShiroAnnotationPresent(Method method) { Annotation a = method.getAnnotation(ClearShiro.class); return a != null; }
[ "private", "boolean", "isClearShiroAnnotationPresent", "(", "Method", "method", ")", "{", "Annotation", "a", "=", "method", ".", "getAnnotation", "(", "ClearShiro", ".", "class", ")", ";", "return", "a", "!=", "null", ";", "}" ]
该方法上是否有ClearShiro注解
[ "该方法上是否有ClearShiro注解" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/plugins/shiro/ShiroPlugin.java#L258-L261
test
Checks if ClearShiro annotation is present in method.
Of course, here is the Java code you requested: ```java private boolean isClearShiroAnnotationPresent(Method method) { Annotation a = method.getAnnotation(ClearShiro.class); return a != null; } ``` Hope this helps!
xmlet/XsdParser
src/main/java/org/xmlet/xsdparser/xsdelements/XsdSimpleType.java
XsdSimpleType.updateExistingRestriction
private void updateExistingRestriction(XsdRestriction existing, XsdRestriction newRestriction) { XsdPattern pattern = newRestriction.getPattern(); XsdMaxExclusive maxExclusive = newRestriction.getMaxExclusive(); XsdMaxInclusive maxInclusive = newRestriction.getMaxInclusive(); XsdMaxLengt...
java
private void updateExistingRestriction(XsdRestriction existing, XsdRestriction newRestriction) { XsdPattern pattern = newRestriction.getPattern(); XsdMaxExclusive maxExclusive = newRestriction.getMaxExclusive(); XsdMaxInclusive maxInclusive = newRestriction.getMaxInclusive(); XsdMaxLengt...
[ "private", "void", "updateExistingRestriction", "(", "XsdRestriction", "existing", ",", "XsdRestriction", "newRestriction", ")", "{", "XsdPattern", "pattern", "=", "newRestriction", ".", "getPattern", "(", ")", ";", "XsdMaxExclusive", "maxExclusive", "=", "newRestrictio...
Joins two distinct {@link XsdRestriction} instances. This method assumes that the information of both {@link XsdRestriction} objects don't have overlapping or contradictory information. @param existing The existing restriction. @param newRestriction The new restriction.
[ "Joins", "two", "distinct", "{" ]
0044681d77400e1568d1e7b1024a38ec76caa2cb
https://github.com/xmlet/XsdParser/blob/0044681d77400e1568d1e7b1024a38ec76caa2cb/src/main/java/org/xmlet/xsdparser/xsdelements/XsdSimpleType.java#L202-L260
test
Update the existing restriction.
Of course, here is the Java code you requested: ```java private void updateExistingRestriction(XsdRestriction existing, XsdRestriction newRestriction) { XsdPattern pattern = newRestriction.getPattern(); XsdMaxExclusive maxExclusive = newRestriction.getMaxExclusive(); XsdMaxInclusive maxInclusiv...
GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
core/src/main/java/com/google/cloud/sql/core/CoreSocketFactory.java
CoreSocketFactory.runningOnGaeStandard
private boolean runningOnGaeStandard() { // gaeEnv="standard" indicates standard instances String gaeEnv = System.getenv("GAE_ENV"); // runEnv="Production" requires to rule out Java 8 emulated environments String runEnv = System.getProperty("com.google.appengine.runtime.environment"); // gaeRuntime=...
java
private boolean runningOnGaeStandard() { // gaeEnv="standard" indicates standard instances String gaeEnv = System.getenv("GAE_ENV"); // runEnv="Production" requires to rule out Java 8 emulated environments String runEnv = System.getProperty("com.google.appengine.runtime.environment"); // gaeRuntime=...
[ "private", "boolean", "runningOnGaeStandard", "(", ")", "{", "// gaeEnv=\"standard\" indicates standard instances", "String", "gaeEnv", "=", "System", ".", "getenv", "(", "\"GAE_ENV\"", ")", ";", "// runEnv=\"Production\" requires to rule out Java 8 emulated environments", "Strin...
Returns {@code true} if running in a Google App Engine Standard runtime.
[ "Returns", "{" ]
f108b0d5c7332a86075d32b8a648fb1b98288852
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/f108b0d5c7332a86075d32b8a648fb1b98288852/core/src/main/java/com/google/cloud/sql/core/CoreSocketFactory.java#L203-L213
test
Checks if the application is running on the GAE standard environment.
Of course, here is the Java code you requested: ```java private boolean runningOnGaeStandard() { // gaeEnv="standard" indicates standard instances String gaeEnv = System.getenv("GAE_ENV"); // runEnv="Production" requires to rule out Java 8 emulated environments String runEnv = System.getProperty("com.g...
streamsets/datacollector
hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java
HiveMetastoreUtil.getPartitionNameValue
public static LinkedHashMap<String, String> getPartitionNameValue(Record metadataRecord) throws HiveStageCheckedException{ LinkedHashMap<String, String> partitionNameValue = new LinkedHashMap<>(); extractInnerMapFromTheList( metadataRecord, PARTITION_FIELD, PARTITION_NAME, PARTIT...
java
public static LinkedHashMap<String, String> getPartitionNameValue(Record metadataRecord) throws HiveStageCheckedException{ LinkedHashMap<String, String> partitionNameValue = new LinkedHashMap<>(); extractInnerMapFromTheList( metadataRecord, PARTITION_FIELD, PARTITION_NAME, PARTIT...
[ "public", "static", "LinkedHashMap", "<", "String", ",", "String", ">", "getPartitionNameValue", "(", "Record", "metadataRecord", ")", "throws", "HiveStageCheckedException", "{", "LinkedHashMap", "<", "String", ",", "String", ">", "partitionNameValue", "=", "new", "...
Extract column information from the Partition list in "/partitions" field.<br> Partition Value Information should exist in this form: <br> [{name:"column1", value:"07-05-2016"}, {name:"column2", value:"production"}] @param metadataRecord record which contains the {@link #PARTITION_FIELD} and conform to the above stru...
[ "Extract", "column", "information", "from", "the", "Partition", "list", "in", "/", "partitions", "field", ".", "<br", ">" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java#L345-L357
test
Extract the partition name value map from the list of the record.
Of course, here is the Java code you requested: ```java public static LinkedHashMap<String, String> getPartitionNameValue(Record metadataRecord) throws HiveStageCheckedException{ LinkedHashMap<String, String> partitionNameValue = new LinkedHashMap<>(); extractInnerMapFromTheList( metadataRecord, ...
retog/wymiwyg-commons-core
src/main/java/org/wymiwyg/commons/util/URI.java
URI.initializeScheme
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = p_uriSpec.indexOf(':'); if (index < 1) throw new MalformedURIException("No scheme found in URI."); if (index == uriSpecLen - 1) throw new MalformedURIException("A ba...
java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = p_uriSpec.indexOf(':'); if (index < 1) throw new MalformedURIException("No scheme found in URI."); if (index == uriSpecLen - 1) throw new MalformedURIException("A ba...
[ "private", "void", "initializeScheme", "(", "String", "p_uriSpec", ")", "throws", "MalformedURIException", "{", "int", "uriSpecLen", "=", "p_uriSpec", ".", "length", "(", ")", ";", "int", "index", "=", "p_uriSpec", ".", "indexOf", "(", "'", "'", ")", ";", ...
Initialize the scheme for this URI from a URI string spec. @param p_uriSpec the URI specification (cannot be null) @exception MalformedURIException if URI does not have a conformant scheme
[ "Initialize", "the", "scheme", "for", "this", "URI", "from", "a", "URI", "string", "spec", "." ]
f64530a2690e2d9ee0184c5671214ee32572482d
https://github.com/retog/wymiwyg-commons-core/blob/f64530a2690e2d9ee0184c5671214ee32572482d/src/main/java/org/wymiwyg/commons/util/URI.java#L555-L567
test
Initializes the scheme.
Of course, here is the Java code you requested: ```java private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = p_uriSpec.indexOf(':'); if (index < 1) throw new MalformedURIException("No scheme found in URI."); if (index == ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/storage/index/sbtree/singlevalue/OSBTreeBucketSingleValue.java
OSBTreeBucketSingleValue.getValue
public ORID getValue(final int entryIndex) { assert isLeaf; int entryPosition = getIntValue(entryIndex * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET); // skip key if (encryption == null) { entryPosition += getObjectSizeInDirectMemory(keySerializer, entryPosition); } else { fin...
java
public ORID getValue(final int entryIndex) { assert isLeaf; int entryPosition = getIntValue(entryIndex * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET); // skip key if (encryption == null) { entryPosition += getObjectSizeInDirectMemory(keySerializer, entryPosition); } else { fin...
[ "public", "ORID", "getValue", "(", "final", "int", "entryIndex", ")", "{", "assert", "isLeaf", ";", "int", "entryPosition", "=", "getIntValue", "(", "entryIndex", "*", "OIntegerSerializer", ".", "INT_SIZE", "+", "POSITIONS_ARRAY_OFFSET", ")", ";", "// skip key", ...
Obtains the value stored under the given entry index in this bucket. @param entryIndex the value entry index. @return the obtained value.
[ "Obtains", "the", "value", "stored", "under", "the", "given", "entry", "index", "in", "this", "bucket", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/index/sbtree/singlevalue/OSBTreeBucketSingleValue.java#L274-L291
test
Returns the value of the entry at the given index.
Of course, here is the Java code you requested: ```java public ORID getValue(final int entryIndex) { assert isLeaf; int entryPosition = getIntValue(entryIndex * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET); // skip key if (encryption == null) { entryPosition += getObjectSizeInDirectMem...
Unidata/thredds
udunits/src/main/java/ucar/units/UnitDBImpl.java
UnitDBImpl.addAlias
public final void addAlias(final String alias, final String name) throws NoSuchUnitException, UnitExistsException { addAlias(alias, name, null); }
java
public final void addAlias(final String alias, final String name) throws NoSuchUnitException, UnitExistsException { addAlias(alias, name, null); }
[ "public", "final", "void", "addAlias", "(", "final", "String", "alias", ",", "final", "String", "name", ")", "throws", "NoSuchUnitException", ",", "UnitExistsException", "{", "addAlias", "(", "alias", ",", "name", ",", "null", ")", ";", "}" ]
Adds an alias for a unit already in the database. @param alias An alias for the unit. @param name The name of the unit already in the database. @throws UnitExistsException Another unit with the same name or symbol already exists in the database. @throws NoSuchUnitException The unit isn't in the database.
[ "Adds", "an", "alias", "for", "a", "unit", "already", "in", "the", "database", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/UnitDBImpl.java#L130-L133
test
Add an alias to the unit.
Of course, here is the Java code you requested: ```java public final void addAlias(final String alias, final String name) throws NoSuchUnitException, UnitExistsException { addAlias(alias, name, null); } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/TldScanner.java
TldScanner.processWebDotXml
private void processWebDotXml() throws Exception { // Skip if we are only looking for listeners if (scanListeners) { return; } JspConfigDescriptor jspConfig = ctxt.getJspConfigDescriptor(); if (jspConfig == null) { return; } for (Taglib...
java
private void processWebDotXml() throws Exception { // Skip if we are only looking for listeners if (scanListeners) { return; } JspConfigDescriptor jspConfig = ctxt.getJspConfigDescriptor(); if (jspConfig == null) { return; } for (Taglib...
[ "private", "void", "processWebDotXml", "(", ")", "throws", "Exception", "{", "// Skip if we are only looking for listeners", "if", "(", "scanListeners", ")", "{", "return", ";", "}", "JspConfigDescriptor", "jspConfig", "=", "ctxt", ".", "getJspConfigDescriptor", "(", ...
/* Populates taglib map described in web.xml.
[ "/", "*", "Populates", "taglib", "map", "described", "in", "web", ".", "xml", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/TldScanner.java#L363-L404
test
Process the web. xml file.
Of course, here is the Java code you requested: ```java private void processWebDotXml() throws Exception { // Skip if we are only looking for listeners if (scanListeners) { return; } JspConfigDescriptor jspConfig = ctxt.getJspConfigDescriptor(); if (jspConfig == n...
streamsets/datacollector
stage-lib-archetype/src/main/resources/archetype-resources/src/main/java/stage/origin/sample/SampleSource.java
SampleSource.produce
@Override public String produce(String lastSourceOffset, int maxBatchSize, BatchMaker batchMaker) throws StageException { // Offsets can vary depending on the data source. Here we use an integer as an example only. long nextSourceOffset = 0; if (lastSourceOffset != null) { nextSourceOffset = Long.pa...
java
@Override public String produce(String lastSourceOffset, int maxBatchSize, BatchMaker batchMaker) throws StageException { // Offsets can vary depending on the data source. Here we use an integer as an example only. long nextSourceOffset = 0; if (lastSourceOffset != null) { nextSourceOffset = Long.pa...
[ "@", "Override", "public", "String", "produce", "(", "String", "lastSourceOffset", ",", "int", "maxBatchSize", ",", "BatchMaker", "batchMaker", ")", "throws", "StageException", "{", "// Offsets can vary depending on the data source. Here we use an integer as an example only.", ...
{@inheritDoc}
[ "{" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/stage-lib-archetype/src/main/resources/archetype-resources/src/main/java/stage/origin/sample/SampleSource.java#L65-L90
test
This method is called by the H2O Data Source to produce a sequence of records from a data source.
Of course, here is the Java code you requested: ```java @Override public String produce(String lastSourceOffset, int maxBatchSize, BatchMaker batchMaker) throws StageException { // Offsets can vary depending on the data source. Here we use an integer as an example only. long nextSourceOffset = 0; if (las...
spring-projects/spring-security
oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/DelegatingOAuth2TokenValidator.java
DelegatingOAuth2TokenValidator.validate
@Override public OAuth2TokenValidatorResult validate(T token) { Collection<OAuth2Error> errors = new ArrayList<>(); for ( OAuth2TokenValidator<T> validator : this.tokenValidators) { errors.addAll(validator.validate(token).getErrors()); } return OAuth2TokenValidatorResult.failure(errors); }
java
@Override public OAuth2TokenValidatorResult validate(T token) { Collection<OAuth2Error> errors = new ArrayList<>(); for ( OAuth2TokenValidator<T> validator : this.tokenValidators) { errors.addAll(validator.validate(token).getErrors()); } return OAuth2TokenValidatorResult.failure(errors); }
[ "@", "Override", "public", "OAuth2TokenValidatorResult", "validate", "(", "T", "token", ")", "{", "Collection", "<", "OAuth2Error", ">", "errors", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "OAuth2TokenValidator", "<", "T", ">", "validator", "...
{@inheritDoc}
[ "{" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/DelegatingOAuth2TokenValidator.java#L62-L71
test
Validate the given token.
Of course, here is the Java code you requested: ```java @Override public OAuth2TokenValidatorResult validate(T token) { Collection<OAuth2Error> errors = new ArrayList<>(); for ( OAuth2TokenValidator<T> validator : this.tokenValidators) { errors.addAll(validator.validate(token).getErrors()); } return OAut...
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/lucene/GeodePagination.java
GeodePagination.storePagination
public List<String> storePagination(String sanId, int pageSize, Map<String, Collection<?>> pageKeysRegion, Collection<String> keys) { if(keys == null || keys.isEmpty()) return null; //add to pages List<Collection<String>> pagesCollection = Organizer.toPages(keys, pageSize); String key = null; ...
java
public List<String> storePagination(String sanId, int pageSize, Map<String, Collection<?>> pageKeysRegion, Collection<String> keys) { if(keys == null || keys.isEmpty()) return null; //add to pages List<Collection<String>> pagesCollection = Organizer.toPages(keys, pageSize); String key = null; ...
[ "public", "List", "<", "String", ">", "storePagination", "(", "String", "sanId", ",", "int", "pageSize", ",", "Map", "<", "String", ",", "Collection", "<", "?", ">", ">", "pageKeysRegion", ",", "Collection", "<", "String", ">", "keys", ")", "{", "if", ...
------------------------------------------------
[ "------------------------------------------------" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/lucene/GeodePagination.java#L138-L164
test
Stores a pagination of the given keys in the specified region.
Of course, here is the Java code you requested: ```java public List<String> storePagination(String sanId, int pageSize, Map<String, Collection<?>> pageKeysRegion, Collection<String> keys) { if(keys == null || keys.isEmpty()) return null; //add to pages List<Collection<String>> pagesCollection = Org...
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/creation/StageLibraryDelegateCreator.java
StageLibraryDelegateCreator.createInstance
private StageLibraryDelegate createInstance(StageLibraryDelegateDefinitition def) { StageLibraryDelegate instance = null; ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(def.getClassLoader()); instance = def.getKlass(...
java
private StageLibraryDelegate createInstance(StageLibraryDelegateDefinitition def) { StageLibraryDelegate instance = null; ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(def.getClassLoader()); instance = def.getKlass(...
[ "private", "StageLibraryDelegate", "createInstance", "(", "StageLibraryDelegateDefinitition", "def", ")", "{", "StageLibraryDelegate", "instance", "=", "null", ";", "ClassLoader", "classLoader", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", ...
Create actual instance of delegator. @param def Delegator definition @return New instance or null on any issue
[ "Create", "actual", "instance", "of", "delegator", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/creation/StageLibraryDelegateCreator.java#L103-L117
test
Create a new instance of the given delegate definition
Of course, here is the Java code you requested: ```java private StageLibraryDelegate createInstance(StageLibraryDelegateDefinitition def) { StageLibraryDelegate instance = null; ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoa...
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/retrieval/QueryConcept.java
QueryConcept.setNamedEntityTypes
public void setNamedEntityTypes(StringList v) { if (QueryConcept_Type.featOkTst && ((QueryConcept_Type)jcasType).casFeat_namedEntityTypes == null) jcasType.jcas.throwFeatMissing("namedEntityTypes", "edu.cmu.lti.oaqa.type.retrieval.QueryConcept"); jcasType.ll_cas.ll_setRefValue(addr, ((QueryConcept_Type)jc...
java
public void setNamedEntityTypes(StringList v) { if (QueryConcept_Type.featOkTst && ((QueryConcept_Type)jcasType).casFeat_namedEntityTypes == null) jcasType.jcas.throwFeatMissing("namedEntityTypes", "edu.cmu.lti.oaqa.type.retrieval.QueryConcept"); jcasType.ll_cas.ll_setRefValue(addr, ((QueryConcept_Type)jc...
[ "public", "void", "setNamedEntityTypes", "(", "StringList", "v", ")", "{", "if", "(", "QueryConcept_Type", ".", "featOkTst", "&&", "(", "(", "QueryConcept_Type", ")", "jcasType", ")", ".", "casFeat_namedEntityTypes", "==", "null", ")", "jcasType", ".", "jcas", ...
setter for namedEntityTypes - sets List of Named Entity types associated with this concept. @generated @param v value to set into the feature
[ "setter", "for", "namedEntityTypes", "-", "sets", "List", "of", "Named", "Entity", "types", "associated", "with", "this", "concept", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/QueryConcept.java#L84-L87
test
setter for namedEntityTypes - sets
Of course, here is the Java code you requested: ```java public void setNamedEntityTypes(StringList v) { if (QueryConcept_Type.featOkTst && ((QueryConcept_Type)jcasType).casFeat_namedEntityTypes == null) jcasType.jcas.throwFeatMissing("namedEntityTypes", "edu.cmu.lti.oaqa.type.retrieval.QueryConcept"); jc...
Unidata/thredds
cdm/src/main/java/ucar/nc2/Attribute.java
Attribute.getNumericValue
public Number getNumericValue(int index) { if ((index < 0) || (index >= nelems)) return null; // LOOK can attributes be enum valued? for now, no switch (dataType) { case STRING: try { return new Double(getStringValue(index)); } catch (NumberFormatException e) { ...
java
public Number getNumericValue(int index) { if ((index < 0) || (index >= nelems)) return null; // LOOK can attributes be enum valued? for now, no switch (dataType) { case STRING: try { return new Double(getStringValue(index)); } catch (NumberFormatException e) { ...
[ "public", "Number", "getNumericValue", "(", "int", "index", ")", "{", "if", "(", "(", "index", "<", "0", ")", "||", "(", "index", ">=", "nelems", ")", ")", "return", "null", ";", "// LOOK can attributes be enum valued? for now, no", "switch", "(", "dataType", ...
Retrieve a numeric value by index. If it's a String, it will try to parse it as a double. @param index the index into the value array. @return Number <code>value[index]</code>, or null if its a non-parseable String or the index is out of range.
[ "Retrieve", "a", "numeric", "value", "by", "index", ".", "If", "it", "s", "a", "String", "it", "will", "try", "to", "parse", "it", "as", "a", "double", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/Attribute.java#L194-L224
test
Gets the numeric value at the specified index.
Of course, here is the Java code you requested: ```java public Number getNumericValue(int index) { if ((index < 0) || (index >= nelems)) return null; // LOOK can attributes be enum valued? for now, no switch (dataType) { case STRING: try { return new Double(getStringValue(ind...
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/LatLonRect.java
LatLonRect.intersect
public LatLonRect intersect(LatLonRect clip) { double latMin = Math.max(getLatMin(), clip.getLatMin()); double latMax = Math.min(getLatMax(), clip.getLatMax()); double deltaLat = latMax - latMin; if (deltaLat < 0) return null; // lon as always is a pain : if not intersection, try +/- 3...
java
public LatLonRect intersect(LatLonRect clip) { double latMin = Math.max(getLatMin(), clip.getLatMin()); double latMax = Math.min(getLatMax(), clip.getLatMax()); double deltaLat = latMax - latMin; if (deltaLat < 0) return null; // lon as always is a pain : if not intersection, try +/- 3...
[ "public", "LatLonRect", "intersect", "(", "LatLonRect", "clip", ")", "{", "double", "latMin", "=", "Math", ".", "max", "(", "getLatMin", "(", ")", ",", "clip", ".", "getLatMin", "(", ")", ")", ";", "double", "latMax", "=", "Math", ".", "min", "(", "g...
Create the instersection of this LatLon with the given one @param clip intersect with this @return intersection, or null if there is no intersection
[ "Create", "the", "instersection", "of", "this", "LatLon", "with", "the", "given", "one" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/LatLonRect.java#L483-L512
test
Returns the intersection of this rectangle with the given rectangle.
Of course, here is the Java code you requested: ```java public LatLonRect intersect(LatLonRect clip) { double latMin = Math.max(getLatMin(), clip.getLatMin()); double latMax = Math.min(getLatMax(), clip.getLatMax()); double deltaLat = latMax - latMin; if (deltaLat < 0) return null; //...
Unidata/thredds
cdm/src/main/java/ucar/ma2/ArrayByte.java
ArrayByte.factory
static ArrayByte factory(Index index, boolean isUnsigned) { return ArrayByte.factory(index, isUnsigned, null); }
java
static ArrayByte factory(Index index, boolean isUnsigned) { return ArrayByte.factory(index, isUnsigned, null); }
[ "static", "ArrayByte", "factory", "(", "Index", "index", ",", "boolean", "isUnsigned", ")", "{", "return", "ArrayByte", ".", "factory", "(", "index", ",", "isUnsigned", ",", "null", ")", ";", "}" ]
package private. use Array.factory()
[ "package", "private", ".", "use", "Array", ".", "factory", "()" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/ArrayByte.java#L22-L24
test
Create an ArrayByte object from an Index.
Of course, here is the Java code you requested: ```java static ArrayByte factory(Index index, boolean isUnsigned) { return ArrayByte.factory(index, isUnsigned, null); } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/storage/fs/OFileClassic.java
OFileClassic.delete
public void delete() throws IOException { int attempts = 0; while (true) { try { acquireWriteLock(); try { close(); if (osFile != null) { Files.deleteIfExists(osFile); } } finally { releaseWriteLock(); attempts++; ...
java
public void delete() throws IOException { int attempts = 0; while (true) { try { acquireWriteLock(); try { close(); if (osFile != null) { Files.deleteIfExists(osFile); } } finally { releaseWriteLock(); attempts++; ...
[ "public", "void", "delete", "(", ")", "throws", "IOException", "{", "int", "attempts", "=", "0", ";", "while", "(", "true", ")", "{", "try", "{", "acquireWriteLock", "(", ")", ";", "try", "{", "close", "(", ")", ";", "if", "(", "osFile", "!=", "nul...
/* (non-Javadoc) @see com.orientechnologies.orient.core.storage.fs.OFileAAA#delete()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OFileClassic.java#L775-L798
test
Delete the file.
Of course, here is the Java code you requested: ```java public void delete() throws IOException { int attempts = 0; while (true) { try { acquireWriteLock(); try { close(); if (osFile != null) { Files.deleteIfExists(osFile); } } finally { ...
spring-projects/spring-security
cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java
CasAuthenticationEntryPoint.afterPropertiesSet
public void afterPropertiesSet() throws Exception { Assert.hasLength(this.loginUrl, "loginUrl must be specified"); Assert.notNull(this.serviceProperties, "serviceProperties must be specified"); Assert.notNull(this.serviceProperties.getService(), "serviceProperties.getService() cannot be null."); }
java
public void afterPropertiesSet() throws Exception { Assert.hasLength(this.loginUrl, "loginUrl must be specified"); Assert.notNull(this.serviceProperties, "serviceProperties must be specified"); Assert.notNull(this.serviceProperties.getService(), "serviceProperties.getService() cannot be null."); }
[ "public", "void", "afterPropertiesSet", "(", ")", "throws", "Exception", "{", "Assert", ".", "hasLength", "(", "this", ".", "loginUrl", ",", "\"loginUrl must be specified\"", ")", ";", "Assert", ".", "notNull", "(", "this", ".", "serviceProperties", ",", "\"serv...
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationEntryPoint.java#L68-L73
test
This method is called after the properties have been set.
Of course, here is the Java code you requested: ```java public void afterPropertiesSet() throws Exception { Assert.hasLength(this.loginUrl, "loginUrl must be specified"); Assert.notNull(this.serviceProperties, "serviceProperties must be specified"); Assert.notNull(this.serviceProperties.getService(), "servic...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.using
@CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public static <T, D> Flowable<T> using(Callable<? extends D> resourceSupplier, Function<? super D, ? extends Publisher<? extends T>> sourceSupplier, Consumer<? super D> resourceDisposer...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public static <T, D> Flowable<T> using(Callable<? extends D> resourceSupplier, Function<? super D, ? extends Publisher<? extends T>> sourceSupplier, Consumer<? super D> resourceDisposer...
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "PASS_THROUGH", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static", "<", "T", ",", "D", ">", "Flowable", "<", "T", ">", "using", "(", ...
Constructs a Publisher that creates a dependent resource object which is disposed of on cancellation. <p> <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/using.png" alt=""> <dl> <dt><b>Backpressure:</b></dt> <dd>The operator is a pass-through for backpressure and othe...
[ "Constructs", "a", "Publisher", "that", "creates", "a", "dependent", "resource", "object", "which", "is", "disposed", "of", "on", "cancellation", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "400", "src", "=", "https", ":", "//", "raw", "....
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L4439-L4445
test
Create a sequence of items using a sequence of items using a sequence of items using a source supplier and a source disposer.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public static <T, D> Flowable<T> using(Callable<? extends D> resourceSupplier, Function<? super D, ? extends Publisher<? extends...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java
ConfigurationUtility.getFullDataCollectNameFromFullName
public static String getFullDataCollectNameFromFullName( final String fullName) { if (fullName == null) { return ""; } int lastEachCommandPos = fullName .lastIndexOf(TieConstants.EACH_COMMAND_FULL_NAME_PREFIX); if (lastEachCommandPos < 0) { return ""; } int lastEachCommandIndexPos =...
java
public static String getFullDataCollectNameFromFullName( final String fullName) { if (fullName == null) { return ""; } int lastEachCommandPos = fullName .lastIndexOf(TieConstants.EACH_COMMAND_FULL_NAME_PREFIX); if (lastEachCommandPos < 0) { return ""; } int lastEachCommandIndexPos =...
[ "public", "static", "String", "getFullDataCollectNameFromFullName", "(", "final", "String", "fullName", ")", "{", "if", "(", "fullName", "==", "null", ")", "{", "return", "\"\"", ";", "}", "int", "lastEachCommandPos", "=", "fullName", ".", "lastIndexOf", "(", ...
Remove last each command index from full name. e.g. for F.departments:E.department.1:E.employee.2 will return F.departments:E.department.1:E.employee Reason for this is for last layer collection. e.g. E.employee.1 and E.employee.2 The E.emloyee is the same. * @param fullName the full name @return the full data collec...
[ "Remove", "last", "each", "command", "index", "from", "full", "name", ".", "e", ".", "g", ".", "for", "F", ".", "departments", ":", "E", ".", "department", ".", "1", ":", "E", ".", "employee", ".", "2", "will", "return", "F", ".", "departments", ":...
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java#L608-L627
test
Gets the full data collect name from the full name.
Of course, here is the Java code you requested: ```java public static String getFullDataCollectNameFromFullName( final String fullName) { if (fullName == null) { return ""; } int lastEachCommandPos = fullName .lastIndexOf(TieConstants.EACH_COMMAND_FULL_NAME_PREFIX); if (lastEachCommandPos < ...
markhobson/microbrowser
spi/src/main/java/org/hobsoft/microbrowser/spi/AbstractMicrodataDocument.java
AbstractMicrodataDocument.getItem
public final MicrodataItem getItem(String type) { List<MicrodataItem> items = getItems(type); if (items.isEmpty()) { throw new MicrodataItemNotFoundException(newUrl(type)); } return items.get(0); }
java
public final MicrodataItem getItem(String type) { List<MicrodataItem> items = getItems(type); if (items.isEmpty()) { throw new MicrodataItemNotFoundException(newUrl(type)); } return items.get(0); }
[ "public", "final", "MicrodataItem", "getItem", "(", "String", "type", ")", "{", "List", "<", "MicrodataItem", ">", "items", "=", "getItems", "(", "type", ")", ";", "if", "(", "items", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "MicrodataItemNotF...
----------------------------------------------------------------------------------------------------------------
[ "----------------------------------------------------------------------------------------------------------------" ]
732d2dadc1c3eaad688de31dc09f360df580faf1
https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/spi/src/main/java/org/hobsoft/microbrowser/spi/AbstractMicrodataDocument.java#L33-L43
test
Gets the item of the specified type.
Of course, here is the Java code you requested: ```java public final MicrodataItem getItem(String type) { List<MicrodataItem> items = getItems(type); if (items.isEmpty()) { throw new MicrodataItemNotFoundException(newUrl(type)); } return items.get(0); } ``` Hope this helps!
Unidata/thredds
opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java
DTSServlet.badURL
public void badURL(HttpServletRequest request, HttpServletResponse response) throws Exception { if(Debug.isSet("showResponse")) { log.debug("Sending Bad URL Page."); } //log.info("DODSServlet.badURL " + rs.getRequest().getRequestURI()); response.setContentTy...
java
public void badURL(HttpServletRequest request, HttpServletResponse response) throws Exception { if(Debug.isSet("showResponse")) { log.debug("Sending Bad URL Page."); } //log.info("DODSServlet.badURL " + rs.getRequest().getRequestURI()); response.setContentTy...
[ "public", "void", "badURL", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "Exception", "{", "if", "(", "Debug", ".", "isSet", "(", "\"showResponse\"", ")", ")", "{", "log", ".", "debug", "(", "\"Sending Bad URL Page...
Sends an html document to the client explaining that they have used a poorly formed URL and then the help page... @param request The client's <code> request </code> @param response The client <code>response</code>
[ "Sends", "an", "html", "document", "to", "the", "client", "explaining", "that", "they", "have", "used", "a", "poorly", "formed", "URL", "and", "then", "the", "help", "page", "..." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java#L1094-L1117
test
This method is called when the user has requested a bad URL.
Of course, here is the Java code you requested: ```java public void badURL(HttpServletRequest request, HttpServletResponse response) throws Exception { if(Debug.isSet("showResponse")) { log.debug("Sending Bad URL Page."); } //log.info("DODSServlet.badURL " + rs.getR...
boonproject/boon
boon/src/main/java/org/boon/criteria/ObjectFilter.java
ObjectFilter.matches
public static boolean matches( Object obj, Criteria... exp ) { return ObjectFilter.and( exp ).test( obj ); }
java
public static boolean matches( Object obj, Criteria... exp ) { return ObjectFilter.and( exp ).test( obj ); }
[ "public", "static", "boolean", "matches", "(", "Object", "obj", ",", "Criteria", "...", "exp", ")", "{", "return", "ObjectFilter", ".", "and", "(", "exp", ")", ".", "test", "(", "obj", ")", ";", "}" ]
Does the object match this expression. An expression is a collection of criteria. @param obj object in question @param exp expression @return true or false
[ "Does", "the", "object", "match", "this", "expression", ".", "An", "expression", "is", "a", "collection", "of", "criteria", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/criteria/ObjectFilter.java#L65-L67
test
Checks if the given object matches the criteria.
Of course, here is the Java code you requested: ```java public static boolean matches( Object obj, Criteria... exp ) { return ObjectFilter.and( exp ).test( obj ); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createAnzahlWohneinheiten
@XmlElementDecl(namespace = "", name = "anzahl_wohneinheiten") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createAnzahlWohneinheiten(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlWohneinheiten_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "anzahl_wohneinheiten") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createAnzahlWohneinheiten(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlWohneinheiten_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"anzahl_wohneinheiten\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter2", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createAnzahlWohneinheiten", "(", "BigDecimal", ...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2468-L2472
test
Create an instance of an Anzahl Wohneinheiten in einen Adapter2.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "anzahl_wohneinheiten") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createAnzahlWohneinheiten(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlWohneinheiten_QNAME, BigDeci...
orientechnologies/orientdb
client/src/main/java/com/orientechnologies/orient/client/remote/OClusterRemote.java
OClusterRemote.configure
public void configure(OStorage iStorage, OStorageClusterConfiguration iConfig) throws IOException { id = iConfig.getId(); name = iConfig.getName(); }
java
public void configure(OStorage iStorage, OStorageClusterConfiguration iConfig) throws IOException { id = iConfig.getId(); name = iConfig.getName(); }
[ "public", "void", "configure", "(", "OStorage", "iStorage", ",", "OStorageClusterConfiguration", "iConfig", ")", "throws", "IOException", "{", "id", "=", "iConfig", ".", "getId", "(", ")", ";", "name", "=", "iConfig", ".", "getName", "(", ")", ";", "}" ]
/* (non-Javadoc) @see com.orientechnologies.orient.core.storage.OCluster#configure(com.orientechnologies.orient.core.storage.OStorage, com.orientechnologies.orient.core.config.OStorageClusterConfiguration)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/client/src/main/java/com/orientechnologies/orient/client/remote/OClusterRemote.java#L59-L62
test
Configures the entity with the configuration from the cluster configuration.
Of course, here is the Java code you requested: ```java public void configure(OStorage iStorage, OStorageClusterConfiguration iConfig) throws IOException { id = iConfig.getId(); name = iConfig.getName(); } ``` Hope this helps!
streamsets/datacollector
rabbitmq-lib/src/main/java/com/streamsets/pipeline/lib/rabbitmq/common/RabbitUtil.java
RabbitUtil.initRabbitConf
private static void initRabbitConf(Channel channel, BaseRabbitConfigBean conf) throws IOException{ // Channel is always bound to the default exchange. When specified, we must declare the exchange. for (RabbitExchangeConfigBean exchange : conf.exchanges) { channel.exchangeDeclare( exchange.name, ...
java
private static void initRabbitConf(Channel channel, BaseRabbitConfigBean conf) throws IOException{ // Channel is always bound to the default exchange. When specified, we must declare the exchange. for (RabbitExchangeConfigBean exchange : conf.exchanges) { channel.exchangeDeclare( exchange.name, ...
[ "private", "static", "void", "initRabbitConf", "(", "Channel", "channel", ",", "BaseRabbitConfigBean", "conf", ")", "throws", "IOException", "{", "// Channel is always bound to the default exchange. When specified, we must declare the exchange.", "for", "(", "RabbitExchangeConfigBe...
----------------------------------------------- Private Members ---------------------------------------------------
[ "-----------------------------------------------", "Private", "Members", "---------------------------------------------------" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/rabbitmq-lib/src/main/java/com/streamsets/pipeline/lib/rabbitmq/common/RabbitUtil.java#L195-L218
test
Initializes the mailbox.
Of course, here is the Java code you requested: ```java private static void initRabbitConf(Channel channel, BaseRabbitConfigBean conf) throws IOException{ // Channel is always bound to the default exchange. When specified, we must declare the exchange. for (RabbitExchangeConfigBean exchange : conf.exchanges) {...
Unidata/thredds
cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java
CatalogBuilder.readTimeCoverage
protected DateRange readTimeCoverage(Element tElem) { if (tElem == null) { return null; } Calendar calendar = readCalendar(tElem.getAttributeValue("calendar")); DateType start = readDate(tElem.getChild("start", Catalog.defNS), calendar); DateType end = readDate(tElem.getChild("end", Catal...
java
protected DateRange readTimeCoverage(Element tElem) { if (tElem == null) { return null; } Calendar calendar = readCalendar(tElem.getAttributeValue("calendar")); DateType start = readDate(tElem.getChild("start", Catalog.defNS), calendar); DateType end = readDate(tElem.getChild("end", Catal...
[ "protected", "DateRange", "readTimeCoverage", "(", "Element", "tElem", ")", "{", "if", "(", "tElem", "==", "null", ")", "{", "return", "null", ";", "}", "Calendar", "calendar", "=", "readCalendar", "(", "tElem", ".", "getAttributeValue", "(", "\"calendar\"", ...
/* <xsd:complexType name="timeCoverageType"> <xsd:sequence> <xsd:attribute name="calendar" type="xsd:string"/> <xsd:choice minOccurs="2" maxOccurs="3"> <xsd:element name="start" type="dateTypeFormatted"/> <xsd:element name="end" type="dateTypeFormatted"/> <xsd:element name="duration" type="duration"/> </xsd:choice> <xs...
[ "/", "*", "<xsd", ":", "complexType", "name", "=", "timeCoverageType", ">", "<xsd", ":", "sequence", ">", "<xsd", ":", "attribute", "name", "=", "calendar", "type", "=", "xsd", ":", "string", "/", ">", "<xsd", ":", "choice", "minOccurs", "=", "2", "max...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java#L1133-L1153
test
Read a TimeCoverage element.
Of course, here is the Java code you requested: ```java protected DateRange readTimeCoverage(Element tElem) { if (tElem == null) { return null; } Calendar calendar = readCalendar(tElem.getAttributeValue("calendar")); DateType start = readDate(tElem.getChild("start", Catalog.defNS), calendar)...
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java
src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java
StdDraw.picture
public static void picture(double x, double y, String filename, double scaledWidth, double scaledHeight, double degrees) { if (scaledWidth < 0) throw new IllegalArgumentException("width is negative: " + scaledWidth); if (scaledHeight < 0) throw new IllegalArgumentException("height is negativ...
java
public static void picture(double x, double y, String filename, double scaledWidth, double scaledHeight, double degrees) { if (scaledWidth < 0) throw new IllegalArgumentException("width is negative: " + scaledWidth); if (scaledHeight < 0) throw new IllegalArgumentException("height is negativ...
[ "public", "static", "void", "picture", "(", "double", "x", ",", "double", "y", ",", "String", "filename", ",", "double", "scaledWidth", ",", "double", "scaledHeight", ",", "double", "degrees", ")", "{", "if", "(", "scaledWidth", "<", "0", ")", "throw", "...
Draws the specified image centered at (<em>x</em>, <em>y</em>), rotated given number of degrees, and rescaled to the specified bounding box. The supported image formats are JPEG, PNG, and GIF. @param x the center <em>x</em>-coordinate of the image @param y the center <em>y</em>-coordinate of the image @param filena...
[ "Draws", "the", "specified", "image", "centered", "at", "(", "<em", ">", "x<", "/", "em", ">", "<em", ">", "y<", "/", "em", ">", ")", "rotated", "given", "number", "of", "degrees", "and", "rescaled", "to", "the", "specified", "bounding", "box", ".", ...
516fee15e537ecdb3f4dcbe3695c5cfde7e930da
https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java#L756-L777
test
Draw a single image in the image system
Of course, here is the Java code you requested: ```java public static void picture(double x, double y, String filename, double scaledWidth, double scaledHeight, double degrees) { if (scaledWidth < 0) throw new IllegalArgumentException("width is negative: " + scaledWidth); if (scaledHeight < 0) ...
playframework/playframework
web/play-java-forms/src/main/java/play/data/format/Formatters.java
Formatters.print
public <T> String print(TypeDescriptor desc, T t) { if (t == null) { return ""; } if (desc != null && conversion.canConvert(desc, TypeDescriptor.valueOf(String.class))) { return (String) conversion.convert(t, desc, TypeDescriptor.valueOf(String.class)); } else if (conversion.canConvert(t.get...
java
public <T> String print(TypeDescriptor desc, T t) { if (t == null) { return ""; } if (desc != null && conversion.canConvert(desc, TypeDescriptor.valueOf(String.class))) { return (String) conversion.convert(t, desc, TypeDescriptor.valueOf(String.class)); } else if (conversion.canConvert(t.get...
[ "public", "<", "T", ">", "String", "print", "(", "TypeDescriptor", "desc", ",", "T", "t", ")", "{", "if", "(", "t", "==", "null", ")", "{", "return", "\"\"", ";", "}", "if", "(", "desc", "!=", "null", "&&", "conversion", ".", "canConvert", "(", "...
Computes the display string for any value, for a specific type. @param desc the field descriptor - custom formatters are extracted from this descriptor. @param t the value to print @param <T> the type to print @return the formatted string
[ "Computes", "the", "display", "string", "for", "any", "value", "for", "a", "specific", "type", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/web/play-java-forms/src/main/java/play/data/format/Formatters.java#L99-L110
test
Print a single object to the output.
Of course, here is the Java code you requested: ```java public <T> String print(TypeDescriptor desc, T t) { if (t == null) { return ""; } if (desc != null && conversion.canConvert(desc, TypeDescriptor.valueOf(String.class))) { return (String) conversion.convert(t, desc, TypeDescriptor.valueOf(S...
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/LatLonPointImpl.java
LatLonPointImpl.latToString
static public String latToString(double lat, int ndec) { boolean is_north = (lat >= 0.0); if (!is_north) lat = -lat; String f = "%."+ndec+"f"; Formatter latBuff = new Formatter(); latBuff.format(f, lat); latBuff.format("%s", is_north ? "N" : "S"); return latBuff.toString(...
java
static public String latToString(double lat, int ndec) { boolean is_north = (lat >= 0.0); if (!is_north) lat = -lat; String f = "%."+ndec+"f"; Formatter latBuff = new Formatter(); latBuff.format(f, lat); latBuff.format("%s", is_north ? "N" : "S"); return latBuff.toString(...
[ "static", "public", "String", "latToString", "(", "double", "lat", ",", "int", "ndec", ")", "{", "boolean", "is_north", "=", "(", "lat", ">=", "0.0", ")", ";", "if", "(", "!", "is_north", ")", "lat", "=", "-", "lat", ";", "String", "f", "=", "\"%.\...
Make a nicely formatted representation of a latitude, eg 40.34N or 12.9S. @param lat the latitude. @param ndec number of digits to right of decimal point @return String representation.
[ "Make", "a", "nicely", "formatted", "representation", "of", "a", "latitude", "eg", "40", ".", "34N", "or", "12", ".", "9S", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/LatLonPointImpl.java#L136-L148
test
Returns a string representation of the given double value.
Of course, here is the Java code you requested: ```java static public String latToString(double lat, int ndec) { boolean is_north = (lat >= 0.0); if (!is_north) lat = -lat; String f = "%."+ndec+"f"; Formatter latBuff = new Formatter(); latBuff.format(f, lat); latBuff.format("%s...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/matcher/DetailedCookieMatcher.java
DetailedCookieMatcher.value
public DetailedCookieMatcher value(Matcher<? super String> valueMatcher) { return new DetailedCookieMatcher(and(Matchers.hasProperty("value", valueMatcher))); }
java
public DetailedCookieMatcher value(Matcher<? super String> valueMatcher) { return new DetailedCookieMatcher(and(Matchers.hasProperty("value", valueMatcher))); }
[ "public", "DetailedCookieMatcher", "value", "(", "Matcher", "<", "?", "super", "String", ">", "valueMatcher", ")", "{", "return", "new", "DetailedCookieMatcher", "(", "and", "(", "Matchers", ".", "hasProperty", "(", "\"value\"", ",", "valueMatcher", ")", ")", ...
Verifies whether value of cookie satisfies specified matcher. @param valueMatcher value assertion @return A {@link DetailedCookieMatcher} instance with and-composed value property assertion
[ "Verifies", "whether", "value", "of", "cookie", "satisfies", "specified", "matcher", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/matcher/DetailedCookieMatcher.java#L56-L58
test
Returns a new instance of DetailedCookieMatcher where the value of the cookie matches the given matcher.
Of course, here is the Java code you requested: ```java public DetailedCookieMatcher value(Matcher<? super String> valueMatcher) { return new DetailedCookieMatcher(and(Matchers.hasProperty("value", valueMatcher))); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/parallel/ParallelFlowable.java
ParallelFlowable.filter
@CheckReturnValue public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(predicate, "predicate"); ObjectHelper.requireNonNull(errorHandler, "errorHandler is null"); return RxJavaPlugins.onA...
java
@CheckReturnValue public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(predicate, "predicate"); ObjectHelper.requireNonNull(errorHandler, "errorHandler is null"); return RxJavaPlugins.onA...
[ "@", "CheckReturnValue", "public", "final", "ParallelFlowable", "<", "T", ">", "filter", "(", "@", "NonNull", "Predicate", "<", "?", "super", "T", ">", "predicate", ",", "@", "NonNull", "ParallelFailureHandling", "errorHandler", ")", "{", "ObjectHelper", ".", ...
Filters the source values on each 'rail' and handles errors based on the given {@link ParallelFailureHandling} enumeration value. <p> Note that the same predicate may be called from multiple threads concurrently. <p>History: 2.0.8 - experimental @param predicate the function returning true to keep a value or false to d...
[ "Filters", "the", "source", "values", "on", "each", "rail", "and", "handles", "errors", "based", "on", "the", "given", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L224-L229
test
Returns a parallel sequence of items that match the specified predicate.
Of course, here is the Java code you requested: ```java @CheckReturnValue public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate, @NonNull ParallelFailureHandling errorHandler) { ObjectHelper.requireNonNull(predicate, "predicate"); ObjectHelper.requireNonNull(errorHandler, ...
wildfly/wildfly
jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitParseProcessor.java
PersistenceUnitParseProcessor.normalize
private PersistenceUnitMetadataHolder normalize(List<PersistenceUnitMetadataHolder> listPUHolders) { // eliminate duplicates (keeping the first instance of each PU by name) Map<String, PersistenceUnitMetadata> flattened = new HashMap<String, PersistenceUnitMetadata>(); for (PersistenceUnitMetada...
java
private PersistenceUnitMetadataHolder normalize(List<PersistenceUnitMetadataHolder> listPUHolders) { // eliminate duplicates (keeping the first instance of each PU by name) Map<String, PersistenceUnitMetadata> flattened = new HashMap<String, PersistenceUnitMetadata>(); for (PersistenceUnitMetada...
[ "private", "PersistenceUnitMetadataHolder", "normalize", "(", "List", "<", "PersistenceUnitMetadataHolder", ">", "listPUHolders", ")", "{", "// eliminate duplicates (keeping the first instance of each PU by name)", "Map", "<", "String", ",", "PersistenceUnitMetadata", ">", "flatt...
Eliminate duplicate PU definitions from clustering the deployment (first definition will win) <p/> JPA 8.2 A persistence unit must have a name. Only one persistence unit of any given name must be defined within a single EJB-JAR file, within a single WAR file, within a single application client jar, or within an EAR. S...
[ "Eliminate", "duplicate", "PU", "definitions", "from", "clustering", "the", "deployment", "(", "first", "definition", "will", "win", ")", "<p", "/", ">", "JPA", "8", ".", "2", "A", "persistence", "unit", "must", "have", "a", "name", ".", "Only", "one", "...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitParseProcessor.java#L328-L344
test
Normalize the list of PersistenceUnitMetadataHolder objects.
Of course, here is the Java code you requested: ```java private PersistenceUnitMetadataHolder normalize(List<PersistenceUnitMetadataHolder> listPUHolders) { // eliminate duplicates (keeping the first instance of each PU by name) Map<String, PersistenceUnitMetadata> flattened = new HashMap<String, Persi...
play2-maven-plugin/play2-maven-plugin
play2-maven-plugin/src/main/java/com/google/code/play2/plugin/AbstractArchivingMojo.java
AbstractArchivingMojo.getArchiver
protected Archiver getArchiver( String archiverName ) throws NoSuchArchiverException { Archiver result = archiverManager.getArchiver( archiverName ); result.setDuplicateBehavior( Archiver.DUPLICATES_FAIL ); // Just in case return result; }
java
protected Archiver getArchiver( String archiverName ) throws NoSuchArchiverException { Archiver result = archiverManager.getArchiver( archiverName ); result.setDuplicateBehavior( Archiver.DUPLICATES_FAIL ); // Just in case return result; }
[ "protected", "Archiver", "getArchiver", "(", "String", "archiverName", ")", "throws", "NoSuchArchiverException", "{", "Archiver", "result", "=", "archiverManager", ".", "getArchiver", "(", "archiverName", ")", ";", "result", ".", "setDuplicateBehavior", "(", "Archiver...
Returns preconfigured archiver @param archiverName archiver name @return archiver @throws NoSuchArchiverException for unsupported archiver name
[ "Returns", "preconfigured", "archiver" ]
34e174b02c4245cfad64abd230f3cbeda9d9b2f4
https://github.com/play2-maven-plugin/play2-maven-plugin/blob/34e174b02c4245cfad64abd230f3cbeda9d9b2f4/play2-maven-plugin/src/main/java/com/google/code/play2/plugin/AbstractArchivingMojo.java#L49-L55
test
Get the archiver for the given name.
Of course, here is the Java code you requested: ```java protected Archiver getArchiver( String archiverName ) throws NoSuchArchiverException { Archiver result = archiverManager.getArchiver( archiverName ); result.setDuplicateBehavior( Archiver.DUPLICATES_FAIL ); // Just in case retu...
wildfly/wildfly
clustering/jgroups/extension/src/main/java/org/jboss/as/clustering/jgroups/subsystem/AbstractProtocolResourceDefinition.java
AbstractProtocolResourceDefinition.addTransformations
@SuppressWarnings("deprecation") static void addTransformations(ModelVersion version, ResourceTransformationDescriptionBuilder builder) { if (JGroupsModel.VERSION_5_0_0.requiresTransformation(version)) { builder.getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEF...
java
@SuppressWarnings("deprecation") static void addTransformations(ModelVersion version, ResourceTransformationDescriptionBuilder builder) { if (JGroupsModel.VERSION_5_0_0.requiresTransformation(version)) { builder.getAttributeBuilder() .setDiscard(DiscardAttributeChecker.UNDEF...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "static", "void", "addTransformations", "(", "ModelVersion", "version", ",", "ResourceTransformationDescriptionBuilder", "builder", ")", "{", "if", "(", "JGroupsModel", ".", "VERSION_5_0_0", ".", "requiresTransformatio...
Builds transformations common to both stack protocols and transport.
[ "Builds", "transformations", "common", "to", "both", "stack", "protocols", "and", "transport", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/clustering/jgroups/extension/src/main/java/org/jboss/as/clustering/jgroups/subsystem/AbstractProtocolResourceDefinition.java#L127-L162
test
Add the transformers to the resource transformation description builder.
Of course, here is the Java code you requested: ```java @SuppressWarnings("deprecation") static void addTransformations(ModelVersion version, ResourceTransformationDescriptionBuilder builder) { if (JGroupsModel.VERSION_5_0_0.requiresTransformation(version)) { builder.getAttributeBuilder() ...
js-lib-com/tiny-container
src/main/java/js/container/ManagedClass.java
ManagedClass.loadImplementationClass
private Class<?> loadImplementationClass(Config descriptor) throws ConfigException { String implementationName = descriptor.getAttribute("class"); if (implementationName == null) { if (instanceType.requiresImplementation()) { throw new ConfigException("Managed type |%s| requires <class> attribute. See cl...
java
private Class<?> loadImplementationClass(Config descriptor) throws ConfigException { String implementationName = descriptor.getAttribute("class"); if (implementationName == null) { if (instanceType.requiresImplementation()) { throw new ConfigException("Managed type |%s| requires <class> attribute. See cl...
[ "private", "Class", "<", "?", ">", "loadImplementationClass", "(", "Config", "descriptor", ")", "throws", "ConfigException", "{", "String", "implementationName", "=", "descriptor", ".", "getAttribute", "(", "\"class\"", ")", ";", "if", "(", "implementationName", "...
Load optional implementation class from class descriptor and applies insanity checks. Load implementation class from <code>class</code> attribute from descriptor. If <code>class</code> attribute not present return null. <p> Beside loading implementation class this utility method performs sanity checks and throws config...
[ "Load", "optional", "implementation", "class", "from", "class", "descriptor", "and", "applies", "insanity", "checks", ".", "Load", "implementation", "class", "from", "<code", ">", "class<", "/", "code", ">", "attribute", "from", "descriptor", ".", "If", "<code",...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/ManagedClass.java#L750-L779
test
Loads the implementation class from the given config.
Of course, here is the Java code you requested: ```java private Class<?> loadImplementationClass(Config descriptor) throws ConfigException { String implementationName = descriptor.getAttribute("class"); if (implementationName == null) { if (instanceType.requiresImplementation()) { throw new ConfigExcept...
cglib/cglib
cglib/src/main/java/net/sf/cglib/proxy/Mixin.java
Mixin.create
public static Mixin create(Class[] interfaces, Object[] delegates) { Generator gen = new Generator(); gen.setClasses(interfaces); gen.setDelegates(delegates); return gen.create(); }
java
public static Mixin create(Class[] interfaces, Object[] delegates) { Generator gen = new Generator(); gen.setClasses(interfaces); gen.setDelegates(delegates); return gen.create(); }
[ "public", "static", "Mixin", "create", "(", "Class", "[", "]", "interfaces", ",", "Object", "[", "]", "delegates", ")", "{", "Generator", "gen", "=", "new", "Generator", "(", ")", ";", "gen", ".", "setClasses", "(", "interfaces", ")", ";", "gen", ".", ...
Helper method to create an interface mixin. For finer control over the generated instance, use a new instance of <code>Mixin</code> instead of this static method. TODO
[ "Helper", "method", "to", "create", "an", "interface", "mixin", ".", "For", "finer", "control", "over", "the", "generated", "instance", "use", "a", "new", "instance", "of", "<code", ">", "Mixin<", "/", "code", ">", "instead", "of", "this", "static", "metho...
cd01695c11fd3c66641b295b9596f74cf13c548b
https://github.com/cglib/cglib/blob/cd01695c11fd3c66641b295b9596f74cf13c548b/cglib/src/main/java/net/sf/cglib/proxy/Mixin.java#L68-L73
test
Create a new instance of the class system.
Of course, here is the Java code you requested: ```java public static Mixin create(Class[] interfaces, Object[] delegates) { Generator gen = new Generator(); gen.setClasses(interfaces); gen.setDelegates(delegates); return gen.create(); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/internal/observers/BasicFuseableObserver.java
BasicFuseableObserver.fail
protected final void fail(Throwable t) { Exceptions.throwIfFatal(t); upstream.dispose(); onError(t); }
java
protected final void fail(Throwable t) { Exceptions.throwIfFatal(t); upstream.dispose(); onError(t); }
[ "protected", "final", "void", "fail", "(", "Throwable", "t", ")", "{", "Exceptions", ".", "throwIfFatal", "(", "t", ")", ";", "upstream", ".", "dispose", "(", ")", ";", "onError", "(", "t", ")", ";", "}" ]
Rethrows the throwable if it is a fatal exception or calls {@link #onError(Throwable)}. @param t the throwable to rethrow or signal to the actual subscriber
[ "Rethrows", "the", "throwable", "if", "it", "is", "a", "fatal", "exception", "or", "calls", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/observers/BasicFuseableObserver.java#L107-L111
test
Called by the exception handler to handle a fatal exception.
Of course, here is the Java code you requested: ```java protected final void fail(Throwable t) { Exceptions.throwIfFatal(t); upstream.dispose(); onError(t); } ``` Hope this helps!
fabric8io/fabric8-maven-plugin
core/src/main/java/io/fabric8/maven/core/model/GroupArtifactVersion.java
GroupArtifactVersion.getSanitizedArtifactId
public String getSanitizedArtifactId() { if (this.artifactId != null && !this.artifactId.isEmpty() && Character.isDigit(this.artifactId.charAt(0))) { return PREFIX + this.artifactId; } return this.artifactId; }
java
public String getSanitizedArtifactId() { if (this.artifactId != null && !this.artifactId.isEmpty() && Character.isDigit(this.artifactId.charAt(0))) { return PREFIX + this.artifactId; } return this.artifactId; }
[ "public", "String", "getSanitizedArtifactId", "(", ")", "{", "if", "(", "this", ".", "artifactId", "!=", "null", "&&", "!", "this", ".", "artifactId", ".", "isEmpty", "(", ")", "&&", "Character", ".", "isDigit", "(", "this", ".", "artifactId", ".", "char...
ArtifactId is used for setting a resource name (service, pod,...) in Kubernetes resource. The problem is that a Kubernetes resource name must start by a char. This method returns a valid string to be used as Kubernetes name. @return Sanitized Kubernetes name.
[ "ArtifactId", "is", "used", "for", "setting", "a", "resource", "name", "(", "service", "pod", "...", ")", "in", "Kubernetes", "resource", ".", "The", "problem", "is", "that", "a", "Kubernetes", "resource", "name", "must", "start", "by", "a", "char", ".", ...
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/model/GroupArtifactVersion.java#L54-L60
test
Get the sanitized artifact id.
Of course, here is the Java code you requested: ```java public String getSanitizedArtifactId() { if (this.artifactId != null && !this.artifactId.isEmpty() && Character.isDigit(this.artifactId.charAt(0))) { return PREFIX + this.artifactId; } return this.artifactId; } ``` Hope t...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Type.java
Type.appendDescriptor
private void appendDescriptor(final StringBuilder stringBuilder) { if (sort == OBJECT) { stringBuilder.append(valueBuffer, valueBegin - 1, valueEnd + 1); } else if (sort == INTERNAL) { stringBuilder.append('L').append(valueBuffer, valueBegin, valueEnd).append(';'); } else { stringBuilder.a...
java
private void appendDescriptor(final StringBuilder stringBuilder) { if (sort == OBJECT) { stringBuilder.append(valueBuffer, valueBegin - 1, valueEnd + 1); } else if (sort == INTERNAL) { stringBuilder.append('L').append(valueBuffer, valueBegin, valueEnd).append(';'); } else { stringBuilder.a...
[ "private", "void", "appendDescriptor", "(", "final", "StringBuilder", "stringBuilder", ")", "{", "if", "(", "sort", "==", "OBJECT", ")", "{", "stringBuilder", ".", "append", "(", "valueBuffer", ",", "valueBegin", "-", "1", ",", "valueEnd", "+", "1", ")", "...
Appends the descriptor corresponding to this type to the given string buffer. @param stringBuilder the string builder to which the descriptor must be appended.
[ "Appends", "the", "descriptor", "corresponding", "to", "this", "type", "to", "the", "given", "string", "buffer", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Type.java#L587-L595
test
Append the descriptor.
Of course, here is the Java code you requested: ```java private void appendDescriptor(final StringBuilder stringBuilder) { if (sort == OBJECT) { stringBuilder.append(valueBuffer, valueBegin - 1, valueEnd + 1); } else if (sort == INTERNAL) { stringBuilder.append('L').append(valueBuffer, valueBegin, ...
kocakosm/pitaya
src/org/kocakosm/pitaya/util/Strings.java
Strings.trimLeft
public static String trimLeft(String str) { int start = 0; for (char c : str.toCharArray()) { if (c != ' ') { break; } start++; } return str.substring(start); }
java
public static String trimLeft(String str) { int start = 0; for (char c : str.toCharArray()) { if (c != ' ') { break; } start++; } return str.substring(start); }
[ "public", "static", "String", "trimLeft", "(", "String", "str", ")", "{", "int", "start", "=", "0", ";", "for", "(", "char", "c", ":", "str", ".", "toCharArray", "(", ")", ")", "{", "if", "(", "c", "!=", "'", "'", ")", "{", "break", ";", "}", ...
Returns a copy of the given {@code String} with leading whitespaces omitted. @param str the {@code String} to trim. @return the trimmed {@code String}. @throws NullPointerException if {@code str} is {@code null}.
[ "Returns", "a", "copy", "of", "the", "given", "{", "@code", "String", "}", "with", "leading", "whitespaces", "omitted", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Strings.java#L445-L455
test
Trims the left part of a String.
Of course, here is the Java code you requested: ```java public static String trimLeft(String str) { int start = 0; for (char c : str.toCharArray()) { if (c != ' ') { break; } start++; } return str.substring(start); } ``` Hope this helps!
RuedigerMoeller/fast-serialization
src/main/java/org/nustaq/serialization/minbin/MBOut.java
MBOut.writeArray
public void writeArray(Object primitiveArray, int start, int len) { byte type = MinBin.ARRAY_MASK; Class<?> componentType = primitiveArray.getClass().getComponentType(); if (componentType == boolean.class) type |= MinBin.INT_8; else if (componentType == byte.class) type |= MinBin.INT...
java
public void writeArray(Object primitiveArray, int start, int len) { byte type = MinBin.ARRAY_MASK; Class<?> componentType = primitiveArray.getClass().getComponentType(); if (componentType == boolean.class) type |= MinBin.INT_8; else if (componentType == byte.class) type |= MinBin.INT...
[ "public", "void", "writeArray", "(", "Object", "primitiveArray", ",", "int", "start", ",", "int", "len", ")", "{", "byte", "type", "=", "MinBin", ".", "ARRAY_MASK", ";", "Class", "<", "?", ">", "componentType", "=", "primitiveArray", ".", "getClass", "(", ...
write primitive array + header. no floating point or object array allowed. Just int based types @param primitiveArray @param start @param len
[ "write", "primitive", "array", "+", "header", ".", "no", "floating", "point", "or", "object", "array", "allowed", ".", "Just", "int", "based", "types" ]
59f8f800b79479d0b9c80901cf55903d9b027f26
https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/minbin/MBOut.java#L96-L153
test
Writes an array of bytes to the output stream.
Of course, here is the Java code you requested: ```java public void writeArray(Object primitiveArray, int start, int len) { byte type = MinBin.ARRAY_MASK; Class<?> componentType = primitiveArray.getClass().getComponentType(); if (componentType == boolean.class) type |= MinBin.INT_8; ...
eiichiro/bootleg
src/main/java/org/eiichiro/bootleg/URITemplate.java
URITemplate.compareTo
public int compareTo(URITemplate o) { if (template.equals(o.template)) { return 0; } int difference = template.split("/").length - o.template.split("/").length; return (difference == 0) ? 1 : difference * -1; }
java
public int compareTo(URITemplate o) { if (template.equals(o.template)) { return 0; } int difference = template.split("/").length - o.template.split("/").length; return (difference == 0) ? 1 : difference * -1; }
[ "public", "int", "compareTo", "(", "URITemplate", "o", ")", "{", "if", "(", "template", ".", "equals", "(", "o", ".", "template", ")", ")", "{", "return", "0", ";", "}", "int", "difference", "=", "template", ".", "split", "(", "\"/\"", ")", ".", "l...
Compares this URI template to the specified one. Returns <code> &lt; 0</code> if this URI template's segment (split by '/') count is <b>greater</b> than the specified one, <code>&gt; 0</code> if this URI template's segment count is <b>less</b> than the specified one or this URI template's segment count is equivalent to...
[ "Compares", "this", "URI", "template", "to", "the", "specified", "one", ".", "Returns", "<code", ">", "&lt", ";", "0<", "/", "code", ">", "if", "this", "URI", "template", "s", "segment", "(", "split", "by", "/", ")", "count", "is", "<b", ">", "greate...
b98a108500597cb6185056be2eef7de5ba1963d2
https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/URITemplate.java#L168-L175
test
Compares two URIs.
Of course, here is the Java code you requested: ```java public int compareTo(URITemplate o) { if (template.equals(o.template)) { return 0; } int difference = template.split("/").length - o.template.split("/").length; return (difference == 0) ? 1 : difference * -1; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java
ObjectFactory.createWohnungMiete
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "WohnungMiete", substitutionHeadNamespace = "http://www.immobilienscout24.de/immobilientransfer", substitutionHeadName = "Immobilie") public WohnungMiete createWohnungMiete(WohnungMiete.Type value) { return new WohnungM...
java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "WohnungMiete", substitutionHeadNamespace = "http://www.immobilienscout24.de/immobilientransfer", substitutionHeadName = "Immobilie") public WohnungMiete createWohnungMiete(WohnungMiete.Type value) { return new WohnungM...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immobilienscout24.de/immobilientransfer\"", ",", "name", "=", "\"WohnungMiete\"", ",", "substitutionHeadNamespace", "=", "\"http://www.immobilienscout24.de/immobilientransfer\"", ",", "substitutionHeadName", "=", "\"Immobi...
Create an instance of {@link WohnungMiete }}
[ "Create", "an", "instance", "of", "{", "@link", "WohnungMiete", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L738-L741
test
Create a WohnungMiete.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "WohnungMiete", substitutionHeadNamespace = "http://www.immobilienscout24.de/immobilientransfer", substitutionHeadName = "Immobilie") public WohnungMiete createWohnungMie...
streamsets/datacollector
jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcUtil.java
JdbcUtil.getColumnMetadata
public ResultSet getColumnMetadata(Connection connection, String schema, String tableName) throws SQLException { DatabaseMetaData metadata = connection.getMetaData(); // Get all columns for this table return metadata.getColumns(getCatalog(connection, schema), schema, tableName, null); }
java
public ResultSet getColumnMetadata(Connection connection, String schema, String tableName) throws SQLException { DatabaseMetaData metadata = connection.getMetaData(); // Get all columns for this table return metadata.getColumns(getCatalog(connection, schema), schema, tableName, null); }
[ "public", "ResultSet", "getColumnMetadata", "(", "Connection", "connection", ",", "String", "schema", ",", "String", "tableName", ")", "throws", "SQLException", "{", "DatabaseMetaData", "metadata", "=", "connection", ".", "getMetaData", "(", ")", ";", "// Get all co...
Wrapper for {@link java.sql.DatabaseMetaData#getColumns(String, String, String, String)} that detects the format of the supplied tableName. @param connection An open JDBC connection @param tableName table name that is optionally fully qualified with a schema in the form schema.tableName @return ResultSet containing th...
[ "Wrapper", "for", "{", "@link", "java", ".", "sql", ".", "DatabaseMetaData#getColumns", "(", "String", "String", "String", "String", ")", "}", "that", "detects", "the", "format", "of", "the", "supplied", "tableName", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcUtil.java#L277-L281
test
Get the column metadata for a table.
Of course, here is the Java code you requested: ```java public ResultSet getColumnMetadata(Connection connection, String schema, String tableName) throws SQLException { DatabaseMetaData metadata = connection.getMetaData(); // Get all columns for this table return metadata.getColumns(getCatalog(connection, ...
dschulten/hydra-java
spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/xhtml/XhtmlWriter.java
XhtmlWriter.inputButton
private void inputButton(Type type, String value) throws IOException { write("<input type=\""); write(type.toString()); write("\" "); write("value"); write("="); quote(); write(value); quote(); write("/>"); }
java
private void inputButton(Type type, String value) throws IOException { write("<input type=\""); write(type.toString()); write("\" "); write("value"); write("="); quote(); write(value); quote(); write("/>"); }
[ "private", "void", "inputButton", "(", "Type", "type", ",", "String", "value", ")", "throws", "IOException", "{", "write", "(", "\"<input type=\\\"\"", ")", ";", "write", "(", "type", ".", "toString", "(", ")", ")", ";", "write", "(", "\"\\\" \"", ")", "...
Classic submit or reset button. @param type submit or reset @param value caption on the button @throws IOException
[ "Classic", "submit", "or", "reset", "button", "." ]
21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a
https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/xhtml/XhtmlWriter.java#L404-L414
test
Output a button input.
Of course, here is the Java code you requested: ```java private void inputButton(Type type, String value) throws IOException { write("<input type=\""); write(type.toString()); write("\" "); write("value"); write("="); quote(); write(value); quote(); ...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/sqlutil/SQLUtilClient.java
SQLUtilClient.getDescendants
public List<Form> getDescendants( Form formToGetDescendantsForParam, boolean includeFieldDataParam, boolean includeTableFieldsParam, boolean inclTableFieldFormInfoParam) { if (formToGetDescendantsForParam != null && this.serviceTicket != null) { formToGetDescendantsForParam.setServiceTicket(this.servi...
java
public List<Form> getDescendants( Form formToGetDescendantsForParam, boolean includeFieldDataParam, boolean includeTableFieldsParam, boolean inclTableFieldFormInfoParam) { if (formToGetDescendantsForParam != null && this.serviceTicket != null) { formToGetDescendantsForParam.setServiceTicket(this.servi...
[ "public", "List", "<", "Form", ">", "getDescendants", "(", "Form", "formToGetDescendantsForParam", ",", "boolean", "includeFieldDataParam", ",", "boolean", "includeTableFieldsParam", ",", "boolean", "inclTableFieldFormInfoParam", ")", "{", "if", "(", "formToGetDescendants...
Retrieves all Descendants for the {@code formToGetTableFormsForParam}. @param formToGetDescendantsForParam The Fluid Form to get Descendants for. @param includeFieldDataParam Should Descendant (Form) Field data be included? @param includeTableFieldsParam Should Table Record (Form) Field data be included? @param inclTa...
[ "Retrieves", "all", "Descendants", "for", "the", "{", "@code", "formToGetTableFormsForParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/sqlutil/SQLUtilClient.java#L98-L123
test
Get a list of descendants for a form.
Of course, here is the Java code you requested: ```java public List<Form> getDescendants( Form formToGetDescendantsForParam, boolean includeFieldDataParam, boolean includeTableFieldsParam, boolean inclTableFieldFormInfoParam) { if (formToGetDescendantsForParam != null && this.serviceTicket != null) { ...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java
Generator.generate
public static void generate( ServletWriter out, Compiler compiler, Node.Nodes page) throws JasperException { Generator gen = new Generator(out, compiler); if (gen.isPoolingEnabled) { gen.compileTagHandlerPoolList(page); } if (gen.ctxt.isTagFi...
java
public static void generate( ServletWriter out, Compiler compiler, Node.Nodes page) throws JasperException { Generator gen = new Generator(out, compiler); if (gen.isPoolingEnabled) { gen.compileTagHandlerPoolList(page); } if (gen.ctxt.isTagFi...
[ "public", "static", "void", "generate", "(", "ServletWriter", "out", ",", "Compiler", "compiler", ",", "Node", ".", "Nodes", "page", ")", "throws", "JasperException", "{", "Generator", "gen", "=", "new", "Generator", "(", "out", ",", "compiler", ")", ";", ...
The main entry for Generator. @param out The servlet output writer @param compiler The compiler @param page The input page
[ "The", "main", "entry", "for", "Generator", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java#L3460-L3500
test
Generate the XML file.
Of course, here is the Java code you requested: ```java public static void generate( ServletWriter out, Compiler compiler, Node.Nodes page) throws JasperException { Generator gen = new Generator(out, compiler); if (gen.isPoolingEnabled) { gen.compileTagHand...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/WAMCompiledTermsPrintingVisitor.java
WAMCompiledTermsPrintingVisitor.visit
public void visit(Functor functor) { for (AllTermsVisitor printer : printers) { printer.visit(functor); } super.visit(functor); }
java
public void visit(Functor functor) { for (AllTermsVisitor printer : printers) { printer.visit(functor); } super.visit(functor); }
[ "public", "void", "visit", "(", "Functor", "functor", ")", "{", "for", "(", "AllTermsVisitor", "printer", ":", "printers", ")", "{", "printer", ".", "visit", "(", "functor", ")", ";", "}", "super", ".", "visit", "(", "functor", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/WAMCompiledTermsPrintingVisitor.java#L118-L126
test
Visit a RAID RECORD.
Of course, here is the Java code you requested: ```java public void visit(Functor functor) { for (AllTermsVisitor printer : printers) { printer.visit(functor); } super.visit(functor); } ``` Hope this helps!
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientElement.java
OrientElement.removeRecord
void removeRecord() { checkIfAttached(); final OrientBaseGraph graph = getGraph(); graph.setCurrentGraphInThreadLocal(); graph.autoStartTransaction(); if (checkDeletedInTx()) graph.throwRecordNotFoundException(getIdentity(), "The graph element with id " + getIdentity() + " not found"); ...
java
void removeRecord() { checkIfAttached(); final OrientBaseGraph graph = getGraph(); graph.setCurrentGraphInThreadLocal(); graph.autoStartTransaction(); if (checkDeletedInTx()) graph.throwRecordNotFoundException(getIdentity(), "The graph element with id " + getIdentity() + " not found"); ...
[ "void", "removeRecord", "(", ")", "{", "checkIfAttached", "(", ")", ";", "final", "OrientBaseGraph", "graph", "=", "getGraph", "(", ")", ";", "graph", ".", "setCurrentGraphInThreadLocal", "(", ")", ";", "graph", ".", "autoStartTransaction", "(", ")", ";", "i...
Removes the Element from the Graph. In case the element is a Vertex, all the incoming and outgoing edges are automatically removed too.
[ "Removes", "the", "Element", "from", "the", "Graph", ".", "In", "case", "the", "element", "is", "a", "Vertex", "all", "the", "incoming", "and", "outgoing", "edges", "are", "automatically", "removed", "too", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientElement.java#L106-L122
test
Removes the record from the database.
Of course, here is the Java code you requested: ```java void removeRecord() { checkIfAttached(); final OrientBaseGraph graph = getGraph(); graph.setCurrentGraphInThreadLocal(); graph.autoStartTransaction(); if (checkDeletedInTx()) graph.throwRecordNotFoundException(getIdentity(), "The graph...
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/sqlgen/DbEntitySql.java
DbEntitySql.find
public DbSqlBuilder find(final Class target, final Object matchEntity) { final String tableRef = createTableRefName(target); return sql().$(SELECT).column(tableRef).$(FROM).table(target, tableRef).$(WHERE).match(tableRef, matchEntity); }
java
public DbSqlBuilder find(final Class target, final Object matchEntity) { final String tableRef = createTableRefName(target); return sql().$(SELECT).column(tableRef).$(FROM).table(target, tableRef).$(WHERE).match(tableRef, matchEntity); }
[ "public", "DbSqlBuilder", "find", "(", "final", "Class", "target", ",", "final", "Object", "matchEntity", ")", "{", "final", "String", "tableRef", "=", "createTableRefName", "(", "target", ")", ";", "return", "sql", "(", ")", ".", "$", "(", "SELECT", ")", ...
Creates SELECT criteria for the entity matched by non-null values.
[ "Creates", "SELECT", "criteria", "for", "the", "entity", "matched", "by", "non", "-", "null", "values", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/sqlgen/DbEntitySql.java#L198-L201
test
Find by entity.
Of course, here is the Java code you requested: ```java public DbSqlBuilder find(final Class target, final Object matchEntity) { final String tableRef = createTableRefName(target); return sql().$(SELECT).column(tableRef).$(FROM).table(target, tableRef).$(WHERE).match(tableRef, matchEntity); } ``` Hope this helps...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/DefaultErrorHandler.java
DefaultErrorHandler.javacError
public void javacError(JavacErrorDetail[] details) throws JasperException { if (details == null) { return; } Object[] args = null; StringBuilder buf = new StringBuilder(); for (int i=0; i < details.length; i++) { if (details[i].getJspBeginLineNumber() >= 0) { ...
java
public void javacError(JavacErrorDetail[] details) throws JasperException { if (details == null) { return; } Object[] args = null; StringBuilder buf = new StringBuilder(); for (int i=0; i < details.length; i++) { if (details[i].getJspBeginLineNumber() >= 0) { ...
[ "public", "void", "javacError", "(", "JavacErrorDetail", "[", "]", "details", ")", "throws", "JasperException", "{", "if", "(", "details", "==", "null", ")", "{", "return", ";", "}", "Object", "[", "]", "args", "=", "null", ";", "StringBuilder", "buf", "...
/* Processes the given javac compilation errors. @param details Array of JavacErrorDetail instances corresponding to the compilation errors
[ "/", "*", "Processes", "the", "given", "javac", "compilation", "errors", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/DefaultErrorHandler.java#L101-L131
test
javacError Method.
Of course, here is the Java code you requested: ```java public void javacError(JavacErrorDetail[] details) throws JasperException { if (details == null) { return; } Object[] args = null; StringBuilder buf = new StringBuilder(); for (int i=0; i < details.length; i++) { ...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.skipWhile
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipWhile(Predicate<? super T> predicate) { ObjectHelper.requireNonNull(predicate, "predicate is null"); return RxJavaPlugins.onAssembly(new FlowableSk...
java
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipWhile(Predicate<? super T> predicate) { ObjectHelper.requireNonNull(predicate, "predicate is null"); return RxJavaPlugins.onAssembly(new FlowableSk...
[ "@", "CheckReturnValue", "@", "NonNull", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "skipWhile", "(", "Predicate", "<", ...
Returns a Flowable that skips all items emitted by the source Publisher as long as a specified condition holds true, but emits all further source items as soon as the condition becomes false. <p> <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipWhile.png" alt=""> <...
[ "Returns", "a", "Flowable", "that", "skips", "all", "items", "emitted", "by", "the", "source", "Publisher", "as", "long", "as", "a", "specified", "condition", "holds", "true", "but", "emits", "all", "further", "source", "items", "as", "soon", "as", "the", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L14415-L14422
test
Returns a sequence of tokens that skip the elements of this stream until the predicate evaluates to true.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipWhile(Predicate<? super T> predicate) { ObjectHelper.requireNonNull(predicate, "predicate is null"...
streamsets/datacollector
wholefile-transformer-lib/src/main/java/com/streamsets/pipeline/stage/processor/transformer/WholeFileTransformerProcessor.java
WholeFileTransformerProcessor.writeParquet
private void writeParquet(String sourceFileName, DataFileStream<GenericRecord> fileReader, Path tempParquetFile) throws StageException { long recordCount = 0; GenericRecord avroRecord; Schema schema = fileReader.getSchema(); LOG.debug("Start reading input file : {}", sourceFileName); try { //...
java
private void writeParquet(String sourceFileName, DataFileStream<GenericRecord> fileReader, Path tempParquetFile) throws StageException { long recordCount = 0; GenericRecord avroRecord; Schema schema = fileReader.getSchema(); LOG.debug("Start reading input file : {}", sourceFileName); try { //...
[ "private", "void", "writeParquet", "(", "String", "sourceFileName", ",", "DataFileStream", "<", "GenericRecord", ">", "fileReader", ",", "Path", "tempParquetFile", ")", "throws", "StageException", "{", "long", "recordCount", "=", "0", ";", "GenericRecord", "avroReco...
Convert Avro record to Parquet @param sourceFileName the source Avro file name @param fileReader the {@link org.apache.avro.file.DataFileStream} Avro file reader @param tempParquetFile the {@link java.nio.file.Path} temporary parquet file path
[ "Convert", "Avro", "record", "to", "Parquet" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/wholefile-transformer-lib/src/main/java/com/streamsets/pipeline/stage/processor/transformer/WholeFileTransformerProcessor.java#L284-L324
test
Write the parquet file.
Of course, here is the Java code you requested: ```java private void writeParquet(String sourceFileName, DataFileStream<GenericRecord> fileReader, Path tempParquetFile) throws StageException { long recordCount = 0; GenericRecord avroRecord; Schema schema = fileReader.getSchema(); LOG.debug("Start read...
khennig/jpql-querybuilder
src/main/java/com/tri/persistence/jpql/WhereItems.java
WhereItems.and
public WhereAnd and() { final WhereAnd and = new WhereAnd(builder()); items.add(and); return and; }
java
public WhereAnd and() { final WhereAnd and = new WhereAnd(builder()); items.add(and); return and; }
[ "public", "WhereAnd", "and", "(", ")", "{", "final", "WhereAnd", "and", "=", "new", "WhereAnd", "(", "builder", "(", ")", ")", ";", "items", ".", "add", "(", "and", ")", ";", "return", "and", ";", "}" ]
Adds an {@literal SQL} {@code AND} clause. @return the added {@code AND} clause as {@link WhereAnd} object
[ "Adds", "an", "{", "@literal", "SQL", "}", "{", "@code", "AND", "}", "clause", "." ]
61206f7c42631c67a49603b9beddccf48a8112e8
https://github.com/khennig/jpql-querybuilder/blob/61206f7c42631c67a49603b9beddccf48a8112e8/src/main/java/com/tri/persistence/jpql/WhereItems.java#L91-L95
test
Add an AND clause to the WhereAnd.
Of course, here is the Java code you requested: ```java public WhereAnd and() { final WhereAnd and = new WhereAnd(builder()); items.add(and); return and; } ``` Hope this helps!
jbundle/util
jbackup/src/main/java/org/jbundle/jbackup/source/BaseSource.java
BaseSource.initTransfer
public void initTransfer(Properties properties) { boolean bIncremental = false; String strSelected = properties.getProperty(BACKUP_INCREMENTAL_PARAM); if (TRUE.equalsIgnoreCase(strSelected)) bIncremental = true; String strDate = properties.getProperty(BACKUPDATE_PARAM); if (bIncremental) // If incremental...
java
public void initTransfer(Properties properties) { boolean bIncremental = false; String strSelected = properties.getProperty(BACKUP_INCREMENTAL_PARAM); if (TRUE.equalsIgnoreCase(strSelected)) bIncremental = true; String strDate = properties.getProperty(BACKUPDATE_PARAM); if (bIncremental) // If incremental...
[ "public", "void", "initTransfer", "(", "Properties", "properties", ")", "{", "boolean", "bIncremental", "=", "false", ";", "String", "strSelected", "=", "properties", ".", "getProperty", "(", "BACKUP_INCREMENTAL_PARAM", ")", ";", "if", "(", "TRUE", ".", "equalsI...
/* Set up everything to start processing
[ "/", "*", "Set", "up", "everything", "to", "start", "processing" ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/source/BaseSource.java#L62-L72
test
Initialize the transfer.
Of course, here is the Java code you requested: ```java public void initTransfer(Properties properties) { boolean bIncremental = false; String strSelected = properties.getProperty(BACKUP_INCREMENTAL_PARAM); if (TRUE.equalsIgnoreCase(strSelected)) bIncremental = true; String strDate = properties.getProperty...
google/guice
core/src/com/google/inject/internal/RealMapBinder.java
RealMapBinder.newRealMapBinder
public static <K, V> RealMapBinder<K, V> newRealMapBinder( Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Annotation annotation) { binder = binder.skipSources(RealMapBinder.class); return newRealMapBinder( binder, keyType, valueType, Key.get(mapOf(keyType,...
java
public static <K, V> RealMapBinder<K, V> newRealMapBinder( Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Annotation annotation) { binder = binder.skipSources(RealMapBinder.class); return newRealMapBinder( binder, keyType, valueType, Key.get(mapOf(keyType,...
[ "public", "static", "<", "K", ",", "V", ">", "RealMapBinder", "<", "K", ",", "V", ">", "newRealMapBinder", "(", "Binder", "binder", ",", "TypeLiteral", "<", "K", ">", "keyType", ",", "TypeLiteral", "<", "V", ">", "valueType", ",", "Annotation", "annotati...
Returns a new mapbinder that collects entries of {@code keyType}/{@code valueType} in a {@link Map} that is itself bound with {@code annotation}.
[ "Returns", "a", "new", "mapbinder", "that", "collects", "entries", "of", "{" ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/RealMapBinder.java#L86-L96
test
Create a new RealMapBinder.
Of course, here is the Java code you requested: ```java public static <K, V> RealMapBinder<K, V> newRealMapBinder( Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Annotation annotation) { binder = binder.skipSources(RealMapBinder.class); return newRealMapBinder( binder, k...
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GeodeSettings.java
GeodeSettings.getSecuredToken
@SuppressWarnings( { "unchecked", "rawtypes" }) public SecuredToken getSecuredToken(String username, String token) { Map<String, ?> credentials = getCredentials(); if (credentials == null) return null; List<Map<String, String>> users = (List) credentials.get("users"); if (users == null) return null...
java
@SuppressWarnings( { "unchecked", "rawtypes" }) public SecuredToken getSecuredToken(String username, String token) { Map<String, ?> credentials = getCredentials(); if (credentials == null) return null; List<Map<String, String>> users = (List) credentials.get("users"); if (users == null) return null...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "SecuredToken", "getSecuredToken", "(", "String", "username", ",", "String", "token", ")", "{", "Map", "<", "String", ",", "?", ">", "credentials", "=", "getCredential...
------------------------------------------------
[ "------------------------------------------------" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GeodeSettings.java#L231-L267
test
Returns a SecuredToken for the given username and token.
Of course, here is the Java code you requested: ```java @SuppressWarnings( { "unchecked", "rawtypes" }) public SecuredToken getSecuredToken(String username, String token) { Map<String, ?> credentials = getCredentials(); if (credentials == null) return null; List<Map<String, String>> users = (List) crede...
Unidata/thredds
waterml/src/main/java/ucar/nc2/ogc/erddap/util/ErddapString2.java
ErddapString2.indexOf
public static int indexOf(char[] cArray, char c, int fromIndex) { int cArrayLength = cArray.length; for (int index = Math.max(fromIndex, 0); index < cArrayLength; index++) { if (cArray[index] == c) return index; } return -1; }
java
public static int indexOf(char[] cArray, char c, int fromIndex) { int cArrayLength = cArray.length; for (int index = Math.max(fromIndex, 0); index < cArrayLength; index++) { if (cArray[index] == c) return index; } return -1; }
[ "public", "static", "int", "indexOf", "(", "char", "[", "]", "cArray", ",", "char", "c", ",", "int", "fromIndex", ")", "{", "int", "cArrayLength", "=", "cArray", ".", "length", ";", "for", "(", "int", "index", "=", "Math", ".", "max", "(", "fromIndex...
Finds the first instance of c at or after fromIndex (0.. ) in cArray. @param cArray @param c the char you want to find @param fromIndex the index number of the position to start the search @return The first instance of c. If not found, it returns -1.
[ "Finds", "the", "first", "instance", "of", "c", "at", "or", "after", "fromIndex", "(", "0", "..", ")", "in", "cArray", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/erddap/util/ErddapString2.java#L28-L35
test
Gets the index of a single element in a char array.
Of course, here is the Java code you requested: ```java public static int indexOf(char[] cArray, char c, int fromIndex) { int cArrayLength = cArray.length; for (int index = Math.max(fromIndex, 0); index < cArrayLength; index++) { if (cArray[index] == c) return index; ...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/rememberme/PersistentTokenBasedRememberMeServices.java
PersistentTokenBasedRememberMeServices.processAutoLoginCookie
protected UserDetails processAutoLoginCookie(String[] cookieTokens, HttpServletRequest request, HttpServletResponse response) { if (cookieTokens.length != 2) { throw new InvalidCookieException("Cookie token did not contain " + 2 + " tokens, but contained '" + Arrays.asList(cookieTokens) + "'"); } fin...
java
protected UserDetails processAutoLoginCookie(String[] cookieTokens, HttpServletRequest request, HttpServletResponse response) { if (cookieTokens.length != 2) { throw new InvalidCookieException("Cookie token did not contain " + 2 + " tokens, but contained '" + Arrays.asList(cookieTokens) + "'"); } fin...
[ "protected", "UserDetails", "processAutoLoginCookie", "(", "String", "[", "]", "cookieTokens", ",", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "if", "(", "cookieTokens", ".", "length", "!=", "2", ")", "{", "throw", "new", ...
Locates the presented cookie data in the token repository, using the series id. If the data compares successfully with that in the persistent store, a new token is generated and stored with the same series. The corresponding cookie value is set on the response. @param cookieTokens the series and token values @throws ...
[ "Locates", "the", "presented", "cookie", "data", "in", "the", "token", "repository", "using", "the", "series", "id", ".", "If", "the", "data", "compares", "successfully", "with", "that", "in", "the", "persistent", "store", "a", "new", "token", "is", "generat...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/rememberme/PersistentTokenBasedRememberMeServices.java#L92-L151
test
Process the cookie tokens that are used to auto - login the user.
Of course, here is the Java code you requested: ```java protected UserDetails processAutoLoginCookie(String[] cookieTokens, HttpServletRequest request, HttpServletResponse response) { if (cookieTokens.length != 2) { throw new InvalidCookieException("Cookie token did not contain " + 2 + " tokens, but cont...
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/lang/Strs.java
Strs.toBinary
public static String toBinary(int d, int width) { return Strs.cutRight(Integer.toBinaryString(d), width, '0'); }
java
public static String toBinary(int d, int width) { return Strs.cutRight(Integer.toBinaryString(d), width, '0'); }
[ "public", "static", "String", "toBinary", "(", "int", "d", ",", "int", "width", ")", "{", "return", "Strs", ".", "cutRight", "(", "Integer", ".", "toBinaryString", "(", "d", ")", ",", "width", ",", "'", "'", ")", ";", "}" ]
将一个整数转换成固定长度的二进制形式字符串 @param d 整数 @param width 宽度 @return 新字符串
[ "将一个整数转换成固定长度的二进制形式字符串" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/lang/Strs.java#L1633-L1635
test
Convert integer to binary string.
Of course, here is the Java code you requested: ```java public static String toBinary(int d, int width) { return Strs.cutRight(Integer.toBinaryString(d), width, '0'); } ``` Hope this helps!
RuedigerMoeller/fast-serialization
src/main/java/org/nustaq/serialization/FSTConfiguration.java
FSTConfiguration.getCPNameForClass
public String getCPNameForClass( Class cl ) { String res = minbinNamesReverse.get(cl.getName()); if (res == null) { if (cl.isAnonymousClass()) { return getCPNameForClass(cl.getSuperclass()); } return cl.getName(); } return res; }
java
public String getCPNameForClass( Class cl ) { String res = minbinNamesReverse.get(cl.getName()); if (res == null) { if (cl.isAnonymousClass()) { return getCPNameForClass(cl.getSuperclass()); } return cl.getName(); } return res; }
[ "public", "String", "getCPNameForClass", "(", "Class", "cl", ")", "{", "String", "res", "=", "minbinNamesReverse", ".", "get", "(", "cl", ".", "getName", "(", ")", ")", ";", "if", "(", "res", "==", "null", ")", "{", "if", "(", "cl", ".", "isAnonymous...
get cross platform symbolic class identifier @param cl @return
[ "get", "cross", "platform", "symbolic", "class", "identifier" ]
59f8f800b79479d0b9c80901cf55903d9b027f26
https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/FSTConfiguration.java#L1140-L1149
test
Get the CP name for a class.
Of course, here is the Java code you requested: ```java public String getCPNameForClass( Class cl ) { String res = minbinNamesReverse.get(cl.getName()); if (res == null) { if (cl.isAnonymousClass()) { return getCPNameForClass(cl.getSuperclass()); } re...
DigitalPebble/storm-crawler
core/src/main/java/com/digitalpebble/stormcrawler/filtering/URLFilters.java
URLFilters.fromConf
public static URLFilters fromConf(Map stormConf) { String configFile = ConfUtils.getString(stormConf, "urlfilters.config.file"); if (StringUtils.isNotBlank(configFile)) { try { return new URLFilters(stormConf, configFile); } catch (IOException e) ...
java
public static URLFilters fromConf(Map stormConf) { String configFile = ConfUtils.getString(stormConf, "urlfilters.config.file"); if (StringUtils.isNotBlank(configFile)) { try { return new URLFilters(stormConf, configFile); } catch (IOException e) ...
[ "public", "static", "URLFilters", "fromConf", "(", "Map", "stormConf", ")", "{", "String", "configFile", "=", "ConfUtils", ".", "getString", "(", "stormConf", ",", "\"urlfilters.config.file\"", ")", ";", "if", "(", "StringUtils", ".", "isNotBlank", "(", "configF...
Loads and configure the URLFilters based on the storm config if there is one otherwise returns an empty URLFilter.
[ "Loads", "and", "configure", "the", "URLFilters", "based", "on", "the", "storm", "config", "if", "there", "is", "one", "otherwise", "returns", "an", "empty", "URLFilter", "." ]
5d0465192ab8fbd89a90db32cb20960a282411ea
https://github.com/DigitalPebble/storm-crawler/blob/5d0465192ab8fbd89a90db32cb20960a282411ea/core/src/main/java/com/digitalpebble/stormcrawler/filtering/URLFilters.java#L62-L78
test
Get the URLFilters from the storm conf
Of course, here is the Java code you requested: ```java public static URLFilters fromConf(Map stormConf) { String configFile = ConfUtils.getString(stormConf, "urlfilters.config.file"); if (StringUtils.isNotBlank(configFile)) { try { return new URLFilters(sto...
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
WebMetaDataCreator.createWebAppDescriptor
private void createWebAppDescriptor(final Deployment dep, final JBossWebMetaData jbossWebMD) { WSLogger.ROOT_LOGGER.trace("Creating web.xml descriptor"); createServlets(dep, jbossWebMD); createServletMappings(dep, jbossWebMD); createSecurityConstraints(dep, jbossWebMD); createLog...
java
private void createWebAppDescriptor(final Deployment dep, final JBossWebMetaData jbossWebMD) { WSLogger.ROOT_LOGGER.trace("Creating web.xml descriptor"); createServlets(dep, jbossWebMD); createServletMappings(dep, jbossWebMD); createSecurityConstraints(dep, jbossWebMD); createLog...
[ "private", "void", "createWebAppDescriptor", "(", "final", "Deployment", "dep", ",", "final", "JBossWebMetaData", "jbossWebMD", ")", "{", "WSLogger", ".", "ROOT_LOGGER", ".", "trace", "(", "\"Creating web.xml descriptor\"", ")", ";", "createServlets", "(", "dep", ",...
Creates web.xml descriptor meta data. @param dep webservice deployment @param jbossWebMD jboss web meta data
[ "Creates", "web", ".", "xml", "descriptor", "meta", "data", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java#L91-L98
test
Create the web. xml descriptor.
Of course, here is the Java code you requested: ```java private void createWebAppDescriptor(final Deployment dep, final JBossWebMetaData jbossWebMD) { WSLogger.ROOT_LOGGER.trace("Creating web.xml descriptor"); createServlets(dep, jbossWebMD); createServletMappings(dep, jbossWebMD); crea...
leanix/leanix-sdk-java
src/main/java/net/leanix/api/common/ApiClient.java
ApiClient.setConnectTimeout
public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); return this; }
java
public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); return this; }
[ "public", "ApiClient", "setConnectTimeout", "(", "int", "connectionTimeout", ")", "{", "this", ".", "connectionTimeout", "=", "connectionTimeout", ";", "httpClient", ".", "property", "(", "ClientProperties", ".", "CONNECT_TIMEOUT", ",", "connectionTimeout", ")", ";", ...
Set the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 and {@link Integer#MAX_VALUE}.
[ "Set", "the", "connect", "timeout", "(", "in", "milliseconds", ")", ".", "A", "value", "of", "0", "means", "no", "timeout", "otherwise", "values", "must", "be", "between", "1", "and", "{" ]
9516ac593d6a8f73baccc516a45877b4e5920c47
https://github.com/leanix/leanix-sdk-java/blob/9516ac593d6a8f73baccc516a45877b4e5920c47/src/main/java/net/leanix/api/common/ApiClient.java#L311-L315
test
Sets the connection timeout for the HTTP client.
Of course, here is the Java code you requested: ```java public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); return this; } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/internal/util/QueueDrainHelper.java
QueueDrainHelper.createQueue
public static <T> SimpleQueue<T> createQueue(int capacityHint) { if (capacityHint < 0) { return new SpscLinkedArrayQueue<T>(-capacityHint); } return new SpscArrayQueue<T>(capacityHint); }
java
public static <T> SimpleQueue<T> createQueue(int capacityHint) { if (capacityHint < 0) { return new SpscLinkedArrayQueue<T>(-capacityHint); } return new SpscArrayQueue<T>(capacityHint); }
[ "public", "static", "<", "T", ">", "SimpleQueue", "<", "T", ">", "createQueue", "(", "int", "capacityHint", ")", "{", "if", "(", "capacityHint", "<", "0", ")", "{", "return", "new", "SpscLinkedArrayQueue", "<", "T", ">", "(", "-", "capacityHint", ")", ...
Creates a queue: spsc-array if capacityHint is positive and spsc-linked-array if capacityHint is negative; in both cases, the capacity is the absolute value of prefetch. @param <T> the value type of the queue @param capacityHint the capacity hint, negative value will create an array-based SPSC queue @return the queue i...
[ "Creates", "a", "queue", ":", "spsc", "-", "array", "if", "capacityHint", "is", "positive", "and", "spsc", "-", "linked", "-", "array", "if", "capacityHint", "is", "negative", ";", "in", "both", "cases", "the", "capacity", "is", "the", "absolute", "value",...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/util/QueueDrainHelper.java#L213-L218
test
Create a queue of objects with the specified capacity.
Of course, here is the Java code you requested: ```java public static <T> SimpleQueue<T> createQueue(int capacityHint) { if (capacityHint < 0) { return new SpscLinkedArrayQueue<T>(-capacityHint); } return new SpscArrayQueue<T>(capacityHint); } ``` Hope this helps!
alipay/sofa-bolt
src/main/java/com/alipay/remoting/rpc/RpcServer.java
RpcServer.oneway
public void oneway(final Url url, final Object request) throws RemotingException, InterruptedException { check(); this.rpcRemoting.oneway(url, request, null); }
java
public void oneway(final Url url, final Object request) throws RemotingException, InterruptedException { check(); this.rpcRemoting.oneway(url, request, null); }
[ "public", "void", "oneway", "(", "final", "Url", "url", ",", "final", "Object", "request", ")", "throws", "RemotingException", ",", "InterruptedException", "{", "check", "(", ")", ";", "this", ".", "rpcRemoting", ".", "oneway", "(", "url", ",", "request", ...
One way invocation using a parsed {@link Url} <br> <p> Notice:<br> <ol> <li><b>DO NOT modify the request object concurrently when this method is called.</b></li> <li>When do invocation, use the parsed {@link Url} to find a available client connection, if none then throw exception</li> </ol> @param url @param request @...
[ "One", "way", "invocation", "using", "a", "parsed", "{", "@link", "Url", "}", "<br", ">", "<p", ">", "Notice", ":", "<br", ">", "<ol", ">", "<li", ">", "<b", ">", "DO", "NOT", "modify", "the", "request", "object", "concurrently", "when", "this", "met...
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcServer.java#L430-L434
test
Oneway.
Of course, here is the Java code you requested: ```java public void oneway(final Url url, final Object request) throws RemotingException, InterruptedException { check(); this.rpcRemoting.oneway(url, request, null); } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/io/TextFiles.java
TextFiles.readLines
public static List<String> readLines(File f) throws IOException { return readLines(f, Charsets.DEFAULT); }
java
public static List<String> readLines(File f) throws IOException { return readLines(f, Charsets.DEFAULT); }
[ "public", "static", "List", "<", "String", ">", "readLines", "(", "File", "f", ")", "throws", "IOException", "{", "return", "readLines", "(", "f", ",", "Charsets", ".", "DEFAULT", ")", ";", "}" ]
Reads all the lines from the given {@code File} using the system's default charset. Note that the returned {@code List} is immutable. @param f the file to read. @return the file's lines. @throws NullPointerException if {@code f} is {@code null}. @throws IOException if {@code f} does not exist, or if it is a director...
[ "Reads", "all", "the", "lines", "from", "the", "given", "{", "@code", "File", "}", "using", "the", "system", "s", "default", "charset", ".", "Note", "that", "the", "returned", "{", "@code", "List", "}", "is", "immutable", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/TextFiles.java#L401-L404
test
Read lines from a file.
Of course, here is the Java code you requested: ```java public static List<String> readLines(File f) throws IOException { return readLines(f, Charsets.DEFAULT); } ``` Hope this helps!
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/doublemaps/SymbolTableImpl.java
SymbolTableImpl.put
public E put(SymbolKey key, L secondaryKey, E value) { // Extract the sequence key from the symbol key. int sequenceKey = ((SymbolKeyImpl) key).sequenceKey; // Create the field column for the secondary key, if it does not already exist. CircularArrayMap<E> field = fieldMap.get(secon...
java
public E put(SymbolKey key, L secondaryKey, E value) { // Extract the sequence key from the symbol key. int sequenceKey = ((SymbolKeyImpl) key).sequenceKey; // Create the field column for the secondary key, if it does not already exist. CircularArrayMap<E> field = fieldMap.get(secon...
[ "public", "E", "put", "(", "SymbolKey", "key", ",", "L", "secondaryKey", ",", "E", "value", ")", "{", "// Extract the sequence key from the symbol key.", "int", "sequenceKey", "=", "(", "(", "SymbolKeyImpl", ")", "key", ")", ".", "sequenceKey", ";", "// Create t...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/doublemaps/SymbolTableImpl.java#L319-L338
test
Put a value into the field map.
Of course, here is the Java code you requested: ```java public E put(SymbolKey key, L secondaryKey, E value) { // Extract the sequence key from the symbol key. int sequenceKey = ((SymbolKeyImpl) key).sequenceKey; // Create the field column for the secondary key, if it does not already exis...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/CommandLineParser.java
CommandLineParser.addTrailingPairsToProperties
public void addTrailingPairsToProperties(Properties properties) { if (trailingProperties != null) { for (Object propKey : trailingProperties.keySet()) { String name = (String) propKey; String value = trailingProperties.getProperty(name); ...
java
public void addTrailingPairsToProperties(Properties properties) { if (trailingProperties != null) { for (Object propKey : trailingProperties.keySet()) { String name = (String) propKey; String value = trailingProperties.getProperty(name); ...
[ "public", "void", "addTrailingPairsToProperties", "(", "Properties", "properties", ")", "{", "if", "(", "trailingProperties", "!=", "null", ")", "{", "for", "(", "Object", "propKey", ":", "trailingProperties", ".", "keySet", "(", ")", ")", "{", "String", "name...
If a command line has been parsed, calling this method sets all of its free arguments that were name=value pairs on the specified properties. @param properties The property set to add the name=value pairs to.
[ "If", "a", "command", "line", "has", "been", "parsed", "calling", "this", "method", "sets", "all", "of", "its", "free", "arguments", "that", "were", "name", "=", "value", "pairs", "on", "the", "specified", "properties", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/CommandLineParser.java#L569-L581
test
Add trailing pairs to properties.
Of course, here is the Java code you requested: ```java public void addTrailingPairsToProperties(Properties properties) { if (trailingProperties != null) { for (Object propKey : trailingProperties.keySet()) { String name = (String) propKey; St...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/mcidas/AreaServiceProvider.java
AreaServiceProvider.open
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); if (areaReader == null) areaReader = new AreaReader(); try { areaReader.init(raf.getLocation(), ncfile); } catch (Throwable e) { close(); ...
java
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); if (areaReader == null) areaReader = new AreaReader(); try { areaReader.init(raf.getLocation(), ncfile); } catch (Throwable e) { close(); ...
[ "public", "void", "open", "(", "RandomAccessFile", "raf", ",", "NetcdfFile", "ncfile", ",", "CancelTask", "cancelTask", ")", "throws", "IOException", "{", "super", ".", "open", "(", "raf", ",", "ncfile", ",", "cancelTask", ")", ";", "if", "(", "areaReader", ...
Open the service provider for reading. @param raf file to read from @param ncfile netCDF file we are writing to (memory) @param cancelTask task for cancelling @throws IOException problem reading file
[ "Open", "the", "service", "provider", "for", "reading", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/mcidas/AreaServiceProvider.java#L64-L81
test
This method is called by the SequenceFileTask to open the sequence file.
Of course, here is the Java code you requested: ```java public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); if (areaReader == null) areaReader = new AreaReader(); try { areaReader.init(raf.getLocation(), nc...
flow/noise
src/main/java/com/flowpowered/noise/Noise.java
Noise.valueNoise3D
public static double valueNoise3D(int x, int y, int z, int seed) { return intValueNoise3D(x, y, z, seed) / 2147483647.0; }
java
public static double valueNoise3D(int x, int y, int z, int seed) { return intValueNoise3D(x, y, z, seed) / 2147483647.0; }
[ "public", "static", "double", "valueNoise3D", "(", "int", "x", ",", "int", "y", ",", "int", "z", ",", "int", "seed", ")", "{", "return", "intValueNoise3D", "(", "x", ",", "y", ",", "z", ",", "seed", ")", "/", "2147483647.0", ";", "}" ]
Generates a value-noise value from the coordinates of a three-dimensional input value. @param x The @a x coordinate of the input value. @param y The @a y coordinate of the input value. @param z The @a z coordinate of the input value. @param seed A random number seed. @return The generated value-noise value. <p/> The r...
[ "Generates", "a", "value", "-", "noise", "value", "from", "the", "coordinates", "of", "a", "three", "-", "dimensional", "input", "value", "." ]
fe880dbbb09731ade59d9b4c0da6720b70f17509
https://github.com/flow/noise/blob/fe880dbbb09731ade59d9b4c0da6720b70f17509/src/main/java/com/flowpowered/noise/Noise.java#L256-L258
test
Returns the 3 - D noise value of a 3 - D vector.
Of course, here is the Java code you requested: ```java public static double valueNoise3D(int x, int y, int z, int seed) { return intValueNoise3D(x, y, z, seed) / 2147483647.0; } ``` Hope this helps!