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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jdcasey/vabr | api/src/main/java/org/commonjava/vertx/vabr/ApplicationRouter.java | ApplicationRouter.bind | public void bind( final RouteBinding handler )
{
final Method method = handler.getMethod();
logger.info( "Using appId: {} and default version: {}", appAcceptId, defaultVersion );
List<String> versions = handler.getVersions();
if ( versions == null || versions.isEmpty() )
{
... | java | public void bind( final RouteBinding handler )
{
final Method method = handler.getMethod();
logger.info( "Using appId: {} and default version: {}", appAcceptId, defaultVersion );
List<String> versions = handler.getVersions();
if ( versions == null || versions.isEmpty() )
{
... | [
"public",
"void",
"bind",
"(",
"final",
"RouteBinding",
"handler",
")",
"{",
"final",
"Method",
"method",
"=",
"handler",
".",
"getMethod",
"(",
")",
";",
"logger",
".",
"info",
"(",
"\"Using appId: {} and default version: {}\"",
",",
"appAcceptId",
",",
"defaul... | Specify a handler that will be called for all HTTP methods
@param pattern The simple pattern
@param handler The handler to call | [
"Specify",
"a",
"handler",
"that",
"will",
"be",
"called",
"for",
"all",
"HTTP",
"methods"
] | 625afdedb0a3513ce8ba9a38d4ab656b35fb315d | https://github.com/jdcasey/vabr/blob/625afdedb0a3513ce8ba9a38d4ab656b35fb315d/api/src/main/java/org/commonjava/vertx/vabr/ApplicationRouter.java#L513-L553 | test | Binds a RouteBinding to all the routes. | Of course, here is the Java code you requested:
```java
public void bind( final RouteBinding handler )
{
final Method method = handler.getMethod();
logger.info( "Using appId: {} and default version: {}", appAcceptId, defaultVersion );
List<String> versions = handler.getVersions();
... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.throttleFirst | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> throttleFirst(long skipDuration, TimeUnit unit, Scheduler scheduler) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
return RxJavaPlug... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> throttleFirst(long skipDuration, TimeUnit unit, Scheduler scheduler) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
return RxJavaPlug... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"throttleFirst",
"(",
"long",
"skipDuration",
",",
"TimeUnit",
"unit",
",",
"Scheduler",
"scheduler",
")",
"{",
"Object... | Returns an Observable that emits only the first item emitted by the source ObservableSource during sequential
time windows of a specified duration, where the windows are managed by a specified Scheduler.
<p>
This differs from {@link #throttleLast} in that this only tracks passage of time whereas
{@link #throttleLast} t... | [
"Returns",
"an",
"Observable",
"that",
"emits",
"only",
"the",
"first",
"item",
"emitted",
"by",
"the",
"source",
"ObservableSource",
"during",
"sequential",
"time",
"windows",
"of",
"a",
"specified",
"duration",
"where",
"the",
"windows",
"are",
"managed",
"by"... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L13201-L13207 | test | Throttle the source Observable to the first element of the source Observable. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> throttleFirst(long skipDuration, TimeUnit unit, Scheduler scheduler) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(s... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PreCompiler.java | PreCompiler.substituteBuiltIns | private void substituteBuiltIns(Term clause)
{
TermWalker walk =
TermWalkers.positionalWalker(new BuiltInTransformVisitor(interner, symbolTable, null, builtInTransform));
walk.walk(clause);
} | java | private void substituteBuiltIns(Term clause)
{
TermWalker walk =
TermWalkers.positionalWalker(new BuiltInTransformVisitor(interner, symbolTable, null, builtInTransform));
walk.walk(clause);
} | [
"private",
"void",
"substituteBuiltIns",
"(",
"Term",
"clause",
")",
"{",
"TermWalker",
"walk",
"=",
"TermWalkers",
".",
"positionalWalker",
"(",
"new",
"BuiltInTransformVisitor",
"(",
"interner",
",",
"symbolTable",
",",
"null",
",",
"builtInTransform",
")",
")",... | Substitutes built-ins within a clause, with their built-in definitions.
@param clause The clause to transform. | [
"Substitutes",
"built",
"-",
"ins",
"within",
"a",
"clause",
"with",
"their",
"built",
"-",
"in",
"definitions",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PreCompiler.java#L112-L117 | test | Substitute built ins in a given term. | Of course, here is the Java code you requested:
```java
private void substituteBuiltIns(Term clause)
{
TermWalker walk =
TermWalkers.positionalWalker(new BuiltInTransformVisitor(interner, symbolTable, null, builtInTransform));
walk.walk(clause);
}
```
Hope this helps! |
wildfly/wildfly | ee/src/main/java/org/jboss/as/ee/subsystem/EESubsystemParser10.java | EESubsystemParser10.readElement | @Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
// EE subsystem doesn't have any attributes, so make sure that the xml doesn't have any
requireNoAttributes(reader);
final ModelNode eeSubSystem = Util.createAddOperation(Path... | java | @Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
// EE subsystem doesn't have any attributes, so make sure that the xml doesn't have any
requireNoAttributes(reader);
final ModelNode eeSubSystem = Util.createAddOperation(Path... | [
"@",
"Override",
"public",
"void",
"readElement",
"(",
"XMLExtendedStreamReader",
"reader",
",",
"List",
"<",
"ModelNode",
">",
"list",
")",
"throws",
"XMLStreamException",
"{",
"// EE subsystem doesn't have any attributes, so make sure that the xml doesn't have any",
"requireN... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/subsystem/EESubsystemParser10.java#L58-L99 | test | Read the AE subsystem root resource. | Of course, here is the Java code you requested:
```java
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
// EE subsystem doesn't have any attributes, so make sure that the xml doesn't have any
requireNoAttributes(reader);
f... |
Unidata/thredds | dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DSP.java | D4DSP.build | protected void
build(DapDataset dmr, byte[] serialdata, ByteOrder order)
throws DapException
{
setDMR(dmr);
// "Compile" the databuffer section of the server response
this.databuffer = ByteBuffer.wrap(serialdata).order(order);
D4DataCompiler compiler = new D4DataCompi... | java | protected void
build(DapDataset dmr, byte[] serialdata, ByteOrder order)
throws DapException
{
setDMR(dmr);
// "Compile" the databuffer section of the server response
this.databuffer = ByteBuffer.wrap(serialdata).order(order);
D4DataCompiler compiler = new D4DataCompi... | [
"protected",
"void",
"build",
"(",
"DapDataset",
"dmr",
",",
"byte",
"[",
"]",
"serialdata",
",",
"ByteOrder",
"order",
")",
"throws",
"DapException",
"{",
"setDMR",
"(",
"dmr",
")",
";",
"// \"Compile\" the databuffer section of the server response",
"this",
".",
... | Build the data from the incoming serial data
Note that some DSP's will not use
@param dmr
@param serialdata
@param order
@throws DapException | [
"Build",
"the",
"data",
"from",
"the",
"incoming",
"serial",
"data",
"Note",
"that",
"some",
"DSP",
"s",
"will",
"not",
"use"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DSP.java#L100-L109 | test | Build the netadativ coding. | Of course, here is the Java code you requested:
```java
protected void
build(DapDataset dmr, byte[] serialdata, ByteOrder order)
throws DapException
{
setDMR(dmr);
// "Compile" the databuffer section of the server response
this.databuffer = ByteBuffer.wrap(serialdata).order(... |
ieb/sparsemapcontent | core/src/main/java/org/sakaiproject/nakamura/lite/storage/spi/types/Types.java | Types.storeMapToStream | public static InputStream storeMapToStream(String key, Map<String, Object> m, String type)
throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
dos.writeUTF(key);
writeMapToStream(m, dos);
//... | java | public static InputStream storeMapToStream(String key, Map<String, Object> m, String type)
throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
dos.writeUTF(key);
writeMapToStream(m, dos);
//... | [
"public",
"static",
"InputStream",
"storeMapToStream",
"(",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"m",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
... | the data isnt there. See the last writeUTF for an example. | [
"the",
"data",
"isnt",
"there",
".",
"See",
"the",
"last",
"writeUTF",
"for",
"an",
"example",
"."
] | 0570fdf868adbbf7734790cbc09fe66480e5f2dc | https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/lite/storage/spi/types/Types.java#L167-L181 | test | Store a map to an input stream. | Of course, here is the Java code you requested:
```java
public static InputStream storeMapToStream(String key, Map<String, Object> m, String type)
throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
dos.wr... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java | GempakGridReader.unpackGrib2Data | private float[] unpackGrib2Data(int iiword, int lendat, int[] iarray, float[] rarray) throws IOException {
long start = getOffset(iiword);
rf.seek(start);
Grib2Record gr = makeGribRecord(rf, start);
float[] data = gr.readData(rf);
if (((iarray[3] >> 6) & 1) == 0) { // -y scanning - flip
dat... | java | private float[] unpackGrib2Data(int iiword, int lendat, int[] iarray, float[] rarray) throws IOException {
long start = getOffset(iiword);
rf.seek(start);
Grib2Record gr = makeGribRecord(rf, start);
float[] data = gr.readData(rf);
if (((iarray[3] >> 6) & 1) == 0) { // -y scanning - flip
dat... | [
"private",
"float",
"[",
"]",
"unpackGrib2Data",
"(",
"int",
"iiword",
",",
"int",
"lendat",
",",
"int",
"[",
"]",
"iarray",
",",
"float",
"[",
"]",
"rarray",
")",
"throws",
"IOException",
"{",
"long",
"start",
"=",
"getOffset",
"(",
"iiword",
")",
";"... | Read packed Grib2 data
@param iiword Starting word (FORTRAN 1 based)
@param lendat Number of words
@param iarray integer packing info
@param rarray float packing info
@return unpacked data
@throws IOException problem reading file | [
"Read",
"packed",
"Grib2",
"data"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java#L645-L657 | test | Unpack a Grib2 record from the input stream. | Of course, here is the Java code you requested:
```java
private float[] unpackGrib2Data(int iiword, int lendat, int[] iarray, float[] rarray) throws IOException {
long start = getOffset(iiword);
rf.seek(start);
Grib2Record gr = makeGribRecord(rf, start);
float[] data = gr.readData(rf);
if (((iarr... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/ParserUtility.java | ParserUtility.removeCharsFromString | public static String removeCharsFromString(String inputStr, int start, int end) {
StringBuilder sb = new StringBuilder(inputStr);
sb.delete(start, end);
// if ((start > 0) && (inputStr.charAt(start - 1) ==' ')) {
// // if end with a space, then remove it as well.
// sb.deleteCharAt(sta... | java | public static String removeCharsFromString(String inputStr, int start, int end) {
StringBuilder sb = new StringBuilder(inputStr);
sb.delete(start, end);
// if ((start > 0) && (inputStr.charAt(start - 1) ==' ')) {
// // if end with a space, then remove it as well.
// sb.deleteCharAt(sta... | [
"public",
"static",
"String",
"removeCharsFromString",
"(",
"String",
"inputStr",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"inputStr",
")",
";",
"sb",
".",
"delete",
"(",
"start",
",",
"end"... | Removes the chars from string.
@param inputStr the input str
@param start the start
@param end the end
@return the string | [
"Removes",
"the",
"chars",
"from",
"string",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ParserUtility.java#L636-L644 | test | Remove chars from a string. | Of course, here is the Java code you requested:
```java
public static String removeCharsFromString(String inputStr, int start, int end) {
StringBuilder sb = new StringBuilder(inputStr);
sb.delete(start, end);
// if ((start > 0) && (inputStr.charAt(start - 1) ==' ')) {
// // if end with a spa... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/JNIMemoryManager.java | JNIMemoryManager.startCollectionThread | public void startCollectionThread()
{
synchronized (this)
{
if (mCollectionThread != null)
throw new RuntimeException("Thread already running");
mCollectionThread = new Thread(new Runnable()
{
public void run()
{
JNIReference ref = null;
try
... | java | public void startCollectionThread()
{
synchronized (this)
{
if (mCollectionThread != null)
throw new RuntimeException("Thread already running");
mCollectionThread = new Thread(new Runnable()
{
public void run()
{
JNIReference ref = null;
try
... | [
"public",
"void",
"startCollectionThread",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"mCollectionThread",
"!=",
"null",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Thread already running\"",
")",
";",
"mCollectionThread",
"=",
"new",
... | Starts a new Ferry collection thread that will wake up whenever a memory
reference needs clean-up from native code.
<p>
This thread is not started by default as Ferry calls {@link #gc()}
internally whenever a new Ferry object is allocated. But if you're
caching Ferry objects and hence avoiding new allocations, you may ... | [
"Starts",
"a",
"new",
"Ferry",
"collection",
"thread",
"that",
"will",
"wake",
"up",
"whenever",
"a",
"memory",
"reference",
"needs",
"clean",
"-",
"up",
"from",
"native",
"code",
".",
"<p",
">",
"This",
"thread",
"is",
"not",
"started",
"by",
"default",
... | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNIMemoryManager.java#L1362-L1400 | test | Start the Humble Ferry Collection Thread | Of course, here is the Java code you requested:
```java
public void startCollectionThread()
{
synchronized (this)
{
if (mCollectionThread != null)
throw new RuntimeException("Thread already running");
mCollectionThread = new Thread(new Runnable()
{
public void run()
... |
kocakosm/pitaya | src/org/kocakosm/pitaya/io/XFiles.java | XFiles.head | public static byte[] head(File f, int n) throws IOException
{
Parameters.checkCondition(n >= 0);
InputStream in = newInputStream(f);
byte[] buf = new byte[n];
try {
return XArrays.copyOf(buf, 0, in.read(buf));
} finally {
IO.close(in);
}
} | java | public static byte[] head(File f, int n) throws IOException
{
Parameters.checkCondition(n >= 0);
InputStream in = newInputStream(f);
byte[] buf = new byte[n];
try {
return XArrays.copyOf(buf, 0, in.read(buf));
} finally {
IO.close(in);
}
} | [
"public",
"static",
"byte",
"[",
"]",
"head",
"(",
"File",
"f",
",",
"int",
"n",
")",
"throws",
"IOException",
"{",
"Parameters",
".",
"checkCondition",
"(",
"n",
">=",
"0",
")",
";",
"InputStream",
"in",
"=",
"newInputStream",
"(",
"f",
")",
";",
"b... | Reads the first (up to {@code n}) bytes of the given {@code File}.
Named after the Unix command of the same name.
@param f the file to read.
@param n the maximum number of bytes to read.
@return the first bytes of the given {@code File}.
@throws NullPointerException if {@code f} is {@code null}.
@throws IllegalArgum... | [
"Reads",
"the",
"first",
"(",
"up",
"to",
"{",
"@code",
"n",
"}",
")",
"bytes",
"of",
"the",
"given",
"{",
"@code",
"File",
"}",
".",
"Named",
"after",
"the",
"Unix",
"command",
"of",
"the",
"same",
"name",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/XFiles.java#L306-L316 | test | Reads the first n bytes from the file. | Of course, here is the Java code you requested:
```java
public static byte[] head(File f, int n) throws IOException
{
Parameters.checkCondition(n >= 0);
InputStream in = newInputStream(f);
byte[] buf = new byte[n];
try {
return XArrays.copyOf(buf, 0, in.read(buf));
} finally {
IO.close(in);
}
}
```... |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java | TransactionalBidiTreeMap.nextSmaller | private Node<K,V> nextSmaller(final Node<K,V> node, final int index) {
Node<K,V> lval;
if (node == null) {
lval = null;
} else if (node.getLeft(index) != null) {
// everything to the node's left is smaller. The most of
// the right node's descendan... | java | private Node<K,V> nextSmaller(final Node<K,V> node, final int index) {
Node<K,V> lval;
if (node == null) {
lval = null;
} else if (node.getLeft(index) != null) {
// everything to the node's left is smaller. The most of
// the right node's descendan... | [
"private",
"Node",
"<",
"K",
",",
"V",
">",
"nextSmaller",
"(",
"final",
"Node",
"<",
"K",
",",
"V",
">",
"node",
",",
"final",
"int",
"index",
")",
"{",
"Node",
"<",
"K",
",",
"V",
">",
"lval",
";",
"if",
"(",
"node",
"==",
"null",
")",
"{",... | get the next smaller (previous) node from the specified node
@param node the node to be searched from
@param index KEY or VALUE
@return the specified node | [
"get",
"the",
"next",
"smaller",
"(",
"previous",
")",
"node",
"from",
"the",
"specified",
"node"
] | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1106-L1137 | test | Returns the next smaller node in the ancestry of the specified index. | Of course, here is the Java code you requested:
```java
private Node<K,V> nextSmaller(final Node<K,V> node, final int index) {
Node<K,V> lval;
if (node == null) {
lval = null;
} else if (node.getLeft(index) != null) {
// everything to the node's left is smalle... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/WebSocketClient.java | WebSocketClient.closeSession | public void closeSession() {
if(this.userSession == null) {
return;
}
try {
this.userSession.close();
} catch (IOException e) {
throw new FluidClientException(
"Unable to close session. "+e.getMessage(),
e,FluidClientException.ErrorCode.IO_ERROR);
}
} | java | public void closeSession() {
if(this.userSession == null) {
return;
}
try {
this.userSession.close();
} catch (IOException e) {
throw new FluidClientException(
"Unable to close session. "+e.getMessage(),
e,FluidClientException.ErrorCode.IO_ERROR);
}
} | [
"public",
"void",
"closeSession",
"(",
")",
"{",
"if",
"(",
"this",
".",
"userSession",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"this",
".",
"userSession",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{"... | Closes the Web Socket User session. | [
"Closes",
"the",
"Web",
"Socket",
"User",
"session",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/WebSocketClient.java#L164-L176 | test | Closes the user session. | Of course, here is the Java code you requested:
```java
public void closeSession() {
if(this.userSession == null) {
return;
}
try {
this.userSession.close();
} catch (IOException e) {
throw new FluidClientException(
"Unable to close session. "+e.getMessage(),
e,FluidClientException.ErrorCod... |
Unidata/thredds | grib/src/main/java/ucar/nc2/grib/coord/TimeCoordIntvDateValue.java | TimeCoordIntvDateValue.convertReferenceDate | public TimeCoordIntvValue convertReferenceDate(CalendarDate refDate, CalendarPeriod timeUnit) {
if (timeUnit == null) {
throw new IllegalArgumentException("null time unit");
}
int startOffset = timeUnit.getOffset(refDate, start); // LOOK wrong - not dealing with value ??
int endOffset = timeUnit... | java | public TimeCoordIntvValue convertReferenceDate(CalendarDate refDate, CalendarPeriod timeUnit) {
if (timeUnit == null) {
throw new IllegalArgumentException("null time unit");
}
int startOffset = timeUnit.getOffset(refDate, start); // LOOK wrong - not dealing with value ??
int endOffset = timeUnit... | [
"public",
"TimeCoordIntvValue",
"convertReferenceDate",
"(",
"CalendarDate",
"refDate",
",",
"CalendarPeriod",
"timeUnit",
")",
"{",
"if",
"(",
"timeUnit",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null time unit\"",
")",
";",
"}",
... | Calculate the offset in units of timeUnit from the given reference date? | [
"Calculate",
"the",
"offset",
"in",
"units",
"of",
"timeUnit",
"from",
"the",
"given",
"reference",
"date?"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/coord/TimeCoordIntvDateValue.java#L59-L66 | test | Convert a reference date to a TimeCoordIntvValue. | Of course, here is the Java code you requested:
```java
public TimeCoordIntvValue convertReferenceDate(CalendarDate refDate, CalendarPeriod timeUnit) {
if (timeUnit == null) {
throw new IllegalArgumentException("null time unit");
}
int startOffset = timeUnit.getOffset(refDate, start); // LOOK wrong... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/coverage2/CoverageViewer.java | CoverageViewer.makeActionsDataset | private void makeActionsDataset() {
/* choose local dataset
AbstractAction chooseLocalDatasetAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
String filename = fileChooser.chooseFilename();
if (filename == null) return;
Dataset invDs;
try { ... | java | private void makeActionsDataset() {
/* choose local dataset
AbstractAction chooseLocalDatasetAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
String filename = fileChooser.chooseFilename();
if (filename == null) return;
Dataset invDs;
try { ... | [
"private",
"void",
"makeActionsDataset",
"(",
")",
"{",
"/* choose local dataset\n AbstractAction chooseLocalDatasetAction = new AbstractAction() {\n public void actionPerformed(ActionEvent e) {\n String filename = fileChooser.chooseFilename();\n if (filename == null) return;\n\n ... | actions that control the dataset | [
"actions",
"that",
"control",
"the",
"dataset"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/coverage2/CoverageViewer.java#L357-L547 | test | Make the actions dataset | Of course, here is the Java code you requested:
```java
private void makeActionsDataset() {
/* choose local dataset
AbstractAction chooseLocalDatasetAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
String filename = fileChooser.chooseFilename();
if (filename ... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/MediaEncoded.java | MediaEncoded.setTimeBase | public void setTimeBase(Rational aBase) {
VideoJNI.MediaEncoded_setTimeBase(swigCPtr, this, Rational.getCPtr(aBase), aBase);
} | java | public void setTimeBase(Rational aBase) {
VideoJNI.MediaEncoded_setTimeBase(swigCPtr, this, Rational.getCPtr(aBase), aBase);
} | [
"public",
"void",
"setTimeBase",
"(",
"Rational",
"aBase",
")",
"{",
"VideoJNI",
".",
"MediaEncoded_setTimeBase",
"(",
"swigCPtr",
",",
"this",
",",
"Rational",
".",
"getCPtr",
"(",
"aBase",
")",
",",
"aBase",
")",
";",
"}"
] | Set the time base that time stamps of this object are represented in.<br>
<br>
@param aBase the new time base. If null an exception is thrown. | [
"Set",
"the",
"time",
"base",
"that",
"time",
"stamps",
"of",
"this",
"object",
"are",
"represented",
"in",
".",
"<br",
">",
"<br",
">"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/MediaEncoded.java#L119-L121 | test | Sets the time base of this media encoded. | Of course, here is the Java code you requested:
```java
public void setTimeBase(Rational aBase) {
VideoJNI.MediaEncoded_setTimeBase(swigCPtr, this, Rational.getCPtr(aBase), aBase);
}
```
Hope this helps! |
js-lib-com/tiny-container | src/main/java/js/net/EventStream.java | EventStream.getParameter | protected <T> T getParameter(String name, Class<T> type) {
if (parameters == null) {
throw new BugError("Event stream |%s| parameters not configured.", this);
}
String value = parameters.get(name);
if (value == null) {
throw new BugError("Missing event stream parameter |%s| of expected type |%s|.", ... | java | protected <T> T getParameter(String name, Class<T> type) {
if (parameters == null) {
throw new BugError("Event stream |%s| parameters not configured.", this);
}
String value = parameters.get(name);
if (value == null) {
throw new BugError("Missing event stream parameter |%s| of expected type |%s|.", ... | [
"protected",
"<",
"T",
">",
"T",
"getParameter",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"parameters",
"==",
"null",
")",
"{",
"throw",
"new",
"BugError",
"(",
"\"Event stream |%s| parameters not configured.\"",
",",
... | Get named parameter throwing exception if not found.
@param name requested parameter name,
@param type desired parameter type.
@param <T> parameter type.
@return named parameter instance.
@throws BugError if named parameter does not exist. | [
"Get",
"named",
"parameter",
"throwing",
"exception",
"if",
"not",
"found",
"."
] | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/net/EventStream.java#L329-L338 | test | Returns the value of the named parameter of the given type. | Of course, here is the Java code you requested:
```java
protected <T> T getParameter(String name, Class<T> type) {
if (parameters == null) {
throw new BugError("Event stream |%s| parameters not configured.", this);
}
String value = parameters.get(name);
if (value == null) {
throw new BugError("Miss... |
FitLayout/api | src/main/java/org/fit/layout/model/Rectangular.java | Rectangular.intersection | public Rectangular intersection(Rectangular other)
{
if (this.intersects(other))
{
return new Rectangular(Math.max(x1, other.x1),
Math.max(y1, other.y1),
Math.min(x2, other.x2),
Math.min(y2, other.y2));
}
else
{
return new Rectangular... | java | public Rectangular intersection(Rectangular other)
{
if (this.intersects(other))
{
return new Rectangular(Math.max(x1, other.x1),
Math.max(y1, other.y1),
Math.min(x2, other.x2),
Math.min(y2, other.y2));
}
else
{
return new Rectangular... | [
"public",
"Rectangular",
"intersection",
"(",
"Rectangular",
"other",
")",
"{",
"if",
"(",
"this",
".",
"intersects",
"(",
"other",
")",
")",
"{",
"return",
"new",
"Rectangular",
"(",
"Math",
".",
"max",
"(",
"x1",
",",
"other",
".",
"x1",
")",
",",
... | Computes the intersection of this rectangle with another one.
@param other the other rectangle
@return the resulting intersection or an empty rectangle when there is no intersection | [
"Computes",
"the",
"intersection",
"of",
"this",
"rectangle",
"with",
"another",
"one",
"."
] | fcfa67ce2a7485fbd722576413191fff5d68bae8 | https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/model/Rectangular.java#L281-L294 | test | Intersects this rectangle with another rectangle. | Of course, here is the Java code you requested:
```java
public Rectangular intersection(Rectangular other)
{
if (this.intersects(other))
{
return new Rectangular(Math.max(x1, other.x1),
Math.max(y1, other.y1),
Math.min(x2, other.x2),
Math.min(y2, other.y2))... |
prolificinteractive/ParallaxPager | example/src/main/java/com/prolificinteractive/parallaxproject/ParallaxActivity.java | ParallaxActivity.onCreate | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parallax);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.content, new ParallaxFragment())
.commit();
... | java | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parallax);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.content, new ParallaxFragment())
.commit();
... | [
"@",
"Override",
"protected",
"void",
"onCreate",
"(",
"Bundle",
"savedInstanceState",
")",
"{",
"super",
".",
"onCreate",
"(",
"savedInstanceState",
")",
";",
"setContentView",
"(",
"R",
".",
"layout",
".",
"activity_parallax",
")",
";",
"if",
"(",
"savedInst... | } | [
"}"
] | 1e76f85cf20e7cf9fa36247a3ebedd60495f057e | https://github.com/prolificinteractive/ParallaxPager/blob/1e76f85cf20e7cf9fa36247a3ebedd60495f057e/example/src/main/java/com/prolificinteractive/parallaxproject/ParallaxActivity.java#L27-L37 | test | Override onCreate to add a ParallaxFragment to the content view. | Of course, here is the Java code you requested:
```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parallax);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.i... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.printFunction | public void printFunction(DifferentialFunction differentialFunction) {
if (!logExecution)
return;
if (differentialFunction instanceof SDVariable)
return;
StringBuilder argShapes = new StringBuilder();
for (val arg : differentialFunction.args()) {
argS... | java | public void printFunction(DifferentialFunction differentialFunction) {
if (!logExecution)
return;
if (differentialFunction instanceof SDVariable)
return;
StringBuilder argShapes = new StringBuilder();
for (val arg : differentialFunction.args()) {
argS... | [
"public",
"void",
"printFunction",
"(",
"DifferentialFunction",
"differentialFunction",
")",
"{",
"if",
"(",
"!",
"logExecution",
")",
"return",
";",
"if",
"(",
"differentialFunction",
"instanceof",
"SDVariable",
")",
"return",
";",
"StringBuilder",
"argShapes",
"="... | Print the given function for debugging (will not print functions)
@param differentialFunction the function to print | [
"Print",
"the",
"given",
"function",
"for",
"debugging",
"(",
"will",
"not",
"print",
"functions",
")"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L5990-L6021 | test | Print the result of a single function | Of course, here is the Java code you requested:
```java
public void printFunction(DifferentialFunction differentialFunction) {
if (!logExecution)
return;
if (differentialFunction instanceof SDVariable)
return;
StringBuilder argShapes = new StringBuilder();
for (... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/AbstractCssImportPreProcessor.java | AbstractCssImportPreProcessor.createImportedResource | private Resource createImportedResource(final String resourceUri, final String importUrl) {
final String absoluteUrl = uriLocatorFactory.getInstance(importUrl) != null ? importUrl
: computeAbsoluteUrl(resourceUri, importUrl);
return Resource.create(absoluteUrl, ResourceType.CSS);
} | java | private Resource createImportedResource(final String resourceUri, final String importUrl) {
final String absoluteUrl = uriLocatorFactory.getInstance(importUrl) != null ? importUrl
: computeAbsoluteUrl(resourceUri, importUrl);
return Resource.create(absoluteUrl, ResourceType.CSS);
} | [
"private",
"Resource",
"createImportedResource",
"(",
"final",
"String",
"resourceUri",
",",
"final",
"String",
"importUrl",
")",
"{",
"final",
"String",
"absoluteUrl",
"=",
"uriLocatorFactory",
".",
"getInstance",
"(",
"importUrl",
")",
"!=",
"null",
"?",
"import... | Build a {@link Resource} object from a found importedResource inside a given resource. | [
"Build",
"a",
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/AbstractCssImportPreProcessor.java#L191-L195 | test | Create imported resource. | Of course, here is the Java code you requested:
```java
private Resource createImportedResource(final String resourceUri, final String importUrl) {
final String absoluteUrl = uriLocatorFactory.getInstance(importUrl) != null ? importUrl
: computeAbsoluteUrl(resourceUri, importUrl);
return Resource.creat... |
RestComm/jain-slee | container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/NonRootSbbEntityID.java | NonRootSbbEntityID.readExternal | @Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
parentSbbEntityID = (SbbEntityID) in.readObject();
parentChildRelation = in.readUTF();
childID = in.readUTF();
} | java | @Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
parentSbbEntityID = (SbbEntityID) in.readObject();
parentChildRelation = in.readUTF();
childID = in.readUTF();
} | [
"@",
"Override",
"public",
"void",
"readExternal",
"(",
"ObjectInput",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"parentSbbEntityID",
"=",
"(",
"SbbEntityID",
")",
"in",
".",
"readObject",
"(",
")",
";",
"parentChildRelation",
"=",
... | /*
(non-Javadoc)
@see java.io.Externalizable#readExternal(java.io.ObjectInput) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/NonRootSbbEntityID.java#L137-L143 | test | Method called to read the external representation of the SbbEntityID object. | Of course, here is the Java code you requested:
```java
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
parentSbbEntityID = (SbbEntityID) in.readObject();
parentChildRelation = in.readUTF();
childID = in.readUTF();
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java | BaseComplexNDArray.mmuli | @Override
public IComplexNDArray mmuli(INDArray other, INDArray result) {
IComplexNDArray otherArray = (IComplexNDArray) other;
IComplexNDArray resultArray = (IComplexNDArray) result;
if (other.shape().length > 2) {
for (int i = 0; i < other.slices(); i++) {
re... | java | @Override
public IComplexNDArray mmuli(INDArray other, INDArray result) {
IComplexNDArray otherArray = (IComplexNDArray) other;
IComplexNDArray resultArray = (IComplexNDArray) result;
if (other.shape().length > 2) {
for (int i = 0; i < other.slices(); i++) {
re... | [
"@",
"Override",
"public",
"IComplexNDArray",
"mmuli",
"(",
"INDArray",
"other",
",",
"INDArray",
"result",
")",
"{",
"IComplexNDArray",
"otherArray",
"=",
"(",
"IComplexNDArray",
")",
"other",
";",
"IComplexNDArray",
"resultArray",
"=",
"(",
"IComplexNDArray",
")... | Perform an copy matrix multiplication
@param other the other matrix to perform matrix multiply with
@param result the result ndarray
@return the result of the matrix multiplication | [
"Perform",
"an",
"copy",
"matrix",
"multiplication"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L2550-L2616 | test | Multiplies the two arrays | Of course, here is the Java code you requested:
```java
@Override
public IComplexNDArray mmuli(INDArray other, INDArray result) {
IComplexNDArray otherArray = (IComplexNDArray) other;
IComplexNDArray resultArray = (IComplexNDArray) result;
if (other.shape().length > 2) {
for ... |
playframework/playframework | core/play/src/main/java/play/inject/BindingKey.java | BindingKey.to | public Binding<T> to(final Class<? extends T> implementation) {
return underlying.to(implementation).asJava();
} | java | public Binding<T> to(final Class<? extends T> implementation) {
return underlying.to(implementation).asJava();
} | [
"public",
"Binding",
"<",
"T",
">",
"to",
"(",
"final",
"Class",
"<",
"?",
"extends",
"T",
">",
"implementation",
")",
"{",
"return",
"underlying",
".",
"to",
"(",
"implementation",
")",
".",
"asJava",
"(",
")",
";",
"}"
] | Bind this binding key to the given implementation class.
<p>This class will be instantiated and injected by the injection framework. | [
"Bind",
"this",
"binding",
"key",
"to",
"the",
"given",
"implementation",
"class",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/inject/BindingKey.java#L126-L128 | test | Returns a binding to the given implementation. | Of course, here is the Java code you requested:
```java
public Binding<T> to(final Class<? extends T> implementation) {
return underlying.to(implementation).asJava();
}
```
Hope this helps! |
medcl/elasticsearch-analysis-ik | src/main/java/org/wltea/analyzer/lucene/IKAnalyzer.java | IKAnalyzer.createComponents | @Override
protected TokenStreamComponents createComponents(String fieldName) {
Tokenizer _IKTokenizer = new IKTokenizer(configuration);
return new TokenStreamComponents(_IKTokenizer);
} | java | @Override
protected TokenStreamComponents createComponents(String fieldName) {
Tokenizer _IKTokenizer = new IKTokenizer(configuration);
return new TokenStreamComponents(_IKTokenizer);
} | [
"@",
"Override",
"protected",
"TokenStreamComponents",
"createComponents",
"(",
"String",
"fieldName",
")",
"{",
"Tokenizer",
"_IKTokenizer",
"=",
"new",
"IKTokenizer",
"(",
"configuration",
")",
";",
"return",
"new",
"TokenStreamComponents",
"(",
"_IKTokenizer",
")",... | 重载Analyzer接口,构造分词组件 | [
"重载Analyzer接口,构造分词组件"
] | a1d6ba8ca206d750e68bbf3e53a25284100174bd | https://github.com/medcl/elasticsearch-analysis-ik/blob/a1d6ba8ca206d750e68bbf3e53a25284100174bd/src/main/java/org/wltea/analyzer/lucene/IKAnalyzer.java#L61-L65 | test | Create a TokenStreamComponents object. | Of course, here is the Java code you requested:
```java
@Override
protected TokenStreamComponents createComponents(String fieldName) {
Tokenizer _IKTokenizer = new IKTokenizer(configuration);
return new TokenStreamComponents(_IKTokenizer);
}
```
Hope this helps! |
google/guice | core/src/com/google/inject/spi/InjectionPoint.java | InjectionPoint.overrides | private static boolean overrides(Method a, Method b) {
// See JLS section 8.4.8.1
int modifiers = b.getModifiers();
if (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) {
return true;
}
if (Modifier.isPrivate(modifiers)) {
return false;
}
// b must be package-priv... | java | private static boolean overrides(Method a, Method b) {
// See JLS section 8.4.8.1
int modifiers = b.getModifiers();
if (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) {
return true;
}
if (Modifier.isPrivate(modifiers)) {
return false;
}
// b must be package-priv... | [
"private",
"static",
"boolean",
"overrides",
"(",
"Method",
"a",
",",
"Method",
"b",
")",
"{",
"// See JLS section 8.4.8.1",
"int",
"modifiers",
"=",
"b",
".",
"getModifiers",
"(",
")",
";",
"if",
"(",
"Modifier",
".",
"isPublic",
"(",
"modifiers",
")",
"|... | Returns true if a overrides b. Assumes signatures of a and b are the same and a's declaring
class is a subclass of b's declaring class. | [
"Returns",
"true",
"if",
"a",
"overrides",
"b",
".",
"Assumes",
"signatures",
"of",
"a",
"and",
"b",
"are",
"the",
"same",
"and",
"a",
"s",
"declaring",
"class",
"is",
"a",
"subclass",
"of",
"b",
"s",
"declaring",
"class",
"."
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/spi/InjectionPoint.java#L816-L827 | test | Checks if two methods override the same type. | Of course, here is the Java code you requested:
```java
private static boolean overrides(Method a, Method b) {
// See JLS section 8.4.8.1
int modifiers = b.getModifiers();
if (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) {
return true;
}
if (Modifier.isPrivate(modifiers)) ... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/queues/WrapperQueue.java | WrapperQueue.requeue | private RequeueElementWrapper<E> requeue(E element, Object owner, AcquireState acquired)
{
RequeueElementWrapper<E> record = new RequeueElementWrapper<E>(element);
record.state = acquired;
record.owner = owner;
requeue.add(record);
requeuedElementMap.put(element, record);
... | java | private RequeueElementWrapper<E> requeue(E element, Object owner, AcquireState acquired)
{
RequeueElementWrapper<E> record = new RequeueElementWrapper<E>(element);
record.state = acquired;
record.owner = owner;
requeue.add(record);
requeuedElementMap.put(element, record);
... | [
"private",
"RequeueElementWrapper",
"<",
"E",
">",
"requeue",
"(",
"E",
"element",
",",
"Object",
"owner",
",",
"AcquireState",
"acquired",
")",
"{",
"RequeueElementWrapper",
"<",
"E",
">",
"record",
"=",
"new",
"RequeueElementWrapper",
"<",
"E",
">",
"(",
"... | Places an element onto the requeue buffer, in the acquired state by the specified owner.
@param element The element to place onto the requeue buffer.
@param owner The owner of the acquired element.
@param acquired The acquired state to set on the element in the requeue.
@return The requeue element wrapper for ... | [
"Places",
"an",
"element",
"onto",
"the",
"requeue",
"buffer",
"in",
"the",
"acquired",
"state",
"by",
"the",
"specified",
"owner",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/queues/WrapperQueue.java#L709-L718 | test | requeue a single element. | Of course, here is the Java code you requested:
```java
private RequeueElementWrapper<E> requeue(E element, Object owner, AcquireState acquired)
{
RequeueElementWrapper<E> record = new RequeueElementWrapper<E>(element);
record.state = acquired;
record.owner = owner;
requeue.add(reco... |
wildfly/wildfly | weld/subsystem/src/main/java/org/jboss/as/weld/WeldStartService.java | WeldStartService.stop | @Override
public void stop(final StopContext context) {
final WeldBootstrapService bootstrapService = bootstrapSupplier.get();
if (!bootstrapService.isStarted()) {
throw WeldLogger.ROOT_LOGGER.notStarted("WeldContainer");
}
WeldLogger.DEPLOYMENT_LOGGER.stoppingWeldService... | java | @Override
public void stop(final StopContext context) {
final WeldBootstrapService bootstrapService = bootstrapSupplier.get();
if (!bootstrapService.isStarted()) {
throw WeldLogger.ROOT_LOGGER.notStarted("WeldContainer");
}
WeldLogger.DEPLOYMENT_LOGGER.stoppingWeldService... | [
"@",
"Override",
"public",
"void",
"stop",
"(",
"final",
"StopContext",
"context",
")",
"{",
"final",
"WeldBootstrapService",
"bootstrapService",
"=",
"bootstrapSupplier",
".",
"get",
"(",
")",
";",
"if",
"(",
"!",
"bootstrapService",
".",
"isStarted",
"(",
")... | Stops the container
Executed in WeldStartService to shutdown the runtime before NamingService is closed.
@throws IllegalStateException if the container is not running | [
"Stops",
"the",
"container",
"Executed",
"in",
"WeldStartService",
"to",
"shutdown",
"the",
"runtime",
"before",
"NamingService",
"is",
"closed",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/weld/subsystem/src/main/java/org/jboss/as/weld/WeldStartService.java#L118-L135 | test | Stop the Weld container. | Of course, here is the Java code you requested:
```java
@Override
public void stop(final StopContext context) {
final WeldBootstrapService bootstrapService = bootstrapSupplier.get();
if (!bootstrapService.isStarted()) {
throw WeldLogger.ROOT_LOGGER.notStarted("WeldContainer");
}... |
jbundle/util | jbackup/src/main/java/org/jbundle/jbackup/destination/DebugDestination.java | DebugDestination.initTransfer | public void initTransfer(Properties properties)
{
super.initTransfer(properties);
String strPathname = properties.getProperty(LOG_FILENAME_PARAM);
if (strPathname != null)
if (strPathname.length() > 0)
{
try {
FileOutputStream fileOut = new FileOutputStream(strPathname);
streamOut = new Print... | java | public void initTransfer(Properties properties)
{
super.initTransfer(properties);
String strPathname = properties.getProperty(LOG_FILENAME_PARAM);
if (strPathname != null)
if (strPathname.length() > 0)
{
try {
FileOutputStream fileOut = new FileOutputStream(strPathname);
streamOut = new Print... | [
"public",
"void",
"initTransfer",
"(",
"Properties",
"properties",
")",
"{",
"super",
".",
"initTransfer",
"(",
"properties",
")",
";",
"String",
"strPathname",
"=",
"properties",
".",
"getProperty",
"(",
"LOG_FILENAME_PARAM",
")",
";",
"if",
"(",
"strPathname",... | /*
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/destination/DebugDestination.java#L69-L91 | test | Initialize the transfer. | Of course, here is the Java code you requested:
```java
public void initTransfer(Properties properties)
{
super.initTransfer(properties);
String strPathname = properties.getProperty(LOG_FILENAME_PARAM);
if (strPathname != null)
if (strPathname.length() > 0)
{
try {
FileOutputStream fileOut = new ... |
fracpete/ptstemmer-weka-package | src/main/java/weka/core/stemmers/PTStemmer.java | PTStemmer.setOptions | public void setOptions(String[] options) throws Exception {
String tmpStr;
tmpStr = Utils.getOption('S', options);
if (tmpStr.length() != 0)
setStemmer(new SelectedTag(tmpStr, TAGS_STEMMERS));
else
setStemmer(new SelectedTag(STEMMER_ORENGO, TAGS_STEMMERS));
tmpStr = Utils.getOption('N'... | java | public void setOptions(String[] options) throws Exception {
String tmpStr;
tmpStr = Utils.getOption('S', options);
if (tmpStr.length() != 0)
setStemmer(new SelectedTag(tmpStr, TAGS_STEMMERS));
else
setStemmer(new SelectedTag(STEMMER_ORENGO, TAGS_STEMMERS));
tmpStr = Utils.getOption('N'... | [
"public",
"void",
"setOptions",
"(",
"String",
"[",
"]",
"options",
")",
"throws",
"Exception",
"{",
"String",
"tmpStr",
";",
"tmpStr",
"=",
"Utils",
".",
"getOption",
"(",
"'",
"'",
",",
"options",
")",
";",
"if",
"(",
"tmpStr",
".",
"length",
"(",
... | Parses the options. <p/>
<!-- options-start -->
Valid options are: <p/>
<pre> -S <ORENGO|PORTER|SAVOY>
The type of stemmer algorithm to use:
ORENGO = Orengo
PORTER = Porter
SAVOY = Savoy
(default: ORENGO)</pre>
<pre> -N <file>
The file with the named entities to ignore (optional).
File format: simple tex... | [
"Parses",
"the",
"options",
".",
"<p",
"/",
">"
] | 58a038cff07e7bef2519bc9c2a2d641f0073bd6a | https://github.com/fracpete/ptstemmer-weka-package/blob/58a038cff07e7bef2519bc9c2a2d641f0073bd6a/src/main/java/weka/core/stemmers/PTStemmer.java#L209-L235 | test | Sets the options for this CRA. | Of course, here is the Java code you requested:
```java
public void setOptions(String[] options) throws Exception {
String tmpStr;
tmpStr = Utils.getOption('S', options);
if (tmpStr.length() != 0)
setStemmer(new SelectedTag(tmpStr, TAGS_STEMMERS));
else
setStemmer(new SelectedTag(STEMMER_O... |
Unidata/thredds | cdm/src/main/java/ucar/ma2/StructureDataW.java | StructureDataW.getJavaArrayInt | public int[] getJavaArrayInt(StructureMembers.Member m) {
Array data = getArray(m);
return (int []) data.getStorage();
} | java | public int[] getJavaArrayInt(StructureMembers.Member m) {
Array data = getArray(m);
return (int []) data.getStorage();
} | [
"public",
"int",
"[",
"]",
"getJavaArrayInt",
"(",
"StructureMembers",
".",
"Member",
"m",
")",
"{",
"Array",
"data",
"=",
"getArray",
"(",
"m",
")",
";",
"return",
"(",
"int",
"[",
"]",
")",
"data",
".",
"getStorage",
"(",
")",
";",
"}"
] | Get java int array for a member of type int.
@param m get data from this StructureMembers.Member. Must be of type int.
@return 1D java array of ints | [
"Get",
"java",
"int",
"array",
"for",
"a",
"member",
"of",
"type",
"int",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/StructureDataW.java#L176-L179 | test | Get the Java array int. | Of course, here is the Java code you requested:
```java
public int[] getJavaArrayInt(StructureMembers.Member m) {
Array data = getArray(m);
return (int []) data.getStorage();
}
```
Hope this helps! |
kocakosm/pitaya | src/org/kocakosm/pitaya/util/BaseEncoding.java | BaseEncoding.decode | public byte[] decode(String in, int off, int len)
{
return decode(in.substring(off, off + len));
} | java | public byte[] decode(String in, int off, int len)
{
return decode(in.substring(off, off + len));
} | [
"public",
"byte",
"[",
"]",
"decode",
"(",
"String",
"in",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"return",
"decode",
"(",
"in",
".",
"substring",
"(",
"off",
",",
"off",
"+",
"len",
")",
")",
";",
"}"
] | Decodes the specified range from the given encoded {@code String}
according to this {@code BaseEncoding}'s configuration. Decoding is
not case-sensitive when possible (namely for Base16, Base32 and
Base32Hex schemes).
@param in the input {@code String}.
@param off the input offset.
@param len the number of characters ... | [
"Decodes",
"the",
"specified",
"range",
"from",
"the",
"given",
"encoded",
"{",
"@code",
"String",
"}",
"according",
"to",
"this",
"{",
"@code",
"BaseEncoding",
"}",
"s",
"configuration",
".",
"Decoding",
"is",
"not",
"case",
"-",
"sensitive",
"when",
"possi... | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/BaseEncoding.java#L324-L327 | test | Decodes a string of bytes. | Of course, here is the Java code you requested:
```java
public byte[] decode(String in, int off, int len)
{
return decode(in.substring(off, off + len));
}
```
Hope this helps! |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/KeySetSnapshotFilter.java | KeySetSnapshotFilter.accept | @Override
public boolean accept(Entry<Object, Object> entry)
{
return keys != null && keys.contains(entry.getKey());
} | java | @Override
public boolean accept(Entry<Object, Object> entry)
{
return keys != null && keys.contains(entry.getKey());
} | [
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"Entry",
"<",
"Object",
",",
"Object",
">",
"entry",
")",
"{",
"return",
"keys",
"!=",
"null",
"&&",
"keys",
".",
"contains",
"(",
"entry",
".",
"getKey",
"(",
")",
")",
";",
"}"
] | -------------------------------------------------------- | [
"--------------------------------------------------------"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/KeySetSnapshotFilter.java#L26-L31 | test | Returns true if the entry is a CIDENTENTENT exception. | Of course, here is the Java code you requested:
```java
@Override
public boolean accept(Entry<Object, Object> entry)
{
return keys != null && keys.contains(entry.getKey());
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java | ComplexUtil.complexNumbersFor | public static IComplexNumber[] complexNumbersFor(float[] realComponents) {
IComplexNumber[] ret = new IComplexNumber[realComponents.length];
for (int i = 0; i < realComponents.length; i++)
ret[i] = Nd4j.createComplexNumber(realComponents[i], 0);
return ret;
} | java | public static IComplexNumber[] complexNumbersFor(float[] realComponents) {
IComplexNumber[] ret = new IComplexNumber[realComponents.length];
for (int i = 0; i < realComponents.length; i++)
ret[i] = Nd4j.createComplexNumber(realComponents[i], 0);
return ret;
} | [
"public",
"static",
"IComplexNumber",
"[",
"]",
"complexNumbersFor",
"(",
"float",
"[",
"]",
"realComponents",
")",
"{",
"IComplexNumber",
"[",
"]",
"ret",
"=",
"new",
"IComplexNumber",
"[",
"realComponents",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
... | Create complex number where the
@param realComponents the real components for the complex
@return the complex numbers based on the given real components | [
"Create",
"complex",
"number",
"where",
"the"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java#L66-L71 | test | Create a list of complex numbers for a real vector | Of course, here is the Java code you requested:
```java
public static IComplexNumber[] complexNumbersFor(float[] realComponents) {
IComplexNumber[] ret = new IComplexNumber[realComponents.length];
for (int i = 0; i < realComponents.length; i++)
ret[i] = Nd4j.createComplexNumber(realComponen... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Anbieter.java | Anbieter.getImmobilie | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public List<Immobilie> getImmobilie() {
if (immobilie == null) {
immobilie = new ArrayList<Immobilie>();
}
return this.immobilie;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public List<Immobilie> getImmobilie() {
if (immobilie == null) {
immobilie = new ArrayList<Immobilie>();
}
return this.immobilie;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:50:55+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"List",
"<",
"Immobilie",
">",
"getImmobilie",
"(",
")",
"{",
"if",
"(",
"immobilie"... | Gets the value of the immobilie property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the immobilie property.
<p>
For example, to a... | [
"Gets",
"the",
"value",
"of",
"the",
"immobilie",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Anbieter.java#L196-L202 | test | Gets the value of the immobilie property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public List<Immobilie> getImmobilie() {
if (immobilie == null) {
immobilie = new ArrayList<Immobilie>();
}
ret... |
grzesiek-galezowski/AutoFixtureGenerator | src/main/java/autofixture/publicinterface/Any.java | Any.mapBetween | @NonNull
public static <T, V> Map<T, V> mapBetween(final Class<T> keyClass, final Class<V> valueClass) {
assertIsNotParameterized(keyClass, "generic key types are not allowed for this method.");
assertIsNotParameterized(valueClass, "generic value types are not allowed for this method.");
return PrivateGen... | java | @NonNull
public static <T, V> Map<T, V> mapBetween(final Class<T> keyClass, final Class<V> valueClass) {
assertIsNotParameterized(keyClass, "generic key types are not allowed for this method.");
assertIsNotParameterized(valueClass, "generic value types are not allowed for this method.");
return PrivateGen... | [
"@",
"NonNull",
"public",
"static",
"<",
"T",
",",
"V",
">",
"Map",
"<",
"T",
",",
"V",
">",
"mapBetween",
"(",
"final",
"Class",
"<",
"T",
">",
"keyClass",
",",
"final",
"Class",
"<",
"V",
">",
"valueClass",
")",
"{",
"assertIsNotParameterized",
"("... | TODO variations | [
"TODO",
"variations"
] | a5e1146ec5109e6505f8aff604a20461ec86a57d | https://github.com/grzesiek-galezowski/AutoFixtureGenerator/blob/a5e1146ec5109e6505f8aff604a20461ec86a57d/src/main/java/autofixture/publicinterface/Any.java#L616-L621 | test | Returns a map of the given types between the two given types. | Of course, here is the Java code you requested:
```java
@NonNull
public static <T, V> Map<T, V> mapBetween(final Class<T> keyClass, final Class<V> valueClass) {
assertIsNotParameterized(keyClass, "generic key types are not allowed for this method.");
assertIsNotParameterized(valueClass, "generic value types ... |
streamsets/datacollector | net-commonlib/src/main/java/com/streamsets/pipeline/lib/parser/net/syslog/SyslogDecoder.java | SyslogDecoder.parseRfc5424Date | public static long parseRfc5424Date(LoadingCache<String, Long> cache, String tsStr) throws OnRecordErrorException {
boolean includesTimezone = true;
long ts;
int curPos = 0;
int msgLen = tsStr.length();
if (msgLen <= RFC5424_PREFIX_LEN) {
throw new OnRecordErrorException(Errors.SYSLOG_09, tsS... | java | public static long parseRfc5424Date(LoadingCache<String, Long> cache, String tsStr) throws OnRecordErrorException {
boolean includesTimezone = true;
long ts;
int curPos = 0;
int msgLen = tsStr.length();
if (msgLen <= RFC5424_PREFIX_LEN) {
throw new OnRecordErrorException(Errors.SYSLOG_09, tsS... | [
"public",
"static",
"long",
"parseRfc5424Date",
"(",
"LoadingCache",
"<",
"String",
",",
"Long",
">",
"cache",
",",
"String",
"tsStr",
")",
"throws",
"OnRecordErrorException",
"{",
"boolean",
"includesTimezone",
"=",
"true",
";",
"long",
"ts",
";",
"int",
"cur... | Parse date in RFC 5424 format. Uses an LRU cache to speed up parsing for
multiple messages that occur in the same second.
@param tsStr
@return Typical (for Java) milliseconds since UNIX epoch | [
"Parse",
"date",
"in",
"RFC",
"5424",
"format",
".",
"Uses",
"an",
"LRU",
"cache",
"to",
"speed",
"up",
"parsing",
"for",
"multiple",
"messages",
"that",
"occur",
"in",
"the",
"same",
"second",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/net-commonlib/src/main/java/com/streamsets/pipeline/lib/parser/net/syslog/SyslogDecoder.java#L267-L367 | test | Parse the RFC5424 date string. | Of course, here is the Java code you requested:
```java
public static long parseRfc5424Date(LoadingCache<String, Long> cache, String tsStr) throws OnRecordErrorException {
boolean includesTimezone = true;
long ts;
int curPos = 0;
int msgLen = tsStr.length();
if (msgLen <= RFC5424_PREFIX_LEN) {
... |
Unidata/thredds | ui/src/main/java/thredds/logs/LogReader.java | LogReader.scanLogFile | public void scanLogFile(File file, Closure closure, LogFilter logf, Stats stat) throws IOException {
try (InputStream ios = new FileInputStream(file)) {
System.out.printf("-----Reading %s %n", file.getPath());
BufferedReader dataIS = new BufferedReader(new InputStreamReader(ios,
CDM.utf8C... | java | public void scanLogFile(File file, Closure closure, LogFilter logf, Stats stat) throws IOException {
try (InputStream ios = new FileInputStream(file)) {
System.out.printf("-----Reading %s %n", file.getPath());
BufferedReader dataIS = new BufferedReader(new InputStreamReader(ios,
CDM.utf8C... | [
"public",
"void",
"scanLogFile",
"(",
"File",
"file",
",",
"Closure",
"closure",
",",
"LogFilter",
"logf",
",",
"Stats",
"stat",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"ios",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
")",
"{",... | Read a log file.
@param file file to read
@param closure send each Log to this closure
@param logf filter out these Logs (may be null)
@param stat accumulate statistics (may be null)
@throws IOException on read error | [
"Read",
"a",
"log",
"file",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/thredds/logs/LogReader.java#L227-L253 | test | Scans a log file for exceptions. | Of course, here is the Java code you requested:
```java
public void scanLogFile(File file, Closure closure, LogFilter logf, Stats stat) throws IOException {
try (InputStream ios = new FileInputStream(file)) {
System.out.printf("-----Reading %s %n", file.getPath());
BufferedReader dataIS = new Buffered... |
boonproject/boon | boon/src/main/java/org/boon/StringScanner.java | StringScanner.parseInt | public static int parseInt( String buffer, int from, int to ) {
return CharScanner.parseInt( FastStringUtils.toCharArray(buffer), from , to );
} | java | public static int parseInt( String buffer, int from, int to ) {
return CharScanner.parseInt( FastStringUtils.toCharArray(buffer), from , to );
} | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"buffer",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"return",
"CharScanner",
".",
"parseInt",
"(",
"FastStringUtils",
".",
"toCharArray",
"(",
"buffer",
")",
",",
"from",
",",
"to",
")",
";",
... | parse an int within a range
@param buffer input string
@return value | [
"parse",
"an",
"int",
"within",
"a",
"range"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/StringScanner.java#L234-L236 | test | Parse an int from a string. | Of course, here is the Java code you requested:
```java
public static int parseInt( String buffer, int from, int to ) {
return CharScanner.parseInt( FastStringUtils.toCharArray(buffer), from , to );
}
```
Hope this helps! |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/beans/ClassLoaderUtils.java | ClassLoaderUtils.getClassFileName | public static String getClassFileName(Class<?> clazz) {
if (clazz.isArray()) {
clazz = clazz.getComponentType();
}
return getClassFileName(clazz.getName());
} | java | public static String getClassFileName(Class<?> clazz) {
if (clazz.isArray()) {
clazz = clazz.getComponentType();
}
return getClassFileName(clazz.getName());
} | [
"public",
"static",
"String",
"getClassFileName",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
".",
"isArray",
"(",
")",
")",
"{",
"clazz",
"=",
"clazz",
".",
"getComponentType",
"(",
")",
";",
"}",
"return",
"getClassFileName",
... | 获取一个 class 所代表的文件名 | [
"获取一个",
"class",
"所代表的文件名"
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/beans/ClassLoaderUtils.java#L221-L226 | test | Get the file name of a class. | Of course, here is the Java code you requested:
```java
public static String getClassFileName(Class<?> clazz) {
if (clazz.isArray()) {
clazz = clazz.getComponentType();
}
return getClassFileName(clazz.getName());
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java | GrundstueckEmpfohleneNutzung.setWald | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setWald(JAXBElement<Object> value) {
this.wald = value;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setWald(JAXBElement<Object> value) {
this.wald = value;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:52:47+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"void",
"setWald",
"(",
"JAXBElement",
"<",
"Object",
">",
"value",
")",
"{",
"this"... | Sets the value of the wald property.
@param value
allowed object is
{@link JAXBElement }{@code <}{@link Object }{@code >} | [
"Sets",
"the",
"value",
"of",
"the",
"wald",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java#L834-L837 | test | Sets the value of the wald property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setWald(JAXBElement<Object> value) {
this.wald = value;
}
```
Hope this helps! |
wildfly/wildfly | ee/src/main/java/org/jboss/as/ee/component/ManagedReferenceMethodInterceptor.java | ManagedReferenceMethodInterceptor.processInvocation | public Object processInvocation(final InterceptorContext context) throws Exception {
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey);
final Object instance = reference.getInstance();
try {
return method... | java | public Object processInvocation(final InterceptorContext context) throws Exception {
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey);
final Object instance = reference.getInstance();
try {
return method... | [
"public",
"Object",
"processInvocation",
"(",
"final",
"InterceptorContext",
"context",
")",
"throws",
"Exception",
"{",
"final",
"ManagedReference",
"reference",
"=",
"(",
"ManagedReference",
")",
"context",
".",
"getPrivateData",
"(",
"ComponentInstance",
".",
"clas... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ManagedReferenceMethodInterceptor.java#L48-L60 | test | Process the invocation of the component. | Of course, here is the Java code you requested:
```java
public Object processInvocation(final InterceptorContext context) throws Exception {
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey);
final Object instance = referen... |
vdmeer/execs | src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java | Gen_ExecJarScripts.addOption | protected void addOption(ApplicationOption<?> option){
if(option!=null){
this.getCli().addOption(option);
this.options.add(option);
}
} | java | protected void addOption(ApplicationOption<?> option){
if(option!=null){
this.getCli().addOption(option);
this.options.add(option);
}
} | [
"protected",
"void",
"addOption",
"(",
"ApplicationOption",
"<",
"?",
">",
"option",
")",
"{",
"if",
"(",
"option",
"!=",
"null",
")",
"{",
"this",
".",
"getCli",
"(",
")",
".",
"addOption",
"(",
"option",
")",
";",
"this",
".",
"options",
".",
"add"... | Adds a new option to CLI parser and option list.
@param option new option, ignored if null | [
"Adds",
"a",
"new",
"option",
"to",
"CLI",
"parser",
"and",
"option",
"list",
"."
] | ac73170bfd449de1f460248d56ece57ff3b0c761 | https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java#L207-L212 | test | Add an application option to the command line. | Of course, here is the Java code you requested:
```java
protected void addOption(ApplicationOption<?> option){
if(option!=null){
this.getCli().addOption(option);
this.options.add(option);
}
}
```
Hope this helps! |
blademainer/common_utils | commons-file/src/main/java/info/monitorenter/cpdetector/io/AbstractCodepageDetector.java | AbstractCodepageDetector.open | public final Reader open(final URL url) throws IOException {
Reader ret = null;
Charset cs = this.detectCodepage(url);
if (cs != null) {
ret = new InputStreamReader(new BufferedInputStream(url.openStream()), cs);
}
return ret;
} | java | public final Reader open(final URL url) throws IOException {
Reader ret = null;
Charset cs = this.detectCodepage(url);
if (cs != null) {
ret = new InputStreamReader(new BufferedInputStream(url.openStream()), cs);
}
return ret;
} | [
"public",
"final",
"Reader",
"open",
"(",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"Reader",
"ret",
"=",
"null",
";",
"Charset",
"cs",
"=",
"this",
".",
"detectCodepage",
"(",
"url",
")",
";",
"if",
"(",
"cs",
"!=",
"null",
")",
"{",... | A default delegation to {@link #detectCodepage(java.net.URL)}that opens the document specified by the given URL with the
detected codepage.
<p>
@see ICodepageDetector#open(java.net.URL) | [
"A",
"default",
"delegation",
"to",
"{",
"@link",
"#detectCodepage",
"(",
"java",
".",
"net",
".",
"URL",
")",
"}",
"that",
"opens",
"the",
"document",
"specified",
"by",
"the",
"given",
"URL",
"with",
"the",
"detected",
"codepage",
".",
"<p",
">"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/commons-file/src/main/java/info/monitorenter/cpdetector/io/AbstractCodepageDetector.java#L102-L109 | test | Open a reader for the specified URL. | Of course, here is the Java code you requested:
```java
public final Reader open(final URL url) throws IOException {
Reader ret = null;
Charset cs = this.detectCodepage(url);
if (cs != null) {
ret = new InputStreamReader(new BufferedInputStream(url.openStream()), cs);
}
... |
Unidata/thredds | dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java | CDMUtil.containsVLEN | static public boolean
containsVLEN(List<Dimension> dimset)
{
if(dimset == null) return false;
for(Dimension dim : dimset) {
if(dim.isVariableLength())
return true;
}
return false;
} | java | static public boolean
containsVLEN(List<Dimension> dimset)
{
if(dimset == null) return false;
for(Dimension dim : dimset) {
if(dim.isVariableLength())
return true;
}
return false;
} | [
"static",
"public",
"boolean",
"containsVLEN",
"(",
"List",
"<",
"Dimension",
">",
"dimset",
")",
"{",
"if",
"(",
"dimset",
"==",
"null",
")",
"return",
"false",
";",
"for",
"(",
"Dimension",
"dim",
":",
"dimset",
")",
"{",
"if",
"(",
"dim",
".",
"is... | Test if any dimension is variable length | [
"Test",
"if",
"any",
"dimension",
"is",
"variable",
"length"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java#L236-L245 | test | Checks if the list of dimensions contains a variable length image. | Of course, here is the Java code you requested:
```java
static public boolean
containsVLEN(List<Dimension> dimset)
{
if(dimset == null) return false;
for(Dimension dim : dimset) {
if(dim.isVariableLength())
return true;
}
return false;
}
```
Hope... |
intellimate/IzouSDK | src/main/java/org/intellimate/izou/sdk/frameworks/music/events/PlayerError.java | PlayerError.createMusicPlayerError | public static Optional<PlayerError> createMusicPlayerError(Identification source, String error) {
if (error == null || error.isEmpty())
return Optional.empty();
try {
PlayerError playerError = new PlayerError(source);
playerError.addResource(new MusicErrorResource(sou... | java | public static Optional<PlayerError> createMusicPlayerError(Identification source, String error) {
if (error == null || error.isEmpty())
return Optional.empty();
try {
PlayerError playerError = new PlayerError(source);
playerError.addResource(new MusicErrorResource(sou... | [
"public",
"static",
"Optional",
"<",
"PlayerError",
">",
"createMusicPlayerError",
"(",
"Identification",
"source",
",",
"String",
"error",
")",
"{",
"if",
"(",
"error",
"==",
"null",
"||",
"error",
".",
"isEmpty",
"(",
")",
")",
"return",
"Optional",
".",
... | creates a new MusicPlayerError
@param source the source
@param error the error (not null and not empty)
@return the optional event | [
"creates",
"a",
"new",
"MusicPlayerError"
] | bc8705ad48a6ca12a722f2b787be435949fa5d08 | https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/events/PlayerError.java#L37-L47 | test | Create a MusicPlayerError object. | Of course, here is the Java code you requested:
```java
public static Optional<PlayerError> createMusicPlayerError(Identification source, String error) {
if (error == null || error.isEmpty())
return Optional.empty();
try {
PlayerError playerError = new PlayerError(source);
... |
abmargb/jamppa | src/main/java/org/jivesoftware/smack/RosterEntry.java | RosterEntry.equalsDeep | public boolean equalsDeep(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RosterEntry other = (RosterEntry) obj;
if (name == null) {
if (other.name != null)
... | java | public boolean equalsDeep(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RosterEntry other = (RosterEntry) obj;
if (name == null) {
if (other.name != null)
... | [
"public",
"boolean",
"equalsDeep",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"this",
"==",
"obj",
")",
"return",
"true",
";",
"if",
"(",
"obj",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"getClass",
"(",
")",
"!=",
"obj",
".",
"getClass... | Indicates whether some other object is "equal to" this by comparing all
members.
<p>
The {@link #equals(Object)} method returns <code>true</code> if the user
JIDs are equal.
@param obj
the reference object with which to compare.
@return <code>true</code> if this object is the same as the obj argument;
<code>false</cod... | [
"Indicates",
"whether",
"some",
"other",
"object",
"is",
"equal",
"to",
"this",
"by",
"comparing",
"all",
"members",
".",
"<p",
">",
"The",
"{",
"@link",
"#equals",
"(",
"Object",
")",
"}",
"method",
"returns",
"<code",
">",
"true<",
"/",
"code",
">",
... | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/RosterEntry.java#L228-L257 | test | This method compares two RosterEntry objects to see if they are equal. | Of course, here is the Java code you requested:
```java
public boolean equalsDeep(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RosterEntry other = (RosterEntry) obj;
... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasSetVector | public static int cublasSetVector (int n, cuDoubleComplex x[], int offsetx, int incx, Pointer y, int incy)
{
ByteBuffer byteBufferx = ByteBuffer.allocateDirect(x.length * 8 * 2);
byteBufferx.order(ByteOrder.nativeOrder());
DoubleBuffer doubleBufferx = byteBufferx.asDoubleBuffer();
... | java | public static int cublasSetVector (int n, cuDoubleComplex x[], int offsetx, int incx, Pointer y, int incy)
{
ByteBuffer byteBufferx = ByteBuffer.allocateDirect(x.length * 8 * 2);
byteBufferx.order(ByteOrder.nativeOrder());
DoubleBuffer doubleBufferx = byteBufferx.asDoubleBuffer();
... | [
"public",
"static",
"int",
"cublasSetVector",
"(",
"int",
"n",
",",
"cuDoubleComplex",
"x",
"[",
"]",
",",
"int",
"offsetx",
",",
"int",
"incx",
",",
"Pointer",
"y",
",",
"int",
"incy",
")",
"{",
"ByteBuffer",
"byteBufferx",
"=",
"ByteBuffer",
".",
"allo... | Extended wrapper for arrays of cuDoubleComplex values. Note that this method
only exists for convenience and compatibility with native C code. It
is much more efficient to provide a Pointer to a double array containing
the complex numbers, where each pair of consecutive numbers in the array
describes the real- and imag... | [
"Extended",
"wrapper",
"for",
"arrays",
"of",
"cuDoubleComplex",
"values",
".",
"Note",
"that",
"this",
"method",
"only",
"exists",
"for",
"convenience",
"and",
"compatibility",
"with",
"native",
"C",
"code",
".",
"It",
"is",
"much",
"more",
"efficient",
"to",... | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L634-L647 | test | Standard set vector. | Of course, here is the Java code you requested:
```java
public static int cublasSetVector (int n, cuDoubleComplex x[], int offsetx, int incx, Pointer y, int incy)
{
ByteBuffer byteBufferx = ByteBuffer.allocateDirect(x.length * 8 * 2);
byteBufferx.order(ByteOrder.nativeOrder());
DoubleBu... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.reduce | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> reduce(BiFunction<T, T, T> reducer) {
ObjectHelper.requireNonNull(reducer, "reducer is null");
return RxJavaPlugins.onAssembly(new ObservableReduceMaybe<T>(this, reducer));
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> reduce(BiFunction<T, T, T> reducer) {
ObjectHelper.requireNonNull(reducer, "reducer is null");
return RxJavaPlugins.onAssembly(new ObservableReduceMaybe<T>(this, reducer));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Maybe",
"<",
"T",
">",
"reduce",
"(",
"BiFunction",
"<",
"T",
",",
"T",
",",
"T",
">",
"reducer",
")",
"{",
"ObjectHelper",
".",
"requireNonNul... | Returns a Maybe that applies a specified accumulator function to the first item emitted by a source
ObservableSource, then feeds the result of that function along with the second item emitted by the source
ObservableSource into the same function, and so on until all items have been emitted by the finite source Observab... | [
"Returns",
"a",
"Maybe",
"that",
"applies",
"a",
"specified",
"accumulator",
"function",
"to",
"the",
"first",
"item",
"emitted",
"by",
"a",
"source",
"ObservableSource",
"then",
"feeds",
"the",
"result",
"of",
"that",
"function",
"along",
"with",
"the",
"seco... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L10288-L10293 | test | Reduces the sequence of items in the source Maybe into a single item. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> reduce(BiFunction<T, T, T> reducer) {
ObjectHelper.requireNonNull(reducer, "reducer is null");
return RxJavaPlugins.onAssembly(new ObservableReduceMaybe<T>(th... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasScnrm2 | public static float cublasScnrm2(int n, Pointer x, int incx)
{
float result = cublasScnrm2Native(n, x, incx);
checkResultBLAS();
return result;
} | java | public static float cublasScnrm2(int n, Pointer x, int incx)
{
float result = cublasScnrm2Native(n, x, incx);
checkResultBLAS();
return result;
} | [
"public",
"static",
"float",
"cublasScnrm2",
"(",
"int",
"n",
",",
"Pointer",
"x",
",",
"int",
"incx",
")",
"{",
"float",
"result",
"=",
"cublasScnrm2Native",
"(",
"n",
",",
"x",
",",
"incx",
")",
";",
"checkResultBLAS",
"(",
")",
";",
"return",
"resul... | <pre>
float
cublasScnrm2 (int n, const cuComplex *x, int incx)
computes the Euclidean norm of the single-complex n-vector x. This code
uses simple scaling to avoid intermediate underflow and overflow.
Input
-----
n number of elements in input vector
x single-complex vector with n elements
incx storage spa... | [
"<pre",
">",
"float",
"cublasScnrm2",
"(",
"int",
"n",
"const",
"cuComplex",
"*",
"x",
"int",
"incx",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L2325-L2330 | test | Compute the Hamming distance between two unique attributes. | Of course, here is the Java code you requested:
```java
public static float cublasScnrm2(int n, Pointer x, int incx)
{
float result = cublasScnrm2Native(n, x, incx);
checkResultBLAS();
return result;
}
```
Hope this helps! |
Unidata/thredds | dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java | CDMArrayAtomic.getObject | protected Object getObject(dap4.core.util.Index idx)
{
assert data.getScheme() == Scheme.ATOMIC;
try {
Object value = data.read(idx);
value = java.lang.reflect.Array.get(value, 0);
return value;
} catch (IOException ioe) {
throw new IndexOutOfB... | java | protected Object getObject(dap4.core.util.Index idx)
{
assert data.getScheme() == Scheme.ATOMIC;
try {
Object value = data.read(idx);
value = java.lang.reflect.Array.get(value, 0);
return value;
} catch (IOException ioe) {
throw new IndexOutOfB... | [
"protected",
"Object",
"getObject",
"(",
"dap4",
".",
"core",
".",
"util",
".",
"Index",
"idx",
")",
"{",
"assert",
"data",
".",
"getScheme",
"(",
")",
"==",
"Scheme",
".",
"ATOMIC",
";",
"try",
"{",
"Object",
"value",
"=",
"data",
".",
"read",
"(",
... | Get the array element at a specific dap4 index as an Object
@param idx of element to get
@return value at <code>index</code> cast to Object if necessary. | [
"Get",
"the",
"array",
"element",
"at",
"a",
"specific",
"dap4",
"index",
"as",
"an",
"Object"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java#L510-L520 | test | Get a single object from the data. | Of course, here is the Java code you requested:
```java
protected Object getObject(dap4.core.util.Index idx)
{
assert data.getScheme() == Scheme.ATOMIC;
try {
Object value = data.read(idx);
value = java.lang.reflect.Array.get(value, 0);
return value;
} ca... |
jboss/jboss-common-core | src/main/java/org/jboss/util/Classes.java | Classes.getAttributeSetter | public final static Method getAttributeSetter(Class cls, String attr, Class type) throws NoSuchMethodException
{
StringBuffer buf = new StringBuffer(attr.length() + 3);
buf.append("set");
if(Character.isLowerCase(attr.charAt(0)))
{
buf.append(Character.toUpperCase(attr.charAt(0)))
... | java | public final static Method getAttributeSetter(Class cls, String attr, Class type) throws NoSuchMethodException
{
StringBuffer buf = new StringBuffer(attr.length() + 3);
buf.append("set");
if(Character.isLowerCase(attr.charAt(0)))
{
buf.append(Character.toUpperCase(attr.charAt(0)))
... | [
"public",
"final",
"static",
"Method",
"getAttributeSetter",
"(",
"Class",
"cls",
",",
"String",
"attr",
",",
"Class",
"type",
")",
"throws",
"NoSuchMethodException",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"attr",
".",
"length",
"(",
")",... | Returns attribute's setter method. If the method not found then NoSuchMethodException will be thrown.
@param cls the class the attribute belongs to
@param attr the attribute's name
@param type the attribute's type
@return attribute's setter method
@throws NoSuchMethodException if the setter was not found | [
"Returns",
"attribute",
"s",
"setter",
"method",
".",
"If",
"the",
"method",
"not",
"found",
"then",
"NoSuchMethodException",
"will",
"be",
"thrown",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/Classes.java#L741-L756 | test | Gets the attribute setter Method. | Of course, here is the Java code you requested:
```java
public final static Method getAttributeSetter(Class cls, String attr, Class type) throws NoSuchMethodException
{
StringBuffer buf = new StringBuffer(attr.length() + 3);
buf.append("set");
if(Character.isLowerCase(attr.charAt(0)))
{
... |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/builder/ResponseSpecBuilder.java | ResponseSpecBuilder.expectHeader | public ResponseSpecBuilder expectHeader(String headerName, Matcher<String> expectedValueMatcher) {
spec.header(headerName, expectedValueMatcher);
return this;
} | java | public ResponseSpecBuilder expectHeader(String headerName, Matcher<String> expectedValueMatcher) {
spec.header(headerName, expectedValueMatcher);
return this;
} | [
"public",
"ResponseSpecBuilder",
"expectHeader",
"(",
"String",
"headerName",
",",
"Matcher",
"<",
"String",
">",
"expectedValueMatcher",
")",
"{",
"spec",
".",
"header",
"(",
"headerName",
",",
"expectedValueMatcher",
")",
";",
"return",
"this",
";",
"}"
] | Expect that a response header matches the supplied header name and hamcrest matcher.
@param headerName The name of the expected header
@param expectedValueMatcher The Hamcrest matcher that must conform to the value
@return The builder | [
"Expect",
"that",
"a",
"response",
"header",
"matches",
"the",
"supplied",
"header",
"name",
"and",
"hamcrest",
"matcher",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/builder/ResponseSpecBuilder.java#L149-L152 | test | Expect a header with a given value. | Of course, here is the Java code you requested:
```java
public ResponseSpecBuilder expectHeader(String headerName, Matcher<String> expectedValueMatcher) {
spec.header(headerName, expectedValueMatcher);
return this;
}
```
Hope this helps! |
google/guice | extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java | FactoryProvider2.getAssistedMethods | @Override
@SuppressWarnings("unchecked")
public Collection<AssistedMethod> getAssistedMethods() {
return (Collection<AssistedMethod>) (Collection<?>) assistDataByMethod.values();
} | java | @Override
@SuppressWarnings("unchecked")
public Collection<AssistedMethod> getAssistedMethods() {
return (Collection<AssistedMethod>) (Collection<?>) assistDataByMethod.values();
} | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Collection",
"<",
"AssistedMethod",
">",
"getAssistedMethods",
"(",
")",
"{",
"return",
"(",
"Collection",
"<",
"AssistedMethod",
">",
")",
"(",
"Collection",
"<",
"?",
">",
")",
... | the collection is immutable. | [
"the",
"collection",
"is",
"immutable",
"."
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java#L454-L458 | test | Returns a collection of all the methods that are currently assisted in this class. | Of course, here is the Java code you requested:
```java
@Override
@SuppressWarnings("unchecked")
public Collection<AssistedMethod> getAssistedMethods() {
return (Collection<AssistedMethod>) (Collection<?>) assistDataByMethod.values();
}
```
Hope this helps! |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/widget/IndependentWindow.java | IndependentWindow.show | public void show() {
setState( Frame.NORMAL ); // deiconify if needed
super.toFront();
// need to put on event thread
SwingUtilities.invokeLater(new Runnable() {
public void run() {
IndependentWindow.super.show();
}
});
} | java | public void show() {
setState( Frame.NORMAL ); // deiconify if needed
super.toFront();
// need to put on event thread
SwingUtilities.invokeLater(new Runnable() {
public void run() {
IndependentWindow.super.show();
}
});
} | [
"public",
"void",
"show",
"(",
")",
"{",
"setState",
"(",
"Frame",
".",
"NORMAL",
")",
";",
"// deiconify if needed\r",
"super",
".",
"toFront",
"(",
")",
";",
"// need to put on event thread\r",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",... | show the window. | [
"show",
"the",
"window",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/widget/IndependentWindow.java#L77-L86 | test | show the image | Of course, here is the Java code you requested:
```java
public void show() {
setState( Frame.NORMAL ); // deiconify if needed
super.toFront();
// need to put on event thread
SwingUtilities.invokeLater(new Runnable() {
public void run() {
IndependentWindow.super.show();
}
... |
TooTallNate/Java-WebSocket | src/main/java/org/java_websocket/drafts/Draft_6455.java | Draft_6455.processFrameIsFin | private void processFrameIsFin(WebSocketImpl webSocketImpl, Framedata frame) throws InvalidDataException {
if( currentContinuousFrame == null ) {
log.trace( "Protocol error: Previous continuous frame sequence not completed." );
throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "Continuous frame sequenc... | java | private void processFrameIsFin(WebSocketImpl webSocketImpl, Framedata frame) throws InvalidDataException {
if( currentContinuousFrame == null ) {
log.trace( "Protocol error: Previous continuous frame sequence not completed." );
throw new InvalidDataException( CloseFrame.PROTOCOL_ERROR, "Continuous frame sequenc... | [
"private",
"void",
"processFrameIsFin",
"(",
"WebSocketImpl",
"webSocketImpl",
",",
"Framedata",
"frame",
")",
"throws",
"InvalidDataException",
"{",
"if",
"(",
"currentContinuousFrame",
"==",
"null",
")",
"{",
"log",
".",
"trace",
"(",
"\"Protocol error: Previous con... | Process the frame if it is the last frame
@param webSocketImpl the websocket impl
@param frame the frame
@throws InvalidDataException if there is a protocol error | [
"Process",
"the",
"frame",
"if",
"it",
"is",
"the",
"last",
"frame"
] | 73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9 | https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/drafts/Draft_6455.java#L870-L896 | test | Process a continuous frame. | Of course, here is the Java code you requested:
```java
private void processFrameIsFin(WebSocketImpl webSocketImpl, Framedata frame) throws InvalidDataException {
if( currentContinuousFrame == null ) {
log.trace( "Protocol error: Previous continuous frame sequence not completed." );
throw new InvalidDataExcept... |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspUtil.java | JspUtil.getExprInXml | public static String getExprInXml(String expression) {
String returnString;
int length = expression.length();
if (expression.startsWith(OPEN_EXPR)
&& expression.endsWith(CLOSE_EXPR)) {
returnString = expression.substring (1, length - 1);
} else {
... | java | public static String getExprInXml(String expression) {
String returnString;
int length = expression.length();
if (expression.startsWith(OPEN_EXPR)
&& expression.endsWith(CLOSE_EXPR)) {
returnString = expression.substring (1, length - 1);
} else {
... | [
"public",
"static",
"String",
"getExprInXml",
"(",
"String",
"expression",
")",
"{",
"String",
"returnString",
";",
"int",
"length",
"=",
"expression",
".",
"length",
"(",
")",
";",
"if",
"(",
"expression",
".",
"startsWith",
"(",
"OPEN_EXPR",
")",
"&&",
"... | Takes a potential expression and converts it into XML form | [
"Takes",
"a",
"potential",
"expression",
"and",
"converts",
"it",
"into",
"XML",
"form"
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspUtil.java#L225-L237 | test | Get the expression in xml. | Of course, here is the Java code you requested:
```java
public static String getExprInXml(String expression) {
String returnString;
int length = expression.length();
if (expression.startsWith(OPEN_EXPR)
&& expression.endsWith(CLOSE_EXPR)) {
returnString = expressio... |
Unidata/thredds | legacy/src/main/java/thredds/cataloggen/config/DatasetSource.java | DatasetSource.fullExpand | public InvCatalog fullExpand() throws IOException
{
logger.debug( "fullExpand(): expanding DatasetSource named \"{}\"", this.getName());
InvDataset topDs = this.expand();
InvCatalog generatedCat = topDs.getParentCatalog();
// Add metadata to all datasets.
for ( Iterator it = this.getDatasetEnhan... | java | public InvCatalog fullExpand() throws IOException
{
logger.debug( "fullExpand(): expanding DatasetSource named \"{}\"", this.getName());
InvDataset topDs = this.expand();
InvCatalog generatedCat = topDs.getParentCatalog();
// Add metadata to all datasets.
for ( Iterator it = this.getDatasetEnhan... | [
"public",
"InvCatalog",
"fullExpand",
"(",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"fullExpand(): expanding DatasetSource named \\\"{}\\\"\"",
",",
"this",
".",
"getName",
"(",
")",
")",
";",
"InvDataset",
"topDs",
"=",
"this",
".",
"expa... | Crawl this DatasetSource and generate a new InvCatalog with all datasets
named, sorted, and organized as defined by this DatasetSource, return the
newly generated InvCatalog.
@return the generated InvCatalog.
@throws IOException if DatasetSource does not reference a container dataset. | [
"Crawl",
"this",
"DatasetSource",
"and",
"generate",
"a",
"new",
"InvCatalog",
"with",
"all",
"datasets",
"named",
"sorted",
"and",
"organized",
"as",
"defined",
"by",
"this",
"DatasetSource",
"return",
"the",
"newly",
"generated",
"InvCatalog",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/cataloggen/config/DatasetSource.java#L453-L479 | test | Expand the DatasetSource and return the generated catalog. | Of course, here is the Java code you requested:
```java
public InvCatalog fullExpand() throws IOException
{
logger.debug( "fullExpand(): expanding DatasetSource named \"{}\"", this.getName());
InvDataset topDs = this.expand();
InvCatalog generatedCat = topDs.getParentCatalog();
// Add metadata to a... |
streamsets/datacollector | utils/src/main/java/com/streamsets/datacollector/io/DataStore.java | DataStore.exists | public boolean exists() throws IOException {
acquireLock();
try {
verifyAndRecover();
return Files.exists(file) && Files.size(file) > 0;
} finally {
release();
}
} | java | public boolean exists() throws IOException {
acquireLock();
try {
verifyAndRecover();
return Files.exists(file) && Files.size(file) > 0;
} finally {
release();
}
} | [
"public",
"boolean",
"exists",
"(",
")",
"throws",
"IOException",
"{",
"acquireLock",
"(",
")",
";",
"try",
"{",
"verifyAndRecover",
"(",
")",
";",
"return",
"Files",
".",
"exists",
"(",
"file",
")",
"&&",
"Files",
".",
"size",
"(",
"file",
")",
">",
... | Check if the DataStore exists and contains data.
This method will check for the presence of the set of files that can be used to read data from the store. | [
"Check",
"if",
"the",
"DataStore",
"exists",
"and",
"contains",
"data",
".",
"This",
"method",
"will",
"check",
"for",
"the",
"presence",
"of",
"the",
"set",
"of",
"files",
"that",
"can",
"be",
"used",
"to",
"read",
"data",
"from",
"the",
"store",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/utils/src/main/java/com/streamsets/datacollector/io/DataStore.java#L365-L373 | test | Checks if the file exists. | Of course, here is the Java code you requested:
```java
public boolean exists() throws IOException {
acquireLock();
try {
verifyAndRecover();
return Files.exists(file) && Files.size(file) > 0;
} finally {
release();
}
}
```
Hope this helps! |
robeio/robe | robe-admin/src/main/java/io/robe/admin/resources/JobResource.java | JobResource.pause | @RobeService(group = "HJobInfo", description = "Returns all HTriggerInfo as a collection with the matches given job id.")
@PUT
@Path("{id}/pause")
@UnitOfWork(readOnly = true, cacheMode = GET, flushMode = FlushMode.MANUAL)
public boolean pause(@RobeAuth Credentials credentials, @PathParam("id") String i... | java | @RobeService(group = "HJobInfo", description = "Returns all HTriggerInfo as a collection with the matches given job id.")
@PUT
@Path("{id}/pause")
@UnitOfWork(readOnly = true, cacheMode = GET, flushMode = FlushMode.MANUAL)
public boolean pause(@RobeAuth Credentials credentials, @PathParam("id") String i... | [
"@",
"RobeService",
"(",
"group",
"=",
"\"HJobInfo\"",
",",
"description",
"=",
"\"Returns all HTriggerInfo as a collection with the matches given job id.\"",
")",
"@",
"PUT",
"@",
"Path",
"(",
"\"{id}/pause\"",
")",
"@",
"UnitOfWork",
"(",
"readOnly",
"=",
"true",
",... | Returns all HTriggerInfo as a collection with the matches given job id.
@param credentials auto fill by {@link RobeAuth} annotation for authentication.
@return all {@link HTriggerInfo} as a collection | [
"Returns",
"all",
"HTriggerInfo",
"as",
"a",
"collection",
"with",
"the",
"matches",
"given",
"job",
"id",
"."
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-admin/src/main/java/io/robe/admin/resources/JobResource.java#L192-L208 | test | Pause a HJob. | Of course, here is the Java code you requested:
```java
@RobeService(group = "HJobInfo", description = "Returns all HTriggerInfo as a collection with the matches given job id.")
@PUT
@Path("{id}/pause")
@UnitOfWork(readOnly = true, cacheMode = GET, flushMode = FlushMode.MANUAL)
public boolean pause(@Ro... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/http/HttpConn.java | HttpConn.sendBody | public static String sendBody(UsernamePasswordCredentials upc,
InputStream keystore, char[] password,
HttpHost targetHost, String uri, List<NameValuePair> params,
HttpHost proxyHost, String encoding, RequestMethod meth... | java | public static String sendBody(UsernamePasswordCredentials upc,
InputStream keystore, char[] password,
HttpHost targetHost, String uri, List<NameValuePair> params,
HttpHost proxyHost, String encoding, RequestMethod meth... | [
"public",
"static",
"String",
"sendBody",
"(",
"UsernamePasswordCredentials",
"upc",
",",
"InputStream",
"keystore",
",",
"char",
"[",
"]",
"password",
",",
"HttpHost",
"targetHost",
",",
"String",
"uri",
",",
"List",
"<",
"NameValuePair",
">",
"params",
",",
... | Send a http request with implicit params
@param upc basic auth {@link UsernamePasswordCredentials}
@param keystore keyStore InputStream
@param password keyStore password
@param targetHost HttpHost
@param uri URI
@param params parameters ( ArrayList NameValuePair)
@param proxyHost HttpHost
@param... | [
"Send",
"a",
"http",
"request",
"with",
"implicit",
"params"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/http/HttpConn.java#L1248-L1256 | test | Send a body to a server using a keystore and a list of parameters. | Of course, here is the Java code you requested:
```java
public static String sendBody(UsernamePasswordCredentials upc,
InputStream keystore, char[] password,
HttpHost targetHost, String uri, List<NameValuePair> params,
... |
fuinorg/srcgen4j-core | src/main/java/org/fuin/srcgen4j/core/emf/AbstractEMFParser.java | AbstractEMFParser.parseDir | private void parseDir(final File dir) {
LOG.debug("Parse: {}", dir);
final File[] files = getFiles(dir);
if ((files == null) || (files.length == 0)) {
LOG.debug("No files found in directory: {}", dir);
} else {
for (final File file : files) {
... | java | private void parseDir(final File dir) {
LOG.debug("Parse: {}", dir);
final File[] files = getFiles(dir);
if ((files == null) || (files.length == 0)) {
LOG.debug("No files found in directory: {}", dir);
} else {
for (final File file : files) {
... | [
"private",
"void",
"parseDir",
"(",
"final",
"File",
"dir",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Parse: {}\"",
",",
"dir",
")",
";",
"final",
"File",
"[",
"]",
"files",
"=",
"getFiles",
"(",
"dir",
")",
";",
"if",
"(",
"(",
"files",
"==",
"null",... | Parse the directory and it's sub directory.
@param dir
Directory to parse. | [
"Parse",
"the",
"directory",
"and",
"it",
"s",
"sub",
"directory",
"."
] | da2bc58370993e6294ddc4eb7e696fe255f979db | https://github.com/fuinorg/srcgen4j-core/blob/da2bc58370993e6294ddc4eb7e696fe255f979db/src/main/java/org/fuin/srcgen4j/core/emf/AbstractEMFParser.java#L203-L224 | test | Parses the directory containing the
alternative files. | Of course, here is the Java code you requested:
```java
private void parseDir(final File dir) {
LOG.debug("Parse: {}", dir);
final File[] files = getFiles(dir);
if ((files == null) || (files.length == 0)) {
LOG.debug("No files found in directory: {}", dir);
} else {
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java | Nidsheader.read | void read(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile ) throws IOException {
int hedsiz; /* NEXRAD header size */
int rc; /* function return status */
int hoff = 0;
int type;
i... | java | void read(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile ) throws IOException {
int hedsiz; /* NEXRAD header size */
int rc; /* function return status */
int hoff = 0;
int type;
i... | [
"void",
"read",
"(",
"ucar",
".",
"unidata",
".",
"io",
".",
"RandomAccessFile",
"raf",
",",
"ucar",
".",
"nc2",
".",
"NetcdfFile",
"ncfile",
")",
"throws",
"IOException",
"{",
"int",
"hedsiz",
";",
"/* NEXRAD header size */",
"int",
"rc",
";",
"/... | read and parse the header of the nids/tdwr file
@param raf input file
@param ncfile output file
@throws IOException | [
"read",
"and",
"parse",
"the",
"header",
"of",
"the",
"nids",
"/",
"tdwr",
"file"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java#L256-L914 | test | Reads the NIDS product message header from the specified file. | Of course, here is the Java code you requested:
```java
void read(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile ) throws IOException {
int hedsiz; /* NEXRAD header size */
int rc; /* function return status */
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/util/cache/FileCache.java | FileCache.shutdown | public static synchronized void shutdown() {
if (timer != null) {
timer.cancel();
System.out.printf("FileCache.shutdown called%n");
}
timer = null;
} | java | public static synchronized void shutdown() {
if (timer != null) {
timer.cancel();
System.out.printf("FileCache.shutdown called%n");
}
timer = null;
} | [
"public",
"static",
"synchronized",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"timer",
"!=",
"null",
")",
"{",
"timer",
".",
"cancel",
"(",
")",
";",
"System",
".",
"out",
".",
"printf",
"(",
"\"FileCache.shutdown called%n\"",
")",
";",
"}",
"timer",... | You must call shutdown() to shut down the background threads in order to get a clean process shutdown. | [
"You",
"must",
"call",
"shutdown",
"()",
"to",
"shut",
"down",
"the",
"background",
"threads",
"in",
"order",
"to",
"get",
"a",
"clean",
"process",
"shutdown",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/cache/FileCache.java#L73-L79 | test | Shutdown the cache. | Of course, here is the Java code you requested:
```java
public static synchronized void shutdown() {
if (timer != null) {
timer.cancel();
System.out.printf("FileCache.shutdown called%n");
}
timer = null;
}
```
Hope this helps! |
oblac/jodd | jodd-mail/src/main/java/jodd/mail/EmailFilter.java | EmailFilter.or | protected void or(final SearchTerm searchTerm) {
if (this.searchTerm == null) {
this.searchTerm = searchTerm;
return;
}
this.searchTerm = new OrTerm(this.searchTerm, searchTerm);
} | java | protected void or(final SearchTerm searchTerm) {
if (this.searchTerm == null) {
this.searchTerm = searchTerm;
return;
}
this.searchTerm = new OrTerm(this.searchTerm, searchTerm);
} | [
"protected",
"void",
"or",
"(",
"final",
"SearchTerm",
"searchTerm",
")",
"{",
"if",
"(",
"this",
".",
"searchTerm",
"==",
"null",
")",
"{",
"this",
".",
"searchTerm",
"=",
"searchTerm",
";",
"return",
";",
"}",
"this",
".",
"searchTerm",
"=",
"new",
"... | Sets {@link OrTerm} searchTerm.
@param searchTerm {@link SearchTerm} to set as OR. | [
"Sets",
"{",
"@link",
"OrTerm",
"}",
"searchTerm",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/EmailFilter.java#L390-L397 | test | OR. | Of course, here is the Java code you requested:
```java
protected void or(final SearchTerm searchTerm) {
if (this.searchTerm == null) {
this.searchTerm = searchTerm;
return;
}
this.searchTerm = new OrTerm(this.searchTerm, searchTerm);
}
```
Hope this helps! |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasCgemm | public static void cublasCgemm(char transa, char transb, int m, int n, int k, cuComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuComplex beta, Pointer C, int ldc)
{
cublasCgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
checkResultBLAS();
} | java | public static void cublasCgemm(char transa, char transb, int m, int n, int k, cuComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuComplex beta, Pointer C, int ldc)
{
cublasCgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasCgemm",
"(",
"char",
"transa",
",",
"char",
"transb",
",",
"int",
"m",
",",
"int",
"n",
",",
"int",
"k",
",",
"cuComplex",
"alpha",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"B",
",",
"int",
"ldb",
"... | <pre>
void cublasCgemm (char transa, char transb, int m, int n, int k,
cuComplex alpha, const cuComplex *A, int lda,
const cuComplex *B, int ldb, cuComplex beta,
cuComplex *C, int ldc)
performs one of the matrix-matrix operations
C = alpha * op(A) * op(B) + beta*C,
where op(X) is one of
op(X) = X or op(X) = tra... | [
"<pre",
">",
"void",
"cublasCgemm",
"(",
"char",
"transa",
"char",
"transb",
"int",
"m",
"int",
"n",
"int",
"k",
"cuComplex",
"alpha",
"const",
"cuComplex",
"*",
"A",
"int",
"lda",
"const",
"cuComplex",
"*",
"B",
"int",
"ldb",
"cuComplex",
"beta",
"cuCom... | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L6268-L6272 | test | Cublas C GEM m. | Of course, here is the Java code you requested:
```java
public static void cublasCgemm(char transa, char transb, int m, int n, int k, cuComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuComplex beta, Pointer C, int ldc)
{
cublasCgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, l... |
agentsoz/jill | jill/src/main/java/io/github/agentsoz/jill/core/beliefbase/BeliefSet.java | BeliefSet.getFieldByName | public BeliefSetField getFieldByName(String name) {
BeliefSetField field = null;
for (int i = 0; i < fields.length; i++) {
if (name.equals(fields[i].getName())) {
field = fields[i];
break;
}
}
return field;
} | java | public BeliefSetField getFieldByName(String name) {
BeliefSetField field = null;
for (int i = 0; i < fields.length; i++) {
if (name.equals(fields[i].getName())) {
field = fields[i];
break;
}
}
return field;
} | [
"public",
"BeliefSetField",
"getFieldByName",
"(",
"String",
"name",
")",
"{",
"BeliefSetField",
"field",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fields",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"name",
".",
... | Gets the field of this belief set that has the given name.
@param name the name of the field to retrieve
@return the belief set field matching that name, or null if not found
@since 0.3.4 | [
"Gets",
"the",
"field",
"of",
"this",
"belief",
"set",
"that",
"has",
"the",
"given",
"name",
"."
] | 13126fc78350465b477386132465f84cad719426 | https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/core/beliefbase/BeliefSet.java#L67-L76 | test | Gets the field by name. | Of course, here is the Java code you requested:
```java
public BeliefSetField getFieldByName(String name) {
BeliefSetField field = null;
for (int i = 0; i < fields.length; i++) {
if (name.equals(fields[i].getName())) {
field = fields[i];
break;
}
}
return field;
}
```
Hop... |
rackerlabs/blueflood | blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/IOConfig.java | IOConfig.getUniqueBinaryTransportHosts | protected Set<String> getUniqueBinaryTransportHosts() {
Set<String> uniqueHosts = new HashSet<String>();
Collections.addAll(uniqueHosts, config.getStringProperty(CoreConfig.CASSANDRA_BINXPORT_HOSTS).split(","));
return uniqueHosts;
} | java | protected Set<String> getUniqueBinaryTransportHosts() {
Set<String> uniqueHosts = new HashSet<String>();
Collections.addAll(uniqueHosts, config.getStringProperty(CoreConfig.CASSANDRA_BINXPORT_HOSTS).split(","));
return uniqueHosts;
} | [
"protected",
"Set",
"<",
"String",
">",
"getUniqueBinaryTransportHosts",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"uniqueHosts",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"Collections",
".",
"addAll",
"(",
"uniqueHosts",
",",
"config",
"."... | Retrieves a set of unique Cassandra hosts with Binary Transport protocol
enabled from configuration file. This may or may not be different than
{@link #getUniqueHosts()}
@return set of unique Cassandra hosts with binary transport protocol enabled | [
"Retrieves",
"a",
"set",
"of",
"unique",
"Cassandra",
"hosts",
"with",
"Binary",
"Transport",
"protocol",
"enabled",
"from",
"configuration",
"file",
".",
"This",
"may",
"or",
"may",
"not",
"be",
"different",
"than",
"{",
"@link",
"#getUniqueHosts",
"()",
"}"
... | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/IOConfig.java#L58-L62 | test | Get the list of binary transport hosts. | Of course, here is the Java code you requested:
```java
protected Set<String> getUniqueBinaryTransportHosts() {
Set<String> uniqueHosts = new HashSet<String>();
Collections.addAll(uniqueHosts, config.getStringProperty(CoreConfig.CASSANDRA_BINXPORT_HOSTS).split(","));
return uniqueHosts;
}
`... |
real-logic/aeron | aeron-client/src/main/java/io/aeron/ConcurrentPublication.java | ConcurrentPublication.offer | public long offer(
final DirectBuffer buffer,
final int offset,
final int length,
final ReservedValueSupplier reservedValueSupplier)
{
long newPosition = CLOSED;
if (!isClosed)
{
final long limit = positionLimit.getVolatile();
final int... | java | public long offer(
final DirectBuffer buffer,
final int offset,
final int length,
final ReservedValueSupplier reservedValueSupplier)
{
long newPosition = CLOSED;
if (!isClosed)
{
final long limit = positionLimit.getVolatile();
final int... | [
"public",
"long",
"offer",
"(",
"final",
"DirectBuffer",
"buffer",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
",",
"final",
"ReservedValueSupplier",
"reservedValueSupplier",
")",
"{",
"long",
"newPosition",
"=",
"CLOSED",
";",
"if",
"(",
"!"... | Non-blocking publish of a partial buffer containing a message.
@param buffer containing message.
@param offset offset in the buffer at which the encoded message begins.
@param length in bytes of the encoded message.
@param reservedValueSupplier {@link ReservedValueSupplier}... | [
"Non",
"-",
"blocking",
"publish",
"of",
"a",
"partial",
"buffer",
"containing",
"a",
"message",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/ConcurrentPublication.java#L92-L139 | test | Offer a message to the log. | Of course, here is the Java code you requested:
```java
public long offer(
final DirectBuffer buffer,
final int offset,
final int length,
final ReservedValueSupplier reservedValueSupplier)
{
long newPosition = CLOSED;
if (!isClosed)
{
final long l... |
rupertlssmith/lojix | lojix/search/src/main/com/thesett/aima/search/TraversableState.java | TraversableState.successors | public Iterator<Successor<O>> successors(boolean reverse)
{
return new Filterator<Operator<O>, Successor<O>>(validOperators(reverse),
new Function<Operator<O>, Successor<O>>()
{
public Successor<O> apply(Operator operator)
{
return ... | java | public Iterator<Successor<O>> successors(boolean reverse)
{
return new Filterator<Operator<O>, Successor<O>>(validOperators(reverse),
new Function<Operator<O>, Successor<O>>()
{
public Successor<O> apply(Operator operator)
{
return ... | [
"public",
"Iterator",
"<",
"Successor",
"<",
"O",
">",
">",
"successors",
"(",
"boolean",
"reverse",
")",
"{",
"return",
"new",
"Filterator",
"<",
"Operator",
"<",
"O",
">",
",",
"Successor",
"<",
"O",
">",
">",
"(",
"validOperators",
"(",
"reverse",
"... | Works out all the possible successors by applying all the operators returned by the
{@link Traversable#validOperators} method.
@param reverse When set, indicates that the successors should be presented in reverse order.
@return An iterator over all the {@link Successor}s that can be reached by applying valid operato... | [
"Works",
"out",
"all",
"the",
"possible",
"successors",
"by",
"applying",
"all",
"the",
"operators",
"returned",
"by",
"the",
"{",
"@link",
"Traversable#validOperators",
"}",
"method",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/TraversableState.java#L51-L61 | test | Returns an iterator of successors of all valid operators. | Of course, here is the Java code you requested:
```java
public Iterator<Successor<O>> successors(boolean reverse)
{
return new Filterator<Operator<O>, Successor<O>>(validOperators(reverse),
new Function<Operator<O>, Successor<O>>()
{
public Successor<O> apply(Operato... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/component/ActionMethodParamNameResolver.java | ActionMethodParamNameResolver.resolveParamNames | public String[] resolveParamNames(final Method actionClassMethod) {
MethodParameter[] methodParameters = Paramo.resolveParameters(actionClassMethod);
String[] names = new String[methodParameters.length];
for (int i = 0; i < methodParameters.length; i++) {
names[i] = methodParameters[i].getName();
}
retu... | java | public String[] resolveParamNames(final Method actionClassMethod) {
MethodParameter[] methodParameters = Paramo.resolveParameters(actionClassMethod);
String[] names = new String[methodParameters.length];
for (int i = 0; i < methodParameters.length; i++) {
names[i] = methodParameters[i].getName();
}
retu... | [
"public",
"String",
"[",
"]",
"resolveParamNames",
"(",
"final",
"Method",
"actionClassMethod",
")",
"{",
"MethodParameter",
"[",
"]",
"methodParameters",
"=",
"Paramo",
".",
"resolveParameters",
"(",
"actionClassMethod",
")",
";",
"String",
"[",
"]",
"names",
"... | Returns method parameter names. | [
"Returns",
"method",
"parameter",
"names",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/ActionMethodParamNameResolver.java#L43-L53 | test | Resolve parameter names. | Of course, here is the Java code you requested:
```java
public String[] resolveParamNames(final Method actionClassMethod) {
MethodParameter[] methodParameters = Paramo.resolveParameters(actionClassMethod);
String[] names = new String[methodParameters.length];
for (int i = 0; i < methodParameters.length; i++) {... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Client.java | Client.multipleQueriesAsync | public Request multipleQueriesAsync(final @NonNull List<IndexQuery> queries, final MultipleQueriesStrategy strategy, @NonNull CompletionHandler completionHandler) {
return multipleQueriesAsync(queries, strategy, /* requestOptions: */ null, completionHandler);
} | java | public Request multipleQueriesAsync(final @NonNull List<IndexQuery> queries, final MultipleQueriesStrategy strategy, @NonNull CompletionHandler completionHandler) {
return multipleQueriesAsync(queries, strategy, /* requestOptions: */ null, completionHandler);
} | [
"public",
"Request",
"multipleQueriesAsync",
"(",
"final",
"@",
"NonNull",
"List",
"<",
"IndexQuery",
">",
"queries",
",",
"final",
"MultipleQueriesStrategy",
"strategy",
",",
"@",
"NonNull",
"CompletionHandler",
"completionHandler",
")",
"{",
"return",
"multipleQueri... | Run multiple queries, potentially targeting multiple indexes, with one API call.
@param queries The queries to run.
@param strategy The strategy to use.
@param completionHandler The listener that will be notified of the request's outcome.
@return A cancellable request. | [
"Run",
"multiple",
"queries",
"potentially",
"targeting",
"multiple",
"indexes",
"with",
"one",
"API",
"call",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Client.java#L336-L338 | test | Asynchronously sends a list of multiple queries request. | Of course, here is the Java code you requested:
```java
public Request multipleQueriesAsync(final @NonNull List<IndexQuery> queries, final MultipleQueriesStrategy strategy, @NonNull CompletionHandler completionHandler) {
return multipleQueriesAsync(queries, strategy, /* requestOptions: */ null, completionHandl... |
1gravity/Android-RTEditor | RTEditor/src/main/java/com/onegravity/rteditor/media/crop/CropImageActivity.java | CropImageActivity.onCreate | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rte_crop_image);
mImageView = (CropImageView) findViewById(R.id.image);
Intent intent = getIntent();
Bundle extras = intent.getExtras();
if (ex... | java | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rte_crop_image);
mImageView = (CropImageView) findViewById(R.id.image);
Intent intent = getIntent();
Bundle extras = intent.getExtras();
if (ex... | [
"@",
"Override",
"protected",
"void",
"onCreate",
"(",
"Bundle",
"savedInstanceState",
")",
"{",
"super",
".",
"onCreate",
"(",
"savedInstanceState",
")",
";",
"setContentView",
"(",
"R",
".",
"layout",
".",
"rte_crop_image",
")",
";",
"mImageView",
"=",
"(",
... | ****************************************** Lifecycle Methods ******************************************* | [
"******************************************",
"Lifecycle",
"Methods",
"*******************************************"
] | 9d8fb4bb865b3b3d011e7633afedcdfb8d21754f | https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/media/crop/CropImageActivity.java#L99-L150 | test | Override onCreate to set up the image view and set up the imageFaceDetection | Of course, here is the Java code you requested:
```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rte_crop_image);
mImageView = (CropImageView) findViewById(R.id.image);
Intent intent = getIntent();
... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/reflect/BeanMemento.java | BeanMemento.put | public void put(Class cls, String property, Object value)
{
// Store the new data under the specified property name.
values.put(property, value);
} | java | public void put(Class cls, String property, Object value)
{
// Store the new data under the specified property name.
values.put(property, value);
} | [
"public",
"void",
"put",
"(",
"Class",
"cls",
",",
"String",
"property",
",",
"Object",
"value",
")",
"{",
"// Store the new data under the specified property name.",
"values",
".",
"put",
"(",
"property",
",",
"value",
")",
";",
"}"
] | Places the specified value into the memento based on the property's declaring class and name.
@param cls The class in which the property is declared. This is ignored as only properties of the top-level
bean class are used by this memento. Properties higher up the inheritance chain can be overriden.
@param propert... | [
"Places",
"the",
"specified",
"value",
"into",
"the",
"memento",
"based",
"on",
"the",
"property",
"s",
"declaring",
"class",
"and",
"name",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/BeanMemento.java#L263-L267 | test | Stores the specified value in the cache. | Of course, here is the Java code you requested:
```java
public void put(Class cls, String property, Object value)
{
// Store the new data under the specified property name.
values.put(property, value);
}
```
Hope this helps! |
streamsets/datacollector | google-cloud-lib/src/main/java/com/streamsets/pipeline/stage/bigquery/lib/BigQueryDelegate.java | BigQueryDelegate.fieldsToMap | public LinkedHashMap<String, Field> fieldsToMap( // NOSONAR
List<com.google.cloud.bigquery.Field> schema,
List<FieldValue> values
) {
checkState(
schema.size() == values.size(),
"Schema '{}' and Values '{}' sizes do not match.",
schema.size(),
values.size()
);
... | java | public LinkedHashMap<String, Field> fieldsToMap( // NOSONAR
List<com.google.cloud.bigquery.Field> schema,
List<FieldValue> values
) {
checkState(
schema.size() == values.size(),
"Schema '{}' and Values '{}' sizes do not match.",
schema.size(),
values.size()
);
... | [
"public",
"LinkedHashMap",
"<",
"String",
",",
"Field",
">",
"fieldsToMap",
"(",
"// NOSONAR",
"List",
"<",
"com",
".",
"google",
".",
"cloud",
".",
"bigquery",
".",
"Field",
">",
"schema",
",",
"List",
"<",
"FieldValue",
">",
"values",
")",
"{",
"checkS... | Converts a list of BigQuery fields to SDC Record fields.
The provided parameters must have matching lengths.
If not, an unchecked exception will be thrown. This method is called when the resulting
container type should be a {@link Field.Type#LIST_MAP}
@param schema List of {@link com.google.cloud.bigquery.Field} repr... | [
"Converts",
"a",
"list",
"of",
"BigQuery",
"fields",
"to",
"SDC",
"Record",
"fields",
".",
"The",
"provided",
"parameters",
"must",
"have",
"matching",
"lengths",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/google-cloud-lib/src/main/java/com/streamsets/pipeline/stage/bigquery/lib/BigQueryDelegate.java#L261-L288 | test | Convert a list of fields to a LinkedHashMap of fields. | Of course, here is the Java code you requested:
```java
public LinkedHashMap<String, Field> fieldsToMap( // NOSONAR
List<com.google.cloud.bigquery.Field> schema,
List<FieldValue> values
) {
checkState(
schema.size() == values.size(),
"Schema '{}' and Values '{}' sizes do not match.",
... |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/builder/MultiPartSpecBuilder.java | MultiPartSpecBuilder.charset | public MultiPartSpecBuilder charset(Charset charset) {
Validate.notNull(charset, "Charset cannot be null");
this.charset = charset.toString();
return this;
} | java | public MultiPartSpecBuilder charset(Charset charset) {
Validate.notNull(charset, "Charset cannot be null");
this.charset = charset.toString();
return this;
} | [
"public",
"MultiPartSpecBuilder",
"charset",
"(",
"Charset",
"charset",
")",
"{",
"Validate",
".",
"notNull",
"(",
"charset",
",",
"\"Charset cannot be null\"",
")",
";",
"this",
".",
"charset",
"=",
"charset",
".",
"toString",
"(",
")",
";",
"return",
"this",... | Specify the charset for this charset.
@param charset The charset to use
@return An instance of MultiPartSpecBuilder | [
"Specify",
"the",
"charset",
"for",
"this",
"charset",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/builder/MultiPartSpecBuilder.java#L260-L264 | test | Sets the charset. | Of course, here is the Java code you requested:
```java
public MultiPartSpecBuilder charset(Charset charset) {
Validate.notNull(charset, "Charset cannot be null");
this.charset = charset.toString();
return this;
}
```
Hope this helps! |
RestComm/jain-slee | container/common/src/main/java/org/mobicents/slee/runtime/facilities/TracerImpl.java | TracerImpl.severe | public void severe(String message) throws NullPointerException,
FacilityException {
sendNotification(TraceLevel.SEVERE, message, null);
logger.error(message);
} | java | public void severe(String message) throws NullPointerException,
FacilityException {
sendNotification(TraceLevel.SEVERE, message, null);
logger.error(message);
} | [
"public",
"void",
"severe",
"(",
"String",
"message",
")",
"throws",
"NullPointerException",
",",
"FacilityException",
"{",
"sendNotification",
"(",
"TraceLevel",
".",
"SEVERE",
",",
"message",
",",
"null",
")",
";",
"logger",
".",
"error",
"(",
"message",
")"... | /* (non-Javadoc)
@see javax.slee.facilities.Tracer#severe(java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/runtime/facilities/TracerImpl.java#L401-L405 | test | Sends a severity error notification to the application. | Of course, here is the Java code you requested:
```java
public void severe(String message) throws NullPointerException,
FacilityException {
sendNotification(TraceLevel.SEVERE, message, null);
logger.error(message);
}
```
Hope this helps! |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/AbstractCssImportPreProcessor.java | AbstractCssImportPreProcessor.process | public final void process(final Resource resource, final Reader reader, final Writer writer)
throws IOException {
LOG.debug("Applying {} processor", toString());
validate();
try {
final String result = parseCss(resource, IOUtils.toString(reader));
writer.write(result);
} finally {
... | java | public final void process(final Resource resource, final Reader reader, final Writer writer)
throws IOException {
LOG.debug("Applying {} processor", toString());
validate();
try {
final String result = parseCss(resource, IOUtils.toString(reader));
writer.write(result);
} finally {
... | [
"public",
"final",
"void",
"process",
"(",
"final",
"Resource",
"resource",
",",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"Applying {} processor\"",
",",
"toString",
"(",
")",... | {@inheritDoc} | [
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/AbstractCssImportPreProcessor.java#L92-L105 | test | Process the CSS file. | Of course, here is the Java code you requested:
```java
public final void process(final Resource resource, final Reader reader, final Writer writer)
throws IOException {
LOG.debug("Applying {} processor", toString());
validate();
try {
final String result = parseCss(resource, IOUtils.toString(rea... |
oblac/jodd | jodd-core/src/main/java/jodd/io/watch/DirWatcher.java | DirWatcher.useWatchFile | public DirWatcher useWatchFile(final String name) {
watchFile = new File(dir, name);
if (!watchFile.isFile() || !watchFile.exists()) {
try {
FileUtil.touch(watchFile);
} catch (IOException ioex) {
throw new DirWatcherException("Invalid watch file: " + name, ioex);
}
}
watchFileLastAccessTime ... | java | public DirWatcher useWatchFile(final String name) {
watchFile = new File(dir, name);
if (!watchFile.isFile() || !watchFile.exists()) {
try {
FileUtil.touch(watchFile);
} catch (IOException ioex) {
throw new DirWatcherException("Invalid watch file: " + name, ioex);
}
}
watchFileLastAccessTime ... | [
"public",
"DirWatcher",
"useWatchFile",
"(",
"final",
"String",
"name",
")",
"{",
"watchFile",
"=",
"new",
"File",
"(",
"dir",
",",
"name",
")",
";",
"if",
"(",
"!",
"watchFile",
".",
"isFile",
"(",
")",
"||",
"!",
"watchFile",
".",
"exists",
"(",
")... | Enables usage of provided watch file. | [
"Enables",
"usage",
"of",
"provided",
"watch",
"file",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/watch/DirWatcher.java#L165-L179 | test | Use a watch file to watch the directory. | Of course, here is the Java code you requested:
```java
public DirWatcher useWatchFile(final String name) {
watchFile = new File(dir, name);
if (!watchFile.isFile() || !watchFile.exists()) {
try {
FileUtil.touch(watchFile);
} catch (IOException ioex) {
throw new DirWatcherException("Invalid watch fi... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java | GradsDataDescriptorFile.getDDFPath | private String getDDFPath() {
if (pathToDDF == null) {
int lastSlash = ddFile.lastIndexOf("/");
if (lastSlash < 0) {
lastSlash = ddFile.lastIndexOf(File.separator);
}
pathToDDF = (lastSlash < 0)
? ""
: ddFile.substring(0, lastSlash + 1);
}... | java | private String getDDFPath() {
if (pathToDDF == null) {
int lastSlash = ddFile.lastIndexOf("/");
if (lastSlash < 0) {
lastSlash = ddFile.lastIndexOf(File.separator);
}
pathToDDF = (lastSlash < 0)
? ""
: ddFile.substring(0, lastSlash + 1);
}... | [
"private",
"String",
"getDDFPath",
"(",
")",
"{",
"if",
"(",
"pathToDDF",
"==",
"null",
")",
"{",
"int",
"lastSlash",
"=",
"ddFile",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"lastSlash",
"<",
"0",
")",
"{",
"lastSlash",
"=",
"ddFile",
"... | Get the path to the Data Descriptor File
@return the path to the Data Descriptor File | [
"Get",
"the",
"path",
"to",
"the",
"Data",
"Descriptor",
"File"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java#L961-L974 | test | Get the path to the DDF file. | Of course, here is the Java code you requested:
```java
private String getDDFPath() {
if (pathToDDF == null) {
int lastSlash = ddFile.lastIndexOf("/");
if (lastSlash < 0) {
lastSlash = ddFile.lastIndexOf(File.separator);
}
pathToDDF = (lastSlash < 0)
? ""
... |
rupertlssmith/lojix | lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java | Functor.structuralEquals | public boolean structuralEquals(Term term)
{
Term comparator = term.getValue();
if (this == comparator)
{
return true;
}
if ((comparator == null) || !(getClass().isAssignableFrom(comparator.getClass())))
{
return false;
}
Fun... | java | public boolean structuralEquals(Term term)
{
Term comparator = term.getValue();
if (this == comparator)
{
return true;
}
if ((comparator == null) || !(getClass().isAssignableFrom(comparator.getClass())))
{
return false;
}
Fun... | [
"public",
"boolean",
"structuralEquals",
"(",
"Term",
"term",
")",
"{",
"Term",
"comparator",
"=",
"term",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"this",
"==",
"comparator",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"(",
"comparator",
"==",
... | Compares this term for structural equality with another. Two terms are structurally equal if they are the same
functor with the same arguments, or are the same unbound variable, or the bound values of the left or right
variable operands are structurally equal. Structural equality is a stronger equality than unification... | [
"Compares",
"this",
"term",
"for",
"structural",
"equality",
"with",
"another",
".",
"Two",
"terms",
"are",
"structurally",
"equal",
"if",
"they",
"are",
"the",
"same",
"functor",
"with",
"the",
"same",
"arguments",
"or",
"are",
"the",
"same",
"unbound",
"va... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L240-L281 | test | Structural equals method. | Of course, here is the Java code you requested:
```java
public boolean structuralEquals(Term term)
{
Term comparator = term.getValue();
if (this == comparator)
{
return true;
}
if ((comparator == null) || !(getClass().isAssignableFrom(comparator.getClass())))
... |
jboss/jboss-common-core | src/main/java/org/jboss/util/collection/LazyMap.java | LazyMap.createImplementation | private Map<K, V> createImplementation()
{
if (delegate instanceof HashMap == false)
return new HashMap<K, V>(delegate);
return delegate;
} | java | private Map<K, V> createImplementation()
{
if (delegate instanceof HashMap == false)
return new HashMap<K, V>(delegate);
return delegate;
} | [
"private",
"Map",
"<",
"K",
",",
"V",
">",
"createImplementation",
"(",
")",
"{",
"if",
"(",
"delegate",
"instanceof",
"HashMap",
"==",
"false",
")",
"return",
"new",
"HashMap",
"<",
"K",
",",
"V",
">",
"(",
"delegate",
")",
";",
"return",
"delegate",
... | Create the map implementation
@return the map | [
"Create",
"the",
"map",
"implementation"
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/collection/LazyMap.java#L48-L53 | test | Create the implementation of the result map. | Of course, here is the Java code you requested:
```java
private Map<K, V> createImplementation()
{
if (delegate instanceof HashMap == false)
return new HashMap<K, V>(delegate);
return delegate;
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java | FeatureIndexManager.getIndexedType | private FeatureIndexType getIndexedType() {
FeatureIndexType indexType = FeatureIndexType.NONE;
// Check for an indexed type
for (FeatureIndexType type : indexLocationQueryOrder) {
if (isIndexed(type)) {
indexType = type;
break;
}
... | java | private FeatureIndexType getIndexedType() {
FeatureIndexType indexType = FeatureIndexType.NONE;
// Check for an indexed type
for (FeatureIndexType type : indexLocationQueryOrder) {
if (isIndexed(type)) {
indexType = type;
break;
}
... | [
"private",
"FeatureIndexType",
"getIndexedType",
"(",
")",
"{",
"FeatureIndexType",
"indexType",
"=",
"FeatureIndexType",
".",
"NONE",
";",
"// Check for an indexed type",
"for",
"(",
"FeatureIndexType",
"type",
":",
"indexLocationQueryOrder",
")",
"{",
"if",
"(",
"is... | Get the indexed type or throw an error if not indexed | [
"Get",
"the",
"indexed",
"type",
"or",
"throw",
"an",
"error",
"if",
"not",
"indexed"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L994-L1007 | test | Get the indexed type | Of course, here is the Java code you requested:
```java
private FeatureIndexType getIndexedType() {
FeatureIndexType indexType = FeatureIndexType.NONE;
// Check for an indexed type
for (FeatureIndexType type : indexLocationQueryOrder) {
if (isIndexed(type)) {
index... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/LambertConformal.java | LambertConformal.toWKS | public String toWKS() {
StringBuilder sbuff = new StringBuilder();
sbuff.append("PROJCS[\"").append(getName()).append("\",");
if (true) {
sbuff.append("GEOGCS[\"Normal Sphere (r=6371007)\",");
sbuff.append("DATUM[\"unknown\",");
sbuff.append("SPHEROID[\"sphere\",6371007,0]],");
... | java | public String toWKS() {
StringBuilder sbuff = new StringBuilder();
sbuff.append("PROJCS[\"").append(getName()).append("\",");
if (true) {
sbuff.append("GEOGCS[\"Normal Sphere (r=6371007)\",");
sbuff.append("DATUM[\"unknown\",");
sbuff.append("SPHEROID[\"sphere\",6371007,0]],");
... | [
"public",
"String",
"toWKS",
"(",
")",
"{",
"StringBuilder",
"sbuff",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sbuff",
".",
"append",
"(",
"\"PROJCS[\\\"\"",
")",
".",
"append",
"(",
"getName",
"(",
")",
")",
".",
"append",
"(",
"\"\\\",\"",
")",
"... | Create a WKS string
@return WKS string | [
"Create",
"a",
"WKS",
"string"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/LambertConformal.java#L378-L401 | test | Converts the GPS specification to WKS format. | Of course, here is the Java code you requested:
```java
public String toWKS() {
StringBuilder sbuff = new StringBuilder();
sbuff.append("PROJCS[\"").append(getName()).append("\",");
if (true) {
sbuff.append("GEOGCS[\"Normal Sphere (r=6371007)\",");
sbuff.append("DATUM[\"unknown\",");
... |
ReactiveX/RxJava | src/main/java/io/reactivex/Completable.java | Completable.doOnSubscribe | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnSubscribe(Consumer<? super Disposable> onSubscribe) {
return doOnLifecycle(onSubscribe, Functions.emptyConsumer(),
Functions.EMPTY_ACTION, Functions.EMPTY_ACTION,
Functions.EMPTY_ACTIO... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnSubscribe(Consumer<? super Disposable> onSubscribe) {
return doOnLifecycle(onSubscribe, Functions.emptyConsumer(),
Functions.EMPTY_ACTION, Functions.EMPTY_ACTION,
Functions.EMPTY_ACTIO... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Completable",
"doOnSubscribe",
"(",
"Consumer",
"<",
"?",
"super",
"Disposable",
">",
"onSubscribe",
")",
"{",
"return",
"doOnLifecycle",
"(",
"onSubsc... | Returns a Completable instance that calls the given onSubscribe callback with the disposable
that child subscribers receive on subscription.
<p>
<img width="640" height="304" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.doOnSubscribe.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>... | [
"Returns",
"a",
"Completable",
"instance",
"that",
"calls",
"the",
"given",
"onSubscribe",
"callback",
"with",
"the",
"disposable",
"that",
"child",
"subscribers",
"receive",
"on",
"subscription",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"30... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L1613-L1619 | test | Creates a new instance of the class and invokes the provided consumer onSubscribe on each subscription. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnSubscribe(Consumer<? super Disposable> onSubscribe) {
return doOnLifecycle(onSubscribe, Functions.emptyConsumer(),
Functions.EMPTY_ACTION, Func... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/Coder.java | Coder.setTimeBase | public void setTimeBase(Rational newTimeBase) {
VideoJNI.Coder_setTimeBase(swigCPtr, this, Rational.getCPtr(newTimeBase), newTimeBase);
} | java | public void setTimeBase(Rational newTimeBase) {
VideoJNI.Coder_setTimeBase(swigCPtr, this, Rational.getCPtr(newTimeBase), newTimeBase);
} | [
"public",
"void",
"setTimeBase",
"(",
"Rational",
"newTimeBase",
")",
"{",
"VideoJNI",
".",
"Coder_setTimeBase",
"(",
"swigCPtr",
",",
"this",
",",
"Rational",
".",
"getCPtr",
"(",
"newTimeBase",
")",
",",
"newTimeBase",
")",
";",
"}"
] | Set the time base we'll use to ENCODE with. A no-op when DECODING.<br>
<br>
As a convenience, we forward this call to the Stream#setTimeBase()<br>
method.<br>
<br>
@see #getTimeBase()<br>
<br>
@param newTimeBase The new time base to use. | [
"Set",
"the",
"time",
"base",
"we",
"ll",
"use",
"to",
"ENCODE",
"with",
".",
"A",
"no",
"-",
"op",
"when",
"DECODING",
".",
"<br",
">",
"<br",
">",
"As",
"a",
"convenience",
"we",
"forward",
"this",
"call",
"to",
"the",
"Stream#setTimeBase",
"()",
"... | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Coder.java#L342-L344 | test | Sets the time base of this Coder. | Of course, here is the Java code you requested:
```java
public void setTimeBase(Rational newTimeBase) {
VideoJNI.Coder_setTimeBase(swigCPtr, this, Rational.getCPtr(newTimeBase), newTimeBase);
}
```
Hope this helps! |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/mcidas/McIDASAreaTransformBuilder.java | McIDASAreaTransformBuilder.getIntArray | private int[] getIntArray(AttributeContainer ctv, String attName) {
Attribute att = ctv.findAttribute(attName);
if (att == null) {
throw new IllegalArgumentException("McIDASArea coordTransformVariable " + ctv.getName() + " must have " + attName + " attribute");
}
Array arr = att.getValues()... | java | private int[] getIntArray(AttributeContainer ctv, String attName) {
Attribute att = ctv.findAttribute(attName);
if (att == null) {
throw new IllegalArgumentException("McIDASArea coordTransformVariable " + ctv.getName() + " must have " + attName + " attribute");
}
Array arr = att.getValues()... | [
"private",
"int",
"[",
"]",
"getIntArray",
"(",
"AttributeContainer",
"ctv",
",",
"String",
"attName",
")",
"{",
"Attribute",
"att",
"=",
"ctv",
".",
"findAttribute",
"(",
"attName",
")",
";",
"if",
"(",
"att",
"==",
"null",
")",
"{",
"throw",
"new",
"... | get the int array from the variable attribute
@param ctv coordinate transform variable
@param attName the attribute name
@return the int array | [
"get",
"the",
"int",
"array",
"from",
"the",
"variable",
"attribute"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/mcidas/McIDASAreaTransformBuilder.java#L60-L68 | test | Gets the int array. | Of course, here is the Java code you requested:
```java
private int[] getIntArray(AttributeContainer ctv, String attName) {
Attribute att = ctv.findAttribute(attName);
if (att == null) {
throw new IllegalArgumentException("McIDASArea coordTransformVariable " + ctv.getName() + " must have " + attName +... |
eiichiro/bootleg | src/main/java/org/eiichiro/bootleg/Pipeline.java | Pipeline.set | public Pipeline<T> set(String name, Function<T, T> function) {
return set(stages.size(), name, function);
} | java | public Pipeline<T> set(String name, Function<T, T> function) {
return set(stages.size(), name, function);
} | [
"public",
"Pipeline",
"<",
"T",
">",
"set",
"(",
"String",
"name",
",",
"Function",
"<",
"T",
",",
"T",
">",
"function",
")",
"{",
"return",
"set",
"(",
"stages",
".",
"size",
"(",
")",
",",
"name",
",",
"function",
")",
";",
"}"
] | Sets the specified {@code Function} to the next processing stage with the
specified stage name.
@param name The stage name.
@param function The {@code Function} set to the next processing stage.
@return This {@code Pipeline} instance. | [
"Sets",
"the",
"specified",
"{",
"@code",
"Function",
"}",
"to",
"the",
"next",
"processing",
"stage",
"with",
"the",
"specified",
"stage",
"name",
"."
] | b98a108500597cb6185056be2eef7de5ba1963d2 | https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/Pipeline.java#L113-L115 | test | Set a pipeline to the given name and function. | Of course, here is the Java code you requested:
```java
public Pipeline<T> set(String name, Function<T, T> function) {
return set(stages.size(), name, function);
}
```
Hope this helps! |
oblac/jodd | jodd-db/src/main/java/jodd/db/DbCallResult.java | DbCallResult.getByte | public byte getByte(final int index) {
try {
return statement.getByte(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
} | java | public byte getByte(final int index) {
try {
return statement.getByte(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
} | [
"public",
"byte",
"getByte",
"(",
"final",
"int",
"index",
")",
"{",
"try",
"{",
"return",
"statement",
".",
"getByte",
"(",
"index",
")",
";",
"}",
"catch",
"(",
"SQLException",
"sex",
")",
"{",
"throw",
"newGetParamError",
"(",
"index",
",",
"sex",
"... | ---------------------------------------------------------------- byte | [
"----------------------------------------------------------------",
"byte"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/DbCallResult.java#L114-L120 | test | Retrieve a byte value from the database. | Of course, here is the Java code you requested:
```java
public byte getByte(final int index) {
try {
return statement.getByte(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java | BaseComplexNDArray.addiColumnVector | @Override
public IComplexNDArray addiColumnVector(INDArray columnVector) {
for (int i = 0; i < columns(); i++) {
getColumn(i).addi(columnVector.getScalar(i));
}
return this;
} | java | @Override
public IComplexNDArray addiColumnVector(INDArray columnVector) {
for (int i = 0; i < columns(); i++) {
getColumn(i).addi(columnVector.getScalar(i));
}
return this;
} | [
"@",
"Override",
"public",
"IComplexNDArray",
"addiColumnVector",
"(",
"INDArray",
"columnVector",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"columns",
"(",
")",
";",
"i",
"++",
")",
"{",
"getColumn",
"(",
"i",
")",
".",
"addi",
"(",... | In place addition of a column vector
@param columnVector the column vector to add
@return the result of the addition | [
"In",
"place",
"addition",
"of",
"a",
"column",
"vector"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L2373-L2379 | test | Add the vector to the matrix. | Of course, here is the Java code you requested:
```java
@Override
public IComplexNDArray addiColumnVector(INDArray columnVector) {
for (int i = 0; i < columns(); i++) {
getColumn(i).addi(columnVector.getScalar(i));
}
return this;
}
```
Hope this helps! |
RuedigerMoeller/fast-serialization | src/main/java/org/nustaq/serialization/minbin/MBOut.java | MBOut.writeRawInt | protected void writeRawInt(byte type, long data) {
int numBytes = MinBin.extractNumBytes(type);
for (int i = 0; i < numBytes; i++) {
writeOut((byte) (data & 0xff));
data = data >>> 8;
}
} | java | protected void writeRawInt(byte type, long data) {
int numBytes = MinBin.extractNumBytes(type);
for (int i = 0; i < numBytes; i++) {
writeOut((byte) (data & 0xff));
data = data >>> 8;
}
} | [
"protected",
"void",
"writeRawInt",
"(",
"byte",
"type",
",",
"long",
"data",
")",
"{",
"int",
"numBytes",
"=",
"MinBin",
".",
"extractNumBytes",
"(",
"type",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numBytes",
";",
"i",
"++",
")... | encode int without header tag
@param data | [
"encode",
"int",
"without",
"header",
"tag"
] | 59f8f800b79479d0b9c80901cf55903d9b027f26 | https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/minbin/MBOut.java#L72-L78 | test | Write raw int. | Of course, here is the Java code you requested:
```java
protected void writeRawInt(byte type, long data) {
int numBytes = MinBin.extractNumBytes(type);
for (int i = 0; i < numBytes; i++) {
writeOut((byte) (data & 0xff));
data = data >>> 8;
}
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java | ObjectFactory.createHebebuehne | @XmlElementDecl(namespace = "", name = "hebebuehne")
public JAXBElement<Boolean> createHebebuehne(Boolean value) {
return new JAXBElement<Boolean>(_Hebebuehne_QNAME, Boolean.class, null, value);
} | java | @XmlElementDecl(namespace = "", name = "hebebuehne")
public JAXBElement<Boolean> createHebebuehne(Boolean value) {
return new JAXBElement<Boolean>(_Hebebuehne_QNAME, Boolean.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"\"",
",",
"name",
"=",
"\"hebebuehne\"",
")",
"public",
"JAXBElement",
"<",
"Boolean",
">",
"createHebebuehne",
"(",
"Boolean",
"value",
")",
"{",
"return",
"new",
"JAXBElement",
"<",
"Boolean",
">",
"(",
"_He... | Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Boolean",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2787-L2790 | test | Create an instance of the Hebebuehne JAXBElement. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "hebebuehne")
public JAXBElement<Boolean> createHebebuehne(Boolean value) {
return new JAXBElement<Boolean>(_Hebebuehne_QNAME, Boolean.class, null, value);
}
```
Hope this helps! |
wildfly/wildfly | connector/src/main/java/org/jboss/as/connector/util/Injection.java | Injection.findField | protected Field findField(Class<?> clz, String fieldName, String fieldType) {
while (!clz.equals(Object.class)) {
List<Field> hits = null;
Field[] fields = SecurityActions.getDeclaredFields(clz);
for (int i = 0; i < fields.length; i++) {
final Field field = fi... | java | protected Field findField(Class<?> clz, String fieldName, String fieldType) {
while (!clz.equals(Object.class)) {
List<Field> hits = null;
Field[] fields = SecurityActions.getDeclaredFields(clz);
for (int i = 0; i < fields.length; i++) {
final Field field = fi... | [
"protected",
"Field",
"findField",
"(",
"Class",
"<",
"?",
">",
"clz",
",",
"String",
"fieldName",
",",
"String",
"fieldType",
")",
"{",
"while",
"(",
"!",
"clz",
".",
"equals",
"(",
"Object",
".",
"class",
")",
")",
"{",
"List",
"<",
"Field",
">",
... | Find a field
@param clz The class
@param fieldName The field name
@param fieldType The field type; can be <code>null</code>
@return The field; <code>null</code> if not found | [
"Find",
"a",
"field"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/connector/src/main/java/org/jboss/as/connector/util/Injection.java#L231-L269 | test | Find field. | Of course, here is the Java code you requested:
```java
protected Field findField(Class<?> clz, String fieldName, String fieldType) {
while (!clz.equals(Object.class)) {
List<Field> hits = null;
Field[] fields = SecurityActions.getDeclaredFields(clz);
for (int i = 0; i < fie... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/hdf5/H5iosp.java | H5iosp.convertHeap | void convertHeap(ArrayStructureBB asbb, int pos, StructureMembers sm) throws java.io.IOException, InvalidRangeException {
ByteBuffer bb = asbb.getByteBuffer();
for (StructureMembers.Member m : sm.getMembers()) {
if (m.getDataType() == DataType.STRING) {
m.setDataObject(ByteOrder.nativeOrder()); //... | java | void convertHeap(ArrayStructureBB asbb, int pos, StructureMembers sm) throws java.io.IOException, InvalidRangeException {
ByteBuffer bb = asbb.getByteBuffer();
for (StructureMembers.Member m : sm.getMembers()) {
if (m.getDataType() == DataType.STRING) {
m.setDataObject(ByteOrder.nativeOrder()); //... | [
"void",
"convertHeap",
"(",
"ArrayStructureBB",
"asbb",
",",
"int",
"pos",
",",
"StructureMembers",
"sm",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"InvalidRangeException",
"{",
"ByteBuffer",
"bb",
"=",
"asbb",
".",
"getByteBuffer",
"(",
")",
... | /*
public static int setOffsets(StructureMembers members) {
int offset = 0;
for (StructureMembers.Member m : members.getMembers()) {
m.setDataParam(offset);
offset += m.getSizeBytes();
set inner offsets (starts again at 0)
if (m.getStructureMembers() != null)
setOffsets(m.getStructureMembers());
}
members.setStructure... | [
"/",
"*",
"public",
"static",
"int",
"setOffsets",
"(",
"StructureMembers",
"members",
")",
"{",
"int",
"offset",
"=",
"0",
";",
"for",
"(",
"StructureMembers",
".",
"Member",
"m",
":",
"members",
".",
"getMembers",
"()",
")",
"{",
"m",
".",
"setDataPara... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/hdf5/H5iosp.java#L415-L487 | test | Convert the heap structure to the array structurebb. | Of course, here is the Java code you requested:
```java
void convertHeap(ArrayStructureBB asbb, int pos, StructureMembers sm) throws java.io.IOException, InvalidRangeException {
ByteBuffer bb = asbb.getByteBuffer();
for (StructureMembers.Member m : sm.getMembers()) {
if (m.getDataType() == DataType.STRIN... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasDnrm2 | public static double cublasDnrm2(int n, Pointer x, int incx)
{
double result = cublasDnrm2Native(n, x, incx);
checkResultBLAS();
return result;
} | java | public static double cublasDnrm2(int n, Pointer x, int incx)
{
double result = cublasDnrm2Native(n, x, incx);
checkResultBLAS();
return result;
} | [
"public",
"static",
"double",
"cublasDnrm2",
"(",
"int",
"n",
",",
"Pointer",
"x",
",",
"int",
"incx",
")",
"{",
"double",
"result",
"=",
"cublasDnrm2Native",
"(",
"n",
",",
"x",
",",
"incx",
")",
";",
"checkResultBLAS",
"(",
")",
";",
"return",
"resul... | <pre>
double
dnrm2 (int n, const double *x, int incx)
computes the Euclidean norm of the double-precision n-vector x (with
storage increment incx). This code uses a multiphase model of
accumulation to avoid intermediate underflow and overflow.
Input
-----
n number of elements in input vector
x double-precis... | [
"<pre",
">",
"double",
"dnrm2",
"(",
"int",
"n",
"const",
"double",
"*",
"x",
"int",
"incx",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L7235-L7240 | test | Deduce Translation of a Cublas tag. | Of course, here is the Java code you requested:
```java
public static double cublasDnrm2(int n, Pointer x, int incx)
{
double result = cublasDnrm2Native(n, x, incx);
checkResultBLAS();
return result;
}
```
Hope this helps! |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java | Generator.genPreambleMethods | private void genPreambleMethods() throws JasperException {
// Method used to get compile time file dependencies
out.printil("public java.util.List<String> getDependants() {");
out.pushIndent();
out.printil("return _jspx_dependants;");
out.popIndent();
out.printil("}");
... | java | private void genPreambleMethods() throws JasperException {
// Method used to get compile time file dependencies
out.printil("public java.util.List<String> getDependants() {");
out.pushIndent();
out.printil("return _jspx_dependants;");
out.popIndent();
out.printil("}");
... | [
"private",
"void",
"genPreambleMethods",
"(",
")",
"throws",
"JasperException",
"{",
"// Method used to get compile time file dependencies",
"out",
".",
"printil",
"(",
"\"public java.util.List<String> getDependants() {\"",
")",
";",
"out",
".",
"pushIndent",
"(",
")",
";",... | Declare general-purpose methods
(shared by servlet and tag handler preamble generation) | [
"Declare",
"general",
"-",
"purpose",
"methods",
"(",
"shared",
"by",
"servlet",
"and",
"tag",
"handler",
"preamble",
"generation",
")"
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java#L490-L535 | test | Generate code to generate the tag handler methods. | Of course, here is the Java code you requested:
```java
private void genPreambleMethods() throws JasperException {
// Method used to get compile time file dependencies
out.printil("public java.util.List<String> getDependants() {");
out.pushIndent();
out.printil("return _jspx_dependants;... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/util/StringUtil2.java | StringUtil2.filter | static public String filter(String x, String okChars) {
boolean ok = true;
for (int pos = 0; pos < x.length(); pos++) {
char c = x.charAt(pos);
if (!(Character.isLetterOrDigit(c) || (0 <= okChars.indexOf(c)))) {
ok = false;
break;
}
}
if (ok) {
return x;... | java | static public String filter(String x, String okChars) {
boolean ok = true;
for (int pos = 0; pos < x.length(); pos++) {
char c = x.charAt(pos);
if (!(Character.isLetterOrDigit(c) || (0 <= okChars.indexOf(c)))) {
ok = false;
break;
}
}
if (ok) {
return x;... | [
"static",
"public",
"String",
"filter",
"(",
"String",
"x",
",",
"String",
"okChars",
")",
"{",
"boolean",
"ok",
"=",
"true",
";",
"for",
"(",
"int",
"pos",
"=",
"0",
";",
"pos",
"<",
"x",
".",
"length",
"(",
")",
";",
"pos",
"++",
")",
"{",
"c... | Remove any char not alphanumeric or in okChars.
@param x filter this string
@param okChars these are ok.
@return filtered string. | [
"Remove",
"any",
"char",
"not",
"alphanumeric",
"or",
"in",
"okChars",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/util/StringUtil2.java#L112-L135 | test | Filter the input String by checking if all of the characters in okChars are letters or digits. | Of course, here is the Java code you requested:
```java
static public String filter(String x, String okChars) {
boolean ok = true;
for (int pos = 0; pos < x.length(); pos++) {
char c = x.charAt(pos);
if (!(Character.isLetterOrDigit(c) || (0 <= okChars.indexOf(c)))) {
ok = false;
... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/AES256Local.java | AES256Local.poisonBytes | private static byte[] poisonBytes(byte[] bytesToPoisonParam) {
if (bytesToPoisonParam == null) {
return null;
}
byte[] returnVal = new byte[bytesToPoisonParam.length];
for (int index = 0; index < bytesToPoisonParam.length; index++) {
byte poisoned = (byte) (byte... | java | private static byte[] poisonBytes(byte[] bytesToPoisonParam) {
if (bytesToPoisonParam == null) {
return null;
}
byte[] returnVal = new byte[bytesToPoisonParam.length];
for (int index = 0; index < bytesToPoisonParam.length; index++) {
byte poisoned = (byte) (byte... | [
"private",
"static",
"byte",
"[",
"]",
"poisonBytes",
"(",
"byte",
"[",
"]",
"bytesToPoisonParam",
")",
"{",
"if",
"(",
"bytesToPoisonParam",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"byte",
"[",
"]",
"returnVal",
"=",
"new",
"byte",
"[",
"b... | Creates a derived version of {@code bytesToPoisonParam}.
@param bytesToPoisonParam The bytes to poison.
@return The poisoned bytes. | [
"Creates",
"a",
"derived",
"version",
"of",
"{",
"@code",
"bytesToPoisonParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/AES256Local.java#L141-L155 | test | poison bytes to bytes | Of course, here is the Java code you requested:
```java
private static byte[] poisonBytes(byte[] bytesToPoisonParam) {
if (bytesToPoisonParam == null) {
return null;
}
byte[] returnVal = new byte[bytesToPoisonParam.length];
for (int index = 0; index < bytesToPoisonParam.le... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/wmo/Util.java | Util.equivilantName | public static boolean equivilantName(String name1, String name2) {
if (name1 == null || name2 == null) return (name1 == name2);
String name1clean = cleanName(name1).toLowerCase();
String name2clean = cleanName(name2).toLowerCase();
if (name1.equals(name2)) return true;
StringBuilder sb1 = new... | java | public static boolean equivilantName(String name1, String name2) {
if (name1 == null || name2 == null) return (name1 == name2);
String name1clean = cleanName(name1).toLowerCase();
String name2clean = cleanName(name2).toLowerCase();
if (name1.equals(name2)) return true;
StringBuilder sb1 = new... | [
"public",
"static",
"boolean",
"equivilantName",
"(",
"String",
"name1",
",",
"String",
"name2",
")",
"{",
"if",
"(",
"name1",
"==",
"null",
"||",
"name2",
"==",
"null",
")",
"return",
"(",
"name1",
"==",
"name2",
")",
";",
"String",
"name1clean",
"=",
... | Compare two names from tables, trying to ignore superfulous characters.
@return true if these are equivilent | [
"Compare",
"two",
"names",
"from",
"tables",
"trying",
"to",
"ignore",
"superfulous",
"characters",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/wmo/Util.java#L80-L91 | test | Checks if two name are equivalent. | Of course, here is the Java code you requested:
```java
public static boolean equivilantName(String name1, String name2) {
if (name1 == null || name2 == null) return (name1 == name2);
String name1clean = cleanName(name1).toLowerCase();
String name2clean = cleanName(name2).toLowerCase();
if (name1.e... |
NanoHttpd/nanohttpd | core/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java | NanoHTTPD.getMimeTypeForFile | public static String getMimeTypeForFile(String uri) {
int dot = uri.lastIndexOf('.');
String mime = null;
if (dot >= 0) {
mime = mimeTypes().get(uri.substring(dot + 1).toLowerCase());
}
return mime == null ? "application/octet-stream" : mime;
} | java | public static String getMimeTypeForFile(String uri) {
int dot = uri.lastIndexOf('.');
String mime = null;
if (dot >= 0) {
mime = mimeTypes().get(uri.substring(dot + 1).toLowerCase());
}
return mime == null ? "application/octet-stream" : mime;
} | [
"public",
"static",
"String",
"getMimeTypeForFile",
"(",
"String",
"uri",
")",
"{",
"int",
"dot",
"=",
"uri",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"String",
"mime",
"=",
"null",
";",
"if",
"(",
"dot",
">=",
"0",
")",
"{",
"mime",
"=",
"mime... | Get MIME type from file name extension, if possible
@param uri
the string representing a file
@return the connected mime/type | [
"Get",
"MIME",
"type",
"from",
"file",
"name",
"extension",
"if",
"possible"
] | b04a342a4bcd0ff44be65138acffc73a29381c72 | https://github.com/NanoHttpd/nanohttpd/blob/b04a342a4bcd0ff44be65138acffc73a29381c72/core/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java#L292-L299 | test | Get the mime type for a file. | Of course, here is the Java code you requested:
```java
public static String getMimeTypeForFile(String uri) {
int dot = uri.lastIndexOf('.');
String mime = null;
if (dot >= 0) {
mime = mimeTypes().get(uri.substring(dot + 1).toLowerCase());
}
return mime == null ? "ap... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/config/Targets.java | Targets.createActionMethodArgument | @SuppressWarnings({"unchecked", "NullArgumentToVariableArgMethod"})
protected Object createActionMethodArgument(final Class type, final Object action) {
try {
if (type.getEnclosingClass() == null || Modifier.isStatic(type.getModifiers())) {
// regular or static class
return ClassUtil.newInstance(type);
... | java | @SuppressWarnings({"unchecked", "NullArgumentToVariableArgMethod"})
protected Object createActionMethodArgument(final Class type, final Object action) {
try {
if (type.getEnclosingClass() == null || Modifier.isStatic(type.getModifiers())) {
// regular or static class
return ClassUtil.newInstance(type);
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"NullArgumentToVariableArgMethod\"",
"}",
")",
"protected",
"Object",
"createActionMethodArgument",
"(",
"final",
"Class",
"type",
",",
"final",
"Object",
"action",
")",
"{",
"try",
"{",
"if",
"(",
"type",... | Creates action method arguments. | [
"Creates",
"action",
"method",
"arguments",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/config/Targets.java#L171-L186 | test | Create action method argument. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({"unchecked", "NullArgumentToVariableArgMethod"})
protected Object createActionMethodArgument(final Class type, final Object action) {
try {
if (type.getEnclosingClass() == null || Modifier.isStatic(type.getModifiers())) {
// regular o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.