repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/function/SampleFunction.java | SampleFunction.convertBatch | private int[] convertBatch(int[] batch) {
int[] conv = new int[batch.length];
for (int i=0; i<batch.length; i++) {
conv[i] = sample[batch[i]];
}
return conv;
} | java | private int[] convertBatch(int[] batch) {
int[] conv = new int[batch.length];
for (int i=0; i<batch.length; i++) {
conv[i] = sample[batch[i]];
}
return conv;
} | [
"private",
"int",
"[",
"]",
"convertBatch",
"(",
"int",
"[",
"]",
"batch",
")",
"{",
"int",
"[",
"]",
"conv",
"=",
"new",
"int",
"[",
"batch",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"batch",
".",
"length",
"... | Converts a batch indexing into the sample, to a batch indexing into the
original function.
@param batch The batch indexing into the sample.
@return A new batch indexing into the original function, containing only
the indices from the sample. | [
"Converts",
"a",
"batch",
"indexing",
"into",
"the",
"sample",
"to",
"a",
"batch",
"indexing",
"into",
"the",
"original",
"function",
"."
] | 3d1b93260b99febb8a5ecd9e8543c223e151a8d3 | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/SampleFunction.java#L37-L43 | train |
Canadensys/canadensys-core | src/main/java/net/canadensys/utils/ListUtils.java | ListUtils.containsAtLeastOneNonBlank | public static boolean containsAtLeastOneNonBlank(List<String> list){
for(String str : list){
if(StringUtils.isNotBlank(str)){
return true;
}
}
return false;
} | java | public static boolean containsAtLeastOneNonBlank(List<String> list){
for(String str : list){
if(StringUtils.isNotBlank(str)){
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsAtLeastOneNonBlank",
"(",
"List",
"<",
"String",
">",
"list",
")",
"{",
"for",
"(",
"String",
"str",
":",
"list",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"str",
")",
")",
"{",
"return",
"true",
... | Check that a list allowing null and empty item contains at least one element that is
not blank.
@param list can't be null
@return | [
"Check",
"that",
"a",
"list",
"allowing",
"null",
"and",
"empty",
"item",
"contains",
"at",
"least",
"one",
"element",
"that",
"is",
"not",
"blank",
"."
] | 5e13569f7c0f4cdc7080da72643ff61123ad76fd | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ListUtils.java#L21-L28 | train |
Canadensys/canadensys-core | src/main/java/net/canadensys/utils/ListUtils.java | ListUtils.toIntegerList | public static List<Integer> toIntegerList(List<String> strList, boolean failOnException){
List<Integer> intList = new ArrayList<Integer>();
for(String str : strList){
try{
intList.add(Integer.parseInt(str));
}
catch(NumberFormatException nfe){
if(failOnException){
return null;
}
else{
... | java | public static List<Integer> toIntegerList(List<String> strList, boolean failOnException){
List<Integer> intList = new ArrayList<Integer>();
for(String str : strList){
try{
intList.add(Integer.parseInt(str));
}
catch(NumberFormatException nfe){
if(failOnException){
return null;
}
else{
... | [
"public",
"static",
"List",
"<",
"Integer",
">",
"toIntegerList",
"(",
"List",
"<",
"String",
">",
"strList",
",",
"boolean",
"failOnException",
")",
"{",
"List",
"<",
"Integer",
">",
"intList",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")",
";"... | Parse a list of String into a list of Integer.
If one element can not be parsed, the behavior depends on the value of failOnException.
@param strList can't be null
@param failOnException if an element can not be parsed should we return null or add a null element to the list.
@return list of all String parsed as Integer... | [
"Parse",
"a",
"list",
"of",
"String",
"into",
"a",
"list",
"of",
"Integer",
".",
"If",
"one",
"element",
"can",
"not",
"be",
"parsed",
"the",
"behavior",
"depends",
"on",
"the",
"value",
"of",
"failOnException",
"."
] | 5e13569f7c0f4cdc7080da72643ff61123ad76fd | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ListUtils.java#L37-L53 | train |
mgormley/optimize | src/main/java/edu/jhu/hlt/util/math/Vectors.java | Vectors.add | public static void add(double[] array1, double[] array2) {
assert (array1.length == array2.length);
for (int i=0; i<array1.length; i++) {
array1[i] += array2[i];
}
} | java | public static void add(double[] array1, double[] array2) {
assert (array1.length == array2.length);
for (int i=0; i<array1.length; i++) {
array1[i] += array2[i];
}
} | [
"public",
"static",
"void",
"add",
"(",
"double",
"[",
"]",
"array1",
",",
"double",
"[",
"]",
"array2",
")",
"{",
"assert",
"(",
"array1",
".",
"length",
"==",
"array2",
".",
"length",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Each element of the second array is added to each element of the first. | [
"Each",
"element",
"of",
"the",
"second",
"array",
"is",
"added",
"to",
"each",
"element",
"of",
"the",
"first",
"."
] | 3d1b93260b99febb8a5ecd9e8543c223e151a8d3 | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/math/Vectors.java#L233-L238 | train |
Canadensys/canadensys-core | src/main/java/net/canadensys/utils/ArrayUtils.java | ArrayUtils.containsOnlyNull | public static boolean containsOnlyNull(Object... values){
for(Object o : values){
if(o!= null){
return false;
}
}
return true;
} | java | public static boolean containsOnlyNull(Object... values){
for(Object o : values){
if(o!= null){
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"containsOnlyNull",
"(",
"Object",
"...",
"values",
")",
"{",
"for",
"(",
"Object",
"o",
":",
"values",
")",
"{",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"return",
"false",
";",
"}",
"}",
"return",
"true",
";",
"}"
] | Check that an array only contains null elements.
@param values, can't be null
@return | [
"Check",
"that",
"an",
"array",
"only",
"contains",
"null",
"elements",
"."
] | 5e13569f7c0f4cdc7080da72643ff61123ad76fd | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ArrayUtils.java#L17-L24 | train |
Canadensys/canadensys-core | src/main/java/net/canadensys/utils/ArrayUtils.java | ArrayUtils.containsOnlyNotNull | public static boolean containsOnlyNotNull(Object... values){
for(Object o : values){
if(o== null){
return false;
}
}
return true;
} | java | public static boolean containsOnlyNotNull(Object... values){
for(Object o : values){
if(o== null){
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"containsOnlyNotNull",
"(",
"Object",
"...",
"values",
")",
"{",
"for",
"(",
"Object",
"o",
":",
"values",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"}",
"return",
"true",
";",
"}"
] | Check that an array only contains elements that are not null.
@param values, can't be null
@return | [
"Check",
"that",
"an",
"array",
"only",
"contains",
"elements",
"that",
"are",
"not",
"null",
"."
] | 5e13569f7c0f4cdc7080da72643ff61123ad76fd | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ArrayUtils.java#L31-L38 | train |
matiwinnetou/spring-soy-view | spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/SoyAjaxController.java | SoyAjaxController.compile | @RequestMapping(value="/soy/compileJs", method=GET)
public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash,
@RequestParam(required = true, value = "file") final String[] templateFileNames,
... | java | @RequestMapping(value="/soy/compileJs", method=GET)
public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash,
@RequestParam(required = true, value = "file") final String[] templateFileNames,
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/soy/compileJs\"",
",",
"method",
"=",
"GET",
")",
"public",
"ResponseEntity",
"<",
"String",
">",
"compile",
"(",
"@",
"RequestParam",
"(",
"required",
"=",
"false",
",",
"value",
"=",
"\"hash\"",
",",
"defaultVa... | An endpoint to compile an array of soy templates to JavaScript.
This endpoint is a preferred way of compiling soy templates to JavaScript but it requires a user to compose a url
on their own or using a helper class TemplateUrlComposer, which calculates checksum of a file and puts this in url
so that whenever a file ch... | [
"An",
"endpoint",
"to",
"compile",
"an",
"array",
"of",
"soy",
"templates",
"to",
"JavaScript",
"."
] | a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1 | https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/SoyAjaxController.java#L156-L163 | train |
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/BatchSampler.java | BatchSampler.sampleBatchWithReplacement | public int[] sampleBatchWithReplacement() {
// Sample the indices with replacement.
int[] batch = new int[batchSize];
for (int i=0; i<batch.length; i++) {
batch[i] = Prng.nextInt(numExamples);
}
return batch;
} | java | public int[] sampleBatchWithReplacement() {
// Sample the indices with replacement.
int[] batch = new int[batchSize];
for (int i=0; i<batch.length; i++) {
batch[i] = Prng.nextInt(numExamples);
}
return batch;
} | [
"public",
"int",
"[",
"]",
"sampleBatchWithReplacement",
"(",
")",
"{",
"// Sample the indices with replacement.",
"int",
"[",
"]",
"batch",
"=",
"new",
"int",
"[",
"batchSize",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"batch",
".",
"le... | Samples a batch of indices in the range [0, numExamples) with replacement. | [
"Samples",
"a",
"batch",
"of",
"indices",
"in",
"the",
"range",
"[",
"0",
"numExamples",
")",
"with",
"replacement",
"."
] | 3d1b93260b99febb8a5ecd9e8543c223e151a8d3 | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/BatchSampler.java#L56-L63 | train |
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/BatchSampler.java | BatchSampler.sampleBatchWithoutReplacement | public int[] sampleBatchWithoutReplacement() {
int[] batch = new int[batchSize];
for (int i=0; i<batch.length; i++) {
if (cur == indices.length) {
cur = 0;
}
if (cur == 0) {
IntArrays.shuffle(indices);
}
batch[i]... | java | public int[] sampleBatchWithoutReplacement() {
int[] batch = new int[batchSize];
for (int i=0; i<batch.length; i++) {
if (cur == indices.length) {
cur = 0;
}
if (cur == 0) {
IntArrays.shuffle(indices);
}
batch[i]... | [
"public",
"int",
"[",
"]",
"sampleBatchWithoutReplacement",
"(",
")",
"{",
"int",
"[",
"]",
"batch",
"=",
"new",
"int",
"[",
"batchSize",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"batch",
".",
"length",
";",
"i",
"++",
")",
"{",... | Samples a batch of indices in the range [0, numExamples) without replacement. | [
"Samples",
"a",
"batch",
"of",
"indices",
"in",
"the",
"range",
"[",
"0",
"numExamples",
")",
"without",
"replacement",
"."
] | 3d1b93260b99febb8a5ecd9e8543c223e151a8d3 | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/BatchSampler.java#L66-L78 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/TractionDialogBox.java | TractionDialogBox.adjustGlassSize | public void adjustGlassSize() {
if (isGlassEnabled()) {
ResizeHandler handler = getGlassResizer();
if (handler != null) handler.onResize(null);
}
} | java | public void adjustGlassSize() {
if (isGlassEnabled()) {
ResizeHandler handler = getGlassResizer();
if (handler != null) handler.onResize(null);
}
} | [
"public",
"void",
"adjustGlassSize",
"(",
")",
"{",
"if",
"(",
"isGlassEnabled",
"(",
")",
")",
"{",
"ResizeHandler",
"handler",
"=",
"getGlassResizer",
"(",
")",
";",
"if",
"(",
"handler",
"!=",
"null",
")",
"handler",
".",
"onResize",
"(",
"null",
")",... | This can be called to adjust the size of the dialog glass. It
is implemented using JSNI to bypass the "private" keyword on
the glassResizer. | [
"This",
"can",
"be",
"called",
"to",
"adjust",
"the",
"size",
"of",
"the",
"dialog",
"glass",
".",
"It",
"is",
"implemented",
"using",
"JSNI",
"to",
"bypass",
"the",
"private",
"keyword",
"on",
"the",
"glassResizer",
"."
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/TractionDialogBox.java#L201-L206 | train |
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/function/Bounds.java | Bounds.getSymmetricBounds | public static Bounds getSymmetricBounds(int dim, double l, double u) {
double [] L = new double[dim];
double [] U = new double[dim];
for(int i=0; i<dim; i++) {
L[i] = l;
U[i] = u;
}
return new Bounds(L, U);
} | java | public static Bounds getSymmetricBounds(int dim, double l, double u) {
double [] L = new double[dim];
double [] U = new double[dim];
for(int i=0; i<dim; i++) {
L[i] = l;
U[i] = u;
}
return new Bounds(L, U);
} | [
"public",
"static",
"Bounds",
"getSymmetricBounds",
"(",
"int",
"dim",
",",
"double",
"l",
",",
"double",
"u",
")",
"{",
"double",
"[",
"]",
"L",
"=",
"new",
"double",
"[",
"dim",
"]",
";",
"double",
"[",
"]",
"U",
"=",
"new",
"double",
"[",
"dim",... | Gets bounds which are identical for all dimensions.
@param dim The number of dimensions.
@param l The value of all lower bounds.
@param u The value of all upper bounds.
@return The new bounds. | [
"Gets",
"bounds",
"which",
"are",
"identical",
"for",
"all",
"dimensions",
"."
] | 3d1b93260b99febb8a5ecd9e8543c223e151a8d3 | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/Bounds.java#L67-L75 | train |
httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java | Tag.parse | public static Optional<Tag> parse(final String httpTag) {
Tag result = null;
boolean weak = false;
String internal = httpTag;
if (internal.startsWith("W/")) {
weak = true;
internal = internal.substring(2);
}
if (internal.startsWith("\""... | java | public static Optional<Tag> parse(final String httpTag) {
Tag result = null;
boolean weak = false;
String internal = httpTag;
if (internal.startsWith("W/")) {
weak = true;
internal = internal.substring(2);
}
if (internal.startsWith("\""... | [
"public",
"static",
"Optional",
"<",
"Tag",
">",
"parse",
"(",
"final",
"String",
"httpTag",
")",
"{",
"Tag",
"result",
"=",
"null",
";",
"boolean",
"weak",
"=",
"false",
";",
"String",
"internal",
"=",
"httpTag",
";",
"if",
"(",
"internal",
".",
"star... | Parses a tag formatted as defined by the HTTP standard.
@param httpTag The HTTP tag string; if it starts with 'W/' the tag will be
marked as weak and the data following the 'W/' used as the tag;
otherwise it should be surrounded with quotes (e.g.,
"sometag").
@return A new tag instance.
@see <a
href="http://www.w3.o... | [
"Parses",
"a",
"tag",
"formatted",
"as",
"defined",
"by",
"the",
"HTTP",
"standard",
"."
] | 9c07ebd63cd104a99eb9e771f760f14efa4fe0f6 | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java#L58-L77 | train |
httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java | Tag.format | public String format() {
if (getName().equals("*")) {
return "*";
}
else {
StringBuilder sb = new StringBuilder();
if (isWeak()) {
sb.append("W/");
}
return sb.append('"').append(getName()).append('"').toString(... | java | public String format() {
if (getName().equals("*")) {
return "*";
}
else {
StringBuilder sb = new StringBuilder();
if (isWeak()) {
sb.append("W/");
}
return sb.append('"').append(getName()).append('"').toString(... | [
"public",
"String",
"format",
"(",
")",
"{",
"if",
"(",
"getName",
"(",
")",
".",
"equals",
"(",
"\"*\"",
")",
")",
"{",
"return",
"\"*\"",
";",
"}",
"else",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"isWeak... | Returns tag formatted as an HTTP tag string.
@return The formatted HTTP tag string.
@see <a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11">HTTP
Entity Tags</a> | [
"Returns",
"tag",
"formatted",
"as",
"an",
"HTTP",
"tag",
"string",
"."
] | 9c07ebd63cd104a99eb9e771f760f14efa4fe0f6 | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java#L151-L162 | train |
Canadensys/canadensys-core | src/main/java/net/canadensys/bundle/UTF8PropertyResourceBundle.java | UTF8PropertyResourceBundle.getBundle | public static PropertyResourceBundle getBundle(String baseName, Locale locale) throws UnsupportedEncodingException, IOException{
InputStream is = UTF8PropertyResourceBundle.class.getResourceAsStream("/"+baseName + "_"+locale.toString()+PROPERTIES_EXT);
if(is != null){
return new PropertyResourceBundle(new InputS... | java | public static PropertyResourceBundle getBundle(String baseName, Locale locale) throws UnsupportedEncodingException, IOException{
InputStream is = UTF8PropertyResourceBundle.class.getResourceAsStream("/"+baseName + "_"+locale.toString()+PROPERTIES_EXT);
if(is != null){
return new PropertyResourceBundle(new InputS... | [
"public",
"static",
"PropertyResourceBundle",
"getBundle",
"(",
"String",
"baseName",
",",
"Locale",
"locale",
")",
"throws",
"UnsupportedEncodingException",
",",
"IOException",
"{",
"InputStream",
"is",
"=",
"UTF8PropertyResourceBundle",
".",
"class",
".",
"getResource... | Get a PropertyResourceBundle able to read an UTF-8 properties file.
@param baseName
@param locale
@return new ResourceBundle or null if no bundle can be found.
@throws UnsupportedEncodingException
@throws IOException | [
"Get",
"a",
"PropertyResourceBundle",
"able",
"to",
"read",
"an",
"UTF",
"-",
"8",
"properties",
"file",
"."
] | 5e13569f7c0f4cdc7080da72643ff61123ad76fd | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/bundle/UTF8PropertyResourceBundle.java#L26-L32 | train |
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/SGD.java | SGD.minimize | @Override
public boolean minimize(DifferentiableBatchFunction function, IntDoubleVector point) {
return minimize(function, point, null);
} | java | @Override
public boolean minimize(DifferentiableBatchFunction function, IntDoubleVector point) {
return minimize(function, point, null);
} | [
"@",
"Override",
"public",
"boolean",
"minimize",
"(",
"DifferentiableBatchFunction",
"function",
",",
"IntDoubleVector",
"point",
")",
"{",
"return",
"minimize",
"(",
"function",
",",
"point",
",",
"null",
")",
";",
"}"
] | Minimize the function starting at the given initial point. | [
"Minimize",
"the",
"function",
"starting",
"at",
"the",
"given",
"initial",
"point",
"."
] | 3d1b93260b99febb8a5ecd9e8543c223e151a8d3 | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/SGD.java#L87-L90 | train |
cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/beans/AbstractSimpleBeanConverter.java | AbstractSimpleBeanConverter.convertElement | @SuppressWarnings("unchecked")
public <T> T convertElement(ConversionContext context, Object source,
TypeReference<T> destinationType) throws ConverterException {
return (T) elementConverter.convert(context, source, destinationType);
} | java | @SuppressWarnings("unchecked")
public <T> T convertElement(ConversionContext context, Object source,
TypeReference<T> destinationType) throws ConverterException {
return (T) elementConverter.convert(context, source, destinationType);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"convertElement",
"(",
"ConversionContext",
"context",
",",
"Object",
"source",
",",
"TypeReference",
"<",
"T",
">",
"destinationType",
")",
"throws",
"ConverterException",
"{",
"r... | Convert element to another object given a parameterized type signature
@param context
@param destinationType
the destination type
@param source
the source object
@return the converted object
@throws ConverterException
if conversion failed | [
"Convert",
"element",
"to",
"another",
"object",
"given",
"a",
"parameterized",
"type",
"signature"
] | 118550f30b9680a84eab7496bd8b04118740dcec | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/beans/AbstractSimpleBeanConverter.java#L78-L82 | train |
httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java | Conditionals.addIfMatch | public Conditionals addIfMatch(Tag tag) {
Preconditions.checkArgument(!modifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderConstants.IF_MODIFIED_SINCE));
Preconditions.checkArgument(noneMatch.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderCons... | java | public Conditionals addIfMatch(Tag tag) {
Preconditions.checkArgument(!modifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderConstants.IF_MODIFIED_SINCE));
Preconditions.checkArgument(noneMatch.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderCons... | [
"public",
"Conditionals",
"addIfMatch",
"(",
"Tag",
"tag",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"modifiedSince",
".",
"isPresent",
"(",
")",
",",
"String",
".",
"format",
"(",
"ERROR_MESSAGE",
",",
"HeaderConstants",
".",
"IF_MATCH",
",",... | Adds tags to the If-Match header.
@param tag the tag to add, may be null. This means the same as adding {@link Tag#ALL}
@throws IllegalArgumentException if ALL is supplied more than once, or you add a null tag more than once.
@return a new Conditionals object with the If-Match tag added. | [
"Adds",
"tags",
"to",
"the",
"If",
"-",
"Match",
"header",
"."
] | 9c07ebd63cd104a99eb9e771f760f14efa4fe0f6 | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java#L90-L110 | train |
httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java | Conditionals.ifModifiedSince | public Conditionals ifModifiedSince(LocalDateTime time) {
Preconditions.checkArgument(match.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MODIFIED_SINCE, HeaderConstants.IF_MATCH));
Preconditions.checkArgument(!unModifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MOD... | java | public Conditionals ifModifiedSince(LocalDateTime time) {
Preconditions.checkArgument(match.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MODIFIED_SINCE, HeaderConstants.IF_MATCH));
Preconditions.checkArgument(!unModifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MOD... | [
"public",
"Conditionals",
"ifModifiedSince",
"(",
"LocalDateTime",
"time",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"match",
".",
"isEmpty",
"(",
")",
",",
"String",
".",
"format",
"(",
"ERROR_MESSAGE",
",",
"HeaderConstants",
".",
"IF_MODIFIED_SINCE"... | You should use the server's time here. Otherwise you might get unexpected results.
The typical use case is:
<pre>
HTTPResponse response = ....
HTTPRequest request = createRequest();
request = request.conditionals(new Conditionals().ifModifiedSince(response.getLastModified());
</pre>
@param time the time to check.
@... | [
"You",
"should",
"use",
"the",
"server",
"s",
"time",
"here",
".",
"Otherwise",
"you",
"might",
"get",
"unexpected",
"results",
"."
] | 9c07ebd63cd104a99eb9e771f760f14efa4fe0f6 | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java#L160-L165 | train |
httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java | Conditionals.toHeaders | public Headers toHeaders() {
Headers headers = new Headers();
if (!getMatch().isEmpty()) {
headers = headers.add(new Header(HeaderConstants.IF_MATCH, buildTagHeaderValue(getMatch())));
}
if (!getNoneMatch().isEmpty()) {
headers = headers.add(new Header(HeaderConst... | java | public Headers toHeaders() {
Headers headers = new Headers();
if (!getMatch().isEmpty()) {
headers = headers.add(new Header(HeaderConstants.IF_MATCH, buildTagHeaderValue(getMatch())));
}
if (!getNoneMatch().isEmpty()) {
headers = headers.add(new Header(HeaderConst... | [
"public",
"Headers",
"toHeaders",
"(",
")",
"{",
"Headers",
"headers",
"=",
"new",
"Headers",
"(",
")",
";",
"if",
"(",
"!",
"getMatch",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"headers",
"=",
"headers",
".",
"add",
"(",
"new",
"Header",
"(",... | Converts the Conditionals into real headers.
@return real headers. | [
"Converts",
"the",
"Conditionals",
"into",
"real",
"headers",
"."
] | 9c07ebd63cd104a99eb9e771f760f14efa4fe0f6 | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java#L216-L232 | train |
jbossws/jbossws-spi | src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java | WebserviceDescriptionMetaData.getPortComponentQNames | public Collection<QName> getPortComponentQNames()
{
//TODO:Check if there is just one QName that drives all portcomponents
//or each port component can have a distinct QName (namespace/prefix)
//Maintain uniqueness of the QName
Map<String, QName> map = new HashMap<String, QName>();
for ... | java | public Collection<QName> getPortComponentQNames()
{
//TODO:Check if there is just one QName that drives all portcomponents
//or each port component can have a distinct QName (namespace/prefix)
//Maintain uniqueness of the QName
Map<String, QName> map = new HashMap<String, QName>();
for ... | [
"public",
"Collection",
"<",
"QName",
">",
"getPortComponentQNames",
"(",
")",
"{",
"//TODO:Check if there is just one QName that drives all portcomponents",
"//or each port component can have a distinct QName (namespace/prefix)",
"//Maintain uniqueness of the QName",
"Map",
"<",
"String... | Get the QNames of the port components to be declared
in the namespaces
@return collection of QNames | [
"Get",
"the",
"QNames",
"of",
"the",
"port",
"components",
"to",
"be",
"declared",
"in",
"the",
"namespaces"
] | 845e66c18679ce3aaf76f849822110b4650a9d78 | https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java#L102-L114 | train |
jbossws/jbossws-spi | src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java | WebserviceDescriptionMetaData.getPortComponentByWsdlPort | public PortComponentMetaData getPortComponentByWsdlPort(String name)
{
ArrayList<String> pcNames = new ArrayList<String>();
for (PortComponentMetaData pc : portComponents)
{
String wsdlPortName = pc.getWsdlPort().getLocalPart();
if (wsdlPortName.equals(name))
return pc... | java | public PortComponentMetaData getPortComponentByWsdlPort(String name)
{
ArrayList<String> pcNames = new ArrayList<String>();
for (PortComponentMetaData pc : portComponents)
{
String wsdlPortName = pc.getWsdlPort().getLocalPart();
if (wsdlPortName.equals(name))
return pc... | [
"public",
"PortComponentMetaData",
"getPortComponentByWsdlPort",
"(",
"String",
"name",
")",
"{",
"ArrayList",
"<",
"String",
">",
"pcNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"PortComponentMetaData",
"pc",
":",
"portCompone... | Lookup a PortComponentMetaData by wsdl-port local part
@param name - the wsdl-port local part
@return PortComponentMetaData if found, null otherwise | [
"Lookup",
"a",
"PortComponentMetaData",
"by",
"wsdl",
"-",
"port",
"local",
"part"
] | 845e66c18679ce3aaf76f849822110b4650a9d78 | https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java#L122-L136 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java | Geometry.setBounds | public static final void setBounds(UIObject o, Rect bounds) {
setPosition(o, bounds);
setSize(o, bounds);
} | java | public static final void setBounds(UIObject o, Rect bounds) {
setPosition(o, bounds);
setSize(o, bounds);
} | [
"public",
"static",
"final",
"void",
"setBounds",
"(",
"UIObject",
"o",
",",
"Rect",
"bounds",
")",
"{",
"setPosition",
"(",
"o",
",",
"bounds",
")",
";",
"setSize",
"(",
"o",
",",
"bounds",
")",
";",
"}"
] | Sets the bounds of a UIObject, moving and sizing to match the
bounds specified. Currently used for the itemhover and useful
for other absolutely positioned elements. | [
"Sets",
"the",
"bounds",
"of",
"a",
"UIObject",
"moving",
"and",
"sizing",
"to",
"match",
"the",
"bounds",
"specified",
".",
"Currently",
"used",
"for",
"the",
"itemhover",
"and",
"useful",
"for",
"other",
"absolutely",
"positioned",
"elements",
"."
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java#L89-L92 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java | Geometry.setPosition | public static final void setPosition(UIObject o, Rect pos) {
Style style = o.getElement().getStyle();
style.setPropertyPx("left", pos.x);
style.setPropertyPx("top", pos.y);
} | java | public static final void setPosition(UIObject o, Rect pos) {
Style style = o.getElement().getStyle();
style.setPropertyPx("left", pos.x);
style.setPropertyPx("top", pos.y);
} | [
"public",
"static",
"final",
"void",
"setPosition",
"(",
"UIObject",
"o",
",",
"Rect",
"pos",
")",
"{",
"Style",
"style",
"=",
"o",
".",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
";",
"style",
".",
"setPropertyPx",
"(",
"\"left\"",
",",
"pos",... | Sets the position of a UIObject | [
"Sets",
"the",
"position",
"of",
"a",
"UIObject"
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java#L97-L101 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java | Geometry.setSize | public static final void setSize(UIObject o, Rect size) {
o.setPixelSize(size.w, size.h);
} | java | public static final void setSize(UIObject o, Rect size) {
o.setPixelSize(size.w, size.h);
} | [
"public",
"static",
"final",
"void",
"setSize",
"(",
"UIObject",
"o",
",",
"Rect",
"size",
")",
"{",
"o",
".",
"setPixelSize",
"(",
"size",
".",
"w",
",",
"size",
".",
"h",
")",
";",
"}"
] | Sets the size of a UIObject | [
"Sets",
"the",
"size",
"of",
"a",
"UIObject"
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java#L106-L109 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java | Geometry.isInside | public static final boolean isInside(int x, int y, Rect box) {
return (box.x < x && x < box.x + box.w && box.y < y && y < box.y + box.h);
} | java | public static final boolean isInside(int x, int y, Rect box) {
return (box.x < x && x < box.x + box.w && box.y < y && y < box.y + box.h);
} | [
"public",
"static",
"final",
"boolean",
"isInside",
"(",
"int",
"x",
",",
"int",
"y",
",",
"Rect",
"box",
")",
"{",
"return",
"(",
"box",
".",
"x",
"<",
"x",
"&&",
"x",
"<",
"box",
".",
"x",
"+",
"box",
".",
"w",
"&&",
"box",
".",
"y",
"<",
... | Determines if a point is inside a box. | [
"Determines",
"if",
"a",
"point",
"is",
"inside",
"a",
"box",
"."
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java#L114-L116 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java | Geometry.isMouseInside | public static final boolean isMouseInside(NativeEvent event, Element element) {
return isInside(event.getClientX() + Window.getScrollLeft(), event.getClientY() + Window.getScrollTop(), getBounds(element));
} | java | public static final boolean isMouseInside(NativeEvent event, Element element) {
return isInside(event.getClientX() + Window.getScrollLeft(), event.getClientY() + Window.getScrollTop(), getBounds(element));
} | [
"public",
"static",
"final",
"boolean",
"isMouseInside",
"(",
"NativeEvent",
"event",
",",
"Element",
"element",
")",
"{",
"return",
"isInside",
"(",
"event",
".",
"getClientX",
"(",
")",
"+",
"Window",
".",
"getScrollLeft",
"(",
")",
",",
"event",
".",
"g... | Determines if a mouse event is inside a box. | [
"Determines",
"if",
"a",
"mouse",
"event",
"is",
"inside",
"a",
"box",
"."
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java#L121-L123 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java | Geometry.getViewportBounds | public static final Rect getViewportBounds() {
return new Rect(Window.getScrollLeft(), Window.getScrollTop(), Window.getClientWidth(), Window.getClientHeight());
} | java | public static final Rect getViewportBounds() {
return new Rect(Window.getScrollLeft(), Window.getScrollTop(), Window.getClientWidth(), Window.getClientHeight());
} | [
"public",
"static",
"final",
"Rect",
"getViewportBounds",
"(",
")",
"{",
"return",
"new",
"Rect",
"(",
"Window",
".",
"getScrollLeft",
"(",
")",
",",
"Window",
".",
"getScrollTop",
"(",
")",
",",
"Window",
".",
"getClientWidth",
"(",
")",
",",
"Window",
... | This takes into account scrolling and will be in absolute
coordinates where the top left corner of the page is 0,0 but
the viewport may be scrolled to something else. | [
"This",
"takes",
"into",
"account",
"scrolling",
"and",
"will",
"be",
"in",
"absolute",
"coordinates",
"where",
"the",
"top",
"left",
"corner",
"of",
"the",
"page",
"is",
"0",
"0",
"but",
"the",
"viewport",
"may",
"be",
"scrolled",
"to",
"something",
"else... | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java#L130-L132 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateBox.java | UTCDateBox.utc2date | public static final Date utc2date(Long time) {
// don't accept negative values
if (time == null || time < 0) return null;
// add the timezone offset
time += timezoneOffsetMillis(new Date(time));
return new Date(time);
} | java | public static final Date utc2date(Long time) {
// don't accept negative values
if (time == null || time < 0) return null;
// add the timezone offset
time += timezoneOffsetMillis(new Date(time));
return new Date(time);
} | [
"public",
"static",
"final",
"Date",
"utc2date",
"(",
"Long",
"time",
")",
"{",
"// don't accept negative values",
"if",
"(",
"time",
"==",
"null",
"||",
"time",
"<",
"0",
")",
"return",
"null",
";",
"// add the timezone offset",
"time",
"+=",
"timezoneOffsetMil... | Converts a time in UTC to a gwt Date object which is in the timezone of
the current browser.
@return The Date corresponding to the time, adjusted for the timezone of
the current browser. null if the specified time is null or
represents a negative number. | [
"Converts",
"a",
"time",
"in",
"UTC",
"to",
"a",
"gwt",
"Date",
"object",
"which",
"is",
"in",
"the",
"timezone",
"of",
"the",
"current",
"browser",
"."
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateBox.java#L206-L215 | train |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateBox.java | UTCDateBox.date2utc | public static final Long date2utc(Date date) {
// use null for a null date
if (date == null) return null;
long time = date.getTime();
// remove the timezone offset
time -= timezoneOffsetMillis(date);
return time;
} | java | public static final Long date2utc(Date date) {
// use null for a null date
if (date == null) return null;
long time = date.getTime();
// remove the timezone offset
time -= timezoneOffsetMillis(date);
return time;
} | [
"public",
"static",
"final",
"Long",
"date2utc",
"(",
"Date",
"date",
")",
"{",
"// use null for a null date",
"if",
"(",
"date",
"==",
"null",
")",
"return",
"null",
";",
"long",
"time",
"=",
"date",
".",
"getTime",
"(",
")",
";",
"// remove the timezone of... | Converts a gwt Date in the timezone of the current browser to a time in
UTC.
@return A Long corresponding to the number of milliseconds since January
1, 1970, 00:00:00 GMT or null if the specified Date is null. | [
"Converts",
"a",
"gwt",
"Date",
"in",
"the",
"timezone",
"of",
"the",
"current",
"browser",
"to",
"a",
"time",
"in",
"UTC",
"."
] | efc1423c619439763fb064b777b7235e9ce414a3 | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateBox.java#L224-L235 | train |
cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/signature/TypeSignatureFactory.java | TypeSignatureFactory.getTypeSignature | public static FullTypeSignature getTypeSignature(String typeSignatureString,
boolean useInternalFormFullyQualifiedName) {
String key;
if (!useInternalFormFullyQualifiedName) {
key = typeSignatureString.replace('.', '/')
.replace('$', '.');
} else {
key = typeSignatureString;
}
// we always use ... | java | public static FullTypeSignature getTypeSignature(String typeSignatureString,
boolean useInternalFormFullyQualifiedName) {
String key;
if (!useInternalFormFullyQualifiedName) {
key = typeSignatureString.replace('.', '/')
.replace('$', '.');
} else {
key = typeSignatureString;
}
// we always use ... | [
"public",
"static",
"FullTypeSignature",
"getTypeSignature",
"(",
"String",
"typeSignatureString",
",",
"boolean",
"useInternalFormFullyQualifiedName",
")",
"{",
"String",
"key",
";",
"if",
"(",
"!",
"useInternalFormFullyQualifiedName",
")",
"{",
"key",
"=",
"typeSignat... | get TypeSignature given the signature
@param typeSignature
@param useInternalFormFullyQualifiedName
if true, fqn in parameterizedTypeSignature must be in the form
'java/lang/Thread'. If false fqn must be of the form
'java.lang.Thread'
@return | [
"get",
"TypeSignature",
"given",
"the",
"signature"
] | 118550f30b9680a84eab7496bd8b04118740dcec | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/TypeSignatureFactory.java#L57-L78 | train |
cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/signature/TypeSignatureFactory.java | TypeSignatureFactory.getTypeSignature | public static FullTypeSignature getTypeSignature(Class<?> clazz, Class<?>[] typeArgs) {
ClassTypeSignature rawClassTypeSignature = (ClassTypeSignature) javaTypeToTypeSignature
.getTypeSignature(clazz);
TypeArgSignature[] typeArgSignatures = new TypeArgSignature[typeArgs.length];
for (int i = 0; i < typeArgs.l... | java | public static FullTypeSignature getTypeSignature(Class<?> clazz, Class<?>[] typeArgs) {
ClassTypeSignature rawClassTypeSignature = (ClassTypeSignature) javaTypeToTypeSignature
.getTypeSignature(clazz);
TypeArgSignature[] typeArgSignatures = new TypeArgSignature[typeArgs.length];
for (int i = 0; i < typeArgs.l... | [
"public",
"static",
"FullTypeSignature",
"getTypeSignature",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"typeArgs",
")",
"{",
"ClassTypeSignature",
"rawClassTypeSignature",
"=",
"(",
"ClassTypeSignature",
")",
"javaTypeToTypeSigna... | get the TypeSignature corresponding to given class with given type
arguments
@param clazz
@param typeArgs
@return | [
"get",
"the",
"TypeSignature",
"corresponding",
"to",
"given",
"class",
"with",
"given",
"type",
"arguments"
] | 118550f30b9680a84eab7496bd8b04118740dcec | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/TypeSignatureFactory.java#L112-L127 | train |
resource4j/resource4j | core/src/main/java/com/github/resource4j/values/ResourceStrings.java | ResourceStrings.ofNullable | public static OptionalString ofNullable(ResourceKey key, String value) {
return new GenericOptionalString(RUNTIME_SOURCE, key, value);
} | java | public static OptionalString ofNullable(ResourceKey key, String value) {
return new GenericOptionalString(RUNTIME_SOURCE, key, value);
} | [
"public",
"static",
"OptionalString",
"ofNullable",
"(",
"ResourceKey",
"key",
",",
"String",
"value",
")",
"{",
"return",
"new",
"GenericOptionalString",
"(",
"RUNTIME_SOURCE",
",",
"key",
",",
"value",
")",
";",
"}"
] | Returns new instance of OptionalString with given key and value
@param key key of the returned OptionalString
@param value wrapped string
@return given object wrapped in OptionalString with given key | [
"Returns",
"new",
"instance",
"of",
"OptionalString",
"with",
"given",
"key",
"and",
"value"
] | 6100443b9a78edc8a5867e1e075f7ee12e6698ca | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/core/src/main/java/com/github/resource4j/values/ResourceStrings.java#L41-L43 | train |
openEHR/adl2-core | adl2core-parser/src/main/java/org/openehr/adl/parser/AdlDeserializer.java | AdlDeserializer.parse | public Archetype parse(String adl) {
try {
return parse(new StringReader(adl));
} catch (IOException e) {
// StringReader should never throw an IOException
throw new AssertionError(e);
}
} | java | public Archetype parse(String adl) {
try {
return parse(new StringReader(adl));
} catch (IOException e) {
// StringReader should never throw an IOException
throw new AssertionError(e);
}
} | [
"public",
"Archetype",
"parse",
"(",
"String",
"adl",
")",
"{",
"try",
"{",
"return",
"parse",
"(",
"new",
"StringReader",
"(",
"adl",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"// StringReader should never throw an IOException",
"throw",... | Parses an adl source into a differential archetype.
@param adl contents of an adl source file
@return parsed archetype
@throws org.openehr.adl.parser.AdlParserException if an error occurred while parsing | [
"Parses",
"an",
"adl",
"source",
"into",
"a",
"differential",
"archetype",
"."
] | dd5c1c0fe7ef5e43fbfaf6a0389990ba5380e22c | https://github.com/openEHR/adl2-core/blob/dd5c1c0fe7ef5e43fbfaf6a0389990ba5380e22c/adl2core-parser/src/main/java/org/openehr/adl/parser/AdlDeserializer.java#L52-L59 | train |
taimos/dvalin | interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/service/DaemonScanner.java | DaemonScanner.object2Array | @SuppressWarnings({"unchecked", "unused"})
public static <T> T[] object2Array(final Class<T> clazz, final Object obj) {
return (T[]) obj;
} | java | @SuppressWarnings({"unchecked", "unused"})
public static <T> T[] object2Array(final Class<T> clazz, final Object obj) {
return (T[]) obj;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"unused\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"object2Array",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"obj",
")",
"{",
"return",
"(",
... | We try to convert an Object to an Array and this is not easy in Java so we need a little bit of nasty magic.
@param <T> Type of elements
@param clazz Clazz of the Objct elements
@param obj Object
@return Array | [
"We",
"try",
"to",
"convert",
"an",
"Object",
"to",
"an",
"Array",
"and",
"this",
"is",
"not",
"easy",
"in",
"Java",
"so",
"we",
"need",
"a",
"little",
"bit",
"of",
"nasty",
"magic",
"."
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/service/DaemonScanner.java#L271-L274 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/async/AsyncAssembly.java | AsyncAssembly.pauseUpload | public void pauseUpload() throws LocalOperationException {
if (state == State.UPLOADING) {
setState(State.PAUSED);
executor.hardStop();
} else {
throw new LocalOperationException("Attempt to pause upload while assembly is not uploading");
}
} | java | public void pauseUpload() throws LocalOperationException {
if (state == State.UPLOADING) {
setState(State.PAUSED);
executor.hardStop();
} else {
throw new LocalOperationException("Attempt to pause upload while assembly is not uploading");
}
} | [
"public",
"void",
"pauseUpload",
"(",
")",
"throws",
"LocalOperationException",
"{",
"if",
"(",
"state",
"==",
"State",
".",
"UPLOADING",
")",
"{",
"setState",
"(",
"State",
".",
"PAUSED",
")",
";",
"executor",
".",
"hardStop",
"(",
")",
";",
"}",
"else"... | Pauses the file upload. This is a blocking function that would try to wait till the assembly file uploads
have actually been paused if possible.
@throws LocalOperationException if the method is called while no upload is going on. | [
"Pauses",
"the",
"file",
"upload",
".",
"This",
"is",
"a",
"blocking",
"function",
"that",
"would",
"try",
"to",
"wait",
"till",
"the",
"assembly",
"file",
"uploads",
"have",
"actually",
"been",
"paused",
"if",
"possible",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/async/AsyncAssembly.java#L68-L75 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/async/AsyncAssembly.java | AsyncAssembly.watchStatus | protected AssemblyResponse watchStatus() throws LocalOperationException, RequestException {
AssemblyResponse response;
do {
response = getClient().getAssemblyByUrl(url);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw... | java | protected AssemblyResponse watchStatus() throws LocalOperationException, RequestException {
AssemblyResponse response;
do {
response = getClient().getAssemblyByUrl(url);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw... | [
"protected",
"AssemblyResponse",
"watchStatus",
"(",
")",
"throws",
"LocalOperationException",
",",
"RequestException",
"{",
"AssemblyResponse",
"response",
";",
"do",
"{",
"response",
"=",
"getClient",
"(",
")",
".",
"getAssemblyByUrl",
"(",
"url",
")",
";",
"try... | Runs intermediate check on the Assembly status until it is finished executing,
then returns it as a response.
@return {@link AssemblyResponse}
@throws LocalOperationException if something goes wrong while running non-http operations.
@throws RequestException if request to Transloadit server fails. | [
"Runs",
"intermediate",
"check",
"on",
"the",
"Assembly",
"status",
"until",
"it",
"is",
"finished",
"executing",
"then",
"returns",
"it",
"as",
"a",
"response",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/async/AsyncAssembly.java#L123-L136 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/async/AsyncAssembly.java | AsyncAssembly.getTotalUploadSize | private long getTotalUploadSize() throws IOException {
long size = 0;
for (Map.Entry<String, File> entry : files.entrySet()) {
size += entry.getValue().length();
}
for (Map.Entry<String, InputStream> entry : fileStreams.entrySet()) {
size += entry.getValue().avai... | java | private long getTotalUploadSize() throws IOException {
long size = 0;
for (Map.Entry<String, File> entry : files.entrySet()) {
size += entry.getValue().length();
}
for (Map.Entry<String, InputStream> entry : fileStreams.entrySet()) {
size += entry.getValue().avai... | [
"private",
"long",
"getTotalUploadSize",
"(",
")",
"throws",
"IOException",
"{",
"long",
"size",
"=",
"0",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"File",
">",
"entry",
":",
"files",
".",
"entrySet",
"(",
")",
")",
"{",
"size",
"+="... | used for upload progress | [
"used",
"for",
"upload",
"progress"
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/async/AsyncAssembly.java#L252-L262 | train |
taimos/dvalin | interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/InterconnectMapper.java | InterconnectMapper.fromJson | public static <T extends InterconnectObject> T fromJson(String data, Class<T> clazz) throws IOException {
return InterconnectMapper.mapper.readValue(data, clazz);
} | java | public static <T extends InterconnectObject> T fromJson(String data, Class<T> clazz) throws IOException {
return InterconnectMapper.mapper.readValue(data, clazz);
} | [
"public",
"static",
"<",
"T",
"extends",
"InterconnectObject",
">",
"T",
"fromJson",
"(",
"String",
"data",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"return",
"InterconnectMapper",
".",
"mapper",
".",
"readValue",
"(",
"data",... | Creates an object from the given JSON data.
@param data the JSON data
@param clazz the class object for the content of the JSON data
@param <T> the type of the class object extending {@link InterconnectObject}
@return the object contained in the given JSON data
@throws JsonParseException if a the JSON data could ... | [
"Creates",
"an",
"object",
"from",
"the",
"given",
"JSON",
"data",
"."
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/InterconnectMapper.java#L77-L79 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Template.java | Template.save | public Response save() throws RequestException, LocalOperationException {
Map<String, Object> templateData = new HashMap<String, Object>();
templateData.put("name", name);
options.put("steps", steps.toMap());
templateData.put("template", options);
Request request = new Request(... | java | public Response save() throws RequestException, LocalOperationException {
Map<String, Object> templateData = new HashMap<String, Object>();
templateData.put("name", name);
options.put("steps", steps.toMap());
templateData.put("template", options);
Request request = new Request(... | [
"public",
"Response",
"save",
"(",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"templateData",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"templateData",
".",... | Submits the configured template to Transloadit.
@return {@link Response}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"Submits",
"the",
"configured",
"template",
"to",
"Transloadit",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Template.java#L62-L71 | train |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/caservice/impl/ServiceInfo.java | ServiceInfo.matches | public boolean matches(String resourcePath) {
if (!valid) {
return false;
}
if (resourcePath == null) {
return acceptsContextPathEmpty;
}
if (contextPathRegex != null && !contextPathRegex.matcher(resourcePath).matches()) {
return false;
}
if (contextPathBlacklistRegex != nu... | java | public boolean matches(String resourcePath) {
if (!valid) {
return false;
}
if (resourcePath == null) {
return acceptsContextPathEmpty;
}
if (contextPathRegex != null && !contextPathRegex.matcher(resourcePath).matches()) {
return false;
}
if (contextPathBlacklistRegex != nu... | [
"public",
"boolean",
"matches",
"(",
"String",
"resourcePath",
")",
"{",
"if",
"(",
"!",
"valid",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"resourcePath",
"==",
"null",
")",
"{",
"return",
"acceptsContextPathEmpty",
";",
"}",
"if",
"(",
"context... | Checks if this service implementation accepts the given resource path.
@param resourcePath Resource path
@return true if the implementation matches and the configuration is not invalid. | [
"Checks",
"if",
"this",
"service",
"implementation",
"accepts",
"the",
"given",
"resource",
"path",
"."
] | 90adbe432469378794b5695c72e9cdfa2b7d36f1 | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/caservice/impl/ServiceInfo.java#L148-L162 | train |
cenobites/struts2-json-plugin | src/main/java/es/cenobit/struts2/json/JsonService.java | JsonService.getClassLoader | private ClassLoaderInterface getClassLoader() {
Map<String, Object> application = ActionContext.getContext().getApplication();
if (application != null) {
return (ClassLoaderInterface) application.get(ClassLoaderInterface.CLASS_LOADER_INTERFACE);
}
return null;
} | java | private ClassLoaderInterface getClassLoader() {
Map<String, Object> application = ActionContext.getContext().getApplication();
if (application != null) {
return (ClassLoaderInterface) application.get(ClassLoaderInterface.CLASS_LOADER_INTERFACE);
}
return null;
} | [
"private",
"ClassLoaderInterface",
"getClassLoader",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"application",
"=",
"ActionContext",
".",
"getContext",
"(",
")",
".",
"getApplication",
"(",
")",
";",
"if",
"(",
"application",
"!=",
"null",
")",... | this class loader interface can be used by other plugins to lookup
resources from the bundles. A temporary class loader interface is set
during other configuration loading as well
@return ClassLoaderInterface (BundleClassLoaderInterface) | [
"this",
"class",
"loader",
"interface",
"can",
"be",
"used",
"by",
"other",
"plugins",
"to",
"lookup",
"resources",
"from",
"the",
"bundles",
".",
"A",
"temporary",
"class",
"loader",
"interface",
"is",
"set",
"during",
"other",
"configuration",
"loading",
"as... | 00f948942d85b6f696d46672332ff7b3942ecb1b | https://github.com/cenobites/struts2-json-plugin/blob/00f948942d85b6f696d46672332ff7b3942ecb1b/src/main/java/es/cenobit/struts2/json/JsonService.java#L105-L111 | train |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/QueryStringBuilder.java | QueryStringBuilder.build | public @Nullable String build() {
StringBuilder queryString = new StringBuilder();
for (NameValuePair param : params) {
if (queryString.length() > 0) {
queryString.append(PARAM_SEPARATOR);
}
queryString.append(Escape.urlEncode(param.getName()));
queryString.append(VALUE_SEPARATO... | java | public @Nullable String build() {
StringBuilder queryString = new StringBuilder();
for (NameValuePair param : params) {
if (queryString.length() > 0) {
queryString.append(PARAM_SEPARATOR);
}
queryString.append(Escape.urlEncode(param.getName()));
queryString.append(VALUE_SEPARATO... | [
"public",
"@",
"Nullable",
"String",
"build",
"(",
")",
"{",
"StringBuilder",
"queryString",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"NameValuePair",
"param",
":",
"params",
")",
"{",
"if",
"(",
"queryString",
".",
"length",
"(",
")",
">"... | Build query string.
@return Query string or null if query string contains no parameters at all. | [
"Build",
"query",
"string",
"."
] | 90adbe432469378794b5695c72e9cdfa2b7d36f1 | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/QueryStringBuilder.java#L89-L107 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Transloadit.java | Transloadit.cancelAssembly | public AssemblyResponse cancelAssembly(String url)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new AssemblyResponse(request.delete(url, new HashMap<String, Object>()));
} | java | public AssemblyResponse cancelAssembly(String url)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new AssemblyResponse(request.delete(url, new HashMap<String, Object>()));
} | [
"public",
"AssemblyResponse",
"cancelAssembly",
"(",
"String",
"url",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
")",
";",
"return",
"new",
"AssemblyResponse",
"(",
"request",
"... | cancels a running assembly.
@param url full url of the Assembly.
@return {@link AssemblyResponse}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"cancels",
"a",
"running",
"assembly",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L152-L156 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Transloadit.java | Transloadit.getTemplate | public Response getTemplate(String id) throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.get("/templates/" + id));
} | java | public Response getTemplate(String id) throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.get("/templates/" + id));
} | [
"public",
"Response",
"getTemplate",
"(",
"String",
"id",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
")",
";",
"return",
"new",
"Response",
"(",
"request",
".",
"get",
"(",
... | Returns a single template.
@param id id of the template to retrieve.
@return {@link Response}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"Returns",
"a",
"single",
"template",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L195-L198 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Transloadit.java | Transloadit.updateTemplate | public Response updateTemplate(String id, Map<String, Object> options)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.put("/templates/" + id, options));
} | java | public Response updateTemplate(String id, Map<String, Object> options)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.put("/templates/" + id, options));
} | [
"public",
"Response",
"updateTemplate",
"(",
"String",
"id",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
")",
";",
... | Updates the template with the specified id.
@param id id of the template to update
@param options a Map of options to update/add.
@return {@link Response}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"Updates",
"the",
"template",
"with",
"the",
"specified",
"id",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L210-L214 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Transloadit.java | Transloadit.deleteTemplate | public Response deleteTemplate(String id)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.delete("/templates/" + id, new HashMap<String, Object>()));
} | java | public Response deleteTemplate(String id)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.delete("/templates/" + id, new HashMap<String, Object>()));
} | [
"public",
"Response",
"deleteTemplate",
"(",
"String",
"id",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
")",
";",
"return",
"new",
"Response",
"(",
"request",
".",
"delete",
... | Deletes a template.
@param id id of the template to delete.
@return {@link Response}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"Deletes",
"a",
"template",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L225-L229 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Transloadit.java | Transloadit.listTemplates | public ListResponse listTemplates(Map<String, Object> options)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new ListResponse(request.get("/templates", options));
} | java | public ListResponse listTemplates(Map<String, Object> options)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new ListResponse(request.get("/templates", options));
} | [
"public",
"ListResponse",
"listTemplates",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
")",
";",
"return",
"new",
"L... | Returns a list of all templates under the user account
@param options {@link Map} extra options to send along with the request.
@return {@link ListResponse}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"Returns",
"a",
"list",
"of",
"all",
"templates",
"under",
"the",
"user",
"account"
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L240-L244 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Transloadit.java | Transloadit.getBill | public Response getBill(int month, int year)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.get("/bill/" + year + String.format("-%02d", month)));
} | java | public Response getBill(int month, int year)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new Response(request.get("/bill/" + year + String.format("-%02d", month)));
} | [
"public",
"Response",
"getBill",
"(",
"int",
"month",
",",
"int",
"year",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
")",
";",
"return",
"new",
"Response",
"(",
"request",
... | Returns the bill for the month specified.
@param month for which bill to retrieve.
@param year for which bill to retrieve.
@return {@link Response}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"Returns",
"the",
"bill",
"for",
"the",
"month",
"specified",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L269-L273 | train |
resource4j/resource4j | converters/src/main/java/com/github/resource4j/converters/TypeConverter.java | TypeConverter.convert | @SuppressWarnings("unchecked")
public static <T> T convert(Object fromValue, Class<T> toType) throws TypeCastException {
return convert(fromValue, toType, (String) null);
} | java | @SuppressWarnings("unchecked")
public static <T> T convert(Object fromValue, Class<T> toType) throws TypeCastException {
return convert(fromValue, toType, (String) null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"convert",
"(",
"Object",
"fromValue",
",",
"Class",
"<",
"T",
">",
"toType",
")",
"throws",
"TypeCastException",
"{",
"return",
"convert",
"(",
"fromValue",
",",
"... | Convert given value to given target
@param fromValue
the value to convert
@param toType
target target
@param <T>
target of the result
@return the value converted to given target
@throws TypeCastException
if conversion was not possible | [
"Convert",
"given",
"value",
"to",
"given",
"target"
] | 6100443b9a78edc8a5867e1e075f7ee12e6698ca | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/converters/src/main/java/com/github/resource4j/converters/TypeConverter.java#L122-L125 | train |
taimos/dvalin | jaxrs-jwtauth/src/main/java/de/taimos/dvalin/jaxrs/security/jwt/JWTAuth.java | JWTAuth.verifyToken | public SignedJWT verifyToken(String jwtString) throws ParseException {
try {
SignedJWT jwt = SignedJWT.parse(jwtString);
if (jwt.verify(new MACVerifier(this.jwtSharedSecret))) {
return jwt;
}
return null;
} catch (JOSEException e) {
... | java | public SignedJWT verifyToken(String jwtString) throws ParseException {
try {
SignedJWT jwt = SignedJWT.parse(jwtString);
if (jwt.verify(new MACVerifier(this.jwtSharedSecret))) {
return jwt;
}
return null;
} catch (JOSEException e) {
... | [
"public",
"SignedJWT",
"verifyToken",
"(",
"String",
"jwtString",
")",
"throws",
"ParseException",
"{",
"try",
"{",
"SignedJWT",
"jwt",
"=",
"SignedJWT",
".",
"parse",
"(",
"jwtString",
")",
";",
"if",
"(",
"jwt",
".",
"verify",
"(",
"new",
"MACVerifier",
... | Check the given JWT
@param jwtString the JSON Web Token
@return the parsed and verified token or null if token is invalid
@throws ParseException if the token cannot be parsed | [
"Check",
"the",
"given",
"JWT"
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/jaxrs-jwtauth/src/main/java/de/taimos/dvalin/jaxrs/security/jwt/JWTAuth.java#L97-L107 | train |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/osgi/RankedServices.java | RankedServices.bind | public void bind(T service, Map<String, Object> props) {
synchronized (serviceMap) {
serviceMap.put(ServiceUtil.getComparableForServiceRanking(props), service);
updateSortedServices();
}
} | java | public void bind(T service, Map<String, Object> props) {
synchronized (serviceMap) {
serviceMap.put(ServiceUtil.getComparableForServiceRanking(props), service);
updateSortedServices();
}
} | [
"public",
"void",
"bind",
"(",
"T",
"service",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"synchronized",
"(",
"serviceMap",
")",
"{",
"serviceMap",
".",
"put",
"(",
"ServiceUtil",
".",
"getComparableForServiceRanking",
"(",
"props",
... | Handle bind service event.
@param service Service instance
@param props Service reference properties | [
"Handle",
"bind",
"service",
"event",
"."
] | 90adbe432469378794b5695c72e9cdfa2b7d36f1 | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/osgi/RankedServices.java#L69-L74 | train |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/osgi/RankedServices.java | RankedServices.unbind | public void unbind(T service, Map<String, Object> props) {
synchronized (serviceMap) {
serviceMap.remove(ServiceUtil.getComparableForServiceRanking(props));
updateSortedServices();
}
} | java | public void unbind(T service, Map<String, Object> props) {
synchronized (serviceMap) {
serviceMap.remove(ServiceUtil.getComparableForServiceRanking(props));
updateSortedServices();
}
} | [
"public",
"void",
"unbind",
"(",
"T",
"service",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"synchronized",
"(",
"serviceMap",
")",
"{",
"serviceMap",
".",
"remove",
"(",
"ServiceUtil",
".",
"getComparableForServiceRanking",
"(",
"prop... | Handle unbind service event.
@param service Service instance
@param props Service reference properties | [
"Handle",
"unbind",
"service",
"event",
"."
] | 90adbe432469378794b5695c72e9cdfa2b7d36f1 | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/osgi/RankedServices.java#L81-L86 | train |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/osgi/RankedServices.java | RankedServices.updateSortedServices | private void updateSortedServices() {
List<T> copiedList = new ArrayList<T>(serviceMap.values());
sortedServices = Collections.unmodifiableList(copiedList);
if (changeListener != null) {
changeListener.changed();
}
} | java | private void updateSortedServices() {
List<T> copiedList = new ArrayList<T>(serviceMap.values());
sortedServices = Collections.unmodifiableList(copiedList);
if (changeListener != null) {
changeListener.changed();
}
} | [
"private",
"void",
"updateSortedServices",
"(",
")",
"{",
"List",
"<",
"T",
">",
"copiedList",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"serviceMap",
".",
"values",
"(",
")",
")",
";",
"sortedServices",
"=",
"Collections",
".",
"unmodifiableList",
"(",... | Update list of sorted services by copying it from the array and making it unmodifiable. | [
"Update",
"list",
"of",
"sorted",
"services",
"by",
"copying",
"it",
"from",
"the",
"array",
"and",
"making",
"it",
"unmodifiable",
"."
] | 90adbe432469378794b5695c72e9cdfa2b7d36f1 | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/osgi/RankedServices.java#L91-L97 | train |
resource4j/resource4j | integration/extras/src/main/java/com/github/resource4j/extras/json/JacksonParser.java | JacksonParser.json | public static <T> JacksonParser<T> json(Class<T> contentType) {
return new JacksonParser<>(null, contentType);
} | java | public static <T> JacksonParser<T> json(Class<T> contentType) {
return new JacksonParser<>(null, contentType);
} | [
"public",
"static",
"<",
"T",
">",
"JacksonParser",
"<",
"T",
">",
"json",
"(",
"Class",
"<",
"T",
">",
"contentType",
")",
"{",
"return",
"new",
"JacksonParser",
"<>",
"(",
"null",
",",
"contentType",
")",
";",
"}"
] | Creates typed parser
@param contentType class of parsed object
@param <T> type of parsed object
@return parser of objects of given type | [
"Creates",
"typed",
"parser"
] | 6100443b9a78edc8a5867e1e075f7ee12e6698ca | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/integration/extras/src/main/java/com/github/resource4j/extras/json/JacksonParser.java#L35-L37 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Steps.java | Steps.addStep | public void addStep(String name, String robot, Map<String, Object> options) {
all.put(name, new Step(name, robot, options));
} | java | public void addStep(String name, String robot, Map<String, Object> options) {
all.put(name, new Step(name, robot, options));
} | [
"public",
"void",
"addStep",
"(",
"String",
"name",
",",
"String",
"robot",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"all",
".",
"put",
"(",
"name",
",",
"new",
"Step",
"(",
"name",
",",
"robot",
",",
"options",
")",
")",... | Adds a new step to the list of steps.
@param name Name of the step to add.
@param robot The name of the robot ot use with the step.
@param options extra options required for the step. | [
"Adds",
"a",
"new",
"step",
"to",
"the",
"list",
"of",
"steps",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Steps.java#L54-L56 | train |
heneke/thymeleaf-extras-togglz | src/main/java/com/github/heneke/thymeleaf/togglz/processor/AbstractFeatureAttrProcessor.java | AbstractFeatureAttrProcessor.determineFeatureState | protected boolean determineFeatureState(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, boolean defaultState) {
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration())... | java | protected boolean determineFeatureState(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, boolean defaultState) {
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration())... | [
"protected",
"boolean",
"determineFeatureState",
"(",
"final",
"ITemplateContext",
"context",
",",
"final",
"IProcessableElementTag",
"tag",
",",
"final",
"AttributeName",
"attributeName",
",",
"final",
"String",
"attributeValue",
",",
"boolean",
"defaultState",
")",
"{... | Determines the feature state
@param context the template context
@param tag the tag
@param attributeName the attribute name
@param attributeValue the attribute value
@param defaultState the default state if the expression evaluates to null
@return the feature state | [
"Determines",
"the",
"feature",
"state"
] | 768984cd373c7220c35557799e79ddbc5d7f9cf2 | https://github.com/heneke/thymeleaf-extras-togglz/blob/768984cd373c7220c35557799e79ddbc5d7f9cf2/src/main/java/com/github/heneke/thymeleaf/togglz/processor/AbstractFeatureAttrProcessor.java#L53-L63 | train |
cenobites/struts2-json-plugin | src/main/java/es/cenobit/struts2/json/ClasspathConfigurationProvider.java | ClasspathConfigurationProvider.init | public void init(Configuration configuration) {
if (devMode && reload && !listeningToDispatcher) {
// this is the only way I found to be able to get added to to
// ConfigurationProvider list
// listening to events in Dispatcher
listeningToDispatcher = true;
... | java | public void init(Configuration configuration) {
if (devMode && reload && !listeningToDispatcher) {
// this is the only way I found to be able to get added to to
// ConfigurationProvider list
// listening to events in Dispatcher
listeningToDispatcher = true;
... | [
"public",
"void",
"init",
"(",
"Configuration",
"configuration",
")",
"{",
"if",
"(",
"devMode",
"&&",
"reload",
"&&",
"!",
"listeningToDispatcher",
")",
"{",
"// this is the only way I found to be able to get added to to",
"// ConfigurationProvider list",
"// listening to ev... | Not used. | [
"Not",
"used",
"."
] | 00f948942d85b6f696d46672332ff7b3942ecb1b | https://github.com/cenobites/struts2-json-plugin/blob/00f948942d85b6f696d46672332ff7b3942ecb1b/src/main/java/es/cenobit/struts2/json/ClasspathConfigurationProvider.java#L71-L79 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Assembly.java | Assembly.addFile | public void addFile(File file) {
String name = "file";
files.put(normalizeDuplicateName(name), file);
} | java | public void addFile(File file) {
String name = "file";
files.put(normalizeDuplicateName(name), file);
} | [
"public",
"void",
"addFile",
"(",
"File",
"file",
")",
"{",
"String",
"name",
"=",
"\"file\"",
";",
"files",
".",
"put",
"(",
"normalizeDuplicateName",
"(",
"name",
")",
",",
"file",
")",
";",
"}"
] | Adds a file to your assembly but automatically generates the field name of the file.
@param file {@link File} the file to be uploaded. | [
"Adds",
"a",
"file",
"to",
"your",
"assembly",
"but",
"automatically",
"generates",
"the",
"field",
"name",
"of",
"the",
"file",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Assembly.java#L71-L74 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Assembly.java | Assembly.addFile | public void addFile(InputStream inputStream) {
String name = "file";
fileStreams.put(normalizeDuplicateName(name), inputStream);
} | java | public void addFile(InputStream inputStream) {
String name = "file";
fileStreams.put(normalizeDuplicateName(name), inputStream);
} | [
"public",
"void",
"addFile",
"(",
"InputStream",
"inputStream",
")",
"{",
"String",
"name",
"=",
"\"file\"",
";",
"fileStreams",
".",
"put",
"(",
"normalizeDuplicateName",
"(",
"name",
")",
",",
"inputStream",
")",
";",
"}"
] | Adds a file to your assembly but automatically genarates the name of the file.
@param inputStream {@link InputStream} the file to be uploaded. | [
"Adds",
"a",
"file",
"to",
"your",
"assembly",
"but",
"automatically",
"genarates",
"the",
"name",
"of",
"the",
"file",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Assembly.java#L97-L100 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Assembly.java | Assembly.removeFile | public void removeFile(String name) {
if(files.containsKey(name)) {
files.remove(name);
}
if(fileStreams.containsKey(name)) {
fileStreams.remove(name);
}
} | java | public void removeFile(String name) {
if(files.containsKey(name)) {
files.remove(name);
}
if(fileStreams.containsKey(name)) {
fileStreams.remove(name);
}
} | [
"public",
"void",
"removeFile",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"files",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"files",
".",
"remove",
"(",
"name",
")",
";",
"}",
"if",
"(",
"fileStreams",
".",
"containsKey",
"(",
"name",
")",
... | Removes file from your assembly.
@param name field name of the file to remove. | [
"Removes",
"file",
"from",
"your",
"assembly",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Assembly.java#L107-L115 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Assembly.java | Assembly.save | public AssemblyResponse save(boolean isResumable)
throws RequestException, LocalOperationException {
Request request = new Request(getClient());
options.put("steps", steps.toMap());
// only do tus uploads if files will be uploaded
if (isResumable && getFilesCount() > 0) {
... | java | public AssemblyResponse save(boolean isResumable)
throws RequestException, LocalOperationException {
Request request = new Request(getClient());
options.put("steps", steps.toMap());
// only do tus uploads if files will be uploaded
if (isResumable && getFilesCount() > 0) {
... | [
"public",
"AssemblyResponse",
"save",
"(",
"boolean",
"isResumable",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"getClient",
"(",
")",
")",
";",
"options",
".",
"put",
"(",
"\"steps\"... | Submits the configured assembly to Transloadit for processing.
@param isResumable boolean value that tells the assembly whether or not to use tus.
@return {@link AssemblyResponse} the response received from the Transloadit server.
@throws RequestException if request to Transloadit server fails.
@throws LocalOpe... | [
"Submits",
"the",
"configured",
"assembly",
"to",
"Transloadit",
"for",
"processing",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Assembly.java#L155-L184 | train |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Assembly.java | Assembly.processTusFiles | protected void processTusFiles(String assemblyUrl) throws IOException, ProtocolException {
tusClient.setUploadCreationURL(new URL(getClient().getHostUrl() + "/resumable/files/"));
tusClient.enableResuming(tusURLStore);
for (Map.Entry<String, File> entry : files.entrySet()) {
process... | java | protected void processTusFiles(String assemblyUrl) throws IOException, ProtocolException {
tusClient.setUploadCreationURL(new URL(getClient().getHostUrl() + "/resumable/files/"));
tusClient.enableResuming(tusURLStore);
for (Map.Entry<String, File> entry : files.entrySet()) {
process... | [
"protected",
"void",
"processTusFiles",
"(",
"String",
"assemblyUrl",
")",
"throws",
"IOException",
",",
"ProtocolException",
"{",
"tusClient",
".",
"setUploadCreationURL",
"(",
"new",
"URL",
"(",
"getClient",
"(",
")",
".",
"getHostUrl",
"(",
")",
"+",
"\"/resu... | Prepares all files added for tus uploads.
@param assemblyUrl the assembly url affiliated with the tus upload.
@throws IOException when there's a failure with file retrieval.
@throws ProtocolException when there's a failure with tus upload. | [
"Prepares",
"all",
"files",
"added",
"for",
"tus",
"uploads",
"."
] | 9326c540a66f77b3d907d0b2c05bff1145ca14f7 | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Assembly.java#L209-L220 | train |
openEHR/adl2-core | adl2core-common/src/main/java/org/openehr/adl/util/AdlUtils.java | AdlUtils.makeClone | @SuppressWarnings("unchecked")
public static <T extends Serializable> T makeClone(T from) {
return (T) SerializationUtils.clone(from);
} | java | @SuppressWarnings("unchecked")
public static <T extends Serializable> T makeClone(T from) {
return (T) SerializationUtils.clone(from);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"makeClone",
"(",
"T",
"from",
")",
"{",
"return",
"(",
"T",
")",
"SerializationUtils",
".",
"clone",
"(",
"from",
")",
";",
"}"
] | Creates a clone using java serialization
@param from Object to be cloned
@param <T> type of the cloned object
@return Clone of the object | [
"Creates",
"a",
"clone",
"using",
"java",
"serialization"
] | dd5c1c0fe7ef5e43fbfaf6a0389990ba5380e22c | https://github.com/openEHR/adl2-core/blob/dd5c1c0fe7ef5e43fbfaf6a0389990ba5380e22c/adl2core-common/src/main/java/org/openehr/adl/util/AdlUtils.java#L96-L99 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.checkResult | private static int checkResult(int result)
{
if (exceptionsEnabled && result !=
cudnnStatus.CUDNN_STATUS_SUCCESS)
{
throw new CudaException(cudnnStatus.stringFor(result));
}
return result;
} | java | private static int checkResult(int result)
{
if (exceptionsEnabled && result !=
cudnnStatus.CUDNN_STATUS_SUCCESS)
{
throw new CudaException(cudnnStatus.stringFor(result));
}
return result;
} | [
"private",
"static",
"int",
"checkResult",
"(",
"int",
"result",
")",
"{",
"if",
"(",
"exceptionsEnabled",
"&&",
"result",
"!=",
"cudnnStatus",
".",
"CUDNN_STATUS_SUCCESS",
")",
"{",
"throw",
"new",
"CudaException",
"(",
"cudnnStatus",
".",
"stringFor",
"(",
"... | If the given result is not cudnnStatus.CUDNN_STATUS_SUCCESS
and exceptions have been enabled, this method will throw a
CudaException with an error message that corresponds to the
given result code. Otherwise, the given result is simply
returned.
@param result The result to check
@return The result that was given as th... | [
"If",
"the",
"given",
"result",
"is",
"not",
"cudnnStatus",
".",
"CUDNN_STATUS_SUCCESS",
"and",
"exceptions",
"have",
"been",
"enabled",
"this",
"method",
"will",
"throw",
"a",
"CudaException",
"with",
"an",
"error",
"message",
"that",
"corresponds",
"to",
"the"... | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L134-L142 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnSetTensor4dDescriptorEx | public static int cudnnSetTensor4dDescriptorEx(
cudnnTensorDescriptor tensorDesc,
int dataType, /** image data type */
int n, /** number of inputs (batch size) */
int c, /** number of input feature maps */
int h, /** height of input section */
int w, /** width of input s... | java | public static int cudnnSetTensor4dDescriptorEx(
cudnnTensorDescriptor tensorDesc,
int dataType, /** image data type */
int n, /** number of inputs (batch size) */
int c, /** number of input feature maps */
int h, /** height of input section */
int w, /** width of input s... | [
"public",
"static",
"int",
"cudnnSetTensor4dDescriptorEx",
"(",
"cudnnTensorDescriptor",
"tensorDesc",
",",
"int",
"dataType",
",",
"/** image data type */",
"int",
"n",
",",
"/** number of inputs (batch size) */",
"int",
"c",
",",
"/** number of input feature maps */",
"int"... | width of input section | [
"width",
"of",
"input",
"section"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L285-L298 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnOpTensor | public static int cudnnOpTensor(
cudnnHandle handle,
cudnnOpTensorDescriptor opTensorDesc,
Pointer alpha1,
cudnnTensorDescriptor aDesc,
Pointer A,
Pointer alpha2,
cudnnTensorDescriptor bDesc,
Pointer B,
Pointer beta,
cudnnTensorDes... | java | public static int cudnnOpTensor(
cudnnHandle handle,
cudnnOpTensorDescriptor opTensorDesc,
Pointer alpha1,
cudnnTensorDescriptor aDesc,
Pointer A,
Pointer alpha2,
cudnnTensorDescriptor bDesc,
Pointer B,
Pointer beta,
cudnnTensorDes... | [
"public",
"static",
"int",
"cudnnOpTensor",
"(",
"cudnnHandle",
"handle",
",",
"cudnnOpTensorDescriptor",
"opTensorDesc",
",",
"Pointer",
"alpha1",
",",
"cudnnTensorDescriptor",
"aDesc",
",",
"Pointer",
"A",
",",
"Pointer",
"alpha2",
",",
"cudnnTensorDescriptor",
"bDe... | B tensor is ignored for CUDNN_OP_TENSOR_SQRT, CUDNN_OP_TENSOR_NOT. | [
"B",
"tensor",
"is",
"ignored",
"for",
"CUDNN_OP_TENSOR_SQRT",
"CUDNN_OP_TENSOR_NOT",
"."
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L532-L546 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetReductionIndicesSize | public static int cudnnGetReductionIndicesSize(
cudnnHandle handle,
cudnnReduceTensorDescriptor reduceTensorDesc,
cudnnTensorDescriptor aDesc,
cudnnTensorDescriptor cDesc,
long[] sizeInBytes)
{
return checkResult(cudnnGetReductionIndicesSizeNative(handle, reduceTe... | java | public static int cudnnGetReductionIndicesSize(
cudnnHandle handle,
cudnnReduceTensorDescriptor reduceTensorDesc,
cudnnTensorDescriptor aDesc,
cudnnTensorDescriptor cDesc,
long[] sizeInBytes)
{
return checkResult(cudnnGetReductionIndicesSizeNative(handle, reduceTe... | [
"public",
"static",
"int",
"cudnnGetReductionIndicesSize",
"(",
"cudnnHandle",
"handle",
",",
"cudnnReduceTensorDescriptor",
"reduceTensorDesc",
",",
"cudnnTensorDescriptor",
"aDesc",
",",
"cudnnTensorDescriptor",
"cDesc",
",",
"long",
"[",
"]",
"sizeInBytes",
")",
"{",
... | Helper function to return the minimum size of the index space to be passed to the reduction given the input and
output tensors | [
"Helper",
"function",
"to",
"return",
"the",
"minimum",
"size",
"of",
"the",
"index",
"space",
"to",
"be",
"passed",
"to",
"the",
"reduction",
"given",
"the",
"input",
"and",
"output",
"tensors"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L619-L627 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetReductionWorkspaceSize | public static int cudnnGetReductionWorkspaceSize(
cudnnHandle handle,
cudnnReduceTensorDescriptor reduceTensorDesc,
cudnnTensorDescriptor aDesc,
cudnnTensorDescriptor cDesc,
long[] sizeInBytes)
{
return checkResult(cudnnGetReductionWorkspaceSizeNative(handle, redu... | java | public static int cudnnGetReductionWorkspaceSize(
cudnnHandle handle,
cudnnReduceTensorDescriptor reduceTensorDesc,
cudnnTensorDescriptor aDesc,
cudnnTensorDescriptor cDesc,
long[] sizeInBytes)
{
return checkResult(cudnnGetReductionWorkspaceSizeNative(handle, redu... | [
"public",
"static",
"int",
"cudnnGetReductionWorkspaceSize",
"(",
"cudnnHandle",
"handle",
",",
"cudnnReduceTensorDescriptor",
"reduceTensorDesc",
",",
"cudnnTensorDescriptor",
"aDesc",
",",
"cudnnTensorDescriptor",
"cDesc",
",",
"long",
"[",
"]",
"sizeInBytes",
")",
"{",... | Helper function to return the minimum size of the workspace to be passed to the reduction given the input and output
tensors | [
"Helper",
"function",
"to",
"return",
"the",
"minimum",
"size",
"of",
"the",
"workspace",
"to",
"be",
"passed",
"to",
"the",
"reduction",
"given",
"the",
"input",
"and",
"output",
"tensors"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L638-L646 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnReduceTensor | public static int cudnnReduceTensor(
cudnnHandle handle,
cudnnReduceTensorDescriptor reduceTensorDesc,
Pointer indices,
long indicesSizeInBytes,
Pointer workspace,
long workspaceSizeInBytes,
Pointer alpha,
cudnnTensorDescriptor aDesc,
Point... | java | public static int cudnnReduceTensor(
cudnnHandle handle,
cudnnReduceTensorDescriptor reduceTensorDesc,
Pointer indices,
long indicesSizeInBytes,
Pointer workspace,
long workspaceSizeInBytes,
Pointer alpha,
cudnnTensorDescriptor aDesc,
Point... | [
"public",
"static",
"int",
"cudnnReduceTensor",
"(",
"cudnnHandle",
"handle",
",",
"cudnnReduceTensorDescriptor",
"reduceTensorDesc",
",",
"Pointer",
"indices",
",",
"long",
"indicesSizeInBytes",
",",
"Pointer",
"workspace",
",",
"long",
"workspaceSizeInBytes",
",",
"Po... | The indices space is ignored for reduce ops other than min or max. | [
"The",
"indices",
"space",
"is",
"ignored",
"for",
"reduce",
"ops",
"other",
"than",
"min",
"or",
"max",
"."
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L658-L673 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetConvolutionNdDescriptor | public static int cudnnGetConvolutionNdDescriptor(
cudnnConvolutionDescriptor convDesc,
int arrayLengthRequested,
int[] arrayLength,
int[] padA,
int[] strideA,
int[] dilationA,
int[] mode,
int[] computeType)/** convolution data type */
{
... | java | public static int cudnnGetConvolutionNdDescriptor(
cudnnConvolutionDescriptor convDesc,
int arrayLengthRequested,
int[] arrayLength,
int[] padA,
int[] strideA,
int[] dilationA,
int[] mode,
int[] computeType)/** convolution data type */
{
... | [
"public",
"static",
"int",
"cudnnGetConvolutionNdDescriptor",
"(",
"cudnnConvolutionDescriptor",
"convDesc",
",",
"int",
"arrayLengthRequested",
",",
"int",
"[",
"]",
"arrayLength",
",",
"int",
"[",
"]",
"padA",
",",
"int",
"[",
"]",
"strideA",
",",
"int",
"[",
... | convolution data type | [
"convolution",
"data",
"type"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L965-L976 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnConvolutionForward | public static int cudnnConvolutionForward(
cudnnHandle handle,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
cudnnFilterDescriptor wDesc,
Pointer w,
cudnnConvolutionDescriptor convDesc,
int algo,
Pointer workSpace,
long wo... | java | public static int cudnnConvolutionForward(
cudnnHandle handle,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
cudnnFilterDescriptor wDesc,
Pointer w,
cudnnConvolutionDescriptor convDesc,
int algo,
Pointer workSpace,
long wo... | [
"public",
"static",
"int",
"cudnnConvolutionForward",
"(",
"cudnnHandle",
"handle",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"xDesc",
",",
"Pointer",
"x",
",",
"cudnnFilterDescriptor",
"wDesc",
",",
"Pointer",
"w",
",",
"cudnnConvolutionDescriptor",
"con... | Function to perform the forward pass for batch convolution | [
"Function",
"to",
"perform",
"the",
"forward",
"pass",
"for",
"batch",
"convolution"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1156-L1172 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnConvolutionBackwardBias | public static int cudnnConvolutionBackwardBias(
cudnnHandle handle,
Pointer alpha,
cudnnTensorDescriptor dyDesc,
Pointer dy,
Pointer beta,
cudnnTensorDescriptor dbDesc,
Pointer db)
{
return checkResult(cudnnConvolutionBackwardBiasNative(handle, a... | java | public static int cudnnConvolutionBackwardBias(
cudnnHandle handle,
Pointer alpha,
cudnnTensorDescriptor dyDesc,
Pointer dy,
Pointer beta,
cudnnTensorDescriptor dbDesc,
Pointer db)
{
return checkResult(cudnnConvolutionBackwardBiasNative(handle, a... | [
"public",
"static",
"int",
"cudnnConvolutionBackwardBias",
"(",
"cudnnHandle",
"handle",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"dyDesc",
",",
"Pointer",
"dy",
",",
"Pointer",
"beta",
",",
"cudnnTensorDescriptor",
"dbDesc",
",",
"Pointer",
"db",
")",... | Function to compute the bias gradient for batch convolution | [
"Function",
"to",
"compute",
"the",
"bias",
"gradient",
"for",
"batch",
"convolution"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1234-L1244 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnSoftmaxForward | public static int cudnnSoftmaxForward(
cudnnHandle handle,
int algo,
int mode,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return checkResult(cudnnSoftmaxForward... | java | public static int cudnnSoftmaxForward(
cudnnHandle handle,
int algo,
int mode,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return checkResult(cudnnSoftmaxForward... | [
"public",
"static",
"int",
"cudnnSoftmaxForward",
"(",
"cudnnHandle",
"handle",
",",
"int",
"algo",
",",
"int",
"mode",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"xDesc",
",",
"Pointer",
"x",
",",
"Pointer",
"beta",
",",
"cudnnTensorDescriptor",
"yD... | Function to perform forward softmax | [
"Function",
"to",
"perform",
"forward",
"softmax"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1615-L1627 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnSoftmaxBackward | public static int cudnnSoftmaxBackward(
cudnnHandle handle,
int algo,
int mode,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
Pointer beta,
cudnnTensorDescriptor dxDesc,
P... | java | public static int cudnnSoftmaxBackward(
cudnnHandle handle,
int algo,
int mode,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
Pointer beta,
cudnnTensorDescriptor dxDesc,
P... | [
"public",
"static",
"int",
"cudnnSoftmaxBackward",
"(",
"cudnnHandle",
"handle",
",",
"int",
"algo",
",",
"int",
"mode",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"yDesc",
",",
"Pointer",
"y",
",",
"cudnnTensorDescriptor",
"dyDesc",
",",
"Pointer",
... | Function to perform backward softmax | [
"Function",
"to",
"perform",
"backward",
"softmax"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1641-L1655 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnPoolingForward | public static int cudnnPoolingForward(
cudnnHandle handle,
cudnnPoolingDescriptor poolingDesc,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return checkResult(cudnnPooling... | java | public static int cudnnPoolingForward(
cudnnHandle handle,
cudnnPoolingDescriptor poolingDesc,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return checkResult(cudnnPooling... | [
"public",
"static",
"int",
"cudnnPoolingForward",
"(",
"cudnnHandle",
"handle",
",",
"cudnnPoolingDescriptor",
"poolingDesc",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"xDesc",
",",
"Pointer",
"x",
",",
"Pointer",
"beta",
",",
"cudnnTensorDescriptor",
"yD... | Function to perform forward pooling | [
"Function",
"to",
"perform",
"forward",
"pooling"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1820-L1831 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnPoolingBackward | public static int cudnnPoolingBackward(
cudnnHandle handle,
cudnnPoolingDescriptor poolingDesc,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
cudnnTensorDescriptor xDesc,
Pointer x,
... | java | public static int cudnnPoolingBackward(
cudnnHandle handle,
cudnnPoolingDescriptor poolingDesc,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
cudnnTensorDescriptor xDesc,
Pointer x,
... | [
"public",
"static",
"int",
"cudnnPoolingBackward",
"(",
"cudnnHandle",
"handle",
",",
"cudnnPoolingDescriptor",
"poolingDesc",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"yDesc",
",",
"Pointer",
"y",
",",
"cudnnTensorDescriptor",
"dyDesc",
",",
"Pointer",
... | Function to perform backward pooling | [
"Function",
"to",
"perform",
"backward",
"pooling"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1844-L1859 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetActivationDescriptor | public static int cudnnGetActivationDescriptor(
cudnnActivationDescriptor activationDesc,
int[] mode,
int[] reluNanOpt,
double[] coef)/** ceiling for clipped RELU, alpha for ELU */
{
return checkResult(cudnnGetActivationDescriptorNative(activationDesc, mode, reluNanOpt, co... | java | public static int cudnnGetActivationDescriptor(
cudnnActivationDescriptor activationDesc,
int[] mode,
int[] reluNanOpt,
double[] coef)/** ceiling for clipped RELU, alpha for ELU */
{
return checkResult(cudnnGetActivationDescriptorNative(activationDesc, mode, reluNanOpt, co... | [
"public",
"static",
"int",
"cudnnGetActivationDescriptor",
"(",
"cudnnActivationDescriptor",
"activationDesc",
",",
"int",
"[",
"]",
"mode",
",",
"int",
"[",
"]",
"reluNanOpt",
",",
"double",
"[",
"]",
"coef",
")",
"/** ceiling for clipped RELU, alpha for ELU */",
"{"... | ceiling for clipped RELU, alpha for ELU | [
"ceiling",
"for",
"clipped",
"RELU",
"alpha",
"for",
"ELU"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1900-L1907 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnActivationForward | public static int cudnnActivationForward(
cudnnHandle handle,
cudnnActivationDescriptor activationDesc,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return checkResult(cud... | java | public static int cudnnActivationForward(
cudnnHandle handle,
cudnnActivationDescriptor activationDesc,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return checkResult(cud... | [
"public",
"static",
"int",
"cudnnActivationForward",
"(",
"cudnnHandle",
"handle",
",",
"cudnnActivationDescriptor",
"activationDesc",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"xDesc",
",",
"Pointer",
"x",
",",
"Pointer",
"beta",
",",
"cudnnTensorDescripto... | Function to perform forward activation | [
"Function",
"to",
"perform",
"forward",
"activation"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1925-L1936 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnActivationBackward | public static int cudnnActivationBackward(
cudnnHandle handle,
cudnnActivationDescriptor activationDesc,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
cudnnTensorDescriptor xDesc,
Pointer x... | java | public static int cudnnActivationBackward(
cudnnHandle handle,
cudnnActivationDescriptor activationDesc,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
cudnnTensorDescriptor xDesc,
Pointer x... | [
"public",
"static",
"int",
"cudnnActivationBackward",
"(",
"cudnnHandle",
"handle",
",",
"cudnnActivationDescriptor",
"activationDesc",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"yDesc",
",",
"Pointer",
"y",
",",
"cudnnTensorDescriptor",
"dyDesc",
",",
"Poi... | Function to perform backward activation | [
"Function",
"to",
"perform",
"backward",
"activation"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L1949-L1964 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnLRNCrossChannelForward | public static int cudnnLRNCrossChannelForward(
cudnnHandle handle,
cudnnLRNDescriptor normDesc,
int lrnMode,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return c... | java | public static int cudnnLRNCrossChannelForward(
cudnnHandle handle,
cudnnLRNDescriptor normDesc,
int lrnMode,
Pointer alpha,
cudnnTensorDescriptor xDesc,
Pointer x,
Pointer beta,
cudnnTensorDescriptor yDesc,
Pointer y)
{
return c... | [
"public",
"static",
"int",
"cudnnLRNCrossChannelForward",
"(",
"cudnnHandle",
"handle",
",",
"cudnnLRNDescriptor",
"normDesc",
",",
"int",
"lrnMode",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"xDesc",
",",
"Pointer",
"x",
",",
"Pointer",
"beta",
",",
... | LRN cross-channel forward computation. Double parameters cast to tensor data type | [
"LRN",
"cross",
"-",
"channel",
"forward",
"computation",
".",
"Double",
"parameters",
"cast",
"to",
"tensor",
"data",
"type"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L2054-L2066 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnLRNCrossChannelBackward | public static int cudnnLRNCrossChannelBackward(
cudnnHandle handle,
cudnnLRNDescriptor normDesc,
int lrnMode,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
cudnnTensorDescriptor xDesc,
... | java | public static int cudnnLRNCrossChannelBackward(
cudnnHandle handle,
cudnnLRNDescriptor normDesc,
int lrnMode,
Pointer alpha,
cudnnTensorDescriptor yDesc,
Pointer y,
cudnnTensorDescriptor dyDesc,
Pointer dy,
cudnnTensorDescriptor xDesc,
... | [
"public",
"static",
"int",
"cudnnLRNCrossChannelBackward",
"(",
"cudnnHandle",
"handle",
",",
"cudnnLRNDescriptor",
"normDesc",
",",
"int",
"lrnMode",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"yDesc",
",",
"Pointer",
"y",
",",
"cudnnTensorDescriptor",
"d... | LRN cross-channel backward computation. Double parameters cast to tensor data type | [
"LRN",
"cross",
"-",
"channel",
"backward",
"computation",
".",
"Double",
"parameters",
"cast",
"to",
"tensor",
"data",
"type"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L2080-L2096 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnBatchNormalizationBackward | public static int cudnnBatchNormalizationBackward(
cudnnHandle handle,
int mode,
Pointer alphaDataDiff,
Pointer betaDataDiff,
Pointer alphaParamDiff,
Pointer betaParamDiff,
cudnnTensorDescriptor xDesc, /** same desc for x, dx, dy */
Pointer x,
... | java | public static int cudnnBatchNormalizationBackward(
cudnnHandle handle,
int mode,
Pointer alphaDataDiff,
Pointer betaDataDiff,
Pointer alphaParamDiff,
Pointer betaParamDiff,
cudnnTensorDescriptor xDesc, /** same desc for x, dx, dy */
Pointer x,
... | [
"public",
"static",
"int",
"cudnnBatchNormalizationBackward",
"(",
"cudnnHandle",
"handle",
",",
"int",
"mode",
",",
"Pointer",
"alphaDataDiff",
",",
"Pointer",
"betaDataDiff",
",",
"Pointer",
"alphaParamDiff",
",",
"Pointer",
"betaParamDiff",
",",
"cudnnTensorDescripto... | Performs backward pass of Batch Normalization layer. Returns x gradient,
bnScale gradient and bnBias gradient | [
"Performs",
"backward",
"pass",
"of",
"Batch",
"Normalization",
"layer",
".",
"Returns",
"x",
"gradient",
"bnScale",
"gradient",
"and",
"bnBias",
"gradient"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L2487-L2514 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnRestoreDropoutDescriptor | public static int cudnnRestoreDropoutDescriptor(
cudnnDropoutDescriptor dropoutDesc,
cudnnHandle handle,
float dropout,
Pointer states,
long stateSizeInBytes,
long seed)
{
return checkResult(cudnnRestoreDropoutDescriptorNative(dropoutDesc, handle, dropout... | java | public static int cudnnRestoreDropoutDescriptor(
cudnnDropoutDescriptor dropoutDesc,
cudnnHandle handle,
float dropout,
Pointer states,
long stateSizeInBytes,
long seed)
{
return checkResult(cudnnRestoreDropoutDescriptorNative(dropoutDesc, handle, dropout... | [
"public",
"static",
"int",
"cudnnRestoreDropoutDescriptor",
"(",
"cudnnDropoutDescriptor",
"dropoutDesc",
",",
"cudnnHandle",
"handle",
",",
"float",
"dropout",
",",
"Pointer",
"states",
",",
"long",
"stateSizeInBytes",
",",
"long",
"seed",
")",
"{",
"return",
"chec... | Restores the dropout descriptor to a previously saved-off state | [
"Restores",
"the",
"dropout",
"descriptor",
"to",
"a",
"previously",
"saved",
"-",
"off",
"state"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L2802-L2811 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnCreatePersistentRNNPlan | public static int cudnnCreatePersistentRNNPlan(
cudnnRNNDescriptor rnnDesc,
int minibatch,
int dataType,
cudnnPersistentRNNPlan plan)
{
return checkResult(cudnnCreatePersistentRNNPlanNative(rnnDesc, minibatch, dataType, plan));
} | java | public static int cudnnCreatePersistentRNNPlan(
cudnnRNNDescriptor rnnDesc,
int minibatch,
int dataType,
cudnnPersistentRNNPlan plan)
{
return checkResult(cudnnCreatePersistentRNNPlanNative(rnnDesc, minibatch, dataType, plan));
} | [
"public",
"static",
"int",
"cudnnCreatePersistentRNNPlan",
"(",
"cudnnRNNDescriptor",
"rnnDesc",
",",
"int",
"minibatch",
",",
"int",
"dataType",
",",
"cudnnPersistentRNNPlan",
"plan",
")",
"{",
"return",
"checkResult",
"(",
"cudnnCreatePersistentRNNPlanNative",
"(",
"r... | Expensive. Creates the plan for the specific settings. | [
"Expensive",
".",
"Creates",
"the",
"plan",
"for",
"the",
"specific",
"settings",
"."
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L3179-L3186 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetRNNWorkspaceSize | public static int cudnnGetRNNWorkspaceSize(
cudnnHandle handle,
cudnnRNNDescriptor rnnDesc,
int seqLength,
cudnnTensorDescriptor[] xDesc,
long[] sizeInBytes)
{
return checkResult(cudnnGetRNNWorkspaceSizeNative(handle, rnnDesc, seqLength, xDesc, sizeInBytes));
... | java | public static int cudnnGetRNNWorkspaceSize(
cudnnHandle handle,
cudnnRNNDescriptor rnnDesc,
int seqLength,
cudnnTensorDescriptor[] xDesc,
long[] sizeInBytes)
{
return checkResult(cudnnGetRNNWorkspaceSizeNative(handle, rnnDesc, seqLength, xDesc, sizeInBytes));
... | [
"public",
"static",
"int",
"cudnnGetRNNWorkspaceSize",
"(",
"cudnnHandle",
"handle",
",",
"cudnnRNNDescriptor",
"rnnDesc",
",",
"int",
"seqLength",
",",
"cudnnTensorDescriptor",
"[",
"]",
"xDesc",
",",
"long",
"[",
"]",
"sizeInBytes",
")",
"{",
"return",
"checkRes... | dataType in weight descriptors and input descriptors is used to describe storage | [
"dataType",
"in",
"weight",
"descriptors",
"and",
"input",
"descriptors",
"is",
"used",
"to",
"describe",
"storage"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L3336-L3344 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnCTCLoss | public static int cudnnCTCLoss(
cudnnHandle handle,
cudnnTensorDescriptor probsDesc, /** Tensor descriptor for probabilities, the dimensions are T,N,A (T is the timing steps, N is the
mini batch size, A is the alphabet size) */
Pointer probs, /** probabilities after s... | java | public static int cudnnCTCLoss(
cudnnHandle handle,
cudnnTensorDescriptor probsDesc, /** Tensor descriptor for probabilities, the dimensions are T,N,A (T is the timing steps, N is the
mini batch size, A is the alphabet size) */
Pointer probs, /** probabilities after s... | [
"public",
"static",
"int",
"cudnnCTCLoss",
"(",
"cudnnHandle",
"handle",
",",
"cudnnTensorDescriptor",
"probsDesc",
",",
"/** Tensor descriptor for probabilities, the dimensions are T,N,A (T is the timing steps, N is the\n mini batch size, A is the alphabet size) */",... | return the ctc costs and gradients, given the probabilities and labels | [
"return",
"the",
"ctc",
"costs",
"and",
"gradients",
"given",
"the",
"probabilities",
"and",
"labels"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L3673-L3690 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetCTCLossWorkspaceSize | public static int cudnnGetCTCLossWorkspaceSize(
cudnnHandle handle,
cudnnTensorDescriptor probsDesc, /** Tensor descriptor for probabilities, the dimensions are T,N,A (T is the
timing steps, N is the mini batch size, A is the alphabet size) */
cud... | java | public static int cudnnGetCTCLossWorkspaceSize(
cudnnHandle handle,
cudnnTensorDescriptor probsDesc, /** Tensor descriptor for probabilities, the dimensions are T,N,A (T is the
timing steps, N is the mini batch size, A is the alphabet size) */
cud... | [
"public",
"static",
"int",
"cudnnGetCTCLossWorkspaceSize",
"(",
"cudnnHandle",
"handle",
",",
"cudnnTensorDescriptor",
"probsDesc",
",",
"/** Tensor descriptor for probabilities, the dimensions are T,N,A (T is the\n timing steps, N is the mini bat... | return the workspace size needed for ctc | [
"return",
"the",
"workspace",
"size",
"needed",
"for",
"ctc"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L3709-L3724 | train |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetRNNDataDescriptor | public static int cudnnGetRNNDataDescriptor(
cudnnRNNDataDescriptor RNNDataDesc,
int[] dataType,
int[] layout,
int[] maxSeqLength,
int[] batchSize,
int[] vectorSize,
int arrayLengthRequested,
int[] seqLengthArray,
Pointer paddingFill)
{... | java | public static int cudnnGetRNNDataDescriptor(
cudnnRNNDataDescriptor RNNDataDesc,
int[] dataType,
int[] layout,
int[] maxSeqLength,
int[] batchSize,
int[] vectorSize,
int arrayLengthRequested,
int[] seqLengthArray,
Pointer paddingFill)
{... | [
"public",
"static",
"int",
"cudnnGetRNNDataDescriptor",
"(",
"cudnnRNNDataDescriptor",
"RNNDataDesc",
",",
"int",
"[",
"]",
"dataType",
",",
"int",
"[",
"]",
"layout",
",",
"int",
"[",
"]",
"maxSeqLength",
",",
"int",
"[",
"]",
"batchSize",
",",
"int",
"[",
... | symbol for filling padding position in output | [
"symbol",
"for",
"filling",
"padding",
"position",
"in",
"output"
] | ce71f2fc02817cecace51a80e6db5f0c7f10cffc | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L4017-L4029 | train |
resource4j/resource4j | core/src/main/java/com/github/resource4j/values/ResourceValues.java | ResourceValues.ofNullable | public static <T> OptionalValue<T> ofNullable(T value) {
return new GenericOptionalValue<T>(RUNTIME_SOURCE, DEFAULT_KEY, value);
} | java | public static <T> OptionalValue<T> ofNullable(T value) {
return new GenericOptionalValue<T>(RUNTIME_SOURCE, DEFAULT_KEY, value);
} | [
"public",
"static",
"<",
"T",
">",
"OptionalValue",
"<",
"T",
">",
"ofNullable",
"(",
"T",
"value",
")",
"{",
"return",
"new",
"GenericOptionalValue",
"<",
"T",
">",
"(",
"RUNTIME_SOURCE",
",",
"DEFAULT_KEY",
",",
"value",
")",
";",
"}"
] | Returns new instance of OptionalValue with given value
@param value wrapped object
@param <T> type of the wrapped object
@return given object wrapped in OptionalValue | [
"Returns",
"new",
"instance",
"of",
"OptionalValue",
"with",
"given",
"value"
] | 6100443b9a78edc8a5867e1e075f7ee12e6698ca | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/core/src/main/java/com/github/resource4j/values/ResourceValues.java#L33-L35 | train |
resource4j/resource4j | core/src/main/java/com/github/resource4j/values/ResourceValues.java | ResourceValues.ofNullable | public static <T> OptionalValue<T> ofNullable(ResourceKey key, T value) {
return new GenericOptionalValue<T>(RUNTIME_SOURCE, key, value);
} | java | public static <T> OptionalValue<T> ofNullable(ResourceKey key, T value) {
return new GenericOptionalValue<T>(RUNTIME_SOURCE, key, value);
} | [
"public",
"static",
"<",
"T",
">",
"OptionalValue",
"<",
"T",
">",
"ofNullable",
"(",
"ResourceKey",
"key",
",",
"T",
"value",
")",
"{",
"return",
"new",
"GenericOptionalValue",
"<",
"T",
">",
"(",
"RUNTIME_SOURCE",
",",
"key",
",",
"value",
")",
";",
... | Returns new instance of OptionalValue with given key and value
@param key resource key of the created value
@param value wrapped object
@param <T> type of the wrapped object
@return given object wrapped in OptionalValue with given key | [
"Returns",
"new",
"instance",
"of",
"OptionalValue",
"with",
"given",
"key",
"and",
"value"
] | 6100443b9a78edc8a5867e1e075f7ee12e6698ca | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/core/src/main/java/com/github/resource4j/values/ResourceValues.java#L44-L46 | train |
taimos/dvalin | daemon/src/main/java/de/taimos/daemon/DaemonStarter.java | DaemonStarter.stopService | public static void stopService() {
DaemonStarter.currentPhase.set(LifecyclePhase.STOPPING);
final CountDownLatch cdl = new CountDownLatch(1);
Executors.newSingleThreadExecutor().execute(() -> {
DaemonStarter.getLifecycleListener().stopping();
DaemonStarter.daemon.stop();
... | java | public static void stopService() {
DaemonStarter.currentPhase.set(LifecyclePhase.STOPPING);
final CountDownLatch cdl = new CountDownLatch(1);
Executors.newSingleThreadExecutor().execute(() -> {
DaemonStarter.getLifecycleListener().stopping();
DaemonStarter.daemon.stop();
... | [
"public",
"static",
"void",
"stopService",
"(",
")",
"{",
"DaemonStarter",
".",
"currentPhase",
".",
"set",
"(",
"LifecyclePhase",
".",
"STOPPING",
")",
";",
"final",
"CountDownLatch",
"cdl",
"=",
"new",
"CountDownLatch",
"(",
"1",
")",
";",
"Executors",
"."... | Stop the service and end the program | [
"Stop",
"the",
"service",
"and",
"end",
"the",
"program"
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/daemon/src/main/java/de/taimos/daemon/DaemonStarter.java#L307-L327 | train |
taimos/dvalin | daemon/src/main/java/de/taimos/daemon/DaemonStarter.java | DaemonStarter.handleSignals | private static void handleSignals() {
if (DaemonStarter.isRunMode()) {
try {
// handle SIGHUP to prevent process to get killed when exiting the tty
Signal.handle(new Signal("HUP"), arg0 -> {
// Nothing to do here
System.out.prin... | java | private static void handleSignals() {
if (DaemonStarter.isRunMode()) {
try {
// handle SIGHUP to prevent process to get killed when exiting the tty
Signal.handle(new Signal("HUP"), arg0 -> {
// Nothing to do here
System.out.prin... | [
"private",
"static",
"void",
"handleSignals",
"(",
")",
"{",
"if",
"(",
"DaemonStarter",
".",
"isRunMode",
"(",
")",
")",
"{",
"try",
"{",
"// handle SIGHUP to prevent process to get killed when exiting the tty",
"Signal",
".",
"handle",
"(",
"new",
"Signal",
"(",
... | I KNOW WHAT I AM DOING | [
"I",
"KNOW",
"WHAT",
"I",
"AM",
"DOING"
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/daemon/src/main/java/de/taimos/daemon/DaemonStarter.java#L330-L372 | train |
taimos/dvalin | daemon/src/main/java/de/taimos/daemon/DaemonStarter.java | DaemonStarter.abortSystem | public static void abortSystem(final Throwable error) {
DaemonStarter.currentPhase.set(LifecyclePhase.ABORTING);
try {
DaemonStarter.getLifecycleListener().aborting();
} catch (Exception e) {
DaemonStarter.rlog.error("Custom abort failed", e);
}
if (error ... | java | public static void abortSystem(final Throwable error) {
DaemonStarter.currentPhase.set(LifecyclePhase.ABORTING);
try {
DaemonStarter.getLifecycleListener().aborting();
} catch (Exception e) {
DaemonStarter.rlog.error("Custom abort failed", e);
}
if (error ... | [
"public",
"static",
"void",
"abortSystem",
"(",
"final",
"Throwable",
"error",
")",
"{",
"DaemonStarter",
".",
"currentPhase",
".",
"set",
"(",
"LifecyclePhase",
".",
"ABORTING",
")",
";",
"try",
"{",
"DaemonStarter",
".",
"getLifecycleListener",
"(",
")",
"."... | Abort the daemon
@param error the error causing the abortion | [
"Abort",
"the",
"daemon"
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/daemon/src/main/java/de/taimos/daemon/DaemonStarter.java#L386-L401 | train |
taimos/dvalin | mongodb/src/main/java/de/taimos/dvalin/mongo/MongoDBInit.java | MongoDBInit.initDatabase | @PostConstruct
public void initDatabase() {
MongoDBInit.LOGGER.info("initializing MongoDB");
String dbName = System.getProperty("mongodb.name");
if (dbName == null) {
throw new RuntimeException("Missing database name; Set system property 'mongodb.name'");
}
MongoD... | java | @PostConstruct
public void initDatabase() {
MongoDBInit.LOGGER.info("initializing MongoDB");
String dbName = System.getProperty("mongodb.name");
if (dbName == null) {
throw new RuntimeException("Missing database name; Set system property 'mongodb.name'");
}
MongoD... | [
"@",
"PostConstruct",
"public",
"void",
"initDatabase",
"(",
")",
"{",
"MongoDBInit",
".",
"LOGGER",
".",
"info",
"(",
"\"initializing MongoDB\"",
")",
";",
"String",
"dbName",
"=",
"System",
".",
"getProperty",
"(",
"\"mongodb.name\"",
")",
";",
"if",
"(",
... | init database with demo data | [
"init",
"database",
"with",
"demo",
"data"
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/mongodb/src/main/java/de/taimos/dvalin/mongo/MongoDBInit.java#L67-L105 | train |
resource4j/resource4j | core/src/main/java/com/github/resource4j/resources/context/ResourceResolutionContext.java | ResourceResolutionContext.with | public static Map<String, Object> with(Object... params) {
Map<String, Object> map = new HashMap<>();
for (int i = 0; i < params.length; i++) {
map.put(String.valueOf(i), params[i]);
}
return map;
} | java | public static Map<String, Object> with(Object... params) {
Map<String, Object> map = new HashMap<>();
for (int i = 0; i < params.length; i++) {
map.put(String.valueOf(i), params[i]);
}
return map;
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"with",
"(",
"Object",
"...",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Convenience wrapper for message parameters
@param params
@return | [
"Convenience",
"wrapper",
"for",
"message",
"parameters"
] | 6100443b9a78edc8a5867e1e075f7ee12e6698ca | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/core/src/main/java/com/github/resource4j/resources/context/ResourceResolutionContext.java#L46-L52 | train |
resource4j/resource4j | core/src/main/java/com/github/resource4j/resources/context/ResourceResolutionContext.java | ResourceResolutionContext.context | public static ResourceResolutionContext context(ResourceResolutionComponent[] components,
Map<String, Object> messageParams) {
return new ResourceResolutionContext(components, messageParams);
} | java | public static ResourceResolutionContext context(ResourceResolutionComponent[] components,
Map<String, Object> messageParams) {
return new ResourceResolutionContext(components, messageParams);
} | [
"public",
"static",
"ResourceResolutionContext",
"context",
"(",
"ResourceResolutionComponent",
"[",
"]",
"components",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"messageParams",
")",
"{",
"return",
"new",
"ResourceResolutionContext",
"(",
"components",
",",
"m... | Build resolution context in which message will be discovered and built
@param components resolution components, used to identify message bundle
@param messageParams message parameters will be substituted in message and used in pattern matching
@since 3.1
@return immutable resolution context instance for given parameter... | [
"Build",
"resolution",
"context",
"in",
"which",
"message",
"will",
"be",
"discovered",
"and",
"built"
] | 6100443b9a78edc8a5867e1e075f7ee12e6698ca | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/core/src/main/java/com/github/resource4j/resources/context/ResourceResolutionContext.java#L61-L64 | train |
cenobites/struts2-json-plugin | src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java | PackageBasedActionConfigBuilder.setFileProtocols | @Inject("struts.json.action.fileProtocols")
public void setFileProtocols(String fileProtocols) {
if (StringUtils.isNotBlank(fileProtocols)) {
this.fileProtocols = TextParseUtil.commaDelimitedStringToSet(fileProtocols);
}
} | java | @Inject("struts.json.action.fileProtocols")
public void setFileProtocols(String fileProtocols) {
if (StringUtils.isNotBlank(fileProtocols)) {
this.fileProtocols = TextParseUtil.commaDelimitedStringToSet(fileProtocols);
}
} | [
"@",
"Inject",
"(",
"\"struts.json.action.fileProtocols\"",
")",
"public",
"void",
"setFileProtocols",
"(",
"String",
"fileProtocols",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"fileProtocols",
")",
")",
"{",
"this",
".",
"fileProtocols",
"=",
... | File URLs whose protocol are in these list will be processed as jars
containing classes
@param fileProtocols
Comma separated list of file protocols that will be considered
as jar files and scanned | [
"File",
"URLs",
"whose",
"protocol",
"are",
"in",
"these",
"list",
"will",
"be",
"processed",
"as",
"jars",
"containing",
"classes"
] | 00f948942d85b6f696d46672332ff7b3942ecb1b | https://github.com/cenobites/struts2-json-plugin/blob/00f948942d85b6f696d46672332ff7b3942ecb1b/src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java#L122-L127 | train |
cenobites/struts2-json-plugin | src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java | PackageBasedActionConfigBuilder.cannotInstantiate | protected boolean cannotInstantiate(Class<?> actionClass) {
return actionClass.isAnnotation() || actionClass.isInterface() || actionClass.isEnum()
|| (actionClass.getModifiers() & Modifier.ABSTRACT) != 0 || actionClass.isAnonymousClass();
} | java | protected boolean cannotInstantiate(Class<?> actionClass) {
return actionClass.isAnnotation() || actionClass.isInterface() || actionClass.isEnum()
|| (actionClass.getModifiers() & Modifier.ABSTRACT) != 0 || actionClass.isAnonymousClass();
} | [
"protected",
"boolean",
"cannotInstantiate",
"(",
"Class",
"<",
"?",
">",
"actionClass",
")",
"{",
"return",
"actionClass",
".",
"isAnnotation",
"(",
")",
"||",
"actionClass",
".",
"isInterface",
"(",
")",
"||",
"actionClass",
".",
"isEnum",
"(",
")",
"||",
... | Interfaces, enums, annotations, and abstract classes cannot be
instantiated.
@param actionClass
class to check
@return returns true if the class cannot be instantiated or should be
ignored | [
"Interfaces",
"enums",
"annotations",
"and",
"abstract",
"classes",
"cannot",
"be",
"instantiated",
"."
] | 00f948942d85b6f696d46672332ff7b3942ecb1b | https://github.com/cenobites/struts2-json-plugin/blob/00f948942d85b6f696d46672332ff7b3942ecb1b/src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java#L337-L340 | train |
cenobites/struts2-json-plugin | src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java | PackageBasedActionConfigBuilder.checkExcludePackages | protected boolean checkExcludePackages(String classPackageName) {
if (excludePackages != null && excludePackages.length > 0) {
WildcardHelper wildcardHelper = new WildcardHelper();
// we really don't care about the results, just the boolean
Map<String, String> matchMap = new HashMap<String, String>();
f... | java | protected boolean checkExcludePackages(String classPackageName) {
if (excludePackages != null && excludePackages.length > 0) {
WildcardHelper wildcardHelper = new WildcardHelper();
// we really don't care about the results, just the boolean
Map<String, String> matchMap = new HashMap<String, String>();
f... | [
"protected",
"boolean",
"checkExcludePackages",
"(",
"String",
"classPackageName",
")",
"{",
"if",
"(",
"excludePackages",
"!=",
"null",
"&&",
"excludePackages",
".",
"length",
">",
"0",
")",
"{",
"WildcardHelper",
"wildcardHelper",
"=",
"new",
"WildcardHelper",
"... | Checks if provided class package is on the exclude list
@param classPackageName
name of class package
@return false if class package is on the {@link #excludePackages} list | [
"Checks",
"if",
"provided",
"class",
"package",
"is",
"on",
"the",
"exclude",
"list"
] | 00f948942d85b6f696d46672332ff7b3942ecb1b | https://github.com/cenobites/struts2-json-plugin/blob/00f948942d85b6f696d46672332ff7b3942ecb1b/src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java#L397-L412 | train |
cenobites/struts2-json-plugin | src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java | PackageBasedActionConfigBuilder.checkActionPackages | protected boolean checkActionPackages(String classPackageName) {
if (actionPackages != null) {
for (String packageName : actionPackages) {
String strictPackageName = packageName + ".";
if (classPackageName.equals(packageName) || classPackageName.startsWith(strictPackageName))
return true;
}
}
r... | java | protected boolean checkActionPackages(String classPackageName) {
if (actionPackages != null) {
for (String packageName : actionPackages) {
String strictPackageName = packageName + ".";
if (classPackageName.equals(packageName) || classPackageName.startsWith(strictPackageName))
return true;
}
}
r... | [
"protected",
"boolean",
"checkActionPackages",
"(",
"String",
"classPackageName",
")",
"{",
"if",
"(",
"actionPackages",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"packageName",
":",
"actionPackages",
")",
"{",
"String",
"strictPackageName",
"=",
"packageName"... | Checks if class package match provided list of action packages
@param classPackageName
name of class package
@return true if class package is on the {@link #actionPackages} list | [
"Checks",
"if",
"class",
"package",
"match",
"provided",
"list",
"of",
"action",
"packages"
] | 00f948942d85b6f696d46672332ff7b3942ecb1b | https://github.com/cenobites/struts2-json-plugin/blob/00f948942d85b6f696d46672332ff7b3942ecb1b/src/main/java/es/cenobit/struts2/json/PackageBasedActionConfigBuilder.java#L421-L430 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.