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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oblac/jodd | jodd-core/src/main/java/jodd/time/JulianDate.java | JulianDate.toMilliseconds | public long toMilliseconds() {
double then = (fraction - JD_1970.fraction) * MILLIS_IN_DAY;
then += (integer - JD_1970.integer) * MILLIS_IN_DAY;
then += then > 0 ? 1.0e-6 : -1.0e-6;
return (long) then;
} | java | public long toMilliseconds() {
double then = (fraction - JD_1970.fraction) * MILLIS_IN_DAY;
then += (integer - JD_1970.integer) * MILLIS_IN_DAY;
then += then > 0 ? 1.0e-6 : -1.0e-6;
return (long) then;
} | [
"public",
"long",
"toMilliseconds",
"(",
")",
"{",
"double",
"then",
"=",
"(",
"fraction",
"-",
"JD_1970",
".",
"fraction",
")",
"*",
"MILLIS_IN_DAY",
";",
"then",
"+=",
"(",
"integer",
"-",
"JD_1970",
".",
"integer",
")",
"*",
"MILLIS_IN_DAY",
";",
"the... | Converts to milliseconds. | [
"Converts",
"to",
"milliseconds",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/time/JulianDate.java#L273-L278 | test | Gets the milliseconds. | Of course, here is the Java code you requested:
```java
public long toMilliseconds() {
double then = (fraction - JD_1970.fraction) * MILLIS_IN_DAY;
then += (integer - JD_1970.integer) * MILLIS_IN_DAY;
then += then > 0 ? 1.0e-6 : -1.0e-6;
return (long) then;
}
```
Hope this helps! |
arnohaase/a-foundation | a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/ABTreeMap.java | ABTreeMap.empty | @SuppressWarnings ("unchecked")
public static <K, V> ABTreeMap<K, V> empty (ABTreeSpec spec) {
return new LeafNode (spec, new Object[0], new Object[0]);
} | java | @SuppressWarnings ("unchecked")
public static <K, V> ABTreeMap<K, V> empty (ABTreeSpec spec) {
return new LeafNode (spec, new Object[0], new Object[0]);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"ABTreeMap",
"<",
"K",
",",
"V",
">",
"empty",
"(",
"ABTreeSpec",
"spec",
")",
"{",
"return",
"new",
"LeafNode",
"(",
"spec",
",",
"new",
"Object",
"[",
... | intentionally not volatile: This class is immutable, so recalculating per thread works | [
"intentionally",
"not",
"volatile",
":",
"This",
"class",
"is",
"immutable",
"so",
"recalculating",
"per",
"thread",
"works"
] | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/ABTreeMap.java#L18-L21 | test | Create an empty map. | Of course, here is the Java code you requested:
```java
@SuppressWarnings ("unchecked")
public static <K, V> ABTreeMap<K, V> empty (ABTreeSpec spec) {
return new LeafNode (spec, new Object[0], new Object[0]);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/sigmet/SigmetIOServiceProvider.java | SigmetIOServiceProvider.readToByteChannel11 | public long readToByteChannel11(ucar.nc2.Variable v2, Section section, WritableByteChannel channel)
throws java.io.IOException, ucar.ma2.InvalidRangeException {
Array data = readData(v2, section);
float[] ftdata = new float[(int) data.getSize()];
byte[] bytedata = new byte[(int) data.getSize()... | java | public long readToByteChannel11(ucar.nc2.Variable v2, Section section, WritableByteChannel channel)
throws java.io.IOException, ucar.ma2.InvalidRangeException {
Array data = readData(v2, section);
float[] ftdata = new float[(int) data.getSize()];
byte[] bytedata = new byte[(int) data.getSize()... | [
"public",
"long",
"readToByteChannel11",
"(",
"ucar",
".",
"nc2",
".",
"Variable",
"v2",
",",
"Section",
"section",
",",
"WritableByteChannel",
"channel",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"ucar",
".",
"ma2",
".",
"InvalidRangeExceptio... | Read data from a top level Variable and send data to a WritableByteChannel.
@param v2 Variable
@param section wanted section of data of Variable. The section list is a list
of ucar.ma2.Range which define the requested data subset.
@param channel WritableByteChannel object - channel that can write bytes.
@return t... | [
"Read",
"data",
"from",
"a",
"top",
"level",
"Variable",
"and",
"send",
"data",
"to",
"a",
"WritableByteChannel",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/sigmet/SigmetIOServiceProvider.java#L864-L891 | test | Reads the data from the Variable v2 to the WritableByteChannel 11. | Of course, here is the Java code you requested:
```java
public long readToByteChannel11(ucar.nc2.Variable v2, Section section, WritableByteChannel channel)
throws java.io.IOException, ucar.ma2.InvalidRangeException {
Array data = readData(v2, section);
float[] ftdata = new float[(int) data.getSize... |
abmargb/jamppa | src/main/java/org/jivesoftware/smack/debugger/LiteDebugger.java | LiteDebugger.rootWindowClosing | public void rootWindowClosing(WindowEvent evt) {
connection.removePacketListener(listener);
((ObservableReader) reader).removeReaderListener(readerListener);
((ObservableWriter) writer).removeWriterListener(writerListener);
} | java | public void rootWindowClosing(WindowEvent evt) {
connection.removePacketListener(listener);
((ObservableReader) reader).removeReaderListener(readerListener);
((ObservableWriter) writer).removeWriterListener(writerListener);
} | [
"public",
"void",
"rootWindowClosing",
"(",
"WindowEvent",
"evt",
")",
"{",
"connection",
".",
"removePacketListener",
"(",
"listener",
")",
";",
"(",
"(",
"ObservableReader",
")",
"reader",
")",
".",
"removeReaderListener",
"(",
"readerListener",
")",
";",
"(",... | Notification that the root window is closing. Stop listening for received
and transmitted packets.
@param evt
the event that indicates that the root window is closing | [
"Notification",
"that",
"the",
"root",
"window",
"is",
"closing",
".",
"Stop",
"listening",
"for",
"received",
"and",
"transmitted",
"packets",
"."
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/debugger/LiteDebugger.java#L293-L297 | test | This method is called when the root window is closed. | Of course, here is the Java code you requested:
```java
public void rootWindowClosing(WindowEvent evt) {
connection.removePacketListener(listener);
((ObservableReader) reader).removeReaderListener(readerListener);
((ObservableWriter) writer).removeWriterListener(writerListener);
}
```
Hope... |
cologneintelligence/FitGoodies | fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/FixtureRunner.java | FixtureRunner.doDocument | public void doDocument(FitDocument document) {
summary.put("run date", new Date());
summary.put("run elapsed time", new RunTime());
if (document != null) {
interpretTables(document);
}
} | java | public void doDocument(FitDocument document) {
summary.put("run date", new Date());
summary.put("run elapsed time", new RunTime());
if (document != null) {
interpretTables(document);
}
} | [
"public",
"void",
"doDocument",
"(",
"FitDocument",
"document",
")",
"{",
"summary",
".",
"put",
"(",
"\"run date\"",
",",
"new",
"Date",
"(",
")",
")",
";",
"summary",
".",
"put",
"(",
"\"run elapsed time\"",
",",
"new",
"RunTime",
"(",
")",
")",
";",
... | /* Altered by Rick Mugridge to dispatch on the first Fixture | [
"/",
"*",
"Altered",
"by",
"Rick",
"Mugridge",
"to",
"dispatch",
"on",
"the",
"first",
"Fixture"
] | 834e42d1f41b4b9226060b1e83a80cc69ea88c7b | https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/FixtureRunner.java#L39-L45 | test | This method is called to process a fit document. | Of course, here is the Java code you requested:
```java
public void doDocument(FitDocument document) {
summary.put("run date", new Date());
summary.put("run elapsed time", new RunTime());
if (document != null) {
interpretTables(document);
}
}
```
Hope this helps! |
wildfly/wildfly | pojo/src/main/java/org/jboss/as/pojo/service/AbstractPojoPhase.java | AbstractPojoPhase.considerUninstalls | protected void considerUninstalls(List<Joinpoint> uninstalls, int index) {
if (uninstalls == null)
return;
for (int j = Math.min(index, uninstalls.size() - 1); j >= 0; j--) {
try {
uninstalls.get(j).dispatch();
} catch (Throwable t) {
... | java | protected void considerUninstalls(List<Joinpoint> uninstalls, int index) {
if (uninstalls == null)
return;
for (int j = Math.min(index, uninstalls.size() - 1); j >= 0; j--) {
try {
uninstalls.get(j).dispatch();
} catch (Throwable t) {
... | [
"protected",
"void",
"considerUninstalls",
"(",
"List",
"<",
"Joinpoint",
">",
"uninstalls",
",",
"int",
"index",
")",
"{",
"if",
"(",
"uninstalls",
"==",
"null",
")",
"return",
";",
"for",
"(",
"int",
"j",
"=",
"Math",
".",
"min",
"(",
"index",
",",
... | Consider the uninstalls.
<p/>
This method is here to be able to override
the behavior after installs failed.
e.g. perhaps only running uninstalls from the index.
<p/>
By default we run all uninstalls in the case
at least one install failed.
@param uninstalls the uninstalls
@param index current installs index | [
"Consider",
"the",
"uninstalls",
".",
"<p",
"/",
">",
"This",
"method",
"is",
"here",
"to",
"be",
"able",
"to",
"override",
"the",
"behavior",
"after",
"installs",
"failed",
".",
"e",
".",
"g",
".",
"perhaps",
"only",
"running",
"uninstalls",
"from",
"th... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/pojo/src/main/java/org/jboss/as/pojo/service/AbstractPojoPhase.java#L223-L234 | test | Consider uninstalls. | Of course, here is the Java code you requested:
```java
protected void considerUninstalls(List<Joinpoint> uninstalls, int index) {
if (uninstalls == null)
return;
for (int j = Math.min(index, uninstalls.size() - 1); j >= 0; j--) {
try {
uninstalls.get(j).dispatc... |
markhobson/microbrowser | tck/src/main/java/org/hobsoft/microbrowser/tck/MicrodataPropertyTck.java | MicrodataPropertyTck.getDoubleValueReturnsDouble | @Test
public void getDoubleValueReturnsDouble()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://i'>"
+ "<p itemprop='p'>1</p>"
+ "</div>"
+ "</body></html>"));
double actual = newBrowser().get(url(server()))
.getItem("http://i")
.get... | java | @Test
public void getDoubleValueReturnsDouble()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://i'>"
+ "<p itemprop='p'>1</p>"
+ "</div>"
+ "</body></html>"));
double actual = newBrowser().get(url(server()))
.getItem("http://i")
.get... | [
"@",
"Test",
"public",
"void",
"getDoubleValueReturnsDouble",
"(",
")",
"{",
"server",
"(",
")",
".",
"enqueue",
"(",
"new",
"MockResponse",
"(",
")",
".",
"setBody",
"(",
"\"<html><body>\"",
"+",
"\"<div itemscope='itemscope' itemtype='http://i'>\"",
"+",
"\"<p ite... | ---------------------------------------------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------------------------------------------"
] | 732d2dadc1c3eaad688de31dc09f360df580faf1 | https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/tck/src/main/java/org/hobsoft/microbrowser/tck/MicrodataPropertyTck.java#L1041-L1056 | test | Gets a double value. | Of course, here is the Java code you requested:
```java
@Test
public void getDoubleValueReturnsDouble()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://i'>"
+ "<p itemprop='p'>1</p>"
+ "</div>"
+ "</body></html>"));
double actual = newBro... |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/messaging/MessageSecurityMetadataSourceRegistry.java | MessageSecurityMetadataSourceRegistry.expressionHandler | public MessageSecurityMetadataSourceRegistry expressionHandler(SecurityExpressionHandler<Message<Object>> expressionHandler) {
Assert.notNull(expressionHandler, "expressionHandler cannot be null");
this.expressionHandler = expressionHandler;
return this;
} | java | public MessageSecurityMetadataSourceRegistry expressionHandler(SecurityExpressionHandler<Message<Object>> expressionHandler) {
Assert.notNull(expressionHandler, "expressionHandler cannot be null");
this.expressionHandler = expressionHandler;
return this;
} | [
"public",
"MessageSecurityMetadataSourceRegistry",
"expressionHandler",
"(",
"SecurityExpressionHandler",
"<",
"Message",
"<",
"Object",
">",
">",
"expressionHandler",
")",
"{",
"Assert",
".",
"notNull",
"(",
"expressionHandler",
",",
"\"expressionHandler cannot be null\"",
... | The {@link SecurityExpressionHandler} to be used. The
default is to use {@link DefaultMessageSecurityExpressionHandler}.
@param expressionHandler the {@link SecurityExpressionHandler} to use. Cannot be null.
@return the {@link MessageSecurityMetadataSourceRegistry} for further
customization. | [
"The",
"{",
"@link",
"SecurityExpressionHandler",
"}",
"to",
"be",
"used",
".",
"The",
"default",
"is",
"to",
"use",
"{",
"@link",
"DefaultMessageSecurityExpressionHandler",
"}",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/messaging/MessageSecurityMetadataSourceRegistry.java#L219-L223 | test | Sets the expression handler. | Of course, here is the Java code you requested:
```java
public MessageSecurityMetadataSourceRegistry expressionHandler(SecurityExpressionHandler<Message<Object>> expressionHandler) {
Assert.notNull(expressionHandler, "expressionHandler cannot be null");
this.expressionHandler = expressionHandler;
return this;
}... |
GojaFramework/goja | goja-core/src/main/java/goja/core/kits/stream/StreamUtil.java | StreamUtil.compare | public static boolean compare(InputStream input1, InputStream input2) throws IOException {
if (!(input1 instanceof BufferedInputStream)) {
input1 = new BufferedInputStream(input1);
}
if (!(input2 instanceof BufferedInputStream)) {
input2 = new BufferedInputStream(input2);... | java | public static boolean compare(InputStream input1, InputStream input2) throws IOException {
if (!(input1 instanceof BufferedInputStream)) {
input1 = new BufferedInputStream(input1);
}
if (!(input2 instanceof BufferedInputStream)) {
input2 = new BufferedInputStream(input2);... | [
"public",
"static",
"boolean",
"compare",
"(",
"InputStream",
"input1",
",",
"InputStream",
"input2",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"(",
"input1",
"instanceof",
"BufferedInputStream",
")",
")",
"{",
"input1",
"=",
"new",
"BufferedInputStream... | Compares the content of two byte streams.
@return <code>true</code> if the content of the first stream is equal
to the content of the second stream. | [
"Compares",
"the",
"content",
"of",
"two",
"byte",
"streams",
"."
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/stream/StreamUtil.java#L347-L364 | test | Compare two input streams for equality. | Of course, here is the Java code you requested:
```java
public static boolean compare(InputStream input1, InputStream input2) throws IOException {
if (!(input1 instanceof BufferedInputStream)) {
input1 = new BufferedInputStream(input1);
}
if (!(input2 instanceof BufferedInputStream)... |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/DeleteTypeImpl.java | DeleteTypeImpl.ids | @Override
public Result<Void> ids(final String... ids) {
return ids(Arrays.asList(ids));
} | java | @Override
public Result<Void> ids(final String... ids) {
return ids(Arrays.asList(ids));
} | [
"@",
"Override",
"public",
"Result",
"<",
"Void",
">",
"ids",
"(",
"final",
"String",
"...",
"ids",
")",
"{",
"return",
"ids",
"(",
"Arrays",
".",
"asList",
"(",
"ids",
")",
")",
";",
"}"
] | /* (non-Javadoc)
@see com.googlecode.objectify.cmd.DeleteIds#ids(java.lang.String[]) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/DeleteTypeImpl.java#L86-L89 | test | Override to provide an array of IDs to be deleted. | Of course, here is the Java code you requested:
```java
@Override
public Result<Void> ids(final String... ids) {
return ids(Arrays.asList(ids));
}
```
Hope this helps! |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/Rational.java | Rational.sMultiply | public static Rational sMultiply(Rational a, Rational b) {
long cPtr = VideoJNI.Rational_sMultiply(Rational.getCPtr(a), a, Rational.getCPtr(b), b);
return (cPtr == 0) ? null : new Rational(cPtr, false);
} | java | public static Rational sMultiply(Rational a, Rational b) {
long cPtr = VideoJNI.Rational_sMultiply(Rational.getCPtr(a), a, Rational.getCPtr(b), b);
return (cPtr == 0) ? null : new Rational(cPtr, false);
} | [
"public",
"static",
"Rational",
"sMultiply",
"(",
"Rational",
"a",
",",
"Rational",
"b",
")",
"{",
"long",
"cPtr",
"=",
"VideoJNI",
".",
"Rational_sMultiply",
"(",
"Rational",
".",
"getCPtr",
"(",
"a",
")",
",",
"a",
",",
"Rational",
".",
"getCPtr",
"(",... | Multiples a by b.<br>
@param a the first number<br>
@param b the second number.<br>
@return a*b | [
"Multiples",
"a",
"by",
"b",
".",
"<br",
">"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Rational.java#L273-L276 | test | Multiply two numbers. | Of course, here is the Java code you requested:
```java
public static Rational sMultiply(Rational a, Rational b) {
long cPtr = VideoJNI.Rational_sMultiply(Rational.getCPtr(a), a, Rational.getCPtr(b), b);
return (cPtr == 0) ? null : new Rational(cPtr, false);
}
```
Hope this helps! |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/InstructionCompiler.java | InstructionCompiler.compileHead | private SizeableLinkedList<WAMInstruction> compileHead(Functor expression)
{
// Used to build up the results in.
SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMInstruction>();
// Allocate argument registers on the body, to all functors as outermost arguments.
... | java | private SizeableLinkedList<WAMInstruction> compileHead(Functor expression)
{
// Used to build up the results in.
SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMInstruction>();
// Allocate argument registers on the body, to all functors as outermost arguments.
... | [
"private",
"SizeableLinkedList",
"<",
"WAMInstruction",
">",
"compileHead",
"(",
"Functor",
"expression",
")",
"{",
"// Used to build up the results in.",
"SizeableLinkedList",
"<",
"WAMInstruction",
">",
"instructions",
"=",
"new",
"SizeableLinkedList",
"<",
"WAMInstructio... | Compiles the head of a clause into an instruction listing in WAM.
@param expression The clause head to compile.
@return A listing of the instructions for the clause head in the WAM instruction set. | [
"Compiles",
"the",
"head",
"of",
"a",
"clause",
"into",
"an",
"instruction",
"listing",
"in",
"WAM",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/InstructionCompiler.java#L640-L789 | test | Compile the head of a get_struc instruction. | Of course, here is the Java code you requested:
```java
private SizeableLinkedList<WAMInstruction> compileHead(Functor expression)
{
// Used to build up the results in.
SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMInstruction>();
// Allocate argument register... |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/java/org/openestate/io/is24_xml/Is24XmlUtils.java | Is24XmlUtils.createDocument | public static Is24XmlDocument createDocument(Document doc) {
if (Is24XmlDocument.isReadable(doc))
return new Is24XmlDocument(doc);
else
return null;
} | java | public static Is24XmlDocument createDocument(Document doc) {
if (Is24XmlDocument.isReadable(doc))
return new Is24XmlDocument(doc);
else
return null;
} | [
"public",
"static",
"Is24XmlDocument",
"createDocument",
"(",
"Document",
"doc",
")",
"{",
"if",
"(",
"Is24XmlDocument",
".",
"isReadable",
"(",
"doc",
")",
")",
"return",
"new",
"Is24XmlDocument",
"(",
"doc",
")",
";",
"else",
"return",
"null",
";",
"}"
] | Creates a {@link Is24XmlDocument} from a {@link Document}.
@param doc XML document
@return created document or null, of the document is not supported by this format | [
"Creates",
"a",
"{",
"@link",
"Is24XmlDocument",
"}",
"from",
"a",
"{",
"@link",
"Document",
"}",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/java/org/openestate/io/is24_xml/Is24XmlUtils.java#L129-L134 | test | Create a Is24XmlDocument from a Document. | Of course, here is the Java code you requested:
```java
public static Is24XmlDocument createDocument(Document doc) {
if (Is24XmlDocument.isReadable(doc))
return new Is24XmlDocument(doc);
else
return null;
}
```
Hope this helps! |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/ContainerStream.java | ContainerStream.getFrameRate | public Rational getFrameRate() {
long cPtr = VideoJNI.ContainerStream_getFrameRate(swigCPtr, this);
return (cPtr == 0) ? null : new Rational(cPtr, false);
} | java | public Rational getFrameRate() {
long cPtr = VideoJNI.ContainerStream_getFrameRate(swigCPtr, this);
return (cPtr == 0) ? null : new Rational(cPtr, false);
} | [
"public",
"Rational",
"getFrameRate",
"(",
")",
"{",
"long",
"cPtr",
"=",
"VideoJNI",
".",
"ContainerStream_getFrameRate",
"(",
"swigCPtr",
",",
"this",
")",
";",
"return",
"(",
"cPtr",
"==",
"0",
")",
"?",
"null",
":",
"new",
"Rational",
"(",
"cPtr",
",... | Get the (sometimes estimated) average frame rate of this container.<br>
For variable frame-rate containers (they do exist) this is just<br>
an approximation. Better to use getTimeBase().<br>
<br>
For contant frame-rate containers, this will be 1 / ( getTimeBase() )<br>
<br>
@return The frame-rate of this container. | [
"Get",
"the",
"(",
"sometimes",
"estimated",
")",
"average",
"frame",
"rate",
"of",
"this",
"container",
".",
"<br",
">",
"For",
"variable",
"frame",
"-",
"rate",
"containers",
"(",
"they",
"do",
"exist",
")",
"this",
"is",
"just<br",
">",
"an",
"approxi... | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/ContainerStream.java#L174-L177 | test | Get the frame rate of this container stream. | Of course, here is the Java code you requested:
```java
public Rational getFrameRate() {
long cPtr = VideoJNI.ContainerStream_getFrameRate(swigCPtr, this);
return (cPtr == 0) ? null : new Rational(cPtr, false);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/ogc/WKTParser.java | WKTParser.convertWKTToProjection | public static ProjectionImpl convertWKTToProjection(WKTParser srp) {
if (!srp.isPlanarProjection()) {
return new ucar.unidata.geoloc.projection.LatLonProjection();
} else {
String projectionType = srp.getProjectionType();
double falseEasting = 0;
double falseNorthing = 0;
Pr... | java | public static ProjectionImpl convertWKTToProjection(WKTParser srp) {
if (!srp.isPlanarProjection()) {
return new ucar.unidata.geoloc.projection.LatLonProjection();
} else {
String projectionType = srp.getProjectionType();
double falseEasting = 0;
double falseNorthing = 0;
Pr... | [
"public",
"static",
"ProjectionImpl",
"convertWKTToProjection",
"(",
"WKTParser",
"srp",
")",
"{",
"if",
"(",
"!",
"srp",
".",
"isPlanarProjection",
"(",
")",
")",
"{",
"return",
"new",
"ucar",
".",
"unidata",
".",
"geoloc",
".",
"projection",
".",
"LatLonPr... | Convert OGC spatial reference WKT to a ProjectionImpl.
An IllegalArgumentException may be thrown if a parameter is missing.
@param srp The parsed OGC WKT spatial reference text.
@return The ProjectionImpl class.
@throws java.text.ParseException If the OGIS spatial reference text was not parseable. | [
"Convert",
"OGC",
"spatial",
"reference",
"WKT",
"to",
"a",
"ProjectionImpl",
".",
"An",
"IllegalArgumentException",
"may",
"be",
"thrown",
"if",
"a",
"parameter",
"is",
"missing",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/ogc/WKTParser.java#L611-L691 | test | Convert a WKT file to a LatLon Projection object | Of course, here is the Java code you requested:
```java
public static ProjectionImpl convertWKTToProjection(WKTParser srp) {
if (!srp.isPlanarProjection()) {
return new ucar.unidata.geoloc.projection.LatLonProjection();
} else {
String projectionType = srp.getProjectionType();
double fal... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/geoloc/Rubberband.java | Rubberband.anchor | public boolean anchor(Point p) {
firstStretch = true;
anchorPt.x = p.x;
anchorPt.y = p.y;
stretchedPt.x = lastPt.x = anchorPt.x;
stretchedPt.y = lastPt.y = anchorPt.y;
return true;
} | java | public boolean anchor(Point p) {
firstStretch = true;
anchorPt.x = p.x;
anchorPt.y = p.y;
stretchedPt.x = lastPt.x = anchorPt.x;
stretchedPt.y = lastPt.y = anchorPt.y;
return true;
} | [
"public",
"boolean",
"anchor",
"(",
"Point",
"p",
")",
"{",
"firstStretch",
"=",
"true",
";",
"anchorPt",
".",
"x",
"=",
"p",
".",
"x",
";",
"anchorPt",
".",
"y",
"=",
"p",
".",
"y",
";",
"stretchedPt",
".",
"x",
"=",
"lastPt",
".",
"x",
"=",
"... | Set the anchor point. | [
"Set",
"the",
"anchor",
"point",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/geoloc/Rubberband.java#L73-L82 | test | Anchor the polygon. | Of course, here is the Java code you requested:
```java
public boolean anchor(Point p) {
firstStretch = true;
anchorPt.x = p.x;
anchorPt.y = p.y;
stretchedPt.x = lastPt.x = anchorPt.x;
stretchedPt.y = lastPt.y = anchorPt.y;
return true;
}
```
Hope this helps! |
kiegroup/droolsjbpm-tools | drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java | ServerProxy.start | @Override
public void start(String launchMode, IOperationListener listener) {
// TODO Auto-generated method stub
server.start(launchMode, listener);
} | java | @Override
public void start(String launchMode, IOperationListener listener) {
// TODO Auto-generated method stub
server.start(launchMode, listener);
} | [
"@",
"Override",
"public",
"void",
"start",
"(",
"String",
"launchMode",
",",
"IOperationListener",
"listener",
")",
"{",
"// TODO Auto-generated method stub",
"server",
".",
"start",
"(",
"launchMode",
",",
"listener",
")",
";",
"}"
] | /* (non-Javadoc)
@see org.eclipse.wst.server.core.IServer#start(java.lang.String, org.eclipse.wst.server.core.IServer.IOperationListener) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java#L388-L392 | test | Start the service. | Of course, here is the Java code you requested:
```java
@Override
public void start(String launchMode, IOperationListener listener) {
// TODO Auto-generated method stub
server.start(launchMode, listener);
}
```
Hope this helps! |
boonproject/boon | boon/src/main/java/org/boon/Str.java | Str.in | @Universal
public static boolean in( char[] chars, String str ) {
return Chr.in ( chars, FastStringUtils.toCharArray(str) );
} | java | @Universal
public static boolean in( char[] chars, String str ) {
return Chr.in ( chars, FastStringUtils.toCharArray(str) );
} | [
"@",
"Universal",
"public",
"static",
"boolean",
"in",
"(",
"char",
"[",
"]",
"chars",
",",
"String",
"str",
")",
"{",
"return",
"Chr",
".",
"in",
"(",
"chars",
",",
"FastStringUtils",
".",
"toCharArray",
"(",
"str",
")",
")",
";",
"}"
] | See if chars is in another string
@param chars chars
@param str string
@return true or false | [
"See",
"if",
"chars",
"is",
"in",
"another",
"string"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Str.java#L213-L216 | test | Check if a char array is in a string. | Of course, here is the Java code you requested:
```java
@Universal
public static boolean in( char[] chars, String str ) {
return Chr.in ( chars, FastStringUtils.toCharArray(str) );
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/configuration/ConfigRange.java | ConfigRange.buildAt | public final int buildAt(final String fullName,
final ConfigBuildRef configBuildRef, final int atRow,
final Map<String, Object> context,
final List<RowsMapping> currentRowsMappingList) {
if (commandList != null) {
for (int i = 0; i < commandList.size(); i++) {
Command command = commandList.get... | java | public final int buildAt(final String fullName,
final ConfigBuildRef configBuildRef, final int atRow,
final Map<String, Object> context,
final List<RowsMapping> currentRowsMappingList) {
if (commandList != null) {
for (int i = 0; i < commandList.size(); i++) {
Command command = commandList.get... | [
"public",
"final",
"int",
"buildAt",
"(",
"final",
"String",
"fullName",
",",
"final",
"ConfigBuildRef",
"configBuildRef",
",",
"final",
"int",
"atRow",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"context",
",",
"final",
"List",
"<",
"RowsMappin... | build the config range at specified point (start row). context include
the data objects for evaluation. build sequence is inside-out. e.g. first
build all the command area the range included. each command will hold the
final length after data populated. then buildCells build all cells in the
range except those commands... | [
"build",
"the",
"config",
"range",
"at",
"specified",
"point",
"(",
"start",
"row",
")",
".",
"context",
"include",
"the",
"data",
"objects",
"for",
"evaluation",
".",
"build",
"sequence",
"is",
"inside",
"-",
"out",
".",
"e",
".",
"g",
".",
"first",
"... | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/configuration/ConfigRange.java#L311-L335 | test | Creates a new row index based on the full name. | Of course, here is the Java code you requested:
```java
public final int buildAt(final String fullName,
final ConfigBuildRef configBuildRef, final int atRow,
final Map<String, Object> context,
final List<RowsMapping> currentRowsMappingList) {
if (commandList != null) {
for (int i = 0; i < commandL... |
agentsoz/jill | jill/src/main/java/io/github/agentsoz/jill/core/ProgramLoader.java | ProgramLoader.processPlansForGoal | private static boolean processPlansForGoal(GoalType gtype, String[] plans) {
for (int j = 0; j < plans.length; j++) {
// Load the Plan class
Class<?> pclass = loadClass(plans[j], Plan.class);
if (pclass == null) {
return false;
}
// Found the plan class, so add this plan to the... | java | private static boolean processPlansForGoal(GoalType gtype, String[] plans) {
for (int j = 0; j < plans.length; j++) {
// Load the Plan class
Class<?> pclass = loadClass(plans[j], Plan.class);
if (pclass == null) {
return false;
}
// Found the plan class, so add this plan to the... | [
"private",
"static",
"boolean",
"processPlansForGoal",
"(",
"GoalType",
"gtype",
",",
"String",
"[",
"]",
"plans",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"plans",
".",
"length",
";",
"j",
"++",
")",
"{",
"// Load the Plan class",
"C... | Loads the given plan classes and sets up parent-child links with the given goal type.
@param gtype the goal for which the list of plans is provided
@param plans list of plans to be loaded
@return true if successful, false otherwise | [
"Loads",
"the",
"given",
"plan",
"classes",
"and",
"sets",
"up",
"parent",
"-",
"child",
"links",
"with",
"the",
"given",
"goal",
"type",
"."
] | 13126fc78350465b477386132465f84cad719426 | https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/core/ProgramLoader.java#L139-L156 | test | Process the plans for a Goal. | Of course, here is the Java code you requested:
```java
private static boolean processPlansForGoal(GoalType gtype, String[] plans) {
for (int j = 0; j < plans.length; j++) {
// Load the Plan class
Class<?> pclass = loadClass(plans[j], Plan.class);
if (pclass == null) {
return false;
... |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java | JspRuntimeContext.getBytecodeBirthTime | public long getBytecodeBirthTime(String name) {
Long time = bytecodeBirthTimes.get(name);
return (time != null? time.longValue(): 0);
} | java | public long getBytecodeBirthTime(String name) {
Long time = bytecodeBirthTimes.get(name);
return (time != null? time.longValue(): 0);
} | [
"public",
"long",
"getBytecodeBirthTime",
"(",
"String",
"name",
")",
"{",
"Long",
"time",
"=",
"bytecodeBirthTimes",
".",
"get",
"(",
"name",
")",
";",
"return",
"(",
"time",
"!=",
"null",
"?",
"time",
".",
"longValue",
"(",
")",
":",
"0",
")",
";",
... | Retrieve the time the bytecode for a class was created | [
"Retrieve",
"the",
"time",
"the",
"bytecode",
"for",
"a",
"class",
"was",
"created"
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java#L415-L418 | test | Gets the bytecode birth time. | Of course, here is the Java code you requested:
```java
public long getBytecodeBirthTime(String name) {
Long time = bytecodeBirthTimes.get(name);
return (time != null? time.longValue(): 0);
}
```
Hope this helps! |
NanoHttpd/nanohttpd | core/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java | NanoHTTPD.serve | @Deprecated
protected Response serve(IHTTPSession session) {
return Response.newFixedLengthResponse(Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Not Found");
} | java | @Deprecated
protected Response serve(IHTTPSession session) {
return Response.newFixedLengthResponse(Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Not Found");
} | [
"@",
"Deprecated",
"protected",
"Response",
"serve",
"(",
"IHTTPSession",
"session",
")",
"{",
"return",
"Response",
".",
"newFixedLengthResponse",
"(",
"Status",
".",
"NOT_FOUND",
",",
"NanoHTTPD",
".",
"MIME_PLAINTEXT",
",",
"\"Not Found\"",
")",
";",
"}"
] | Override this to customize the server.
<p/>
<p/>
(By default, this returns a 404 "Not Found" plain text error response.)
@param session
The HTTP session
@return HTTP response, see class Response for details | [
"Override",
"this",
"to",
"customize",
"the",
"server",
".",
"<p",
"/",
">",
"<p",
"/",
">",
"(",
"By",
"default",
"this",
"returns",
"a",
"404",
"Not",
"Found",
"plain",
"text",
"error",
"response",
".",
")"
] | b04a342a4bcd0ff44be65138acffc73a29381c72 | https://github.com/NanoHttpd/nanohttpd/blob/b04a342a4bcd0ff44be65138acffc73a29381c72/core/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java#L548-L551 | test | Override this method to provide a response for a 404 Not Found response. | Of course, here is the Java code you requested:
```java
@Deprecated
protected Response serve(IHTTPSession session) {
return Response.newFixedLengthResponse(Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Not Found");
}
```
Hope this helps! |
streamsets/datacollector | hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/cache/HMSCache.java | HMSCache.put | public <T extends HMSCacheSupport.HMSCacheInfo> void put(
HMSCacheType cacheType,
String qualifiedTableName,
T hmsCacheInfo
) throws StageException {
if (!cacheMap.containsKey(cacheType)) {
throw new StageException(Errors.HIVE_16, cacheType);
}
cacheMap.get(cacheType).put(qualified... | java | public <T extends HMSCacheSupport.HMSCacheInfo> void put(
HMSCacheType cacheType,
String qualifiedTableName,
T hmsCacheInfo
) throws StageException {
if (!cacheMap.containsKey(cacheType)) {
throw new StageException(Errors.HIVE_16, cacheType);
}
cacheMap.get(cacheType).put(qualified... | [
"public",
"<",
"T",
"extends",
"HMSCacheSupport",
".",
"HMSCacheInfo",
">",
"void",
"put",
"(",
"HMSCacheType",
"cacheType",
",",
"String",
"qualifiedTableName",
",",
"T",
"hmsCacheInfo",
")",
"throws",
"StageException",
"{",
"if",
"(",
"!",
"cacheMap",
".",
"... | Puts/ updates the {@link HMSCache} with {@link HMSCacheSupport.HMSCacheInfo} for corresponding
{@link HMSCacheType} and qualified table name.
This method skips any locking provided by getOrLoad() and hence the caller code should not mix getOrLoad() and
put() calls in the same code.
@param cacheType {@link HMSCacheTyp... | [
"Puts",
"/",
"updates",
"the",
"{",
"@link",
"HMSCache",
"}",
"with",
"{",
"@link",
"HMSCacheSupport",
".",
"HMSCacheInfo",
"}",
"for",
"corresponding",
"{",
"@link",
"HMSCacheType",
"}",
"and",
"qualified",
"table",
"name",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/cache/HMSCache.java#L169-L178 | test | Put a single HMS CacheInfo into the cache. | Of course, here is the Java code you requested:
```java
public <T extends HMSCacheSupport.HMSCacheInfo> void put(
HMSCacheType cacheType,
String qualifiedTableName,
T hmsCacheInfo
) throws StageException {
if (!cacheMap.containsKey(cacheType)) {
throw new StageException(Errors.HIVE_16, ca... |
real-logic/aeron | aeron-driver/src/main/java/io/aeron/driver/PublicationImage.java | PublicationImage.onGapDetected | public void onGapDetected(final int termId, final int termOffset, final int length)
{
final long changeNumber = beginLossChange + 1;
beginLossChange = changeNumber;
lossTermId = termId;
lossTermOffset = termOffset;
lossLength = length;
endLossChange = changeNumber;... | java | public void onGapDetected(final int termId, final int termOffset, final int length)
{
final long changeNumber = beginLossChange + 1;
beginLossChange = changeNumber;
lossTermId = termId;
lossTermOffset = termOffset;
lossLength = length;
endLossChange = changeNumber;... | [
"public",
"void",
"onGapDetected",
"(",
"final",
"int",
"termId",
",",
"final",
"int",
"termOffset",
",",
"final",
"int",
"length",
")",
"{",
"final",
"long",
"changeNumber",
"=",
"beginLossChange",
"+",
"1",
";",
"beginLossChange",
"=",
"changeNumber",
";",
... | Called from the {@link LossDetector} when gap is detected by the {@link DriverConductor} thread.
{@inheritDoc} | [
"Called",
"from",
"the",
"{",
"@link",
"LossDetector",
"}",
"when",
"gap",
"is",
"detected",
"by",
"the",
"{",
"@link",
"DriverConductor",
"}",
"thread",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-driver/src/main/java/io/aeron/driver/PublicationImage.java#L339-L365 | test | On gap detected. | Of course, here is the Java code you requested:
```java
public void onGapDetected(final int termId, final int termOffset, final int length)
{
final long changeNumber = beginLossChange + 1;
beginLossChange = changeNumber;
lossTermId = termId;
lossTermOffset = termOffset;
lo... |
play2-maven-plugin/play2-maven-plugin | play2-providers/play2-provider-play23/src/main/java/com/google/code/play2/provider/play23/Play23LessCompiler.java | Play23LessCompiler.readContent | public static String readContent( File file )
throws IOException
{
String result = null;
BufferedReader is = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) );
try
{
StringBuilder sb = new StringBuilder();
String line... | java | public static String readContent( File file )
throws IOException
{
String result = null;
BufferedReader is = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) );
try
{
StringBuilder sb = new StringBuilder();
String line... | [
"public",
"static",
"String",
"readContent",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"String",
"result",
"=",
"null",
";",
"BufferedReader",
"is",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"new",
"FileInputStream",
"(",
... | Called from Less script, must be "public" | [
"Called",
"from",
"Less",
"script",
"must",
"be",
"public"
] | 34e174b02c4245cfad64abd230f3cbeda9d9b2f4 | https://github.com/play2-maven-plugin/play2-maven-plugin/blob/34e174b02c4245cfad64abd230f3cbeda9d9b2f4/play2-providers/play2-provider-play23/src/main/java/com/google/code/play2/provider/play23/Play23LessCompiler.java#L214-L236 | test | read content of a file into a String | Of course, here is the Java code you requested:
```java
public static String readContent( File file )
throws IOException
{
String result = null;
BufferedReader is = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) );
try
{
String... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/common/serialization/types/ODateTimeSerializer.java | ODateTimeSerializer.deserializeFromByteBufferObject | @Override
public Date deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) {
final Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(walChanges.getLongValue(buffer, offset));
return calendar.getTime();
} | java | @Override
public Date deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) {
final Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(walChanges.getLongValue(buffer, offset));
return calendar.getTime();
} | [
"@",
"Override",
"public",
"Date",
"deserializeFromByteBufferObject",
"(",
"ByteBuffer",
"buffer",
",",
"OWALChanges",
"walChanges",
",",
"int",
"offset",
")",
"{",
"final",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"calendar",
... | {@inheritDoc} | [
"{"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/ODateTimeSerializer.java#L125-L130 | test | Deserialize a Date from a ByteBuffer object. | Of course, here is the Java code you requested:
```java
@Override
public Date deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) {
final Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(walChanges.getLongValue(buffer, offset));
return calendar.getTi... |
rackerlabs/blueflood | blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DSimpleNumberIO.java | DSimpleNumberIO.insertRawAsync | public ResultSetFuture insertRawAsync( IMetric metric ) {
BoundStatement bound = getBoundStatementForMetric(metric);
return session.executeAsync(bound);
} | java | public ResultSetFuture insertRawAsync( IMetric metric ) {
BoundStatement bound = getBoundStatementForMetric(metric);
return session.executeAsync(bound);
} | [
"public",
"ResultSetFuture",
"insertRawAsync",
"(",
"IMetric",
"metric",
")",
"{",
"BoundStatement",
"bound",
"=",
"getBoundStatementForMetric",
"(",
"metric",
")",
";",
"return",
"session",
".",
"executeAsync",
"(",
"bound",
")",
";",
"}"
] | Inserts a raw metric (not its rolled up value) to the proper
column family
@param metric
@return | [
"Inserts",
"a",
"raw",
"metric",
"(",
"not",
"its",
"rolled",
"up",
"value",
")",
"to",
"the",
"proper",
"column",
"family"
] | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DSimpleNumberIO.java#L39-L44 | test | Insert raw result set for the given metric. | Of course, here is the Java code you requested:
```java
public ResultSetFuture insertRawAsync( IMetric metric ) {
BoundStatement bound = getBoundStatementForMetric(metric);
return session.executeAsync(bound);
}
```
Hope this helps! |
Unidata/thredds | opendap/src/main/java/opendap/dap/Int16PrimitiveVector.java | Int16PrimitiveVector.externalize | public void externalize(DataOutputStream sink, int start, int stop, int stride) throws IOException {
for (int i = start; i <= stop; i += stride)
sink.writeInt((int) vals[i]);
}
/**
* Returns (a reference to) the internal storage for this PrimitiveVector
* object.
* <h... | java | public void externalize(DataOutputStream sink, int start, int stop, int stride) throws IOException {
for (int i = start; i <= stop; i += stride)
sink.writeInt((int) vals[i]);
}
/**
* Returns (a reference to) the internal storage for this PrimitiveVector
* object.
* <h... | [
"public",
"void",
"externalize",
"(",
"DataOutputStream",
"sink",
",",
"int",
"start",
",",
"int",
"stop",
",",
"int",
"stride",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<=",
"stop",
";",
"i",
"+=",
"stride",
... | Write a subset of the data to a <code>DataOutputStream</code>.
@param sink a <code>DataOutputStream</code> to write to.
@param start starting index (i=start)
@param stop ending index (i<=stop)
@param stride index stride (i+=stride)
@throws IOException thrown on any <code>OutputStream</code> exception. | [
"Write",
"a",
"subset",
"of",
"the",
"data",
"to",
"a",
"<code",
">",
"DataOutputStream<",
"/",
"code",
">",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/Int16PrimitiveVector.java#L200-L292 | test | Externalize the data. | Of course, here is the Java code you requested:
```java
public void externalize(DataOutputStream sink, int start, int stop, int stride) throws IOException {
for (int i = start; i <= stop; i += stride)
sink.writeInt((int) vals[i]);
}
/**
* Returns (a reference to) the internal st... |
Jasig/NotificationPortlet | notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/classloader/ClassLoaderResourceNotificationService.java | ClassLoaderResourceNotificationService.fetchFromClasspath | private NotificationResponse fetchFromClasspath(List<String> locations) {
if (locations.isEmpty()) {
return NotificationResponse.EMPTY_RESPONSE;
}
NotificationResponse rslt;
final Element m = cache.get(locations);
if (m != null) {
// ## CACHE HIT ##
... | java | private NotificationResponse fetchFromClasspath(List<String> locations) {
if (locations.isEmpty()) {
return NotificationResponse.EMPTY_RESPONSE;
}
NotificationResponse rslt;
final Element m = cache.get(locations);
if (m != null) {
// ## CACHE HIT ##
... | [
"private",
"NotificationResponse",
"fetchFromClasspath",
"(",
"List",
"<",
"String",
">",
"locations",
")",
"{",
"if",
"(",
"locations",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"NotificationResponse",
".",
"EMPTY_RESPONSE",
";",
"}",
"NotificationResponse",
... | /*
Implementation | [
"/",
"*",
"Implementation"
] | a74b87c145b66166a2cb6849d17ce9b0f2c98f3b | https://github.com/Jasig/NotificationPortlet/blob/a74b87c145b66166a2cb6849d17ce9b0f2c98f3b/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/classloader/ClassLoaderResourceNotificationService.java#L109-L135 | test | Fetch from classpath. | Of course, here is the Java code you requested:
```java
private NotificationResponse fetchFromClasspath(List<String> locations) {
if (locations.isEmpty()) {
return NotificationResponse.EMPTY_RESPONSE;
}
NotificationResponse rslt;
final Element m = cache.get(locations);
... |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/rules/backwardlinks/BackwardLinkChainFromBackwardLinkRule.java | BackwardLinkChainFromBackwardLinkRule.addRuleFor | public static boolean addRuleFor(ForwardLink link, Context context) {
BackwardLinkChainFromBackwardLinkRule rule = context
.getBackwardLinkRuleChain().getCreate(MATCHER_, FACTORY_);
return rule.forwardLinksByObjectProperty_.add(link.getChain(),
link.getTarget());
} | java | public static boolean addRuleFor(ForwardLink link, Context context) {
BackwardLinkChainFromBackwardLinkRule rule = context
.getBackwardLinkRuleChain().getCreate(MATCHER_, FACTORY_);
return rule.forwardLinksByObjectProperty_.add(link.getChain(),
link.getTarget());
} | [
"public",
"static",
"boolean",
"addRuleFor",
"(",
"ForwardLink",
"link",
",",
"Context",
"context",
")",
"{",
"BackwardLinkChainFromBackwardLinkRule",
"rule",
"=",
"context",
".",
"getBackwardLinkRuleChain",
"(",
")",
".",
"getCreate",
"(",
"MATCHER_",
",",
"FACTORY... | Adds a {@link BackwardLinkChainFromBackwardLinkRule} inferences for the
given {@link ForwardLink} in the given {@link Context}
@param link
@param context
@return {@code true} if the {@link BackwardLinkChainFromBackwardLinkRule}
stored in the {@link Context} is modified as a result of this
operation | [
"Adds",
"a",
"{",
"@link",
"BackwardLinkChainFromBackwardLinkRule",
"}",
"inferences",
"for",
"the",
"given",
"{",
"@link",
"ForwardLink",
"}",
"in",
"the",
"given",
"{",
"@link",
"Context",
"}"
] | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/rules/backwardlinks/BackwardLinkChainFromBackwardLinkRule.java#L88-L93 | test | Add a rule for the given forward link. | Of course, here is the Java code you requested:
```java
public static boolean addRuleFor(ForwardLink link, Context context) {
BackwardLinkChainFromBackwardLinkRule rule = context
.getBackwardLinkRuleChain().getCreate(MATCHER_, FACTORY_);
return rule.forwardLinksByObjectProperty_.add(link.getChain(),
link.g... |
wildfly/wildfly | weld/subsystem/src/main/java/org/jboss/as/weld/WeldExtension.java | WeldExtension.initialize | @Override
public void initialize(final ExtensionContext context) {
WeldLogger.ROOT_LOGGER.debug("Activating Weld Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
final ManagementResourceRegistration registration = subsyste... | java | @Override
public void initialize(final ExtensionContext context) {
WeldLogger.ROOT_LOGGER.debug("Activating Weld Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
final ManagementResourceRegistration registration = subsyste... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"final",
"ExtensionContext",
"context",
")",
"{",
"WeldLogger",
".",
"ROOT_LOGGER",
".",
"debug",
"(",
"\"Activating Weld Extension\"",
")",
";",
"final",
"SubsystemRegistration",
"subsystem",
"=",
"context",
"."... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/weld/subsystem/src/main/java/org/jboss/as/weld/WeldExtension.java#L66-L74 | test | Initializes the resource manager. | Of course, here is the Java code you requested:
```java
@Override
public void initialize(final ExtensionContext context) {
WeldLogger.ROOT_LOGGER.debug("Activating Weld Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
fin... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/dao/GenericDao.java | GenericDao.find | public <E> List<E> find(final Class<E> entityType, final Object criteria) {
return query(dbOom.entities().find(entityType, criteria)).autoClose().list(entityType);
} | java | public <E> List<E> find(final Class<E> entityType, final Object criteria) {
return query(dbOom.entities().find(entityType, criteria)).autoClose().list(entityType);
} | [
"public",
"<",
"E",
">",
"List",
"<",
"E",
">",
"find",
"(",
"final",
"Class",
"<",
"E",
">",
"entityType",
",",
"final",
"Object",
"criteria",
")",
"{",
"return",
"query",
"(",
"dbOom",
".",
"entities",
"(",
")",
".",
"find",
"(",
"entityType",
",... | Finds list of entities matching given criteria. | [
"Finds",
"list",
"of",
"entities",
"matching",
"given",
"criteria",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/dao/GenericDao.java#L208-L210 | test | Find entities by criteria. | Of course, here is the Java code you requested:
```java
public <E> List<E> find(final Class<E> entityType, final Object criteria) {
return query(dbOom.entities().find(entityType, criteria)).autoClose().list(entityType);
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.