repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLLabelProvider.java | SARLLabelProvider.imageDescriptor | protected ImageDescriptor imageDescriptor(SarlAction element) {
final JvmOperation jvmElement = this.jvmModelAssociations.getDirectlyInferredOperation(element);
return this.images.forOperation(
element.getVisibility(),
this.adornments.get(jvmElement));
} | java | protected ImageDescriptor imageDescriptor(SarlAction element) {
final JvmOperation jvmElement = this.jvmModelAssociations.getDirectlyInferredOperation(element);
return this.images.forOperation(
element.getVisibility(),
this.adornments.get(jvmElement));
} | [
"protected",
"ImageDescriptor",
"imageDescriptor",
"(",
"SarlAction",
"element",
")",
"{",
"final",
"JvmOperation",
"jvmElement",
"=",
"this",
".",
"jvmModelAssociations",
".",
"getDirectlyInferredOperation",
"(",
"element",
")",
";",
"return",
"this",
".",
"images",
... | Replies the image for the given element.
<p>This function is a Xtext dispatch function for {@link #imageDescriptor(Object)}.
@param element the element.
@return the image descriptor.
@see #imageDescriptor(Object) | [
"Replies",
"the",
"image",
"for",
"the",
"given",
"element",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLLabelProvider.java#L378-L383 | train | Replies the image descriptor for the given element. | Of course, here is the Java code you requested:
```java
protected ImageDescriptor imageDescriptor(SarlAction element) {
final JvmOperation jvmElement = this.jvmModelAssociations.getDirectlyInferredOperation(element);
return this.images.forOperation(
element.getVisibility(),
this.adornments.get(jvmElement))... |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java | GuiRenderer.setup | public void setup(float partialTick)
{
this.partialTick = partialTick;
currentTexture = null;
bindDefaultTexture();
GlStateManager.pushMatrix();
if (ignoreScale)
{
GlStateManager.scale(1F / scaleFactor, 1F / scaleFactor, 1);
}
setupGl();
startDrawing();
} | java | public void setup(float partialTick)
{
this.partialTick = partialTick;
currentTexture = null;
bindDefaultTexture();
GlStateManager.pushMatrix();
if (ignoreScale)
{
GlStateManager.scale(1F / scaleFactor, 1F / scaleFactor, 1);
}
setupGl();
startDrawing();
} | [
"public",
"void",
"setup",
"(",
"float",
"partialTick",
")",
"{",
"this",
".",
"partialTick",
"=",
"partialTick",
";",
"currentTexture",
"=",
"null",
";",
"bindDefaultTexture",
"(",
")",
";",
"GlStateManager",
".",
"pushMatrix",
"(",
")",
";",
"if",
"(",
"... | Sets up the rendering and start drawing.
@param partialTick the partial ticks | [
"Sets",
"up",
"the",
"rendering",
"and",
"start",
"drawing",
"."
] | 4f8e1fa462d5c372fc23414482ba9f429881cc54 | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java#L162-L177 | train | Sets up the graphics context. | Of course, here is the Java code you requested:
```java
public void setup(float partialTick)
{
this.partialTick = partialTick;
currentTexture = null;
bindDefaultTexture();
GlStateManager.pushMatrix();
if (ignoreScale)
{
GlStateManager.scale(1F / scaleFactor, 1F / scaleFactor, 1);
}
setupGl();
... |
protostuff/protostuff-compiler | protostuff-parser/src/main/java/io/protostuff/compiler/parser/ProtoContext.java | ProtoContext.pop | @SuppressWarnings("unchecked")
public <T> T pop(Class<T> declarationClass) {
Object declaration = declarationStack.pop();
if (declarationClass.isAssignableFrom(declaration.getClass())) {
return (T) declaration;
}
return fail(declaration, declarationClass);
} | java | @SuppressWarnings("unchecked")
public <T> T pop(Class<T> declarationClass) {
Object declaration = declarationStack.pop();
if (declarationClass.isAssignableFrom(declaration.getClass())) {
return (T) declaration;
}
return fail(declaration, declarationClass);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"pop",
"(",
"Class",
"<",
"T",
">",
"declarationClass",
")",
"{",
"Object",
"declaration",
"=",
"declarationStack",
".",
"pop",
"(",
")",
";",
"if",
"(",
"declarationClass",
... | Pop an element from from a declaration stack.
Used by parse listeners. | [
"Pop",
"an",
"element",
"from",
"from",
"a",
"declaration",
"stack",
".",
"Used",
"by",
"parse",
"listeners",
"."
] | 665256c42cb41da849e8321ffcab088350ace171 | https://github.com/protostuff/protostuff-compiler/blob/665256c42cb41da849e8321ffcab088350ace171/protostuff-parser/src/main/java/io/protostuff/compiler/parser/ProtoContext.java#L83-L90 | train | Pop a class from the class declaration stack. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <T> T pop(Class<T> declarationClass) {
Object declaration = declarationStack.pop();
if (declarationClass.isAssignableFrom(declaration.getClass())) {
return (T) declaration;
}
re... |
Waikato/moa | moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java | Instances.randomize | public void randomize(Random random) {
for (int j = numInstances() - 1; j > 0; j--) {
swap(j, random.nextInt(j + 1));
}
} | java | public void randomize(Random random) {
for (int j = numInstances() - 1; j > 0; j--) {
swap(j, random.nextInt(j + 1));
}
} | [
"public",
"void",
"randomize",
"(",
"Random",
"random",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"numInstances",
"(",
")",
"-",
"1",
";",
"j",
">",
"0",
";",
"j",
"--",
")",
"{",
"swap",
"(",
"j",
",",
"random",
".",
"nextInt",
"(",
"j",
"+",
"... | Randomize.
@param random the random | [
"Randomize",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java#L341-L345 | train | Randomize the sequence of URIs. | Of course, here is the Java code you requested:
```java
public void randomize(Random random) {
for (int j = numInstances() - 1; j > 0; j--) {
swap(j, random.nextInt(j + 1));
}
}
```
Hope this helps! |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java | IterableExtensions.min | public static <T> T min(final Iterable<T> iterable, Comparator<? super T> comparator) {
return IteratorExtensions.min(iterable.iterator(), comparator);
} | java | public static <T> T min(final Iterable<T> iterable, Comparator<? super T> comparator) {
return IteratorExtensions.min(iterable.iterator(), comparator);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"min",
"(",
"final",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
")",
"{",
"return",
"IteratorExtensions",
".",
"min",
"(",
"iterable",
".",
"iterator",
"(... | Finds the mininmum element according to <code>comparator</code>. If there are several minima, the first one will
be returned.
@param iterable
the elements to find the minimum of. May not be <code>null</code>.
@param comparator
the comparison function. May not be <code>null</code>.
@return the minimum
@throws NoSuchEle... | [
"Finds",
"the",
"mininmum",
"element",
"according",
"to",
"<code",
">",
"comparator<",
"/",
"code",
">",
".",
"If",
"there",
"are",
"several",
"minima",
"the",
"first",
"one",
"will",
"be",
"returned",
"."
] | 7063572e1f1bd713a3aa53bdf3a8dc60e25c169a | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java#L925-L927 | train | Returns the minimum element of the specified iterable using the specified comparator. | Of course, here is the Java code you requested:
```java
public static <T> T min(final Iterable<T> iterable, Comparator<? super T> comparator) {
return IteratorExtensions.min(iterable.iterator(), comparator);
}
```
Hope this helps! |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/misc/OptionalRandomizer.java | OptionalRandomizer.aNewOptionalRandomizer | public static <T> Randomizer<T> aNewOptionalRandomizer(final Randomizer<T> delegate, final int optionalPercent) {
return new OptionalRandomizer<>(delegate, optionalPercent);
} | java | public static <T> Randomizer<T> aNewOptionalRandomizer(final Randomizer<T> delegate, final int optionalPercent) {
return new OptionalRandomizer<>(delegate, optionalPercent);
} | [
"public",
"static",
"<",
"T",
">",
"Randomizer",
"<",
"T",
">",
"aNewOptionalRandomizer",
"(",
"final",
"Randomizer",
"<",
"T",
">",
"delegate",
",",
"final",
"int",
"optionalPercent",
")",
"{",
"return",
"new",
"OptionalRandomizer",
"<>",
"(",
"delegate",
"... | Create a new {@link OptionalRandomizer}.
@param delegate the delegate randomizer to use
@param optionalPercent the optional percent threshold
@param <T> the type generated by this randomizer
@return a new {@link OptionalRandomizer} | [
"Create",
"a",
"new",
"{",
"@link",
"OptionalRandomizer",
"}",
"."
] | 816b0d6a74c7288af111e70ae1b0b57d7fe3b59d | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/misc/OptionalRandomizer.java#L67-L69 | train | Create a new optional randomizer. | Of course, here is the Java code you requested:
```java
public static <T> Randomizer<T> aNewOptionalRandomizer(final Randomizer<T> delegate, final int optionalPercent) {
return new OptionalRandomizer<>(delegate, optionalPercent);
}
```
Hope this helps! |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/transcription/RNAToAminoAcidTranslator.java | RNAToAminoAcidTranslator.createSequences | @Override
public List<Sequence<AminoAcidCompound>> createSequences(
Sequence<NucleotideCompound> originalSequence) {
List<List<AminoAcidCompound>> workingList = new ArrayList<List<AminoAcidCompound>>();
Iterable<SequenceView<NucleotideCompound>> iter = new WindowedSequence<NucleotideCompound>(
originalSeq... | java | @Override
public List<Sequence<AminoAcidCompound>> createSequences(
Sequence<NucleotideCompound> originalSequence) {
List<List<AminoAcidCompound>> workingList = new ArrayList<List<AminoAcidCompound>>();
Iterable<SequenceView<NucleotideCompound>> iter = new WindowedSequence<NucleotideCompound>(
originalSeq... | [
"@",
"Override",
"public",
"List",
"<",
"Sequence",
"<",
"AminoAcidCompound",
">",
">",
"createSequences",
"(",
"Sequence",
"<",
"NucleotideCompound",
">",
"originalSequence",
")",
"{",
"List",
"<",
"List",
"<",
"AminoAcidCompound",
">>",
"workingList",
"=",
"ne... | Performs the core conversion of RNA to Peptide. It does this by walking a
windowed version of the given sequence. Any trailing DNA base pairs are
ignored according to the specification of {@link WindowedSequence}. | [
"Performs",
"the",
"core",
"conversion",
"of",
"RNA",
"to",
"Peptide",
".",
"It",
"does",
"this",
"by",
"walking",
"a",
"windowed",
"version",
"of",
"the",
"given",
"sequence",
".",
"Any",
"trailing",
"DNA",
"base",
"pairs",
"are",
"ignored",
"according",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/transcription/RNAToAminoAcidTranslator.java#L113-L168 | train | Create a list of amino acid sequences from the original sequence. | Of course, here is the Java code you requested:
```java
@Override
public List<Sequence<AminoAcidCompound>> createSequences(
Sequence<NucleotideCompound> originalSequence) {
List<List<AminoAcidCompound>> workingList = new ArrayList<List<AminoAcidCompound>>();
Iterable<SequenceView<NucleotideCompound>> iter = ... |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.findByLtD_S_Last | @Override
public CPAttachmentFileEntry findByLtD_S_Last(Date displayDate, int status,
OrderByComparator<CPAttachmentFileEntry> orderByComparator)
throws NoSuchCPAttachmentFileEntryException {
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByLtD_S_Last(displayDate,
status, orderByComparator);
if (cpAtt... | java | @Override
public CPAttachmentFileEntry findByLtD_S_Last(Date displayDate, int status,
OrderByComparator<CPAttachmentFileEntry> orderByComparator)
throws NoSuchCPAttachmentFileEntryException {
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByLtD_S_Last(displayDate,
status, orderByComparator);
if (cpAtt... | [
"@",
"Override",
"public",
"CPAttachmentFileEntry",
"findByLtD_S_Last",
"(",
"Date",
"displayDate",
",",
"int",
"status",
",",
"OrderByComparator",
"<",
"CPAttachmentFileEntry",
">",
"orderByComparator",
")",
"throws",
"NoSuchCPAttachmentFileEntryException",
"{",
"CPAttachm... | Returns the last cp attachment file entry in the ordered set where displayDate < ? and status = ?.
@param displayDate the display date
@param status the status
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the last matching cp attachment file entry
@throw... | [
"Returns",
"the",
"last",
"cp",
"attachment",
"file",
"entry",
"in",
"the",
"ordered",
"set",
"where",
"displayDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L2313-L2337 | train | Returns the cp attachment file entry in the ordered set where displayDate and status are lower than the date the cp attachment file entry status. | Of course, here is the Java code you requested:
```java
@Override
public CPAttachmentFileEntry findByLtD_S_Last(Date displayDate, int status,
OrderByComparator<CPAttachmentFileEntry> orderByComparator)
throws NoSuchCPAttachmentFileEntryException {
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByLtD_S_Last(... |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java | PointerCoords.clear | public void clear() {
mPackedAxisBits = 0;
x = 0;
y = 0;
pressure = 0;
size = 0;
touchMajor = 0;
touchMinor = 0;
toolMajor = 0;
toolMinor = 0;
orientation = 0;
} | java | public void clear() {
mPackedAxisBits = 0;
x = 0;
y = 0;
pressure = 0;
size = 0;
touchMajor = 0;
touchMinor = 0;
toolMajor = 0;
toolMinor = 0;
orientation = 0;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"mPackedAxisBits",
"=",
"0",
";",
"x",
"=",
"0",
";",
"y",
"=",
"0",
";",
"pressure",
"=",
"0",
";",
"size",
"=",
"0",
";",
"touchMajor",
"=",
"0",
";",
"touchMinor",
"=",
"0",
";",
"toolMajor",
"=",
"0... | Clears the contents of this object.
Resets all axes to zero. | [
"Clears",
"the",
"contents",
"of",
"this",
"object",
".",
"Resets",
"all",
"axes",
"to",
"zero",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java#L397-L409 | train | Clear the cache. | Of course, here is the Java code you requested:
```java
public void clear() {
mPackedAxisBits = 0;
x = 0;
y = 0;
pressure = 0;
size = 0;
touchMajor = 0;
touchMinor = 0;
toolMajor = 0;
toolMinor = 0;
orientation = 0;
}
```
Hope this h... |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optParcelable | @Nullable
public static <T extends Parcelable> T optParcelable(@Nullable Bundle bundle, @Nullable String key, @Nullable T fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getParcelable(key);
} | java | @Nullable
public static <T extends Parcelable> T optParcelable(@Nullable Bundle bundle, @Nullable String key, @Nullable T fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getParcelable(key);
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
"extends",
"Parcelable",
">",
"T",
"optParcelable",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"T",
"fallback",
")",
"{",
"if",
"(",
"bundle",
"=="... | Returns a optional {@link android.os.Parcelable} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.Parcelable}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will... | [
"Returns",
"a",
"optional",
"{"
] | 57809ddbfe7897e979cf507982ce0b3aa5e0ed8a | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L703-L709 | train | Get a Parcelable or fallback if bundle is null or key is null. | Of course, here is the Java code you requested:
```java
@Nullable
public static <T extends Parcelable> T optParcelable(@Nullable Bundle bundle, @Nullable String key, @Nullable T fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getParcelable(key);
}
```
Hop... |
Netflix/zeno | src/main/java/com/netflix/zeno/serializer/FrameworkSerializer.java | FrameworkSerializer.serializePrimitive | public void serializePrimitive(S rec, String fieldName, long value) {
serializePrimitive(rec, fieldName, Long.valueOf(value));
} | java | public void serializePrimitive(S rec, String fieldName, long value) {
serializePrimitive(rec, fieldName, Long.valueOf(value));
} | [
"public",
"void",
"serializePrimitive",
"(",
"S",
"rec",
",",
"String",
"fieldName",
",",
"long",
"value",
")",
"{",
"serializePrimitive",
"(",
"rec",
",",
"fieldName",
",",
"Long",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | Can be overridden to avoid boxing a long where appropriate | [
"Can",
"be",
"overridden",
"to",
"avoid",
"boxing",
"a",
"long",
"where",
"appropriate"
] | e571a3f1e304942724d454408fe6417fe18c20fd | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/main/java/com/netflix/zeno/serializer/FrameworkSerializer.java#L76-L78 | train | Serialize a long value to the record. | Of course, here is the Java code you requested:
```java
public void serializePrimitive(S rec, String fieldName, long value) {
serializePrimitive(rec, fieldName, Long.valueOf(value));
}
```
Hope this helps! |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/stats/JMStats.java | JMStats.calStats | public static Number calStats(String statsString,
DoubleStream numberStream) {
return StatsField.valueOfAlias(statsString).calStats(numberStream);
} | java | public static Number calStats(String statsString,
DoubleStream numberStream) {
return StatsField.valueOfAlias(statsString).calStats(numberStream);
} | [
"public",
"static",
"Number",
"calStats",
"(",
"String",
"statsString",
",",
"DoubleStream",
"numberStream",
")",
"{",
"return",
"StatsField",
".",
"valueOfAlias",
"(",
"statsString",
")",
".",
"calStats",
"(",
"numberStream",
")",
";",
"}"
] | Cal stats number.
@param statsString the stats string
@param numberStream the number stream
@return the number | [
"Cal",
"stats",
"number",
"."
] | 9e407b3f28a7990418a1e877229fa8344f4d78a5 | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/stats/JMStats.java#L86-L89 | train | calStats This method is used to get the number of a single element from a DoubleStream. | Of course, here is the Java code you requested:
```java
public static Number calStats(String statsString,
DoubleStream numberStream) {
return StatsField.valueOfAlias(statsString).calStats(numberStream);
}
```
Hope this helps! |
GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java | GoogleHadoopFileSystemBase.overrideConfigFromFile | private void overrideConfigFromFile(Configuration config) throws IOException {
String configFile = GCS_CONFIG_OVERRIDE_FILE.get(config, config::get);
if (configFile != null) {
config.addResource(new FileInputStream(configFile));
}
} | java | private void overrideConfigFromFile(Configuration config) throws IOException {
String configFile = GCS_CONFIG_OVERRIDE_FILE.get(config, config::get);
if (configFile != null) {
config.addResource(new FileInputStream(configFile));
}
} | [
"private",
"void",
"overrideConfigFromFile",
"(",
"Configuration",
"config",
")",
"throws",
"IOException",
"{",
"String",
"configFile",
"=",
"GCS_CONFIG_OVERRIDE_FILE",
".",
"get",
"(",
"config",
",",
"config",
"::",
"get",
")",
";",
"if",
"(",
"configFile",
"!=... | If overrides file configured, update properties from override file into {@link Configuration}
object | [
"If",
"overrides",
"file",
"configured",
"update",
"properties",
"from",
"override",
"file",
"into",
"{"
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java#L1628-L1633 | train | Override the configuration from a file. | Of course, here is the Java code you requested:
```java
private void overrideConfigFromFile(Configuration config) throws IOException {
String configFile = GCS_CONFIG_OVERRIDE_FILE.get(config, config::get);
if (configFile != null) {
config.addResource(new FileInputStream(configFile));
}
}
```
Hope ... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.preconditionRequired | public static Result preconditionRequired(Path content, String filename) {
return preconditionRequired(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | java | public static Result preconditionRequired(Path content, String filename) {
return preconditionRequired(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | [
"public",
"static",
"Result",
"preconditionRequired",
"(",
"Path",
"content",
",",
"String",
"filename",
")",
"{",
"return",
"preconditionRequired",
"(",
"content",
",",
"filename",
",",
"StaticFileMimeTypes",
".",
"fileMimeTypes",
"(",
")",
")",
";",
"}"
] | Generates a 428 Precondition Required result.
@param content The path to send.
@param filename The name to send the file as.
@return the result | [
"Generates",
"a",
"428",
"Precondition",
"Required",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L3255-L3257 | test | Precondition required. | Of course, here is the Java code you requested:
```java
public static Result preconditionRequired(Path content, String filename) {
return preconditionRequired(content, filename, StaticFileMimeTypes.fileMimeTypes());
}
```
Hope this helps! |
h2oai/h2o-2 | src/main/java/hex/gbm/DHistogram.java | DHistogram.isConstantResponse | public boolean isConstantResponse() {
double m = Double.NaN;
for( int b=0; b<_bins.length; b++ ) {
if( _bins[b] == 0 ) continue;
if( var(b) > 1e-14 ) return false;
double mean = mean(b);
if( mean != m )
if( Double.isNaN(m) ) m=mean;
else if(Math.abs(m - mean) > 1e-6) retu... | java | public boolean isConstantResponse() {
double m = Double.NaN;
for( int b=0; b<_bins.length; b++ ) {
if( _bins[b] == 0 ) continue;
if( var(b) > 1e-14 ) return false;
double mean = mean(b);
if( mean != m )
if( Double.isNaN(m) ) m=mean;
else if(Math.abs(m - mean) > 1e-6) retu... | [
"public",
"boolean",
"isConstantResponse",
"(",
")",
"{",
"double",
"m",
"=",
"Double",
".",
"NaN",
";",
"for",
"(",
"int",
"b",
"=",
"0",
";",
"b",
"<",
"_bins",
".",
"length",
";",
"b",
"++",
")",
"{",
"if",
"(",
"_bins",
"[",
"b",
"]",
"==",... | Check for a constant response variable | [
"Check",
"for",
"a",
"constant",
"response",
"variable"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/DHistogram.java#L208-L219 | train | Is this response a constant response. | Of course, here is the Java code you requested:
```java
public boolean isConstantResponse() {
double m = Double.NaN;
for( int b=0; b<_bins.length; b++ ) {
if( _bins[b] == 0 ) continue;
if( var(b) > 1e-14 ) return false;
double mean = mean(b);
if( mean != m )
if( Double.isNaN(m) ... |
rundeck/rundeck | rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JNDILoginModule.java | JNDILoginModule.getUsers | private Map getUsers() throws NamingException {
String filter = "(" + roleNameRDN + "=*)";
HashMap users = new HashMap();
NamingEnumeration results = this.search(roleBase, filter, new String[]{roleMemberRDN});
while (results != null && results.hasMore()) {
SearchResult ro... | java | private Map getUsers() throws NamingException {
String filter = "(" + roleNameRDN + "=*)";
HashMap users = new HashMap();
NamingEnumeration results = this.search(roleBase, filter, new String[]{roleMemberRDN});
while (results != null && results.hasMore()) {
SearchResult ro... | [
"private",
"Map",
"getUsers",
"(",
")",
"throws",
"NamingException",
"{",
"String",
"filter",
"=",
"\"(\"",
"+",
"roleNameRDN",
"+",
"\"=*)\"",
";",
"HashMap",
"users",
"=",
"new",
"HashMap",
"(",
")",
";",
"NamingEnumeration",
"results",
"=",
"this",
".",
... | Return a Map of usernames to role sets.
@return Mapping of usernames (String) to set of roles (Set of String)
@throws javax.naming.NamingException | [
"Return",
"a",
"Map",
"of",
"usernames",
"to",
"role",
"sets",
"."
] | 8070f774f55bffaa1118ff0c03aea319d40a9668 | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JNDILoginModule.java#L338-L384 | train | Get users. | Of course, here is the Java code you requested:
```java
private Map getUsers() throws NamingException {
String filter = "(" + roleNameRDN + "=*)";
HashMap users = new HashMap();
NamingEnumeration results = this.search(roleBase, filter, new String[]{roleMemberRDN});
while (results != ... |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/JobMarshaller.java | JobMarshaller.marshall | public void marshall(Job job, ProtocolMarshaller protocolMarshaller) {
if (job == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(job.getJobArn(), JOBARN_BINDING);
protocolMarshaller.marsh... | java | public void marshall(Job job, ProtocolMarshaller protocolMarshaller) {
if (job == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(job.getJobArn(), JOBARN_BINDING);
protocolMarshaller.marsh... | [
"public",
"void",
"marshall",
"(",
"Job",
"job",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"job",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\"",
")",
";",
"}",
"try",
... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/JobMarshaller.java#L75-L102 | train | marshalls the given job to the JSON object. | Of course, here is the Java code you requested:
```java
public void marshall(Job job, ProtocolMarshaller protocolMarshaller) {
if (job == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(job.getJobArn... |
itfsw/mybatis-generator-plugin | src/main/java/com/itfsw/mybatis/generator/plugins/utils/BeanUtils.java | BeanUtils.invoke | public static Object invoke(final Object bean, Class clazz, final String name) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Method method = clazz.getDeclaredMethod(name);
method.setAccessible(true);
return method.invoke(bean);
} | java | public static Object invoke(final Object bean, Class clazz, final String name) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Method method = clazz.getDeclaredMethod(name);
method.setAccessible(true);
return method.invoke(bean);
} | [
"public",
"static",
"Object",
"invoke",
"(",
"final",
"Object",
"bean",
",",
"Class",
"clazz",
",",
"final",
"String",
"name",
")",
"throws",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"Method",
"method",
"=",
"c... | 执行无参方法
@param bean
@param clazz
@param name
@return
@throws NoSuchMethodException
@throws InvocationTargetException
@throws IllegalAccessException | [
"执行无参方法"
] | c2746d9567952cabe0eed8c533beb8c1a8bc1dce | https://github.com/itfsw/mybatis-generator-plugin/blob/c2746d9567952cabe0eed8c533beb8c1a8bc1dce/src/main/java/com/itfsw/mybatis/generator/plugins/utils/BeanUtils.java#L68-L72 | valid | Invoke a method on a bean. | Of course, here is the Java code you requested:
```java
public static Object invoke(final Object bean, Class clazz, final String name) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Method method = clazz.getDeclaredMethod(name);
method.setAccessible(true);
ret... |
dyu/protostuff-1.0.x | protostuff-me/src/main/java/com/dyuproject/protostuff/me/CodedInput.java | CodedInput.readTag | public int readTag() throws IOException {
if (isAtEnd()) {
lastTag = 0;
return 0;
}
final int tag = readRawVarint32();
if (tag >>> WireFormat.TAG_TYPE_BITS == 0) {
// If we actually read zero, that's not a valid tag.
throw ProtobufException.invalidTag();
}
lastTag = tag;... | java | public int readTag() throws IOException {
if (isAtEnd()) {
lastTag = 0;
return 0;
}
final int tag = readRawVarint32();
if (tag >>> WireFormat.TAG_TYPE_BITS == 0) {
// If we actually read zero, that's not a valid tag.
throw ProtobufException.invalidTag();
}
lastTag = tag;... | [
"public",
"int",
"readTag",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isAtEnd",
"(",
")",
")",
"{",
"lastTag",
"=",
"0",
";",
"return",
"0",
";",
"}",
"final",
"int",
"tag",
"=",
"readRawVarint32",
"(",
")",
";",
"if",
"(",
"tag",
">>>",
... | Attempt to read a field tag, returning zero if we have reached EOF.
Protocol message parsers use this to read tags, since a protocol message
may legally end wherever a tag occurs, and zero is not a valid tag number. | [
"Attempt",
"to",
"read",
"a",
"field",
"tag",
"returning",
"zero",
"if",
"we",
"have",
"reached",
"EOF",
".",
"Protocol",
"message",
"parsers",
"use",
"this",
"to",
"read",
"tags",
"since",
"a",
"protocol",
"message",
"may",
"legally",
"end",
"wherever",
"... | d7c964ec20da3fe44699d86ee95c2677ddffde96 | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-me/src/main/java/com/dyuproject/protostuff/me/CodedInput.java#L96-L109 | train | Read a tag from the stream. | Of course, here is the Java code you requested:
```java
public int readTag() throws IOException {
if (isAtEnd()) {
lastTag = 0;
return 0;
}
final int tag = readRawVarint32();
if (tag >>> WireFormat.TAG_TYPE_BITS == 0) {
// If we actually read zero, that's not a valid tag.
throw... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/related/media/MediaRow.java | MediaRow.getDataBounds | public BitmapFactory.Options getDataBounds() {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
byte[] data = getData();
BitmapFactory.decodeByteArray(data, 0, data.length, options);
return options;
} | java | public BitmapFactory.Options getDataBounds() {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
byte[] data = getData();
BitmapFactory.decodeByteArray(data, 0, data.length, options);
return options;
} | [
"public",
"BitmapFactory",
".",
"Options",
"getDataBounds",
"(",
")",
"{",
"BitmapFactory",
".",
"Options",
"options",
"=",
"new",
"BitmapFactory",
".",
"Options",
"(",
")",
";",
"options",
".",
"inJustDecodeBounds",
"=",
"true",
";",
"byte",
"[",
"]",
"data... | Read the data bounds without allocating pixel memory.
Access values using:
{@link BitmapFactory.Options#outWidth},
{@link BitmapFactory.Options#outHeight},
{@link BitmapFactory.Options#outMimeType},
{@link BitmapFactory.Options#outColorSpace},
and {@link BitmapFactory.Options#outConfig}
@return bounds options
@since 3... | [
"Read",
"the",
"data",
"bounds",
"without",
"allocating",
"pixel",
"memory",
".",
"Access",
"values",
"using",
":",
"{",
"@link",
"BitmapFactory",
".",
"Options#outWidth",
"}",
"{",
"@link",
"BitmapFactory",
".",
"Options#outHeight",
"}",
"{",
"@link",
"BitmapFa... | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/related/media/MediaRow.java#L131-L137 | test | Get the bounds of the image. | Of course, here is the Java code you requested:
```java
public BitmapFactory.Options getDataBounds() {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
byte[] data = getData();
BitmapFactory.decodeByteArray(data, 0, data.length, options);
... |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/configuration/CaffeineConfiguration.java | CaffeineConfiguration.setTypes | public void setTypes(Class<K> keyType, Class<V> valueType) {
delegate.setTypes(keyType, valueType);
} | java | public void setTypes(Class<K> keyType, Class<V> valueType) {
delegate.setTypes(keyType, valueType);
} | [
"public",
"void",
"setTypes",
"(",
"Class",
"<",
"K",
">",
"keyType",
",",
"Class",
"<",
"V",
">",
"valueType",
")",
"{",
"delegate",
".",
"setTypes",
"(",
"keyType",
",",
"valueType",
")",
";",
"}"
] | See {@link MutableConfiguration#setTypes}. | [
"See",
"{"
] | 4cf6d6e6a18ea2e8088f166261e5949343b0f2eb | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/configuration/CaffeineConfiguration.java#L112-L114 | train | Sets the types of the key and value pairs. | Of course, here is the Java code you requested:
```java
public void setTypes(Class<K> keyType, Class<V> valueType) {
delegate.setTypes(keyType, valueType);
}
```
Hope this helps! |
googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java | StorageSnippets.updateBlobWithMetageneration | public Blob updateBlobWithMetageneration(String bucketName, String blobName) {
// [START updateBlobWithMetageneration]
Blob blob = storage.get(bucketName, blobName);
BlobInfo updatedInfo = blob.toBuilder().setContentType("text/plain").build();
storage.update(updatedInfo, BlobTargetOption.metagenerationM... | java | public Blob updateBlobWithMetageneration(String bucketName, String blobName) {
// [START updateBlobWithMetageneration]
Blob blob = storage.get(bucketName, blobName);
BlobInfo updatedInfo = blob.toBuilder().setContentType("text/plain").build();
storage.update(updatedInfo, BlobTargetOption.metagenerationM... | [
"public",
"Blob",
"updateBlobWithMetageneration",
"(",
"String",
"bucketName",
",",
"String",
"blobName",
")",
"{",
"// [START updateBlobWithMetageneration]",
"Blob",
"blob",
"=",
"storage",
".",
"get",
"(",
"bucketName",
",",
"blobName",
")",
";",
"BlobInfo",
"upda... | [VARIABLE "my_blob_name"] | [
"[",
"VARIABLE",
"my_blob_name",
"]"
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java#L326-L333 | train | Update a blob in a bucket with metageneration match. | Of course, here is the Java code you requested:
```java
public Blob updateBlobWithMetageneration(String bucketName, String blobName) {
// [START updateBlobWithMetageneration]
Blob blob = storage.get(bucketName, blobName);
BlobInfo updatedInfo = blob.toBuilder().setContentType("text/plain").build();
sto... |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.createIt | public static <T extends Model> T createIt(Object ... namesAndValues){
return ModelDelegate.createIt(Model.<T>modelClass(), namesAndValues);
} | java | public static <T extends Model> T createIt(Object ... namesAndValues){
return ModelDelegate.createIt(Model.<T>modelClass(), namesAndValues);
} | [
"public",
"static",
"<",
"T",
"extends",
"Model",
">",
"T",
"createIt",
"(",
"Object",
"...",
"namesAndValues",
")",
"{",
"return",
"ModelDelegate",
".",
"createIt",
"(",
"Model",
".",
"<",
"T",
">",
"modelClass",
"(",
")",
",",
"namesAndValues",
")",
";... | This is a convenience method to {@link #create(Object...)}. It will create a new model and will save it
to DB. It has the same semantics as {@link #saveIt()}.
@param namesAndValues names and values. elements at indexes 0, 2, 4, 8... are attribute names, and elements at
indexes 1, 3, 5... are values. Element at index 1... | [
"This",
"is",
"a",
"convenience",
"method",
"to",
"{",
"@link",
"#create",
"(",
"Object",
"...",
")",
"}",
".",
"It",
"will",
"create",
"a",
"new",
"model",
"and",
"will",
"save",
"it",
"to",
"DB",
".",
"It",
"has",
"the",
"same",
"semantics",
"as",
... | ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L2348-L2350 | train | Create a new instance of the class using the given names and values. | Of course, here is the Java code you requested:
```java
public static <T extends Model> T createIt(Object ... namesAndValues){
return ModelDelegate.createIt(Model.<T>modelClass(), namesAndValues);
}
```
Hope this helps! |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/widgets/tabs/Packer.java | Packer.setXLeftRelative | public Packer setXLeftRelative(final boolean how) {
if (how == true) {
gc.gridx = GridBagConstraints.RELATIVE;
} else {
gc.gridx = 0;
}
setConstraints(comp, gc);
return this;
} | java | public Packer setXLeftRelative(final boolean how) {
if (how == true) {
gc.gridx = GridBagConstraints.RELATIVE;
} else {
gc.gridx = 0;
}
setConstraints(comp, gc);
return this;
} | [
"public",
"Packer",
"setXLeftRelative",
"(",
"final",
"boolean",
"how",
")",
"{",
"if",
"(",
"how",
"==",
"true",
")",
"{",
"gc",
".",
"gridx",
"=",
"GridBagConstraints",
".",
"RELATIVE",
";",
"}",
"else",
"{",
"gc",
".",
"gridx",
"=",
"0",
";",
"}",... | Add gridx=RELATIVE to the constraints for the current component if how ==
true 0 it if false. | [
"Add",
"gridx",
"=",
"RELATIVE",
"to",
"the",
"constraints",
"for",
"the",
"current",
"component",
"if",
"how",
"==",
"true",
"0",
"it",
"if",
"false",
"."
] | 9aa01fdac3560cef51c55df3cb2ac5c690b57639 | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/widgets/tabs/Packer.java#L463-L471 | train | Set the x left relative constraints for the current component if how == true set it to 0. | Of course, here is the Java code you requested:
```java
public Packer setXLeftRelative(final boolean how) {
if (how == true) {
gc.gridx = GridBagConstraints.RELATIVE;
} else {
gc.gridx = 0;
}
setConstraints(comp, gc);
return this;
}
```
Hope this hel... |
groovy/groovy-core | src/main/groovy/lang/GroovyShell.java | GroovyShell.run | public Object run(File scriptFile, List list) throws CompilationFailedException, IOException {
String[] args = new String[list.size()];
return run(scriptFile, (String[]) list.toArray(args));
} | java | public Object run(File scriptFile, List list) throws CompilationFailedException, IOException {
String[] args = new String[list.size()];
return run(scriptFile, (String[]) list.toArray(args));
} | [
"public",
"Object",
"run",
"(",
"File",
"scriptFile",
",",
"List",
"list",
")",
"throws",
"CompilationFailedException",
",",
"IOException",
"{",
"String",
"[",
"]",
"args",
"=",
"new",
"String",
"[",
"list",
".",
"size",
"(",
")",
"]",
";",
"return",
"ru... | A helper method which runs the given script file with the given command line arguments
@param scriptFile the file of the script to run
@param list the command line arguments to pass in | [
"A",
"helper",
"method",
"which",
"runs",
"the",
"given",
"script",
"file",
"with",
"the",
"given",
"command",
"line",
"arguments"
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/GroovyShell.java#L156-L159 | train | Run a sequence of code. | Of course, here is the Java code you requested:
```java
public Object run(File scriptFile, List list) throws CompilationFailedException, IOException {
String[] args = new String[list.size()];
return run(scriptFile, (String[]) list.toArray(args));
}
```
Hope this helps! |
csc19601128/Phynixx | phynixx/phynixx-connection/src/main/java/org/csc/phynixx/connection/PhynixxManagedConnectionGuard.java | PhynixxManagedConnectionGuard.recover | @Override
public void recover() {
// not revoverable
if (this.getCoreConnection() == null || !ImplementorUtils.isImplementationOf(getCoreConnection(), IXADataRecorderAware.class)) {
return;
}
IXADataRecorderAware con = ImplementorUtils.cast(getCoreConnection(), IXADataR... | java | @Override
public void recover() {
// not revoverable
if (this.getCoreConnection() == null || !ImplementorUtils.isImplementationOf(getCoreConnection(), IXADataRecorderAware.class)) {
return;
}
IXADataRecorderAware con = ImplementorUtils.cast(getCoreConnection(), IXADataR... | [
"@",
"Override",
"public",
"void",
"recover",
"(",
")",
"{",
"// not revoverable",
"if",
"(",
"this",
".",
"getCoreConnection",
"(",
")",
"==",
"null",
"||",
"!",
"ImplementorUtils",
".",
"isImplementationOf",
"(",
"getCoreConnection",
"(",
")",
",",
"IXADataR... | recovers the data of the dataLogger and provides the recovered data to the connection via the replaylistener | [
"recovers",
"the",
"data",
"of",
"the",
"dataLogger",
"and",
"provides",
"the",
"recovered",
"data",
"to",
"the",
"connection",
"via",
"the",
"replaylistener"
] | a26c03bc229a8882c647799834115bec6bdc0ac8 | https://github.com/csc19601128/Phynixx/blob/a26c03bc229a8882c647799834115bec6bdc0ac8/phynixx/phynixx-connection/src/main/java/org/csc/phynixx/connection/PhynixxManagedConnectionGuard.java#L404-L431 | train | Recovered the connection. | Of course, here is the Java code you requested:
```java
@Override
public void recover() {
// not revoverable
if (this.getCoreConnection() == null || !ImplementorUtils.isImplementationOf(getCoreConnection(), IXADataRecorderAware.class)) {
return;
}
IXADataRecorderAware ... |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java | ProductUrl.getProductUrl | public static MozuUrl getProductUrl(Boolean acceptVariantProductCode, Boolean allowInactive, String productCode, String purchaseLocation, Integer quantity, String responseFields, Boolean skipInventoryCheck, Boolean supressOutOfStock404, String variationProductCode, String variationProductCodeFilter)
{
UrlFormatter... | java | public static MozuUrl getProductUrl(Boolean acceptVariantProductCode, Boolean allowInactive, String productCode, String purchaseLocation, Integer quantity, String responseFields, Boolean skipInventoryCheck, Boolean supressOutOfStock404, String variationProductCode, String variationProductCodeFilter)
{
UrlFormatter... | [
"public",
"static",
"MozuUrl",
"getProductUrl",
"(",
"Boolean",
"acceptVariantProductCode",
",",
"Boolean",
"allowInactive",
",",
"String",
"productCode",
",",
"String",
"purchaseLocation",
",",
"Integer",
"quantity",
",",
"String",
"responseFields",
",",
"Boolean",
"... | Get Resource Url for GetProduct
@param acceptVariantProductCode Specifies whether to accept a product variant's code as the .When you set this parameter to , you can pass in a product variant's code in the GetProduct call to retrieve the product variant details that are associated with the base product.
@param allowIna... | [
"Get",
"Resource",
"Url",
"for",
"GetProduct"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java#L72-L86 | train | Get Resource Url for GetProduct | Of course, here is the Java code you requested:
```java
public static MozuUrl getProductUrl(Boolean acceptVariantProductCode, Boolean allowInactive, String productCode, String purchaseLocation, Integer quantity, String responseFields, Boolean skipInventoryCheck, Boolean supressOutOfStock404, String variationProductCod... |
alkacon/opencms-core | src-modules/org/opencms/workplace/list/CmsListColumnDefinition.java | CmsListColumnDefinition.removeDefaultAction | public CmsListDefaultAction removeDefaultAction(String actionId) {
Iterator<CmsListDefaultAction> it = m_defaultActions.iterator();
while (it.hasNext()) {
CmsListDefaultAction action = it.next();
if (action.getId().equals(actionId)) {
it.remove();
... | java | public CmsListDefaultAction removeDefaultAction(String actionId) {
Iterator<CmsListDefaultAction> it = m_defaultActions.iterator();
while (it.hasNext()) {
CmsListDefaultAction action = it.next();
if (action.getId().equals(actionId)) {
it.remove();
... | [
"public",
"CmsListDefaultAction",
"removeDefaultAction",
"(",
"String",
"actionId",
")",
"{",
"Iterator",
"<",
"CmsListDefaultAction",
">",
"it",
"=",
"m_defaultActions",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
... | Removes the default action from this column by id.<p>
@param actionId the id of the action to remove
@return the action if found or <code>null</code> | [
"Removes",
"the",
"default",
"action",
"from",
"this",
"column",
"by",
"id",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/CmsListColumnDefinition.java#L553-L564 | train | Removes the default action with the given id. | Of course, here is the Java code you requested:
```java
public CmsListDefaultAction removeDefaultAction(String actionId) {
Iterator<CmsListDefaultAction> it = m_defaultActions.iterator();
while (it.hasNext()) {
CmsListDefaultAction action = it.next();
if (action.getId().equals(... |
line/armeria | retrofit2/src/main/java/com/linecorp/armeria/client/retrofit2/ArmeriaRetrofitBuilder.java | ArmeriaRetrofitBuilder.build | public Retrofit build() {
checkState(baseUrl != null, "baseUrl not set");
final URI uri = URI.create(baseUrl);
final String fullUri = SessionProtocol.of(uri.getScheme()) + "://" + uri.getAuthority();
final HttpClient baseHttpClient = HttpClient.of(
clientFactory, fullUri,... | java | public Retrofit build() {
checkState(baseUrl != null, "baseUrl not set");
final URI uri = URI.create(baseUrl);
final String fullUri = SessionProtocol.of(uri.getScheme()) + "://" + uri.getAuthority();
final HttpClient baseHttpClient = HttpClient.of(
clientFactory, fullUri,... | [
"public",
"Retrofit",
"build",
"(",
")",
"{",
"checkState",
"(",
"baseUrl",
"!=",
"null",
",",
"\"baseUrl not set\"",
")",
";",
"final",
"URI",
"uri",
"=",
"URI",
".",
"create",
"(",
"baseUrl",
")",
";",
"final",
"String",
"fullUri",
"=",
"SessionProtocol"... | Returns a newly-created {@link Retrofit} based on the properties of this builder. | [
"Returns",
"a",
"newly",
"-",
"created",
"{"
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/retrofit2/src/main/java/com/linecorp/armeria/client/retrofit2/ArmeriaRetrofitBuilder.java#L198-L210 | train | Build the Retrofit. | Of course, here is the Java code you requested:
```java
public Retrofit build() {
checkState(baseUrl != null, "baseUrl not set");
final URI uri = URI.create(baseUrl);
final String fullUri = SessionProtocol.of(uri.getScheme()) + "://" + uri.getAuthority();
final HttpClient baseHttpClient... |
Unidata/thredds | opendap/src/main/java/opendap/dap/BaseTypePrimitiveVector.java | BaseTypePrimitiveVector.deserialize | public synchronized void deserialize(DataInputStream source,
ServerVersion sv,
StatusUI statusUI)
throws IOException, EOFException, DataReadException {
for (int i = 0; i < vals.length; i++) {
// create... | java | public synchronized void deserialize(DataInputStream source,
ServerVersion sv,
StatusUI statusUI)
throws IOException, EOFException, DataReadException {
for (int i = 0; i < vals.length; i++) {
// create... | [
"public",
"synchronized",
"void",
"deserialize",
"(",
"DataInputStream",
"source",
",",
"ServerVersion",
"sv",
",",
"StatusUI",
"statusUI",
")",
"throws",
"IOException",
",",
"EOFException",
",",
"DataReadException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Reads data from a <code>DataInputStream</code>. This method is only used
on the client side of the OPeNDAP client/server connection.
@param source a <code>DataInputStream</code> to read from.
@param sv The <code>ServerVersion</code> returned by the server.
(used by <code>DSequence</code> to determine which pro... | [
"Reads",
"data",
"from",
"a",
"<code",
">",
"DataInputStream<",
"/",
"code",
">",
".",
"This",
"method",
"is",
"only",
"used",
"on",
"the",
"client",
"side",
"of",
"the",
"OPeNDAP",
"client",
"/",
"server",
"connection",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/BaseTypePrimitiveVector.java#L179-L190 | test | Reads a
CTYPE from the specified input stream. | Of course, here is the Java code you requested:
```java
public synchronized void deserialize(DataInputStream source,
ServerVersion sv,
StatusUI statusUI)
throws IOException, EOFException, DataReadException {
for (... |
openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGProcessor.java | SVGProcessor.loadSVGIconFromUri | public static List<SVGPath> loadSVGIconFromUri(final String uri, final Class clazz) throws CouldNotPerformException {
try {
InputStream inputStream = clazz.getResourceAsStream(uri);
if (inputStream == null) {
inputStream = clazz.getClassLoader().getResourceAsStream(uri);... | java | public static List<SVGPath> loadSVGIconFromUri(final String uri, final Class clazz) throws CouldNotPerformException {
try {
InputStream inputStream = clazz.getResourceAsStream(uri);
if (inputStream == null) {
inputStream = clazz.getClassLoader().getResourceAsStream(uri);... | [
"public",
"static",
"List",
"<",
"SVGPath",
">",
"loadSVGIconFromUri",
"(",
"final",
"String",
"uri",
",",
"final",
"Class",
"clazz",
")",
"throws",
"CouldNotPerformException",
"{",
"try",
"{",
"InputStream",
"inputStream",
"=",
"clazz",
".",
"getResourceAsStream"... | Method tries to build one or more SVGPaths out of the given uri.
By this the content is interpreted as svg xml and new SVGPath instances are generated for each found path element
@param uri the svg xml file
@return a list of SVGPaths instances where each is representing one found path element
@throws CouldNotPerform... | [
"Method",
"tries",
"to",
"build",
"one",
"or",
"more",
"SVGPaths",
"out",
"of",
"the",
"given",
"uri",
".",
"By",
"this",
"the",
"content",
"is",
"interpreted",
"as",
"svg",
"xml",
"and",
"new",
"SVGPath",
"instances",
"are",
"generated",
"for",
"each",
... | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGProcessor.java#L59-L73 | train | Load an SVG icon from the given URI. | Of course, here is the Java code you requested:
```java
public static List<SVGPath> loadSVGIconFromUri(final String uri, final Class clazz) throws CouldNotPerformException {
try {
InputStream inputStream = clazz.getResourceAsStream(uri);
if (inputStream == null) {
input... |
logic-ng/LogicNG | src/main/java/org/logicng/bdds/BDDFactory.java | BDDFactory.setVariableOrder | public void setVariableOrder(final Variable... varOrder) {
this.kernel.setNumberOfVars(varOrder.length);
for (final Variable lit : varOrder) {
final int idx = this.var2idx.size();
this.var2idx.put(lit.variable(), idx);
this.idx2var.put(idx, lit.variable());
}
} | java | public void setVariableOrder(final Variable... varOrder) {
this.kernel.setNumberOfVars(varOrder.length);
for (final Variable lit : varOrder) {
final int idx = this.var2idx.size();
this.var2idx.put(lit.variable(), idx);
this.idx2var.put(idx, lit.variable());
}
} | [
"public",
"void",
"setVariableOrder",
"(",
"final",
"Variable",
"...",
"varOrder",
")",
"{",
"this",
".",
"kernel",
".",
"setNumberOfVars",
"(",
"varOrder",
".",
"length",
")",
";",
"for",
"(",
"final",
"Variable",
"lit",
":",
"varOrder",
")",
"{",
"final"... | Sets the variable order for this factory manually. In this case the number of variables has not to be set manually.
@param varOrder the variable order. | [
"Sets",
"the",
"variable",
"order",
"for",
"this",
"factory",
"manually",
".",
"In",
"this",
"case",
"the",
"number",
"of",
"variables",
"has",
"not",
"to",
"be",
"set",
"manually",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/BDDFactory.java#L197-L204 | train | Sets the variable order. | Of course, here is the Java code you requested:
```java
public void setVariableOrder(final Variable... varOrder) {
this.kernel.setNumberOfVars(varOrder.length);
for (final Variable lit : varOrder) {
final int idx = this.var2idx.size();
this.var2idx.put(lit.variable(), idx);
this.idx2var.put(i... |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/engine/Attribute.java | Attribute.modify | Attribute modify(
final AttributeDefinition definition,
final String completeName,
final String value,
final AttributeValueQuotes valueQuotes) {
return new Attribute(
(definition == null? this.definition : definition),
(completeNam... | java | Attribute modify(
final AttributeDefinition definition,
final String completeName,
final String value,
final AttributeValueQuotes valueQuotes) {
return new Attribute(
(definition == null? this.definition : definition),
(completeNam... | [
"Attribute",
"modify",
"(",
"final",
"AttributeDefinition",
"definition",
",",
"final",
"String",
"completeName",
",",
"final",
"String",
"value",
",",
"final",
"AttributeValueQuotes",
"valueQuotes",
")",
"{",
"return",
"new",
"Attribute",
"(",
"(",
"definition",
... | /*
This method allows the easy creation of instances derivate from this one but keeping some specific fields | [
"/",
"*",
"This",
"method",
"allows",
"the",
"easy",
"creation",
"of",
"instances",
"derivate",
"from",
"this",
"one",
"but",
"keeping",
"some",
"specific",
"fields"
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/engine/Attribute.java#L155-L170 | train | Modify the attribute. | Of course, here is the Java code you requested:
```java
Attribute modify(
final AttributeDefinition definition,
final String completeName,
final String value,
final AttributeValueQuotes valueQuotes) {
return new Attribute(
(definition == null? th... |
aws/aws-sdk-java | aws-java-sdk-quicksight/src/main/java/com/amazonaws/services/quicksight/model/ListUserGroupsResult.java | ListUserGroupsResult.withGroupList | public ListUserGroupsResult withGroupList(Group... groupList) {
if (this.groupList == null) {
setGroupList(new java.util.ArrayList<Group>(groupList.length));
}
for (Group ele : groupList) {
this.groupList.add(ele);
}
return this;
} | java | public ListUserGroupsResult withGroupList(Group... groupList) {
if (this.groupList == null) {
setGroupList(new java.util.ArrayList<Group>(groupList.length));
}
for (Group ele : groupList) {
this.groupList.add(ele);
}
return this;
} | [
"public",
"ListUserGroupsResult",
"withGroupList",
"(",
"Group",
"...",
"groupList",
")",
"{",
"if",
"(",
"this",
".",
"groupList",
"==",
"null",
")",
"{",
"setGroupList",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"Group",
">",
"(",
"groupLis... | <p>
The list of groups the user is a member of.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setGroupList(java.util.Collection)} or {@link #withGroupList(java.util.Collection)} if you want to
override the existing values.
</p>
@param groupList
The list of groups the u... | [
"<p",
">",
"The",
"list",
"of",
"groups",
"the",
"user",
"is",
"a",
"member",
"of",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-quicksight/src/main/java/com/amazonaws/services/quicksight/model/ListUserGroupsResult.java#L96-L104 | train | A list of all the groups in this user. | Of course, here is the Java code you requested:
```java
public ListUserGroupsResult withGroupList(Group... groupList) {
if (this.groupList == null) {
setGroupList(new java.util.ArrayList<Group>(groupList.length));
}
for (Group ele : groupList) {
this.groupList.add(ele);
... |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java | ArmeriaHttpUtil.toArmeria | public static HttpHeaders toArmeria(Http2Headers headers, boolean endOfStream) {
final HttpHeaders converted = new DefaultHttpHeaders(false, headers.size(), endOfStream);
StringJoiner cookieJoiner = null;
for (Entry<CharSequence, CharSequence> e : headers) {
final AsciiString name = ... | java | public static HttpHeaders toArmeria(Http2Headers headers, boolean endOfStream) {
final HttpHeaders converted = new DefaultHttpHeaders(false, headers.size(), endOfStream);
StringJoiner cookieJoiner = null;
for (Entry<CharSequence, CharSequence> e : headers) {
final AsciiString name = ... | [
"public",
"static",
"HttpHeaders",
"toArmeria",
"(",
"Http2Headers",
"headers",
",",
"boolean",
"endOfStream",
")",
"{",
"final",
"HttpHeaders",
"converted",
"=",
"new",
"DefaultHttpHeaders",
"(",
"false",
",",
"headers",
".",
"size",
"(",
")",
",",
"endOfStream... | Converts the specified Netty HTTP/2 into Armeria HTTP/2 headers. | [
"Converts",
"the",
"specified",
"Netty",
"HTTP",
"/",
"2",
"into",
"Armeria",
"HTTP",
"/",
"2",
"headers",
"."
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java#L492-L516 | train | Converts a list of headers to Armeria. | Of course, here is the Java code you requested:
```java
public static HttpHeaders toArmeria(Http2Headers headers, boolean endOfStream) {
final HttpHeaders converted = new DefaultHttpHeaders(false, headers.size(), endOfStream);
StringJoiner cookieJoiner = null;
for (Entry<CharSequence, CharSeque... |
h2oai/h2o-2 | src/main/java/water/persist/Persist.java | Persist.key2Str | private static String key2Str(Key k, byte type) {
String s = key2Str_impl(k, type);
Key x;
assert (x = str2Key_impl(s)).equals(k) : "bijection fail " + k + "." + (char) type + " <-> " + s + " <-> " + x;
return s;
} | java | private static String key2Str(Key k, byte type) {
String s = key2Str_impl(k, type);
Key x;
assert (x = str2Key_impl(s)).equals(k) : "bijection fail " + k + "." + (char) type + " <-> " + s + " <-> " + x;
return s;
} | [
"private",
"static",
"String",
"key2Str",
"(",
"Key",
"k",
",",
"byte",
"type",
")",
"{",
"String",
"s",
"=",
"key2Str_impl",
"(",
"k",
",",
"type",
")",
";",
"Key",
"x",
";",
"assert",
"(",
"x",
"=",
"str2Key_impl",
"(",
"s",
")",
")",
".",
"equ... | Verify bijection of key/file-name mappings. | [
"Verify",
"bijection",
"of",
"key",
"/",
"file",
"-",
"name",
"mappings",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/persist/Persist.java#L127-L132 | train | key2Str - > str | Of course, here is the Java code you requested:
```java
private static String key2Str(Key k, byte type) {
String s = key2Str_impl(k, type);
Key x;
assert (x = str2Key_impl(s)).equals(k) : "bijection fail " + k + "." + (char) type + " <-> " + s + " <-> " + x;
return s;
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsBytesMessageImpl.java | JmsBytesMessageImpl.readUTF | @Override
public String readUTF() throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "readUTF");
String result;
try {
// Check that we are in read mode
checkBodyReadable("readUTF");
if ... | java | @Override
public String readUTF() throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "readUTF");
String result;
try {
// Check that we are in read mode
checkBodyReadable("readUTF");
if ... | [
"@",
"Override",
"public",
"String",
"readUTF",
"(",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
"... | Read in a string that has been encoded using a modified UTF-8
format from the stream message.
<P>For more information on the UTF-8 format, see "File System Safe
UCS Transformation Format (FSS_UFT)", X/Open Preliminary Specification,
X/Open Company Ltd., Document Number: P316. This information also
appears in ISO/IEC 1... | [
"Read",
"in",
"a",
"string",
"that",
"has",
"been",
"encoded",
"using",
"a",
"modified",
"UTF",
"-",
"8",
"format",
"from",
"the",
"stream",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsBytesMessageImpl.java#L912-L944 | train | readUTF Method. | Of course, here is the Java code you requested:
```java
@Override
public String readUTF() throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "readUTF");
String result;
try {
// Check that we are in read mode
... |
redkale/redkale | src/org/redkale/net/http/HttpResponse.java | HttpResponse.finishMapJson | public void finishMapJson(final JsonConvert convert, final Object... objs) {
this.contentType = this.jsonContentType;
if (this.recycleListener != null) this.output = objs;
finish(convert.convertMapTo(getBodyBufferSupplier(), objs));
} | java | public void finishMapJson(final JsonConvert convert, final Object... objs) {
this.contentType = this.jsonContentType;
if (this.recycleListener != null) this.output = objs;
finish(convert.convertMapTo(getBodyBufferSupplier(), objs));
} | [
"public",
"void",
"finishMapJson",
"(",
"final",
"JsonConvert",
"convert",
",",
"final",
"Object",
"...",
"objs",
")",
"{",
"this",
".",
"contentType",
"=",
"this",
".",
"jsonContentType",
";",
"if",
"(",
"this",
".",
"recycleListener",
"!=",
"null",
")",
... | 将对象数组用Map的形式以JSON格式输出 <br>
例如: finishMap("a",2,"b",3) 输出结果为 {"a":2,"b":3}
@param convert 指定的JsonConvert
@param objs 输出对象 | [
"将对象数组用Map的形式以JSON格式输出",
"<br",
">",
"例如",
":",
"finishMap",
"(",
"a",
"2",
"b",
"3",
")",
"输出结果为",
"{",
"a",
":",
"2",
"b",
":",
"3",
"}"
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpResponse.java#L334-L338 | train | Finish a map of objects. | Of course, here is the Java code you requested:
```java
public void finishMapJson(final JsonConvert convert, final Object... objs) {
this.contentType = this.jsonContentType;
if (this.recycleListener != null) this.output = objs;
finish(convert.convertMapTo(getBodyBufferSupplier(), objs));
... |
chen0040/java-genetic-programming | src/main/java/com/github/chen0040/gp/lgp/gp/Crossover.java | Crossover.onePointCrossover | private static void onePointCrossover(Program gp1, Program gp2, LGP manager, RandEngine randEngine) {
// Xianshun says:
// this implementation is derived from Algorithm 5.1 in Section 5.7.1 of Linear
// Genetic Programming
// length(gp1) <= length(gp2)
if (gp1.length() > gp2.length())
... | java | private static void onePointCrossover(Program gp1, Program gp2, LGP manager, RandEngine randEngine) {
// Xianshun says:
// this implementation is derived from Algorithm 5.1 in Section 5.7.1 of Linear
// Genetic Programming
// length(gp1) <= length(gp2)
if (gp1.length() > gp2.length())
... | [
"private",
"static",
"void",
"onePointCrossover",
"(",
"Program",
"gp1",
",",
"Program",
"gp2",
",",
"LGP",
"manager",
",",
"RandEngine",
"randEngine",
")",
"{",
"// Xianshun says:",
"// this implementation is derived from Algorithm 5.1 in Section 5.7.1 of Linear",
"// Geneti... | /* Xianshun says:
This operator is derived from Algorithm 5.2 in Section 5.7.2 of Linear Genetic Programming | [
"/",
"*",
"Xianshun",
"says",
":",
"This",
"operator",
"is",
"derived",
"from",
"Algorithm",
"5",
".",
"2",
"in",
"Section",
"5",
".",
"7",
".",
"2",
"of",
"Linear",
"Genetic",
"Programming"
] | 498fc8f4407ea9d45f2e0ac797a8948da337c74f | https://github.com/chen0040/java-genetic-programming/blob/498fc8f4407ea9d45f2e0ac797a8948da337c74f/src/main/java/com/github/chen0040/gp/lgp/gp/Crossover.java#L119-L236 | train | one point crossover | Of course, here is the Java code you requested:
```java
private static void onePointCrossover(Program gp1, Program gp2, LGP manager, RandEngine randEngine) {
// Xianshun says:
// this implementation is derived from Algorithm 5.1 in Section 5.7.1 of Linear
// Genetic Programming
// length(gp1) ... |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/sourcefeature/SequenceCoverageCheck.java | SequenceCoverageCheck.check | public ValidationResult check(Entry entry) {
result = new ValidationResult();
if(entry == null || entry.getSequence() == null) {
return result;
}
// checks the CONTIG/CO line locations cover the sequence length
if (entry.getSequence().getContigs() != null && entry.getSequence().getContigs().size() != 0) {... | java | public ValidationResult check(Entry entry) {
result = new ValidationResult();
if(entry == null || entry.getSequence() == null) {
return result;
}
// checks the CONTIG/CO line locations cover the sequence length
if (entry.getSequence().getContigs() != null && entry.getSequence().getContigs().size() != 0) {... | [
"public",
"ValidationResult",
"check",
"(",
"Entry",
"entry",
")",
"{",
"result",
"=",
"new",
"ValidationResult",
"(",
")",
";",
"if",
"(",
"entry",
"==",
"null",
"||",
"entry",
".",
"getSequence",
"(",
")",
"==",
"null",
")",
"{",
"return",
"result",
... | Checks the coverage of sequence by source features' locations.
@param entry an entry to be checked (expected type is Entry)
@return a validation result | [
"Checks",
"the",
"coverage",
"of",
"sequence",
"by",
"source",
"features",
"locations",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/sourcefeature/SequenceCoverageCheck.java#L60-L171 | train | Checks if the entry is valid. | Of course, here is the Java code you requested:
```java
public ValidationResult check(Entry entry) {
result = new ValidationResult();
if(entry == null || entry.getSequence() == null) {
return result;
}
// checks the CONTIG/CO line locations cover the sequence length
if (entry.getSequence().getContigs() !... |
ag-gipp/MathMLTools | mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/CMMLHelper.java | CMMLHelper.getStrictCmml | public static Node getStrictCmml(String mathml) {
try {
// get ContentMathML to Strict ContentMathML and finally the abstract CD
CMMLInfo cmmlInfo = new CMMLInfo(mathml).toStrictCmml();
/*
Don't use:
Abstract2CD nicht benutzen! Sobald ein Knoten t... | java | public static Node getStrictCmml(String mathml) {
try {
// get ContentMathML to Strict ContentMathML and finally the abstract CD
CMMLInfo cmmlInfo = new CMMLInfo(mathml).toStrictCmml();
/*
Don't use:
Abstract2CD nicht benutzen! Sobald ein Knoten t... | [
"public",
"static",
"Node",
"getStrictCmml",
"(",
"String",
"mathml",
")",
"{",
"try",
"{",
"// get ContentMathML to Strict ContentMathML and finally the abstract CD",
"CMMLInfo",
"cmmlInfo",
"=",
"new",
"CMMLInfo",
"(",
"mathml",
")",
".",
"toStrictCmml",
"(",
")",
"... | Get the first node of the MathML-Content annotations within a MathML document.
Before, the MathML document was converted to strict CMML and subsequently also converted
to display only the abstract variation of the content dictionary.
@param mathml full MathML document
@return first node of the MathML-Content annotatio... | [
"Get",
"the",
"first",
"node",
"of",
"the",
"MathML",
"-",
"Content",
"annotations",
"within",
"a",
"MathML",
"document",
".",
"Before",
"the",
"MathML",
"document",
"was",
"converted",
"to",
"strict",
"CMML",
"and",
"subsequently",
"also",
"converted",
"to",
... | 77c69b6366a5b8720796d1cd9d155ba26c2f1b20 | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/CMMLHelper.java#L66-L84 | train | Get the Strict MathML Node from the given MathML string. | Of course, here is the Java code you requested:
```java
public static Node getStrictCmml(String mathml) {
try {
// get ContentMathML to Strict ContentMathML and finally the abstract CD
CMMLInfo cmmlInfo = new CMMLInfo(mathml).toStrictCmml();
/*
Don't use:
... |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.getThisSideMatrix | private Matrix getThisSideMatrix(Matrix B)
{
if(this.canBeMutated())
return this.clone();
else//so far, only other option in JSAT is a dense matrix
{
DenseMatrix dm = new DenseMatrix(rows(), cols());
dm.mutableAdd(this);
return dm;
}
... | java | private Matrix getThisSideMatrix(Matrix B)
{
if(this.canBeMutated())
return this.clone();
else//so far, only other option in JSAT is a dense matrix
{
DenseMatrix dm = new DenseMatrix(rows(), cols());
dm.mutableAdd(this);
return dm;
}
... | [
"private",
"Matrix",
"getThisSideMatrix",
"(",
"Matrix",
"B",
")",
"{",
"if",
"(",
"this",
".",
"canBeMutated",
"(",
")",
")",
"return",
"this",
".",
"clone",
"(",
")",
";",
"else",
"//so far, only other option in JSAT is a dense matrix",
"{",
"DenseMatrix",
"dm... | Returns an appropriate matrix to use for some operation A <i>op</i> B,
where {@code A = this }
@param B the other matrix, may be null
@return a matrix that can be mutated to take the place of A | [
"Returns",
"an",
"appropriate",
"matrix",
"to",
"use",
"for",
"some",
"operation",
"A",
"<i",
">",
"op<",
"/",
"i",
">",
"B",
"where",
"{"
] | 0ff53b7b39684b2379cc1da522f5b3a954b15cfb | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L150-L160 | train | Get this side matrix A. | Of course, here is the Java code you requested:
```java
private Matrix getThisSideMatrix(Matrix B)
{
if(this.canBeMutated())
return this.clone();
else//so far, only other option in JSAT is a dense matrix
{
DenseMatrix dm = new DenseMatrix(rows(), cols());
... |
camunda/camunda-bpm-platform | engine-cdi/src/main/java/org/camunda/bpm/engine/cdi/BusinessProcess.java | BusinessProcess.getProcessInstanceId | public String getProcessInstanceId() {
Execution execution = associationManager.getExecution();
return execution != null ? execution.getProcessInstanceId() : null;
} | java | public String getProcessInstanceId() {
Execution execution = associationManager.getExecution();
return execution != null ? execution.getProcessInstanceId() : null;
} | [
"public",
"String",
"getProcessInstanceId",
"(",
")",
"{",
"Execution",
"execution",
"=",
"associationManager",
".",
"getExecution",
"(",
")",
";",
"return",
"execution",
"!=",
"null",
"?",
"execution",
".",
"getProcessInstanceId",
"(",
")",
":",
"null",
";",
... | Returns the id of the currently associated process instance or 'null' | [
"Returns",
"the",
"id",
"of",
"the",
"currently",
"associated",
"process",
"instance",
"or",
"null"
] | 1a464fc887ef3760e53d6f91b9e5b871a0d77cc0 | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine-cdi/src/main/java/org/camunda/bpm/engine/cdi/BusinessProcess.java#L673-L676 | train | Gets the process instance id. | Of course, here is the Java code you requested:
```java
public String getProcessInstanceId() {
Execution execution = associationManager.getExecution();
return execution != null ? execution.getProcessInstanceId() : null;
}
```
Hope this helps! |
cosysoft/device | device-api/src/main/java/com/github/cosysoft/device/android/impl/AbstractDevice.java | AbstractDevice.handlePopBox | public boolean handlePopBox(String deviceBrand) {
pushHandleGps2Device();
CommandLine exeCommand = null;
if (deviceBrand.contains("HTC")) {
exeCommand = adbCommand("shell", "uiautomator", "runtest",
"/data/local/tmp/handlePopBox.jar", "-c", "com.test.device.gps.HTCGPSTest");
} else if (... | java | public boolean handlePopBox(String deviceBrand) {
pushHandleGps2Device();
CommandLine exeCommand = null;
if (deviceBrand.contains("HTC")) {
exeCommand = adbCommand("shell", "uiautomator", "runtest",
"/data/local/tmp/handlePopBox.jar", "-c", "com.test.device.gps.HTCGPSTest");
} else if (... | [
"public",
"boolean",
"handlePopBox",
"(",
"String",
"deviceBrand",
")",
"{",
"pushHandleGps2Device",
"(",
")",
";",
"CommandLine",
"exeCommand",
"=",
"null",
";",
"if",
"(",
"deviceBrand",
".",
"contains",
"(",
"\"HTC\"",
")",
")",
"{",
"exeCommand",
"=",
"a... | try to click GPS Popup window | [
"try",
"to",
"click",
"GPS",
"Popup",
"window"
] | d5cd0b713a47aba4d5f3f5d918578336f44ddb9e | https://github.com/cosysoft/device/blob/d5cd0b713a47aba4d5f3f5d918578336f44ddb9e/device-api/src/main/java/com/github/cosysoft/device/android/impl/AbstractDevice.java#L325-L348 | test | Handle the pop box test | Of course, here is the Java code you requested:
```java
public boolean handlePopBox(String deviceBrand) {
pushHandleGps2Device();
CommandLine exeCommand = null;
if (deviceBrand.contains("HTC")) {
exeCommand = adbCommand("shell", "uiautomator", "runtest",
"/data/local/tmp/handlePopBox.jar",... |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/appstore/googleUtils/Security.java | Security.verifyPurchase | public static boolean verifyPurchase(@NotNull String base64PublicKey, @NotNull String signedData, @NotNull String signature) {
if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey)
|| TextUtils.isEmpty(signature)) {
Logger.e("Purchase verification failed: missing da... | java | public static boolean verifyPurchase(@NotNull String base64PublicKey, @NotNull String signedData, @NotNull String signature) {
if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey)
|| TextUtils.isEmpty(signature)) {
Logger.e("Purchase verification failed: missing da... | [
"public",
"static",
"boolean",
"verifyPurchase",
"(",
"@",
"NotNull",
"String",
"base64PublicKey",
",",
"@",
"NotNull",
"String",
"signedData",
",",
"@",
"NotNull",
"String",
"signature",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"signedData",
")"... | Verifies that the data was signed with the given signature, and returns
the verified purchase. The data is in JSON format and signed
with a private key. The data also contains the {@link com.amazon.inapp.purchasing.PurchaseResponse.PurchaseRequestStatus}
and product ID of the purchase.
@param base64PublicKey the base6... | [
"Verifies",
"that",
"the",
"data",
"was",
"signed",
"with",
"the",
"given",
"signature",
"and",
"returns",
"the",
"verified",
"purchase",
".",
"The",
"data",
"is",
"in",
"JSON",
"format",
"and",
"signed",
"with",
"a",
"private",
"key",
".",
"The",
"data",
... | 90552d53c5303b322940d96a0c4b7cb797d78760 | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/Security.java#L57-L66 | train | Verify a purchase. | Of course, here is the Java code you requested:
```java
public static boolean verifyPurchase(@NotNull String base64PublicKey, @NotNull String signedData, @NotNull String signature) {
if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey)
|| TextUtils.isEmpty(signature)) {
... |
janus-project/guava.janusproject.io | guava/src/com/google/common/io/GwtWorkarounds.java | GwtWorkarounds.asInputStream | @GwtIncompatible("InputStream")
static InputStream asInputStream(final ByteInput input) {
checkNotNull(input);
return new InputStream() {
@Override
public int read() throws IOException {
return input.read();
}
@Override
public int read(byte[] b, int off, int len) throws ... | java | @GwtIncompatible("InputStream")
static InputStream asInputStream(final ByteInput input) {
checkNotNull(input);
return new InputStream() {
@Override
public int read() throws IOException {
return input.read();
}
@Override
public int read(byte[] b, int off, int len) throws ... | [
"@",
"GwtIncompatible",
"(",
"\"InputStream\"",
")",
"static",
"InputStream",
"asInputStream",
"(",
"final",
"ByteInput",
"input",
")",
"{",
"checkNotNull",
"(",
"input",
")",
";",
"return",
"new",
"InputStream",
"(",
")",
"{",
"@",
"Override",
"public",
"int"... | Views a {@code ByteInput} as an {@code InputStream}. | [
"Views",
"a",
"{"
] | 1c48fb672c9fdfddf276970570f703fa1115f588 | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/io/GwtWorkarounds.java#L102-L138 | train | Returns an InputStream that reads bytes from the specified ByteInput. | Of course, here is the Java code you requested:
```java
@GwtIncompatible("InputStream")
static InputStream asInputStream(final ByteInput input) {
checkNotNull(input);
return new InputStream() {
@Override
public int read() throws IOException {
return input.read();
}
@Override
... |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java | SoundStore.poll | public void poll(int delta) {
if (!soundWorks) {
return;
}
if (paused) {
return;
}
if (music) {
if (mod != null) {
try {
mod.poll();
} catch (OpenALException e) {
Log.error("Error with OpenGL MOD Player on this this platform");
Log.error(e);
mod = null;
... | java | public void poll(int delta) {
if (!soundWorks) {
return;
}
if (paused) {
return;
}
if (music) {
if (mod != null) {
try {
mod.poll();
} catch (OpenALException e) {
Log.error("Error with OpenGL MOD Player on this this platform");
Log.error(e);
mod = null;
... | [
"public",
"void",
"poll",
"(",
"int",
"delta",
")",
"{",
"if",
"(",
"!",
"soundWorks",
")",
"{",
"return",
";",
"}",
"if",
"(",
"paused",
")",
"{",
"return",
";",
"}",
"if",
"(",
"music",
")",
"{",
"if",
"(",
"mod",
"!=",
"null",
")",
"{",
"t... | Poll the streaming system
@param delta The amount of time passed since last poll (in milliseconds) | [
"Poll",
"the",
"streaming",
"system"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java#L900-L928 | train | Poll the device for a delta of time. | Of course, here is the Java code you requested:
```java
public void poll(int delta) {
if (!soundWorks) {
return;
}
if (paused) {
return;
}
if (music) {
if (mod != null) {
try {
mod.poll();
} catch (OpenALException e) {
Log.error("Error with OpenGL MOD Player on this t... |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationData.java | CollationData.getGroupForPrimary | public int getGroupForPrimary(long p) {
p >>= 16;
if(p < scriptStarts[1] || scriptStarts[scriptStarts.length - 1] <= p) {
return -1;
}
int index = 1;
while(p >= scriptStarts[index + 1]) { ++index; }
for(int i = 0; i < numScripts; ++i) {
if(scriptsI... | java | public int getGroupForPrimary(long p) {
p >>= 16;
if(p < scriptStarts[1] || scriptStarts[scriptStarts.length - 1] <= p) {
return -1;
}
int index = 1;
while(p >= scriptStarts[index + 1]) { ++index; }
for(int i = 0; i < numScripts; ++i) {
if(scriptsI... | [
"public",
"int",
"getGroupForPrimary",
"(",
"long",
"p",
")",
"{",
"p",
">>=",
"16",
";",
"if",
"(",
"p",
"<",
"scriptStarts",
"[",
"1",
"]",
"||",
"scriptStarts",
"[",
"scriptStarts",
".",
"length",
"-",
"1",
"]",
"<=",
"p",
")",
"{",
"return",
"-... | Finds the reordering group which contains the primary weight.
@return the first script of the group, or -1 if the weight is beyond the last group | [
"Finds",
"the",
"reordering",
"group",
"which",
"contains",
"the",
"primary",
"weight",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationData.java#L221-L239 | train | Get the group for the primary. | Of course, here is the Java code you requested:
```java
public int getGroupForPrimary(long p) {
p >>= 16;
if(p < scriptStarts[1] || scriptStarts[scriptStarts.length - 1] <= p) {
return -1;
}
int index = 1;
while(p >= scriptStarts[index + 1]) { ++index; }
for(... |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_item_itemId_configuration_configurationId_GET | public OvhConfigurationItem cart_cartId_item_itemId_configuration_configurationId_GET(String cartId, Long itemId, Long configurationId) throws IOException {
String qPath = "/order/cart/{cartId}/item/{itemId}/configuration/{configurationId}";
StringBuilder sb = path(qPath, cartId, itemId, configurationId);
String ... | java | public OvhConfigurationItem cart_cartId_item_itemId_configuration_configurationId_GET(String cartId, Long itemId, Long configurationId) throws IOException {
String qPath = "/order/cart/{cartId}/item/{itemId}/configuration/{configurationId}";
StringBuilder sb = path(qPath, cartId, itemId, configurationId);
String ... | [
"public",
"OvhConfigurationItem",
"cart_cartId_item_itemId_configuration_configurationId_GET",
"(",
"String",
"cartId",
",",
"Long",
"itemId",
",",
"Long",
"configurationId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/item/{itemId}/config... | Retrieve configuration item
REST: GET /order/cart/{cartId}/item/{itemId}/configuration/{configurationId}
@param cartId [required] Cart identifier
@param itemId [required] Product item identifier
@param configurationId [required] Configuration item identifier | [
"Retrieve",
"configuration",
"item"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L8088-L8093 | train | Get configuration item | Of course, here is the Java code you requested:
```java
public OvhConfigurationItem cart_cartId_item_itemId_configuration_configurationId_GET(String cartId, Long itemId, Long configurationId) throws IOException {
String qPath = "/order/cart/{cartId}/item/{itemId}/configuration/{configurationId}";
StringBuilder sb ... |
elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/cleaning/ReplaceNaNWithRandomFilter.java | ReplaceNaNWithRandomFilter.updateMeta | private void updateMeta(BundleMeta meta) {
final int cols = meta.size();
densecols = new NumberVector.Factory<?>[cols];
for(int i = 0; i < cols; i++) {
if(TypeUtil.SPARSE_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
throw new AbortException("Filtering sparse vectors is not yet s... | java | private void updateMeta(BundleMeta meta) {
final int cols = meta.size();
densecols = new NumberVector.Factory<?>[cols];
for(int i = 0; i < cols; i++) {
if(TypeUtil.SPARSE_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
throw new AbortException("Filtering sparse vectors is not yet s... | [
"private",
"void",
"updateMeta",
"(",
"BundleMeta",
"meta",
")",
"{",
"final",
"int",
"cols",
"=",
"meta",
".",
"size",
"(",
")",
";",
"densecols",
"=",
"new",
"NumberVector",
".",
"Factory",
"<",
"?",
">",
"[",
"cols",
"]",
";",
"for",
"(",
"int",
... | Process an updated meta record.
@param meta Meta record | [
"Process",
"an",
"updated",
"meta",
"record",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/cleaning/ReplaceNaNWithRandomFilter.java#L136-L149 | train | Update the meta field. | Of course, here is the Java code you requested:
```java
private void updateMeta(BundleMeta meta) {
final int cols = meta.size();
densecols = new NumberVector.Factory<?>[cols];
for(int i = 0; i < cols; i++) {
if(TypeUtil.SPARSE_VECTOR_VARIABLE_LENGTH.isAssignableFromType(meta.get(i))) {
throw ... |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Chemical.java | Chemical.getRegistryNumber | public String getRegistryNumber() {
if (Chemical_Type.featOkTst && ((Chemical_Type)jcasType).casFeat_registryNumber == null)
jcasType.jcas.throwFeatMissing("registryNumber", "de.julielab.jules.types.Chemical");
return jcasType.ll_cas.ll_getStringValue(addr, ((Chemical_Type)jcasType).casFeatCode_registryNu... | java | public String getRegistryNumber() {
if (Chemical_Type.featOkTst && ((Chemical_Type)jcasType).casFeat_registryNumber == null)
jcasType.jcas.throwFeatMissing("registryNumber", "de.julielab.jules.types.Chemical");
return jcasType.ll_cas.ll_getStringValue(addr, ((Chemical_Type)jcasType).casFeatCode_registryNu... | [
"public",
"String",
"getRegistryNumber",
"(",
")",
"{",
"if",
"(",
"Chemical_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Chemical_Type",
")",
"jcasType",
")",
".",
"casFeat_registryNumber",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"("... | getter for registryNumber - gets A unique 5 to 9 digit number in hyphenated format assigned by the Chemical Abstract Service to specify chemical substances, a zero is a valid number when an actual number cannot be located or is not yet available., C
@generated
@return value of the feature | [
"getter",
"for",
"registryNumber",
"-",
"gets",
"A",
"unique",
"5",
"to",
"9",
"digit",
"number",
"in",
"hyphenated",
"format",
"assigned",
"by",
"the",
"Chemical",
"Abstract",
"Service",
"to",
"specify",
"chemical",
"substances",
"a",
"zero",
"is",
"a",
"va... | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Chemical.java#L85-L88 | train | getter for registryNumber - gets Number of the chemical element | Of course, here is the Java code you requested:
```java
public String getRegistryNumber() {
if (Chemical_Type.featOkTst && ((Chemical_Type)jcasType).casFeat_registryNumber == null)
jcasType.jcas.throwFeatMissing("registryNumber", "de.julielab.jules.types.Chemical");
return jcasType.ll_cas.ll_getStringVal... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/deliverydelay/DeliveryDelayManager.java | DeliveryDelayManager.remove | private final boolean remove(DeliveryDelayableReference deliveryDelayableReference, boolean unlocked)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "remove",
" deliveryDelayableReference=" + deliveryDelayableReference + " unlocke... | java | private final boolean remove(DeliveryDelayableReference deliveryDelayableReference, boolean unlocked)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "remove",
" deliveryDelayableReference=" + deliveryDelayableReference + " unlocke... | [
"private",
"final",
"boolean",
"remove",
"(",
"DeliveryDelayableReference",
"deliveryDelayableReference",
",",
"boolean",
"unlocked",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Si... | Remove the DeliveryDelayable reference from the DeliveryDelay index. This will remove the
current entry pointed-to by the iterator.
@param deliveryDelayableReference our reference to the DeliveryDelayable
@param unlocked true if the item is being removed after delivery delay time, false if being
removed because it is ... | [
"Remove",
"the",
"DeliveryDelayable",
"reference",
"from",
"the",
"DeliveryDelay",
"index",
".",
"This",
"will",
"remove",
"the",
"current",
"entry",
"pointed",
"-",
"to",
"by",
"the",
"iterator",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/deliverydelay/DeliveryDelayManager.java#L723-L752 | train | Removes a single delivery delay element from the index. | Of course, here is the Java code you requested:
```java
private final boolean remove(DeliveryDelayableReference deliveryDelayableReference, boolean unlocked)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "remove",
" deliveryDela... |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateCertificateIssuerAsync | public ServiceFuture<IssuerBundle> updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback<IssuerBundle> serviceCallback) {
return ServiceFuture.fromResponse(updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback);
} | java | public ServiceFuture<IssuerBundle> updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback<IssuerBundle> serviceCallback) {
return ServiceFuture.fromResponse(updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"IssuerBundle",
">",
"updateCertificateIssuerAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
",",
"final",
"ServiceCallback",
"<",
"IssuerBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fr... | Updates the specified certificate issuer.
The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param issuerName The name of t... | [
"Updates",
"the",
"specified",
"certificate",
"issuer",
".",
"The",
"UpdateCertificateIssuer",
"operation",
"performs",
"an",
"update",
"on",
"the",
"specified",
"certificate",
"issuer",
"entity",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"se... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6124-L6126 | train | Updates an issuer. | Of course, here is the Java code you requested:
```java
public ServiceFuture<IssuerBundle> updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback<IssuerBundle> serviceCallback) {
return ServiceFuture.fromResponse(updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, ... |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/ReturnPathType.java | ReturnPathType.mergeWith | public void mergeWith(ReturnPathType fact) {
if (fact.isTop()) {
// other fact is top: no change to this one
return;
} else if (this.isTop()) {
// this fact is top: copy other fact
this.copyFrom(fact);
} else {
// neither fact is top: a... | java | public void mergeWith(ReturnPathType fact) {
if (fact.isTop()) {
// other fact is top: no change to this one
return;
} else if (this.isTop()) {
// this fact is top: copy other fact
this.copyFrom(fact);
} else {
// neither fact is top: a... | [
"public",
"void",
"mergeWith",
"(",
"ReturnPathType",
"fact",
")",
"{",
"if",
"(",
"fact",
".",
"isTop",
"(",
")",
")",
"{",
"// other fact is top: no change to this one",
"return",
";",
"}",
"else",
"if",
"(",
"this",
".",
"isTop",
"(",
")",
")",
"{",
"... | Merge this fact with given fact.
@param fact
another dataflow fact | [
"Merge",
"this",
"fact",
"with",
"given",
"fact",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/ReturnPathType.java#L103-L118 | train | Merge two return path facts into this one. | Of course, here is the Java code you requested:
```java
public void mergeWith(ReturnPathType fact) {
if (fact.isTop()) {
// other fact is top: no change to this one
return;
} else if (this.isTop()) {
// this fact is top: copy other fact
this.copyFrom(fact... |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortablePathCursor.java | PortablePathCursor.index | void index(int indexToNavigateTo) {
this.index = 0;
this.offset = 0;
this.nextSplit = StringUtil.indexOf(path, '.', 0);
this.token = null;
for (int i = 1; i <= indexToNavigateTo; i++) {
if (!advanceToNextToken()) {
throw new IndexOutOfBoundsException(... | java | void index(int indexToNavigateTo) {
this.index = 0;
this.offset = 0;
this.nextSplit = StringUtil.indexOf(path, '.', 0);
this.token = null;
for (int i = 1; i <= indexToNavigateTo; i++) {
if (!advanceToNextToken()) {
throw new IndexOutOfBoundsException(... | [
"void",
"index",
"(",
"int",
"indexToNavigateTo",
")",
"{",
"this",
".",
"index",
"=",
"0",
";",
"this",
".",
"offset",
"=",
"0",
";",
"this",
".",
"nextSplit",
"=",
"StringUtil",
".",
"indexOf",
"(",
"path",
",",
"'",
"'",
",",
"0",
")",
";",
"t... | Sets the index to the given index without validating. If the index is out of bound the consecutive token() call
will throw a runtime exception.
@param indexToNavigateTo value to set the cursor's index to. | [
"Sets",
"the",
"index",
"to",
"the",
"given",
"index",
"without",
"validating",
".",
"If",
"the",
"index",
"is",
"out",
"of",
"bound",
"the",
"consecutive",
"token",
"()",
"call",
"will",
"throw",
"a",
"runtime",
"exception",
"."
] | 8c4bc10515dbbfb41a33e0302c0caedf3cda1baf | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortablePathCursor.java#L117-L128 | train | Sets the index of the page. | Of course, here is the Java code you requested:
```java
void index(int indexToNavigateTo) {
this.index = 0;
this.offset = 0;
this.nextSplit = StringUtil.indexOf(path, '.', 0);
this.token = null;
for (int i = 1; i <= indexToNavigateTo; i++) {
if (!advanceToNextToken(... |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/Terminals.java | Terminals.caseInsensitive | @Deprecated
public static Terminals caseInsensitive(String[] ops, String[] keywords) {
return operators(ops).words(Scanners.IDENTIFIER).caseInsensitiveKeywords(asList(keywords)).build();
} | java | @Deprecated
public static Terminals caseInsensitive(String[] ops, String[] keywords) {
return operators(ops).words(Scanners.IDENTIFIER).caseInsensitiveKeywords(asList(keywords)).build();
} | [
"@",
"Deprecated",
"public",
"static",
"Terminals",
"caseInsensitive",
"(",
"String",
"[",
"]",
"ops",
",",
"String",
"[",
"]",
"keywords",
")",
"{",
"return",
"operators",
"(",
"ops",
")",
".",
"words",
"(",
"Scanners",
".",
"IDENTIFIER",
")",
".",
"cas... | Returns a {@link Terminals} object for lexing and parsing the operators with names specified in
{@code ops}, and for lexing and parsing the keywords case insensitively. Parsers for operators
and keywords can be obtained through {@link #token}; parsers for identifiers through
{@link #identifier}.
<p>In detail, keywords... | [
"Returns",
"a",
"{",
"@link",
"Terminals",
"}",
"object",
"for",
"lexing",
"and",
"parsing",
"the",
"operators",
"with",
"names",
"specified",
"in",
"{",
"@code",
"ops",
"}",
"and",
"for",
"lexing",
"and",
"parsing",
"the",
"keywords",
"case",
"insensitively... | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Terminals.java#L241-L244 | train | Creates a terminals object with the given operators and keywords case insensitive. | Of course, here is the Java code you requested:
```java
@Deprecated
public static Terminals caseInsensitive(String[] ops, String[] keywords) {
return operators(ops).words(Scanners.IDENTIFIER).caseInsensitiveKeywords(asList(keywords)).build();
}
```
Hope this helps! |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/key/spi/RowKey.java | RowKey.getColumnValue | public Object getColumnValue(String columnName) {
for ( int j = 0; j < columnNames.length; j++ ) {
if ( columnNames[j].equals( columnName ) ) {
return columnValues[j];
}
}
return null;
} | java | public Object getColumnValue(String columnName) {
for ( int j = 0; j < columnNames.length; j++ ) {
if ( columnNames[j].equals( columnName ) ) {
return columnValues[j];
}
}
return null;
} | [
"public",
"Object",
"getColumnValue",
"(",
"String",
"columnName",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"columnNames",
".",
"length",
";",
"j",
"++",
")",
"{",
"if",
"(",
"columnNames",
"[",
"j",
"]",
".",
"equals",
"(",
"colu... | Get the value of the specified column.
@param columnName the name of the column
@return the corresponding value of the column, {@code null} if the column does not exist in the row key | [
"Get",
"the",
"value",
"of",
"the",
"specified",
"column",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/key/spi/RowKey.java#L57-L64 | train | Gets the value of the column with the specified name. | Of course, here is the Java code you requested:
```java
public Object getColumnValue(String columnName) {
for ( int j = 0; j < columnNames.length; j++ ) {
if ( columnNames[j].equals( columnName ) ) {
return columnValues[j];
}
}
return null;
}
```
Hope this helps! |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/TriangulateProjectiveLinearDLT.java | TriangulateProjectiveLinearDLT.addView | private int addView( DMatrixRMaj P , Point2D_F64 a , int index ) {
final double sx = stats.stdX, sy = stats.stdY;
// final double cx = stats.meanX, cy = stats.meanY;
// Easier to read the code when P is broken up this way
double r11 = P.data[0], r12 = P.data[1], r13 = P.data[2], r14=P.data[3];
double r21 =... | java | private int addView( DMatrixRMaj P , Point2D_F64 a , int index ) {
final double sx = stats.stdX, sy = stats.stdY;
// final double cx = stats.meanX, cy = stats.meanY;
// Easier to read the code when P is broken up this way
double r11 = P.data[0], r12 = P.data[1], r13 = P.data[2], r14=P.data[3];
double r21 =... | [
"private",
"int",
"addView",
"(",
"DMatrixRMaj",
"P",
",",
"Point2D_F64",
"a",
",",
"int",
"index",
")",
"{",
"final",
"double",
"sx",
"=",
"stats",
".",
"stdX",
",",
"sy",
"=",
"stats",
".",
"stdY",
";",
"//\t\tfinal double cx = stats.meanX, cy = stats.meanY;... | Adds a view to the A matrix. Computed using cross product. | [
"Adds",
"a",
"view",
"to",
"the",
"A",
"matrix",
".",
"Computed",
"using",
"cross",
"product",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/TriangulateProjectiveLinearDLT.java#L111-L140 | train | Adds the view of the image to the image | Of course, here is the Java code you requested:
```java
private int addView( DMatrixRMaj P , Point2D_F64 a , int index ) {
final double sx = stats.stdX, sy = stats.stdY;
// final double cx = stats.meanX, cy = stats.meanY;
// Easier to read the code when P is broken up this way
double r11 = P.data[0], r12 = P... |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/upgrade/UpgradedWebConnectionImpl.java | UpgradedWebConnectionImpl.close | @Override
public void close() throws Exception {
if(webConnection_closeComplete){
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "WebConnection close previously completed ...return ");
}
return;
}
... | java | @Override
public void close() throws Exception {
if(webConnection_closeComplete){
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "WebConnection close previously completed ...return ");
}
return;
}
... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"webConnection_closeComplete",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
... | /*
(non-Javadoc)
@see java.lang.AutoCloseable#close() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/upgrade/UpgradedWebConnectionImpl.java#L91-L160 | train | Close the connection. | Of course, here is the Java code you requested:
```java
@Override
public void close() throws Exception {
if(webConnection_closeComplete){
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "WebConnection close previously completed ...return... |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/vectorization/ImageVectorization.java | ImageVectorization.transformToVector | public double[] transformToVector() throws Exception {
if (vectorLength > vladAggregator.getVectorLength() || vectorLength <= 0) {
throw new Exception("Vector length should be between 1 and " + vladAggregator.getVectorLength());
}
// the local features are extracted
double[][] features;
if (image =... | java | public double[] transformToVector() throws Exception {
if (vectorLength > vladAggregator.getVectorLength() || vectorLength <= 0) {
throw new Exception("Vector length should be between 1 and " + vladAggregator.getVectorLength());
}
// the local features are extracted
double[][] features;
if (image =... | [
"public",
"double",
"[",
"]",
"transformToVector",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"vectorLength",
">",
"vladAggregator",
".",
"getVectorLength",
"(",
")",
"||",
"vectorLength",
"<=",
"0",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Vecto... | Transforms the image into a vector and returns the result.
@return The image's vector.
@throws Exception | [
"Transforms",
"the",
"image",
"into",
"a",
"vector",
"and",
"returns",
"the",
"result",
"."
] | f82e8e517da706651f4b7a719805401f3102e135 | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/vectorization/ImageVectorization.java#L169-L208 | train | Transform the image to vector. | Of course, here is the Java code you requested:
```java
public double[] transformToVector() throws Exception {
if (vectorLength > vladAggregator.getVectorLength() || vectorLength <= 0) {
throw new Exception("Vector length should be between 1 and " + vladAggregator.getVectorLength());
}
// the local feat... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/mapper/DefaultResultSetMapper.java | DefaultResultSetMapper.resolveTables | @Override
public Class[] resolveTables() {
List<Class> classes = new ArrayList<>(tableNames.length);
String lastTableName = null;
resultColumns.clear();
for (int i = 0; i < tableNames.length; i++) {
String tableName = tableNames[i];
String columnName = columnNames[i];
if (tableName == null) {
//... | java | @Override
public Class[] resolveTables() {
List<Class> classes = new ArrayList<>(tableNames.length);
String lastTableName = null;
resultColumns.clear();
for (int i = 0; i < tableNames.length; i++) {
String tableName = tableNames[i];
String columnName = columnNames[i];
if (tableName == null) {
//... | [
"@",
"Override",
"public",
"Class",
"[",
"]",
"resolveTables",
"(",
")",
"{",
"List",
"<",
"Class",
">",
"classes",
"=",
"new",
"ArrayList",
"<>",
"(",
"tableNames",
".",
"length",
")",
";",
"String",
"lastTableName",
"=",
"null",
";",
"resultColumns",
"... | {@inheritDoc} | [
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/mapper/DefaultResultSetMapper.java#L206-L235 | test | Resolves the table names. | Of course, here is the Java code you requested:
```java
@Override
public Class[] resolveTables() {
List<Class> classes = new ArrayList<>(tableNames.length);
String lastTableName = null;
resultColumns.clear();
for (int i = 0; i < tableNames.length; i++) {
String tableName = tableNames[i];
String columnN... |
Unidata/thredds | tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestValidator.java | NcssGridRequestValidator.isValid | @Override
public boolean isValid(NcssGridParamsBean params, ConstraintValidatorContext constraintValidatorContext) {
constraintValidatorContext.disableDefaultConstraintViolation();
boolean isValid = true;
// lat/lon point
if (params.getLatitude() != null || params.getLongitude() != null) {
if ... | java | @Override
public boolean isValid(NcssGridParamsBean params, ConstraintValidatorContext constraintValidatorContext) {
constraintValidatorContext.disableDefaultConstraintViolation();
boolean isValid = true;
// lat/lon point
if (params.getLatitude() != null || params.getLongitude() != null) {
if ... | [
"@",
"Override",
"public",
"boolean",
"isValid",
"(",
"NcssGridParamsBean",
"params",
",",
"ConstraintValidatorContext",
"constraintValidatorContext",
")",
"{",
"constraintValidatorContext",
".",
"disableDefaultConstraintViolation",
"(",
")",
";",
"boolean",
"isValid",
"=",... | /*
since none of these are required, can only do consistency checks
@see "http://www.unidata.ucar.edu/software/thredds/current/tds/reference/NetcdfSubsetServiceReference.html" | [
"/",
"*",
"since",
"none",
"of",
"these",
"are",
"required",
"can",
"only",
"do",
"consistency",
"checks"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/ncss/validation/NcssGridRequestValidator.java#L39-L118 | test | Check if the NCSS grid parameters are valid. | Of course, here is the Java code you requested:
```java
@Override
public boolean isValid(NcssGridParamsBean params, ConstraintValidatorContext constraintValidatorContext) {
constraintValidatorContext.disableDefaultConstraintViolation();
boolean isValid = true;
// lat/lon point
if (params.getLatitud... |
ocpsoft/rewrite | addressbuilder/src/main/java/org/ocpsoft/urlbuilder/AddressBuilderSchemeSpecificPart.java | AddressBuilderSchemeSpecificPart.set | public AddressBuilderSchemeSpecificPart set(CharSequence name, Object... values)
{
parent.set(name, values);
return this;
} | java | public AddressBuilderSchemeSpecificPart set(CharSequence name, Object... values)
{
parent.set(name, values);
return this;
} | [
"public",
"AddressBuilderSchemeSpecificPart",
"set",
"(",
"CharSequence",
"name",
",",
"Object",
"...",
"values",
")",
"{",
"parent",
".",
"set",
"(",
"name",
",",
"values",
")",
";",
"return",
"this",
";",
"}"
] | Set a parameter name and value or values. The supplied values will be stored without additional encoding. | [
"Set",
"a",
"parameter",
"name",
"and",
"value",
"or",
"values",
".",
"The",
"supplied",
"values",
"will",
"be",
"stored",
"without",
"additional",
"encoding",
"."
] | eded0bad0101d119a3a1e67ed3f97a3bc9a8222e | https://github.com/ocpsoft/rewrite/blob/eded0bad0101d119a3a1e67ed3f97a3bc9a8222e/addressbuilder/src/main/java/org/ocpsoft/urlbuilder/AddressBuilderSchemeSpecificPart.java#L35-L39 | valid | Add a
operand. | Of course, here is the Java code you requested:
```java
public AddressBuilderSchemeSpecificPart set(CharSequence name, Object... values)
{
parent.set(name, values);
return this;
}
```
Hope this helps! |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/Maps.java | Maps.newConcurrentMap | public static <K, V> ConcurrentMap<K, V> newConcurrentMap() {
return new MapMaker().<K, V>makeMap();
} | java | public static <K, V> ConcurrentMap<K, V> newConcurrentMap() {
return new MapMaker().<K, V>makeMap();
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"ConcurrentMap",
"<",
"K",
",",
"V",
">",
"newConcurrentMap",
"(",
")",
"{",
"return",
"new",
"MapMaker",
"(",
")",
".",
"<",
"K",
",",
"V",
">",
"makeMap",
"(",
")",
";",
"}"
] | Returns a general-purpose instance of {@code ConcurrentMap}, which supports
all optional operations of the ConcurrentMap interface. It does not permit
null keys or values. It is serializable.
<p>This is currently accomplished by calling {@link MapMaker#makeMap()}.
<p>It is preferable to use {@code MapMaker} directly ... | [
"Returns",
"a",
"general",
"-",
"purpose",
"instance",
"of",
"{",
"@code",
"ConcurrentMap",
"}",
"which",
"supports",
"all",
"optional",
"operations",
"of",
"the",
"ConcurrentMap",
"interface",
".",
"It",
"does",
"not",
"permit",
"null",
"keys",
"or",
"values"... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Maps.java#L302-L304 | train | Creates a new ConcurrentMap. | Of course, here is the Java code you requested:
```java
public static <K, V> ConcurrentMap<K, V> newConcurrentMap() {
return new MapMaker().<K, V>makeMap();
}
```
Hope this helps! |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/flow/FlowletDefinition.java | FlowletDefinition.generateSchema | public void generateSchema(SchemaGenerator generator) throws UnsupportedTypeException {
if (inputs == null && outputs == null && inputTypes != null && outputTypes != null) {
// Generate both inputs and outputs before making this visible
Map<String, Set<Schema>> inputs = generateSchema(generator, inputTy... | java | public void generateSchema(SchemaGenerator generator) throws UnsupportedTypeException {
if (inputs == null && outputs == null && inputTypes != null && outputTypes != null) {
// Generate both inputs and outputs before making this visible
Map<String, Set<Schema>> inputs = generateSchema(generator, inputTy... | [
"public",
"void",
"generateSchema",
"(",
"SchemaGenerator",
"generator",
")",
"throws",
"UnsupportedTypeException",
"{",
"if",
"(",
"inputs",
"==",
"null",
"&&",
"outputs",
"==",
"null",
"&&",
"inputTypes",
"!=",
"null",
"&&",
"outputTypes",
"!=",
"null",
")",
... | Generate schemas for all input and output types with the given {@link SchemaGenerator}.
@param generator The {@link SchemaGenerator} for generating type schema. | [
"Generate",
"schemas",
"for",
"all",
"input",
"and",
"output",
"types",
"with",
"the",
"given",
"{"
] | 5be6dffd7c79519d1211bb08f75be7dcfbbad392 | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/flow/FlowletDefinition.java#L168-L177 | train | Generate the schema for this sequence. | Of course, here is the Java code you requested:
```java
public void generateSchema(SchemaGenerator generator) throws UnsupportedTypeException {
if (inputs == null && outputs == null && inputTypes != null && outputTypes != null) {
// Generate both inputs and outputs before making this visible
Map<String... |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.onesLike | public SDVariable onesLike(String name, @NonNull SDVariable input, @NonNull DataType dataType) {
SDVariable ret = f().onesLike(name, input, dataType);
return updateVariableNameAndReference(ret, name);
} | java | public SDVariable onesLike(String name, @NonNull SDVariable input, @NonNull DataType dataType) {
SDVariable ret = f().onesLike(name, input, dataType);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"onesLike",
"(",
"String",
"name",
",",
"@",
"NonNull",
"SDVariable",
"input",
",",
"@",
"NonNull",
"DataType",
"dataType",
")",
"{",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"onesLike",
"(",
"name",
",",
"input",
",",
"dataT... | As per {@link #onesLike(String, SDVariable)} but the output datatype may be specified | [
"As",
"per",
"{"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1535-L1538 | train | One - item operation with ones like operation | Of course, here is the Java code you requested:
```java
public SDVariable onesLike(String name, @NonNull SDVariable input, @NonNull DataType dataType) {
SDVariable ret = f().onesLike(name, input, dataType);
return updateVariableNameAndReference(ret, name);
}
```
Hope this helps! |
line/armeria | grpc/src/main/java/com/linecorp/armeria/internal/grpc/GrpcStatus.java | GrpcStatus.serializeThrowable | public static ThrowableProto serializeThrowable(Throwable t) {
final ThrowableProto.Builder builder = ThrowableProto.newBuilder();
if (t instanceof StatusCauseException) {
final StatusCauseException statusCause = (StatusCauseException) t;
builder.setOriginalClassName(statusCause... | java | public static ThrowableProto serializeThrowable(Throwable t) {
final ThrowableProto.Builder builder = ThrowableProto.newBuilder();
if (t instanceof StatusCauseException) {
final StatusCauseException statusCause = (StatusCauseException) t;
builder.setOriginalClassName(statusCause... | [
"public",
"static",
"ThrowableProto",
"serializeThrowable",
"(",
"Throwable",
"t",
")",
"{",
"final",
"ThrowableProto",
".",
"Builder",
"builder",
"=",
"ThrowableProto",
".",
"newBuilder",
"(",
")",
";",
"if",
"(",
"t",
"instanceof",
"StatusCauseException",
")",
... | Fills the information from the {@link Throwable} into a {@link ThrowableProto} for
returning to a client. | [
"Fills",
"the",
"information",
"from",
"the",
"{"
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/grpc/src/main/java/com/linecorp/armeria/internal/grpc/GrpcStatus.java#L186-L206 | train | Serialize Throwable. | Of course, here is the Java code you requested:
```java
public static ThrowableProto serializeThrowable(Throwable t) {
final ThrowableProto.Builder builder = ThrowableProto.newBuilder();
if (t instanceof StatusCauseException) {
final StatusCauseException statusCause = (StatusCauseException... |
belaban/JGroups | src/org/jgroups/blocks/ReplicatedHashMap.java | ReplicatedHashMap.getState | public void getState(OutputStream ostream) throws Exception {
HashMap<K,V> copy=new HashMap<>();
for(Map.Entry<K,V> entry:entrySet()) {
K key=entry.getKey();
V val=entry.getValue();
copy.put(key, val);
}
try(ObjectOutputStream oos=new ObjectOutputStrea... | java | public void getState(OutputStream ostream) throws Exception {
HashMap<K,V> copy=new HashMap<>();
for(Map.Entry<K,V> entry:entrySet()) {
K key=entry.getKey();
V val=entry.getValue();
copy.put(key, val);
}
try(ObjectOutputStream oos=new ObjectOutputStrea... | [
"public",
"void",
"getState",
"(",
"OutputStream",
"ostream",
")",
"throws",
"Exception",
"{",
"HashMap",
"<",
"K",
",",
"V",
">",
"copy",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
"entry"... | /*-------------------- State Exchange ---------------------- | [
"/",
"*",
"--------------------",
"State",
"Exchange",
"----------------------"
] | bd3ca786aa57fed41dfbc10a94b1281e388be03b | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/ReplicatedHashMap.java#L440-L450 | train | Get the state of the cache. | Of course, here is the Java code you requested:
```java
public void getState(OutputStream ostream) throws Exception {
HashMap<K,V> copy=new HashMap<>();
for(Map.Entry<K,V> entry:entrySet()) {
K key=entry.getKey();
V val=entry.getValue();
copy.put(key, val);
}... |
caduandrade/japura-gui | src/main/java/org/japura/gui/WrapLabel.java | WrapLabel.wrapText | private void wrapText() {
if (getFont() == null || text == null) {
return;
}
FontMetrics fm = getFontMetrics(getFont());
StringBuilder tempText = new StringBuilder();
StringBuilder finalText = new StringBuilder("<html>");
finalText.append("<STYLE type='text/css'>BODY { text-align: ");
finalText.append(align.... | java | private void wrapText() {
if (getFont() == null || text == null) {
return;
}
FontMetrics fm = getFontMetrics(getFont());
StringBuilder tempText = new StringBuilder();
StringBuilder finalText = new StringBuilder("<html>");
finalText.append("<STYLE type='text/css'>BODY { text-align: ");
finalText.append(align.... | [
"private",
"void",
"wrapText",
"(",
")",
"{",
"if",
"(",
"getFont",
"(",
")",
"==",
"null",
"||",
"text",
"==",
"null",
")",
"{",
"return",
";",
"}",
"FontMetrics",
"fm",
"=",
"getFontMetrics",
"(",
"getFont",
"(",
")",
")",
";",
"StringBuilder",
"te... | The plain text is converted to HTML code. The wrap locations are calculated
with the defined wrap width and component width. | [
"The",
"plain",
"text",
"is",
"converted",
"to",
"HTML",
"code",
".",
"The",
"wrap",
"locations",
"are",
"calculated",
"with",
"the",
"defined",
"wrap",
"width",
"and",
"component",
"width",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/WrapLabel.java#L83-L146 | train | Wrap the text. | Of course, here is the Java code you requested:
```java
private void wrapText() {
if (getFont() == null || text == null) {
return;
}
FontMetrics fm = getFontMetrics(getFont());
StringBuilder tempText = new StringBuilder();
StringBuilder finalText = new StringBuilder("<html>");
finalText.append("<STYLE type='... |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/Counter.java | Counter.write | @Override
public synchronized void write(DataOutput out) throws IOException {
Text.writeString(out, name);
boolean distinctDisplayName = ! name.equals(displayName);
out.writeBoolean(distinctDisplayName);
if (distinctDisplayName) {
Text.writeString(out, displayName);
}
WritableUtils.write... | java | @Override
public synchronized void write(DataOutput out) throws IOException {
Text.writeString(out, name);
boolean distinctDisplayName = ! name.equals(displayName);
out.writeBoolean(distinctDisplayName);
if (distinctDisplayName) {
Text.writeString(out, displayName);
}
WritableUtils.write... | [
"@",
"Override",
"public",
"synchronized",
"void",
"write",
"(",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"Text",
".",
"writeString",
"(",
"out",
",",
"name",
")",
";",
"boolean",
"distinctDisplayName",
"=",
"!",
"name",
".",
"equals",
"(",
... | Write the binary representation of the counter | [
"Write",
"the",
"binary",
"representation",
"of",
"the",
"counter"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/Counter.java#L75-L84 | train | Write the data of the CID. | Of course, here is the Java code you requested:
```java
@Override
public synchronized void write(DataOutput out) throws IOException {
Text.writeString(out, name);
boolean distinctDisplayName = ! name.equals(displayName);
out.writeBoolean(distinctDisplayName);
if (distinctDisplayName) {
Text.wri... |
overturetool/overture | core/ast/src/main/java/org/overture/ast/preview/GraphViz.java | GraphViz.writeDotSourceToFile | private File writeDotSourceToFile(String str) throws java.io.IOException,
GraphVizException
{
File temp;
try
{
temp = File.createTempFile("graph_", ".dot.tmp");
FileWriter fout = new FileWriter(temp);
fout.write(str);
fout.close();
} catch (Exception e)
{
throw new GraphVizException("Error:... | java | private File writeDotSourceToFile(String str) throws java.io.IOException,
GraphVizException
{
File temp;
try
{
temp = File.createTempFile("graph_", ".dot.tmp");
FileWriter fout = new FileWriter(temp);
fout.write(str);
fout.close();
} catch (Exception e)
{
throw new GraphVizException("Error:... | [
"private",
"File",
"writeDotSourceToFile",
"(",
"String",
"str",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"GraphVizException",
"{",
"File",
"temp",
";",
"try",
"{",
"temp",
"=",
"File",
".",
"createTempFile",
"(",
"\"graph_\"",
",",
"\".dot... | Writes the source of the graph in a file, and returns the written file as a File object.
@param str
Source of the graph (in dot language).
@return The file (as a File object) that contains the source of the graph.
@throws GraphVizException | [
"Writes",
"the",
"source",
"of",
"the",
"graph",
"in",
"a",
"file",
"and",
"returns",
"the",
"written",
"file",
"as",
"a",
"File",
"object",
"."
] | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/ast/src/main/java/org/overture/ast/preview/GraphViz.java#L258-L273 | train | Write the dot source to a file. | Of course, here is the Java code you requested:
```java
private File writeDotSourceToFile(String str) throws java.io.IOException,
GraphVizException
{
File temp;
try
{
temp = File.createTempFile("graph_", ".dot.tmp");
FileWriter fout = new FileWriter(temp);
fout.write(str);
fout.close();
} catch... |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/datastructure/JMMap.java | JMMap.newFilteredChangedValueWithEntryMap | public static <K, V, NV> Map<K, NV> newFilteredChangedValueWithEntryMap(
Map<K, V> map, Predicate<Entry<K, V>> filter,
Function<Entry<K, V>, NV> changingValueFunction) {
return getEntryStreamWithFilter(map, filter).collect(
toMap(Entry::getKey, changingValueFunction::appl... | java | public static <K, V, NV> Map<K, NV> newFilteredChangedValueWithEntryMap(
Map<K, V> map, Predicate<Entry<K, V>> filter,
Function<Entry<K, V>, NV> changingValueFunction) {
return getEntryStreamWithFilter(map, filter).collect(
toMap(Entry::getKey, changingValueFunction::appl... | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"NV",
">",
"Map",
"<",
"K",
",",
"NV",
">",
"newFilteredChangedValueWithEntryMap",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Predicate",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"filter",
",... | New filtered changed value with entry map map.
@param <K> the type parameter
@param <V> the type parameter
@param <NV> the type parameter
@param map the map
@param filter the filter
@param changingValueFunction the changing value fun... | [
"New",
"filtered",
"changed",
"value",
"with",
"entry",
"map",
"map",
"."
] | 9e407b3f28a7990418a1e877229fa8344f4d78a5 | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/datastructure/JMMap.java#L286-L291 | train | New filtered changed value with entry map map. | Of course, here is the Java code you requested:
```java
public static <K, V, NV> Map<K, NV> newFilteredChangedValueWithEntryMap(
Map<K, V> map, Predicate<Entry<K, V>> filter,
Function<Entry<K, V>, NV> changingValueFunction) {
return getEntryStreamWithFilter(map, filter).collect(
... |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/intset/ConciseSet.java | ConciseSet.intersection | @Override
public ConciseSet intersection(IntSet other)
{
if (isEmpty() || other == null || other.isEmpty()) {
return empty();
}
if (other == this) {
return clone();
}
return performOperation(convert(other), Operator.AND);
} | java | @Override
public ConciseSet intersection(IntSet other)
{
if (isEmpty() || other == null || other.isEmpty()) {
return empty();
}
if (other == this) {
return clone();
}
return performOperation(convert(other), Operator.AND);
} | [
"@",
"Override",
"public",
"ConciseSet",
"intersection",
"(",
"IntSet",
"other",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
"||",
"other",
"==",
"null",
"||",
"other",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"empty",
"(",
")",
";",
"}",
"if",
... | {@inheritDoc} | [
"{"
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/intset/ConciseSet.java#L1449-L1459 | train | Returns the intersection of this set and the other set. | Of course, here is the Java code you requested:
```java
@Override
public ConciseSet intersection(IntSet other)
{
if (isEmpty() || other == null || other.isEmpty()) {
return empty();
}
if (other == this) {
return clone();
}
return performOperation(convert(other), Operator.AN... |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/event/EventBus.java | EventBus.post | public void post(Notification event) {
for (Map.Entry<Object, List<SubscriberMethod>> entry : listeners.entrySet()) {
for (SubscriberMethod method : entry.getValue()) {
if (method.eventTypeToInvokeOn.isInstance(event)) {
try {
method.method... | java | public void post(Notification event) {
for (Map.Entry<Object, List<SubscriberMethod>> entry : listeners.entrySet()) {
for (SubscriberMethod method : entry.getValue()) {
if (method.eventTypeToInvokeOn.isInstance(event)) {
try {
method.method... | [
"public",
"void",
"post",
"(",
"Notification",
"event",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Object",
",",
"List",
"<",
"SubscriberMethod",
">",
">",
"entry",
":",
"listeners",
".",
"entrySet",
"(",
")",
")",
"{",
"for",
"(",
"SubscriberMet... | Post an event to the bus. All subscribers to the event class type posted will be notified.
@param event to post to subscribers | [
"Post",
"an",
"event",
"to",
"the",
"bus",
".",
"All",
"subscribers",
"to",
"the",
"event",
"class",
"type",
"posted",
"will",
"be",
"notified",
"."
] | 5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383 | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/event/EventBus.java#L53-L72 | train | Post notification to all registered listeners. | Of course, here is the Java code you requested:
```java
public void post(Notification event) {
for (Map.Entry<Object, List<SubscriberMethod>> entry : listeners.entrySet()) {
for (SubscriberMethod method : entry.getValue()) {
if (method.eventTypeToInvokeOn.isInstance(event)) {
... |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalSystem.java | RaftJournalSystem.catchUp | private void catchUp(JournalStateMachine stateMachine, CopycatClient client)
throws TimeoutException, InterruptedException {
long startTime = System.currentTimeMillis();
// Wait for any outstanding snapshot to complete.
CommonUtils.waitFor("snapshotting to finish", () -> !stateMachine.isSnapshotting()... | java | private void catchUp(JournalStateMachine stateMachine, CopycatClient client)
throws TimeoutException, InterruptedException {
long startTime = System.currentTimeMillis();
// Wait for any outstanding snapshot to complete.
CommonUtils.waitFor("snapshotting to finish", () -> !stateMachine.isSnapshotting()... | [
"private",
"void",
"catchUp",
"(",
"JournalStateMachine",
"stateMachine",
",",
"CopycatClient",
"client",
")",
"throws",
"TimeoutException",
",",
"InterruptedException",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// Wait for any... | Attempts to catch up. If the master loses leadership during this method, it will return early.
The caller is responsible for detecting and responding to leadership changes. | [
"Attempts",
"to",
"catch",
"up",
".",
"If",
"the",
"master",
"loses",
"leadership",
"during",
"this",
"method",
"it",
"will",
"return",
"early",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalSystem.java#L335-L397 | train | Catch up. | Of course, here is the Java code you requested:
```java
private void catchUp(JournalStateMachine stateMachine, CopycatClient client)
throws TimeoutException, InterruptedException {
long startTime = System.currentTimeMillis();
// Wait for any outstanding snapshot to complete.
CommonUtils.waitFor("snap... |
samskivert/samskivert | src/main/java/com/samskivert/util/Calendars.java | Calendars.at | public static Builder at (long millis)
{
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(millis);
return with(calendar);
} | java | public static Builder at (long millis)
{
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(millis);
return with(calendar);
} | [
"public",
"static",
"Builder",
"at",
"(",
"long",
"millis",
")",
"{",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"calendar",
".",
"setTimeInMillis",
"(",
"millis",
")",
";",
"return",
"with",
"(",
"calendar",
")",
";",
"}... | Returns a fluent wrapper around a calendar configured with the specified time. | [
"Returns",
"a",
"fluent",
"wrapper",
"around",
"a",
"calendar",
"configured",
"with",
"the",
"specified",
"time",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Calendars.java#L184-L189 | train | Create a calendar with the specified time. | Of course, here is the Java code you requested:
```java
public static Builder at (long millis)
{
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(millis);
return with(calendar);
}
```
Hope this helps! |
eFaps/eFaps-Kernel | src/main/java/org/efaps/jaas/efaps/UserLoginModule.java | UserLoginModule.abort | public final boolean abort()
{
boolean ret = false;
if (UserLoginModule.LOG.isDebugEnabled()) {
UserLoginModule.LOG.debug("Abort of " + this.principal);
}
// If our authentication was successful, just return false
if (this.principal != null) {
// Cl... | java | public final boolean abort()
{
boolean ret = false;
if (UserLoginModule.LOG.isDebugEnabled()) {
UserLoginModule.LOG.debug("Abort of " + this.principal);
}
// If our authentication was successful, just return false
if (this.principal != null) {
// Cl... | [
"public",
"final",
"boolean",
"abort",
"(",
")",
"{",
"boolean",
"ret",
"=",
"false",
";",
"if",
"(",
"UserLoginModule",
".",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"UserLoginModule",
".",
"LOG",
".",
"debug",
"(",
"\"Abort of \"",
"+",
"this"... | Abort the login.
@return true if abort was successful | [
"Abort",
"the",
"login",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/jaas/efaps/UserLoginModule.java#L237-L257 | train | Abort the authentication of the user. | Of course, here is the Java code you requested:
```java
public final boolean abort()
{
boolean ret = false;
if (UserLoginModule.LOG.isDebugEnabled()) {
UserLoginModule.LOG.debug("Abort of " + this.principal);
}
// If our authentication was successful, just return false... |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/conversions/implicit/ConversionAnalyzer.java | ConversionAnalyzer.getConversionType | public static ConversionType getConversionType(final Field destination, final Field source){
return getConversionType(destination.getType(),source.getType());
} | java | public static ConversionType getConversionType(final Field destination, final Field source){
return getConversionType(destination.getType(),source.getType());
} | [
"public",
"static",
"ConversionType",
"getConversionType",
"(",
"final",
"Field",
"destination",
",",
"final",
"Field",
"source",
")",
"{",
"return",
"getConversionType",
"(",
"destination",
".",
"getType",
"(",
")",
",",
"source",
".",
"getType",
"(",
")",
")... | Analyzes Fields given as input and returns the type of conversion that has to be done.
@param destination Field to analyze
@param source Field to analyze
@return type of Conversion | [
"Analyzes",
"Fields",
"given",
"as",
"input",
"and",
"returns",
"the",
"type",
"of",
"conversion",
"that",
"has",
"to",
"be",
"done",
"."
] | b48fd3527f35055b8b4a30f53a51136f183acc90 | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/conversions/implicit/ConversionAnalyzer.java#L39-L41 | train | Gets conversion type. | Of course, here is the Java code you requested:
```java
public static ConversionType getConversionType(final Field destination, final Field source){
return getConversionType(destination.getType(),source.getType());
}
```
Hope this helps! |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/Terminals.java | Terminals.caseSensitive | @Deprecated
public static Terminals caseSensitive(
Parser<String> wordScanner, String[] ops, String[] keywords) {
return operators(ops)
.words(wordScanner)
.keywords(keywords)
.build();
} | java | @Deprecated
public static Terminals caseSensitive(
Parser<String> wordScanner, String[] ops, String[] keywords) {
return operators(ops)
.words(wordScanner)
.keywords(keywords)
.build();
} | [
"@",
"Deprecated",
"public",
"static",
"Terminals",
"caseSensitive",
"(",
"Parser",
"<",
"String",
">",
"wordScanner",
",",
"String",
"[",
"]",
"ops",
",",
"String",
"[",
"]",
"keywords",
")",
"{",
"return",
"operators",
"(",
"ops",
")",
".",
"words",
"(... | Returns a {@link Terminals} object for lexing and parsing the operators with names specified in
{@code ops}, and for lexing and parsing the keywords case sensitively. Parsers for operators
and keywords can be obtained through {@link #token}; parsers for identifiers through
{@link #identifier}.
<p>In detail, keywords a... | [
"Returns",
"a",
"{",
"@link",
"Terminals",
"}",
"object",
"for",
"lexing",
"and",
"parsing",
"the",
"operators",
"with",
"names",
"specified",
"in",
"{",
"@code",
"ops",
"}",
"and",
"for",
"lexing",
"and",
"parsing",
"the",
"keywords",
"case",
"sensitively",... | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Terminals.java#L319-L326 | train | Returns a Terminals object that represents the case sensitive version of the CID language. | Of course, here is the Java code you requested:
```java
@Deprecated
public static Terminals caseSensitive(
Parser<String> wordScanner, String[] ops, String[] keywords) {
return operators(ops)
.words(wordScanner)
.keywords(keywords)
.build();
}
```
Hope this helps! |
javagl/ND | nd-arrays/src/main/java/de/javagl/nd/arrays/i/IntArraysND.java | IntArraysND.createSubArray | public static MutableIntArrayND createSubArray(
MutableIntArrayND parent, IntTuple fromIndices, IntTuple toIndices)
{
return new MutableSubIntArrayND(
parent, fromIndices, toIndices);
} | java | public static MutableIntArrayND createSubArray(
MutableIntArrayND parent, IntTuple fromIndices, IntTuple toIndices)
{
return new MutableSubIntArrayND(
parent, fromIndices, toIndices);
} | [
"public",
"static",
"MutableIntArrayND",
"createSubArray",
"(",
"MutableIntArrayND",
"parent",
",",
"IntTuple",
"fromIndices",
",",
"IntTuple",
"toIndices",
")",
"{",
"return",
"new",
"MutableSubIntArrayND",
"(",
"parent",
",",
"fromIndices",
",",
"toIndices",
")",
... | Creates a new array that is a <i>view</i> on the specified portion
of the given parent. Changes in the parent will be visible in the
returned array, and vice versa. The returned array will use
lexicographical iteration order.
@param parent The parent array
@param fromIndices The start indices in the parent, inclusive
... | [
"Creates",
"a",
"new",
"array",
"that",
"is",
"a",
"<i",
">",
"view<",
"/",
"i",
">",
"on",
"the",
"specified",
"portion",
"of",
"the",
"given",
"parent",
".",
"Changes",
"in",
"the",
"parent",
"will",
"be",
"visible",
"in",
"the",
"returned",
"array",... | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-arrays/src/main/java/de/javagl/nd/arrays/i/IntArraysND.java#L224-L229 | train | Creates a sub array of the specified type of int array from the specified indices. | Of course, here is the Java code you requested:
```java
public static MutableIntArrayND createSubArray(
MutableIntArrayND parent, IntTuple fromIndices, IntTuple toIndices)
{
return new MutableSubIntArrayND(
parent, fromIndices, toIndices);
}
```
Hope this helps! |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.get4x3 | public FloatBuffer get4x3(int index, FloatBuffer buffer) {
MemUtil.INSTANCE.put4x3(this, index, buffer);
return buffer;
} | java | public FloatBuffer get4x3(int index, FloatBuffer buffer) {
MemUtil.INSTANCE.put4x3(this, index, buffer);
return buffer;
} | [
"public",
"FloatBuffer",
"get4x3",
"(",
"int",
"index",
",",
"FloatBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"put4x3",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"buffer",
";",
"}"
] | /* (non-Javadoc)
@see org.joml.Matrix4fc#get4x3(int, java.nio.FloatBuffer) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L3203-L3206 | train | Get a 4 - byte array in the image at the given index into the given FloatBuffer. | Of course, here is the Java code you requested:
```java
public FloatBuffer get4x3(int index, FloatBuffer buffer) {
MemUtil.INSTANCE.put4x3(this, index, buffer);
return buffer;
}
```
Hope this helps! |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_cron_id_PUT | public void serviceName_cron_id_PUT(String serviceName, Long id, OvhCron body) throws IOException {
String qPath = "/hosting/web/{serviceName}/cron/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void serviceName_cron_id_PUT(String serviceName, Long id, OvhCron body) throws IOException {
String qPath = "/hosting/web/{serviceName}/cron/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_cron_id_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhCron",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/cron/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",... | Alter this object properties
REST: PUT /hosting/web/{serviceName}/cron/{id}
@param body [required] New object properties
@param serviceName [required] The internal name of your hosting
@param id [required] Cron's id | [
"Alter",
"this",
"object",
"properties"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2095-L2099 | train | Update a cron | Of course, here is the Java code you requested:
```java
public void serviceName_cron_id_PUT(String serviceName, Long id, OvhCron body) throws IOException {
String qPath = "/hosting/web/{serviceName}/cron/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
}
```
Hope... |
apache/parquet-mr | parquet-column/src/main/java/org/apache/parquet/schema/Types.java | Types.required | public static PrimitiveBuilder<PrimitiveType> required(PrimitiveTypeName type) {
return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type)
.repetition(Type.Repetition.REQUIRED);
} | java | public static PrimitiveBuilder<PrimitiveType> required(PrimitiveTypeName type) {
return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type)
.repetition(Type.Repetition.REQUIRED);
} | [
"public",
"static",
"PrimitiveBuilder",
"<",
"PrimitiveType",
">",
"required",
"(",
"PrimitiveTypeName",
"type",
")",
"{",
"return",
"new",
"PrimitiveBuilder",
"<",
"PrimitiveType",
">",
"(",
"PrimitiveType",
".",
"class",
",",
"type",
")",
".",
"repetition",
"(... | Returns a builder to construct a required {@link PrimitiveType}.
@param type a {@link PrimitiveTypeName} for the constructed type
@return a {@link PrimitiveBuilder} | [
"Returns",
"a",
"builder",
"to",
"construct",
"a",
"required",
"{",
"@link",
"PrimitiveType",
"}",
"."
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/schema/Types.java#L1444-L1447 | test | Create a new instance of a required type. | Of course, here is the Java code you requested:
```java
public static PrimitiveBuilder<PrimitiveType> required(PrimitiveTypeName type) {
return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type)
.repetition(Type.Repetition.REQUIRED);
}
```
Hope this helps! |
pushtorefresh/storio | storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/operations/delete/DefaultDeleteResolver.java | DefaultDeleteResolver.performDelete | @NonNull
@Override
public DeleteResult performDelete(@NonNull StorIOSQLite storIOSQLite, @NonNull T object) {
final DeleteQuery deleteQuery = mapToDeleteQuery(object);
final int numberOfRowsDeleted = storIOSQLite.lowLevel().delete(deleteQuery);
return DeleteResult.newInstance(numberOfRow... | java | @NonNull
@Override
public DeleteResult performDelete(@NonNull StorIOSQLite storIOSQLite, @NonNull T object) {
final DeleteQuery deleteQuery = mapToDeleteQuery(object);
final int numberOfRowsDeleted = storIOSQLite.lowLevel().delete(deleteQuery);
return DeleteResult.newInstance(numberOfRow... | [
"@",
"NonNull",
"@",
"Override",
"public",
"DeleteResult",
"performDelete",
"(",
"@",
"NonNull",
"StorIOSQLite",
"storIOSQLite",
",",
"@",
"NonNull",
"T",
"object",
")",
"{",
"final",
"DeleteQuery",
"deleteQuery",
"=",
"mapToDeleteQuery",
"(",
"object",
")",
";"... | {@inheritDoc} | [
"{"
] | 58f53d81bcc7b069c8bb271c46a90e37775abe8d | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/operations/delete/DefaultDeleteResolver.java#L26-L32 | train | Delete the object from the database. | Of course, here is the Java code you requested:
```java
@NonNull
@Override
public DeleteResult performDelete(@NonNull StorIOSQLite storIOSQLite, @NonNull T object) {
final DeleteQuery deleteQuery = mapToDeleteQuery(object);
final int numberOfRowsDeleted = storIOSQLite.lowLevel().delete(deleteQu... |
orientechnologies/orientdb | distributed-v2/src/main/java/com/orientechnologies/orient/distributed/impl/OConflictResolverDatabaseRepairer.java | OConflictResolverDatabaseRepairer.cancelRepairRecord | @Override
public void cancelRepairRecord(final ORecordId rid) {
if (!active)
return;
if (rid.getClusterPosition() < -1)
// SKIP TRANSACTIONAL RIDS
return;
// REMOVE THE RECORD TO REPAIR
if (records.remove(rid) != null)
// REMOVED
recordCanceled.incrementAndGet();
} | java | @Override
public void cancelRepairRecord(final ORecordId rid) {
if (!active)
return;
if (rid.getClusterPosition() < -1)
// SKIP TRANSACTIONAL RIDS
return;
// REMOVE THE RECORD TO REPAIR
if (records.remove(rid) != null)
// REMOVED
recordCanceled.incrementAndGet();
} | [
"@",
"Override",
"public",
"void",
"cancelRepairRecord",
"(",
"final",
"ORecordId",
"rid",
")",
"{",
"if",
"(",
"!",
"active",
")",
"return",
";",
"if",
"(",
"rid",
".",
"getClusterPosition",
"(",
")",
"<",
"-",
"1",
")",
"// SKIP TRANSACTIONAL RIDS",
"ret... | Cancel the repair against a record because the update succeed.
@param rid RecordId to remove from repair | [
"Cancel",
"the",
"repair",
"against",
"a",
"record",
"because",
"the",
"update",
"succeed",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/distributed-v2/src/main/java/com/orientechnologies/orient/distributed/impl/OConflictResolverDatabaseRepairer.java#L168-L181 | test | Cancel a repair record. | Of course, here is the Java code you requested:
```java
@Override
public void cancelRepairRecord(final ORecordId rid) {
if (!active)
return;
if (rid.getClusterPosition() < -1)
// SKIP TRANSACTIONAL RIDS
return;
// REMOVE THE RECORD TO REPAIR
if (records.remove(rid) != null)
... |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteAnalysesSlotAsync | public Observable<Page<AnalysisDefinitionInner>> listSiteAnalysesSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) {
return listSiteAnalysesSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot)
.map(new ... | java | public Observable<Page<AnalysisDefinitionInner>> listSiteAnalysesSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) {
return listSiteAnalysesSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot)
.map(new ... | [
"public",
"Observable",
"<",
"Page",
"<",
"AnalysisDefinitionInner",
">",
">",
"listSiteAnalysesSlotAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"diagnosticCategory",
",",
"final",
"String",
"slot",
... | Get Site Analyses.
Get Site Analyses.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param slot Slot Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ... | [
"Get",
"Site",
"Analyses",
".",
"Get",
"Site",
"Analyses",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1635-L1643 | train | List site analyses. List site analyses. | Of course, here is the Java code you requested:
```java
public Observable<Page<AnalysisDefinitionInner>> listSiteAnalysesSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) {
return listSiteAnalysesSlotWithServiceResponseAsync(resourceGroupName, ... |
jayantk/jklol | src/com/jayantkrish/jklol/models/VariableNumMap.java | VariableNumMap.isValidAssignment | public boolean isValidAssignment(Assignment assignment) {
Preconditions.checkArgument(containsAll(assignment.getVariableNumsArray()));
for (int varNum : assignment.getVariableNumsArray()) {
int index = getVariableIndex(varNum);
if (!vars[index].canTakeValue(assignment.getValue(varNum))) {
re... | java | public boolean isValidAssignment(Assignment assignment) {
Preconditions.checkArgument(containsAll(assignment.getVariableNumsArray()));
for (int varNum : assignment.getVariableNumsArray()) {
int index = getVariableIndex(varNum);
if (!vars[index].canTakeValue(assignment.getValue(varNum))) {
re... | [
"public",
"boolean",
"isValidAssignment",
"(",
"Assignment",
"assignment",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"containsAll",
"(",
"assignment",
".",
"getVariableNumsArray",
"(",
")",
")",
")",
";",
"for",
"(",
"int",
"varNum",
":",
"assignment... | Returns {@code true} if the values in {@code assignment} are
possible values for the variables in {@code this}.
{@code assignment} must contain a subset of the variables in
{@code this}.
@param assignment
@return | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"values",
"in",
"{",
"@code",
"assignment",
"}",
"are",
"possible",
"values",
"for",
"the",
"variables",
"in",
"{",
"@code",
"this",
"}",
".",
"{",
"@code",
"assignment",
"}",
"must",
"contain",
"a",
"... | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/VariableNumMap.java#L866-L875 | train | Checks if the given assignment is a valid assignment. | Of course, here is the Java code you requested:
```java
public boolean isValidAssignment(Assignment assignment) {
Preconditions.checkArgument(containsAll(assignment.getVariableNumsArray()));
for (int varNum : assignment.getVariableNumsArray()) {
int index = getVariableIndex(varNum);
if (!vars[index... |
nlalevee/webpipes | webpipes-core/src/java/org/hibnet/webpipes/resource/pattern/AntPathMatcher.java | AntPathMatcher.combine | @Override
public String combine(String pattern1, String pattern2) {
if (!WebpipeUtils.hasText(pattern1) && !WebpipeUtils.hasText(pattern2)) {
return "";
} else if (!WebpipeUtils.hasText(pattern1)) {
return pattern2;
} else if (!WebpipeUtils.hasText(pattern2)) {
... | java | @Override
public String combine(String pattern1, String pattern2) {
if (!WebpipeUtils.hasText(pattern1) && !WebpipeUtils.hasText(pattern2)) {
return "";
} else if (!WebpipeUtils.hasText(pattern1)) {
return pattern2;
} else if (!WebpipeUtils.hasText(pattern2)) {
... | [
"@",
"Override",
"public",
"String",
"combine",
"(",
"String",
"pattern1",
",",
"String",
"pattern2",
")",
"{",
"if",
"(",
"!",
"WebpipeUtils",
".",
"hasText",
"(",
"pattern1",
")",
"&&",
"!",
"WebpipeUtils",
".",
"hasText",
"(",
"pattern2",
")",
")",
"{... | Combines two patterns into a new pattern that is returned.
<p>
This implementation simply concatenates the two patterns, unless the first pattern contains a file extension match (such as {@code *.html}. In
that case, the second pattern should be included in the first, or an {@code IllegalArgumentException} is thrown.
<... | [
"Combines",
"two",
"patterns",
"into",
"a",
"new",
"pattern",
"that",
"is",
"returned",
".",
"<p",
">",
"This",
"implementation",
"simply",
"concatenates",
"the",
"two",
"patterns",
"unless",
"the",
"first",
"pattern",
"contains",
"a",
"file",
"extension",
"ma... | e1b29cc4e6739e0d47f38dc997ef5995b68f7f54 | https://github.com/nlalevee/webpipes/blob/e1b29cc4e6739e0d47f38dc997ef5995b68f7f54/webpipes-core/src/java/org/hibnet/webpipes/resource/pattern/AntPathMatcher.java#L404-L462 | train | Combine two URL patterns into one. | Of course, here is the Java code you requested:
```java
@Override
public String combine(String pattern1, String pattern2) {
if (!WebpipeUtils.hasText(pattern1) && !WebpipeUtils.hasText(pattern2)) {
return "";
} else if (!WebpipeUtils.hasText(pattern1)) {
return pattern2;
... |
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.mul | public Matrix3x2d mul(Matrix3x2dc right, Matrix3x2d dest) {
double nm00 = m00 * right.m00() + m10 * right.m01();
double nm01 = m01 * right.m00() + m11 * right.m01();
double nm10 = m00 * right.m10() + m10 * right.m11();
double nm11 = m01 * right.m10() + m11 * right.m11();
double n... | java | public Matrix3x2d mul(Matrix3x2dc right, Matrix3x2d dest) {
double nm00 = m00 * right.m00() + m10 * right.m01();
double nm01 = m01 * right.m00() + m11 * right.m01();
double nm10 = m00 * right.m10() + m10 * right.m11();
double nm11 = m01 * right.m10() + m11 * right.m11();
double n... | [
"public",
"Matrix3x2d",
"mul",
"(",
"Matrix3x2dc",
"right",
",",
"Matrix3x2d",
"dest",
")",
"{",
"double",
"nm00",
"=",
"m00",
"*",
"right",
".",
"m00",
"(",
")",
"+",
"m10",
"*",
"right",
".",
"m01",
"(",
")",
";",
"double",
"nm01",
"=",
"m01",
"*... | Multiply this matrix by the supplied <code>right</code> matrix by assuming a third row in
both matrices of <code>(0, 0, 1)</code> and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>R</code> the <code>right</code> matrix,
then the new matrix will be <code>M * R</code>.... | [
"Multiply",
"this",
"matrix",
"by",
"the",
"supplied",
"<code",
">",
"right<",
"/",
"code",
">",
"matrix",
"by",
"assuming",
"a",
"third",
"row",
"in",
"both",
"matrices",
"of",
"<code",
">",
"(",
"0",
"0",
"1",
")",
"<",
"/",
"code",
">",
"and",
"... | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L288-L302 | train | Multiply this matrix with another matrix. | Of course, here is the Java code you requested:
```java
public Matrix3x2d mul(Matrix3x2dc right, Matrix3x2d dest) {
double nm00 = m00 * right.m00() + m10 * right.m01();
double nm01 = m01 * right.m00() + m11 * right.m01();
double nm10 = m00 * right.m10() + m10 * right.m11();
double nm11 ... |
aws/aws-sdk-java | aws-java-sdk-worklink/src/main/java/com/amazonaws/services/worklink/model/transform/DisassociateDomainRequestMarshaller.java | DisassociateDomainRequestMarshaller.marshall | public void marshall(DisassociateDomainRequest disassociateDomainRequest, ProtocolMarshaller protocolMarshaller) {
if (disassociateDomainRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(disa... | java | public void marshall(DisassociateDomainRequest disassociateDomainRequest, ProtocolMarshaller protocolMarshaller) {
if (disassociateDomainRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(disa... | [
"public",
"void",
"marshall",
"(",
"DisassociateDomainRequest",
"disassociateDomainRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"disassociateDomainRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid ar... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-worklink/src/main/java/com/amazonaws/services/worklink/model/transform/DisassociateDomainRequestMarshaller.java#L44-L56 | train | marshalls the given parameter object. | Of course, here is the Java code you requested:
```java
public void marshall(DisassociateDomainRequest disassociateDomainRequest, ProtocolMarshaller protocolMarshaller) {
if (disassociateDomainRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/httpio/HandlerUtil.java | HandlerUtil.getJsonQuery | public static JsonObject getJsonQuery(URL url) throws MalformedURLException {
String query = url.getQuery();
JsonObject payload = new JsonObject();
JsonParser parser = new JsonParser();
if (query == null) {
return null;
}
for (String kv : query.split("&")) {... | java | public static JsonObject getJsonQuery(URL url) throws MalformedURLException {
String query = url.getQuery();
JsonObject payload = new JsonObject();
JsonParser parser = new JsonParser();
if (query == null) {
return null;
}
for (String kv : query.split("&")) {... | [
"public",
"static",
"JsonObject",
"getJsonQuery",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
"{",
"String",
"query",
"=",
"url",
".",
"getQuery",
"(",
")",
";",
"JsonObject",
"payload",
"=",
"new",
"JsonObject",
"(",
")",
";",
"JsonParser",
"... | Parses a url-encoded query string and
@param url The URL to decode
@return a map of keys and JSON Values
@throws MalformedURLException If one of the values is not JSON | [
"Parses",
"a",
"url",
"-",
"encoded",
"query",
"string",
"and"
] | 2085bbebade1d5b6356480e7bf335139d08383da | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/httpio/HandlerUtil.java#L89-L116 | train | Get the JsonObject query from the URL. | Of course, here is the Java code you requested:
```java
public static JsonObject getJsonQuery(URL url) throws MalformedURLException {
String query = url.getQuery();
JsonObject payload = new JsonObject();
JsonParser parser = new JsonParser();
if (query == null) {
return null... |
jenkinsci/jenkins | core/src/main/java/hudson/model/Fingerprint.java | Fingerprint.add | public synchronized void add(@Nonnull String jobFullName, int n) throws IOException {
addWithoutSaving(jobFullName, n);
save();
} | java | public synchronized void add(@Nonnull String jobFullName, int n) throws IOException {
addWithoutSaving(jobFullName, n);
save();
} | [
"public",
"synchronized",
"void",
"add",
"(",
"@",
"Nonnull",
"String",
"jobFullName",
",",
"int",
"n",
")",
"throws",
"IOException",
"{",
"addWithoutSaving",
"(",
"jobFullName",
",",
"n",
")",
";",
"save",
"(",
")",
";",
"}"
] | Records that a build of a job has used this file. | [
"Records",
"that",
"a",
"build",
"of",
"a",
"job",
"has",
"used",
"this",
"file",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L1027-L1030 | train | Add a new entry to the cache. | Of course, here is the Java code you requested:
```java
public synchronized void add(@Nonnull String jobFullName, int n) throws IOException {
addWithoutSaving(jobFullName, n);
save();
}
```
Hope this helps! |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/security/CryptoUtil.java | CryptoUtil.hmacSha1 | public static byte[] hmacSha1(byte[] input, byte[] key) {
try {
SecretKey secretKey = new SecretKeySpec(key, HMACSHA1_ALG);
Mac mac = Mac.getInstance(HMACSHA1_ALG);
mac.init(secretKey);
return mac.doFinal(input);
} catch (GeneralSecurityException e) {
throw ExceptionUtil.unchecked(e);
}
} | java | public static byte[] hmacSha1(byte[] input, byte[] key) {
try {
SecretKey secretKey = new SecretKeySpec(key, HMACSHA1_ALG);
Mac mac = Mac.getInstance(HMACSHA1_ALG);
mac.init(secretKey);
return mac.doFinal(input);
} catch (GeneralSecurityException e) {
throw ExceptionUtil.unchecked(e);
}
} | [
"public",
"static",
"byte",
"[",
"]",
"hmacSha1",
"(",
"byte",
"[",
"]",
"input",
",",
"byte",
"[",
"]",
"key",
")",
"{",
"try",
"{",
"SecretKey",
"secretKey",
"=",
"new",
"SecretKeySpec",
"(",
"key",
",",
"HMACSHA1_ALG",
")",
";",
"Mac",
"mac",
"=",... | 使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
@param input 原始输入字符数组
@param key HMAC-SHA1密钥 | [
"使用HMAC",
"-",
"SHA1进行消息签名",
"返回字节数组",
"长度为20字节",
"."
] | 60c743da35913d72f37f2d79afa90ad2bf73cb89 | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/security/CryptoUtil.java#L42-L51 | train | HMAC SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 - SHA1 | Of course, here is the Java code you requested:
```java
public static byte[] hmacSha1(byte[] input, byte[] key) {
try {
SecretKey secretKey = new SecretKeySpec(key, HMACSHA1_ALG);
Mac mac = Mac.getInstance(HMACSHA1_ALG);
mac.init(secretKey);
return mac.doFinal(input);
} catch (GeneralSecurityException ... |
js-lib-com/transaction.hibernate | src/main/java/js/transaction/hibernate/HibernateAdapter.java | HibernateAdapter.config | public void config(Config config) throws ConfigException, HibernateException
{
log.trace("config(Config)");
// Hibernate configuration class is the session factory builder
Configuration configuration = null;
// Hibernate configuration resource is not null if config parameter is null - for zer... | java | public void config(Config config) throws ConfigException, HibernateException
{
log.trace("config(Config)");
// Hibernate configuration class is the session factory builder
Configuration configuration = null;
// Hibernate configuration resource is not null if config parameter is null - for zer... | [
"public",
"void",
"config",
"(",
"Config",
"config",
")",
"throws",
"ConfigException",
",",
"HibernateException",
"{",
"log",
".",
"trace",
"(",
"\"config(Config)\"",
")",
";",
"// Hibernate configuration class is the session factory builder\r",
"Configuration",
"configurat... | Hibernate adapter initialization. Read Hibernate properties from configuration object and create the session
factory; also configure connections pool. All properties from configuration object are passed as they are to
Hibernate session factory builder.
<p>
Scan and register mappings files in the configured package(s). ... | [
"Hibernate",
"adapter",
"initialization",
".",
"Read",
"Hibernate",
"properties",
"from",
"configuration",
"object",
"and",
"create",
"the",
"session",
"factory",
";",
"also",
"configure",
"connections",
"pool",
".",
"All",
"properties",
"from",
"configuration",
"ob... | 3aaafa6fa573f27733e6edaef3a4b2cf97cf67d6 | https://github.com/js-lib-com/transaction.hibernate/blob/3aaafa6fa573f27733e6edaef3a4b2cf97cf67d6/src/main/java/js/transaction/hibernate/HibernateAdapter.java#L77-L110 | train | Configures the Hibernate application from a configuration object. | Of course, here is the Java code you requested:
```java
public void config(Config config) throws ConfigException, HibernateException
{
log.trace("config(Config)");
// Hibernate configuration class is the session factory builder
Configuration configuration = null;
// Hibernate configuration r... |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.generateEntityQualifiedName | public static String generateEntityQualifiedName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getQualifiedName();
} else {
entityName = entity.getName().toString... | java | public static String generateEntityQualifiedName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getQualifiedName();
} else {
entityName = entity.getName().toString... | [
"public",
"static",
"String",
"generateEntityQualifiedName",
"(",
"SQLiteDaoDefinition",
"dao",
",",
"SQLiteEntity",
"entity",
")",
"{",
"String",
"entityName",
";",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"M2MEntity",
"m2mEntity",
"=",
"M2MEntity",
".",
"e... | Generate entity qualified name.
@param dao
the dao
@param entity
the entity
@return the string | [
"Generate",
"entity",
"qualified",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L1318-L1327 | train | Generate entity qualified name. | Of course, here is the Java code you requested:
```java
public static String generateEntityQualifiedName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getQualifiedNam... |
derari/cthul | objects/src/main/java/org/cthul/objects/Boxing.java | Boxing.boxAllAs | public static <T> T boxAllAs(Object src, Class<T> type) {
return (T) boxAll(type, src, 0, -1);
} | java | public static <T> T boxAllAs(Object src, Class<T> type) {
return (T) boxAll(type, src, 0, -1);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"boxAllAs",
"(",
"Object",
"src",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"(",
"T",
")",
"boxAll",
"(",
"type",
",",
"src",
",",
"0",
",",
"-",
"1",
")",
";",
"}"
] | Transforms any array into an array of boxed values.
@param <T>
@param type target type
@param src source array
@return array | [
"Transforms",
"any",
"array",
"into",
"an",
"array",
"of",
"boxed",
"values",
"."
] | 74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/Boxing.java#L491-L493 | train | Box all as object. | Of course, here is the Java code you requested:
```java
public static <T> T boxAllAs(Object src, Class<T> type) {
return (T) boxAll(type, src, 0, -1);
}
```
Hope this helps! |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.scrollListToLine | public void scrollListToLine(AbsListView absListView, int line){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollListToLine("+absListView+", "+line+")");
}
scroller.scrollListToLine(absListView, line);
} | java | public void scrollListToLine(AbsListView absListView, int line){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollListToLine("+absListView+", "+line+")");
}
scroller.scrollListToLine(absListView, line);
} | [
"public",
"void",
"scrollListToLine",
"(",
"AbsListView",
"absListView",
",",
"int",
"line",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"scrollListToLine(\"",
"+",
"absListVi... | Scroll the specified AbsListView to the specified line.
@param absListView the {@link AbsListView} to scroll
@param line the line to scroll to | [
"Scroll",
"the",
"specified",
"AbsListView",
"to",
"the",
"specified",
"line",
"."
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2186-L2192 | train | Scrolls a ListView matching the specified absolute line. | Of course, here is the Java code you requested:
```java
public void scrollListToLine(AbsListView absListView, int line){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollListToLine("+absListView+", "+line+")");
}
scroller.scrollListToLine(absListView, line);
}
```
Hope this helps! |
kefirfromperm/kefirbb | src/org/kefirsf/bb/proc/ProcVariable.java | ProcVariable.isNextIn | public boolean isNextIn(Context context) {
return regex == null || regex.matcher(context.getSource().subToEnd()).lookingAt();
} | java | public boolean isNextIn(Context context) {
return regex == null || regex.matcher(context.getSource().subToEnd()).lookingAt();
} | [
"public",
"boolean",
"isNextIn",
"(",
"Context",
"context",
")",
"{",
"return",
"regex",
"==",
"null",
"||",
"regex",
".",
"matcher",
"(",
"context",
".",
"getSource",
"(",
")",
".",
"subToEnd",
"(",
")",
")",
".",
"lookingAt",
"(",
")",
";",
"}"
] | Определяет, что дальше в разбираемой строке находится нужная последовательность
@param context current context
@return true если следующие символы в строке совпадают с pattern
false если не совпадают или строка кончилась | [
"Определяет",
"что",
"дальше",
"в",
"разбираемой",
"строке",
"находится",
"нужная",
"последовательность"
] | 8c36fc3d3dc27459b0cdc179b87582df30420856 | https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/proc/ProcVariable.java#L108-L110 | train | Checks if the source is the next in the context. | Of course, here is the Java code you requested:
```java
public boolean isNextIn(Context context) {
return regex == null || regex.matcher(context.getSource().subToEnd()).lookingAt();
}
```
Hope this helps! |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java | VCardManager.saveVCard | public void saveVCard(VCard vcard) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// XEP-54 § 3.2 "A user may publish or update his or her vCard by sending an IQ of type "set" with no 'to' address…"
vcard.setTo((Jid) null);
vcard.setType(IQ.Type.set... | java | public void saveVCard(VCard vcard) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// XEP-54 § 3.2 "A user may publish or update his or her vCard by sending an IQ of type "set" with no 'to' address…"
vcard.setTo((Jid) null);
vcard.setType(IQ.Type.set... | [
"public",
"void",
"saveVCard",
"(",
"VCard",
"vcard",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"// XEP-54 § 3.2 \"A user may publish or update his or her vCard by sending an IQ of type \"set\" wit... | Save this vCard for the user connected by 'connection'. XMPPConnection should be authenticated
and not anonymous.
@param vcard VCard.
@throws XMPPErrorException thrown if there was an issue setting the VCard in the server.
@throws NoResponseException if there was no response from the server.
@throws NotConnectedExcep... | [
"Save",
"this",
"vCard",
"for",
"the",
"user",
"connected",
"by",
"connection",
".",
"XMPPConnection",
"should",
"be",
"authenticated",
"and",
"not",
"anonymous",
"."
] | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java#L102-L110 | train | Saves a new VCard to the server. | Of course, here is the Java code you requested:
```java
public void saveVCard(VCard vcard) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// XEP-54 § 3.2 "A user may publish or update his or her vCard by sending an IQ of type "set" with no 'to' address…"
v... |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/example/extension/BatchManagerExample.java | BatchManagerExample.setUpExample | public static void setUpExample(DatabaseClient client)
throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
{
XMLDocumentManager docMgr = client.newXMLDocumentManager();
StringHandle handle = new StringHandle();
docMgr.write("/batch/read1.xml", handle.with("<read1/>"));... | java | public static void setUpExample(DatabaseClient client)
throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
{
XMLDocumentManager docMgr = client.newXMLDocumentManager();
StringHandle handle = new StringHandle();
docMgr.write("/batch/read1.xml", handle.with("<read1/>"));... | [
"public",
"static",
"void",
"setUpExample",
"(",
"DatabaseClient",
"client",
")",
"throws",
"ResourceNotFoundException",
",",
"ForbiddenUserException",
",",
"FailedRequestException",
"{",
"XMLDocumentManager",
"docMgr",
"=",
"client",
".",
"newXMLDocumentManager",
"(",
")... | create some documents to work with | [
"create",
"some",
"documents",
"to",
"work",
"with"
] | acf60229a928abd4a8cc4b21b641d56957467da7 | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/example/extension/BatchManagerExample.java#L172-L184 | train | This is a test program to set up the examples | Of course, here is the Java code you requested:
```java
public static void setUpExample(DatabaseClient client)
throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
{
XMLDocumentManager docMgr = client.newXMLDocumentManager();
StringHandle handle = new StringHandle();
doc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.