id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,500 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/Tag.java | Tag.getTextDescription | public String getTextDescription(String encodedValue) {
if (forceDescription != null) {
return forceDescription;
}
String desc = null;
if (tagValueDescriptions.containsKey(encodedValue)) {
desc = tagValueDescriptions.get(encodedValue);
}
return desc;
} | java | public String getTextDescription(String encodedValue) {
if (forceDescription != null) {
return forceDescription;
}
String desc = null;
if (tagValueDescriptions.containsKey(encodedValue)) {
desc = tagValueDescriptions.get(encodedValue);
}
return desc;
} | [
"public",
"String",
"getTextDescription",
"(",
"String",
"encodedValue",
")",
"{",
"if",
"(",
"forceDescription",
"!=",
"null",
")",
"{",
"return",
"forceDescription",
";",
"}",
"String",
"desc",
"=",
"null",
";",
"if",
"(",
"tagValueDescriptions",
".",
"conta... | Gets the tag value description.
@param encodedValue the encoded value
@return the tag value description | [
"Gets",
"the",
"tag",
"value",
"description",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/Tag.java#L126-L135 |
11,501 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/TiffEPProfile.java | TiffEPProfile.checkForbiddenTag | private void checkForbiddenTag(IfdTags metadata, String tagName, String ext) {
int tagid = TiffTags.getTagId(tagName);
if (metadata.containsTagId(tagid)) {
validation.addErrorLoc("Forbidden tag for TiffEP found " + tagName, ext);
}
} | java | private void checkForbiddenTag(IfdTags metadata, String tagName, String ext) {
int tagid = TiffTags.getTagId(tagName);
if (metadata.containsTagId(tagid)) {
validation.addErrorLoc("Forbidden tag for TiffEP found " + tagName, ext);
}
} | [
"private",
"void",
"checkForbiddenTag",
"(",
"IfdTags",
"metadata",
",",
"String",
"tagName",
",",
"String",
"ext",
")",
"{",
"int",
"tagid",
"=",
"TiffTags",
".",
"getTagId",
"(",
"tagName",
")",
";",
"if",
"(",
"metadata",
".",
"containsTagId",
"(",
"tag... | Check a forbidden tag is not present.
@param metadata the metadata
@param tagName the tag name
@param ext string extension | [
"Check",
"a",
"forbidden",
"tag",
"is",
"not",
"present",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/TiffEPProfile.java#L372-L377 |
11,502 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/algo/SteepestDescent.java | SteepestDescent.searchStep | @Override
protected void searchStep() {
// get best valid move with positive delta
Move<? super SolutionType> move = getBestMove(
getNeighbourhood().getAllMoves(getCurrentSolution()), // generate all moves
true... | java | @Override
protected void searchStep() {
// get best valid move with positive delta
Move<? super SolutionType> move = getBestMove(
getNeighbourhood().getAllMoves(getCurrentSolution()), // generate all moves
true... | [
"@",
"Override",
"protected",
"void",
"searchStep",
"(",
")",
"{",
"// get best valid move with positive delta",
"Move",
"<",
"?",
"super",
"SolutionType",
">",
"move",
"=",
"getBestMove",
"(",
"getNeighbourhood",
"(",
")",
".",
"getAllMoves",
"(",
"getCurrentSoluti... | Investigates all neighbours of the current solution and adopts the best one as the new current solution,
if it is an improvement. If no improvement is found, the search is requested to stop and no further steps
will be performed.
@throws JamesRuntimeException if depending on malfunctioning components (problem, neighbo... | [
"Investigates",
"all",
"neighbours",
"of",
"the",
"current",
"solution",
"and",
"adopts",
"the",
"best",
"one",
"as",
"the",
"new",
"current",
"solution",
"if",
"it",
"is",
"an",
"improvement",
".",
"If",
"no",
"improvement",
"is",
"found",
"the",
"search",
... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/algo/SteepestDescent.java#L71-L85 |
11,503 | jboss/jboss-el-api_spec | src/main/java/javax/el/ELManager.java | ELManager.setELContext | public ELContext setELContext(ELContext context) {
ELContext prev = elContext;
elContext = new StandardELContext(context);
return prev;
} | java | public ELContext setELContext(ELContext context) {
ELContext prev = elContext;
elContext = new StandardELContext(context);
return prev;
} | [
"public",
"ELContext",
"setELContext",
"(",
"ELContext",
"context",
")",
"{",
"ELContext",
"prev",
"=",
"elContext",
";",
"elContext",
"=",
"new",
"StandardELContext",
"(",
"context",
")",
";",
"return",
"prev",
";",
"}"
] | Set the ELContext used for parsing and evaluating EL expressions.
The supplied ELContext will not be modified, except for the context
object map.
@param context The new ELContext.
@return The previous ELContext, null if none. | [
"Set",
"the",
"ELContext",
"used",
"for",
"parsing",
"and",
"evaluating",
"EL",
"expressions",
".",
"The",
"supplied",
"ELContext",
"will",
"not",
"be",
"modified",
"except",
"for",
"the",
"context",
"object",
"map",
"."
] | 4cef117cae3ccf9f76439845687a8d219ad2eb43 | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELManager.java#L85-L89 |
11,504 | jboss/jboss-el-api_spec | src/main/java/javax/el/ELManager.java | ELManager.mapFunction | public void mapFunction(String prefix, String function, Method meth) {
getELContext().getFunctionMapper().mapFunction(prefix, function, meth);
} | java | public void mapFunction(String prefix, String function, Method meth) {
getELContext().getFunctionMapper().mapFunction(prefix, function, meth);
} | [
"public",
"void",
"mapFunction",
"(",
"String",
"prefix",
",",
"String",
"function",
",",
"Method",
"meth",
")",
"{",
"getELContext",
"(",
")",
".",
"getFunctionMapper",
"(",
")",
".",
"mapFunction",
"(",
"prefix",
",",
"function",
",",
"meth",
")",
";",
... | Maps a static method to an EL function.
@param prefix The namespace of the functions, can be "".
@param function The name of the function.
@param meth The static method to be invoked when the function is used. | [
"Maps",
"a",
"static",
"method",
"to",
"an",
"EL",
"function",
"."
] | 4cef117cae3ccf9f76439845687a8d219ad2eb43 | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELManager.java#L122-L124 |
11,505 | jboss/jboss-el-api_spec | src/main/java/javax/el/ELManager.java | ELManager.defineBean | public Object defineBean(String name, Object bean) {
Object ret = getELContext().getBeans().get(name);
getELContext().getBeans().put(name, bean);
return ret;
} | java | public Object defineBean(String name, Object bean) {
Object ret = getELContext().getBeans().get(name);
getELContext().getBeans().put(name, bean);
return ret;
} | [
"public",
"Object",
"defineBean",
"(",
"String",
"name",
",",
"Object",
"bean",
")",
"{",
"Object",
"ret",
"=",
"getELContext",
"(",
")",
".",
"getBeans",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"getELContext",
"(",
")",
".",
"getBeans",
"(",
")... | Define a bean in the local bean repository
@param name The name of the bean
@param bean The bean instance to be defined. If null, the definition
of the bean is removed. | [
"Define",
"a",
"bean",
"in",
"the",
"local",
"bean",
"repository"
] | 4cef117cae3ccf9f76439845687a8d219ad2eb43 | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELManager.java#L177-L181 |
11,506 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/SubsetProblem.java | SubsetProblem.validate | @Override
public SubsetValidation validate(SubsetSolution solution){
// check size
boolean validSize = solution.getNumSelectedIDs() >= getMinSubsetSize()
&& solution.getNumSelectedIDs() <= getMaxSubsetSize();
// combine with mandatory constraint validation
... | java | @Override
public SubsetValidation validate(SubsetSolution solution){
// check size
boolean validSize = solution.getNumSelectedIDs() >= getMinSubsetSize()
&& solution.getNumSelectedIDs() <= getMaxSubsetSize();
// combine with mandatory constraint validation
... | [
"@",
"Override",
"public",
"SubsetValidation",
"validate",
"(",
"SubsetSolution",
"solution",
")",
"{",
"// check size",
"boolean",
"validSize",
"=",
"solution",
".",
"getNumSelectedIDs",
"(",
")",
">=",
"getMinSubsetSize",
"(",
")",
"&&",
"solution",
".",
"getNum... | Validate a subset solution. The returned validation object separately indicates whether
the solution passed general mandatory constraint validation and whether it has a valid size.
@param solution solution to validate
@return subset validation | [
"Validate",
"a",
"subset",
"solution",
".",
"The",
"returned",
"validation",
"object",
"separately",
"indicates",
"whether",
"the",
"solution",
"passed",
"general",
"mandatory",
"constraint",
"validation",
"and",
"whether",
"it",
"has",
"a",
"valid",
"size",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/SubsetProblem.java#L235-L249 |
11,507 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/SubsetProblem.java | SubsetProblem.setMaxSubsetSize | public void setMaxSubsetSize(int maxSubsetSize) {
// check size
if(maxSubsetSize < minSubsetSize){
throw new IllegalArgumentException("Error while setting maximum subset size: should be >= minimum subset size.");
}
if(maxSubsetSize > getData().getIDs().size()){
th... | java | public void setMaxSubsetSize(int maxSubsetSize) {
// check size
if(maxSubsetSize < minSubsetSize){
throw new IllegalArgumentException("Error while setting maximum subset size: should be >= minimum subset size.");
}
if(maxSubsetSize > getData().getIDs().size()){
th... | [
"public",
"void",
"setMaxSubsetSize",
"(",
"int",
"maxSubsetSize",
")",
"{",
"// check size",
"if",
"(",
"maxSubsetSize",
"<",
"minSubsetSize",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Error while setting maximum subset size: should be >= minimum subset s... | Set the maximum subset size. Specified size should be ≥ the current minimum subset size
and ≤ the number of items in the underlying data.
@param maxSubsetSize new maximum subset size
@throws IllegalArgumentException if an invalid maximum size is given | [
"Set",
"the",
"maximum",
"subset",
"size",
".",
"Specified",
"size",
"should",
"be",
"&ge",
";",
"the",
"current",
"minimum",
"subset",
"size",
"and",
"&le",
";",
"the",
"number",
"of",
"items",
"in",
"the",
"underlying",
"data",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/SubsetProblem.java#L339-L349 |
11,508 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/view/BadgeView.java | BadgeView.setNotifications | @SuppressLint("SetTextI18n")
public void setNotifications(Integer notifications) {
if ((notifications != null) && (notifications > 0)) {
setVisibility(VISIBLE);
if (notifications > maximum) {
this.setText(maximum + "+");
} else {
this.setText(notifications.toString());
}
} else {
setVisibil... | java | @SuppressLint("SetTextI18n")
public void setNotifications(Integer notifications) {
if ((notifications != null) && (notifications > 0)) {
setVisibility(VISIBLE);
if (notifications > maximum) {
this.setText(maximum + "+");
} else {
this.setText(notifications.toString());
}
} else {
setVisibil... | [
"@",
"SuppressLint",
"(",
"\"SetTextI18n\"",
")",
"public",
"void",
"setNotifications",
"(",
"Integer",
"notifications",
")",
"{",
"if",
"(",
"(",
"notifications",
"!=",
"null",
")",
"&&",
"(",
"notifications",
">",
"0",
")",
")",
"{",
"setVisibility",
"(",
... | Sets a notification number in the badge.
@param notifications | [
"Sets",
"a",
"notification",
"number",
"in",
"the",
"badge",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/view/BadgeView.java#L46-L59 |
11,509 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/algo/vns/ReducedVariableNeighbourhoodSearch.java | ReducedVariableNeighbourhoodSearch.nextNeighbourhood | private void nextNeighbourhood(){
if(cycleNeighbourhoods || k < getNeighbourhoods().size()-1){
// try again with next neighbourhood in next step
k = (k+1) % getNeighbourhoods().size();
} else {
// no next neighbourhood... stop
stop();
}
} | java | private void nextNeighbourhood(){
if(cycleNeighbourhoods || k < getNeighbourhoods().size()-1){
// try again with next neighbourhood in next step
k = (k+1) % getNeighbourhoods().size();
} else {
// no next neighbourhood... stop
stop();
}
} | [
"private",
"void",
"nextNeighbourhood",
"(",
")",
"{",
"if",
"(",
"cycleNeighbourhoods",
"||",
"k",
"<",
"getNeighbourhoods",
"(",
")",
".",
"size",
"(",
")",
"-",
"1",
")",
"{",
"// try again with next neighbourhood in next step",
"k",
"=",
"(",
"k",
"+",
"... | Switches to the next neighbourhood in the list, if any,
going back to the start if cycling is enabled and all
neighbourhoods have been used. | [
"Switches",
"to",
"the",
"next",
"neighbourhood",
"in",
"the",
"list",
"if",
"any",
"going",
"back",
"to",
"the",
"start",
"if",
"cycling",
"is",
"enabled",
"and",
"all",
"neighbourhoods",
"have",
"been",
"used",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/algo/vns/ReducedVariableNeighbourhoodSearch.java#L169-L177 |
11,510 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/mzidentml/MzIdentMLParser.java | MzIdentMLParser.parse | public static umich.ms.fileio.filetypes.mzidentml.jaxb.standard.MzIdentMLType parse(Path path)
throws FileParsingException {
try {
XMLStreamReader xsr = JaxbUtils.createXmlStreamReader(path, false);
umich.ms.fileio.filetypes.mzidentml.jaxb.standard.MzIdentMLType mzIdentMLType = JaxbUtils
... | java | public static umich.ms.fileio.filetypes.mzidentml.jaxb.standard.MzIdentMLType parse(Path path)
throws FileParsingException {
try {
XMLStreamReader xsr = JaxbUtils.createXmlStreamReader(path, false);
umich.ms.fileio.filetypes.mzidentml.jaxb.standard.MzIdentMLType mzIdentMLType = JaxbUtils
... | [
"public",
"static",
"umich",
".",
"ms",
".",
"fileio",
".",
"filetypes",
".",
"mzidentml",
".",
"jaxb",
".",
"standard",
".",
"MzIdentMLType",
"parse",
"(",
"Path",
"path",
")",
"throws",
"FileParsingException",
"{",
"try",
"{",
"XMLStreamReader",
"xsr",
"="... | Will parse the whole file. Might be not very efficient memory-wise.
@param path path to the file to parse
@return auto-generated representation of the file, read the MzIdentML schema for details. | [
"Will",
"parse",
"the",
"whole",
"file",
".",
"Might",
"be",
"not",
"very",
"efficient",
"memory",
"-",
"wise",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/mzidentml/MzIdentMLParser.java#L38-L50 |
11,511 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/ValidationResult.java | ValidationResult.iaddWarning | private void iaddWarning(String desc, String value, String loc) {
if (!validate) return;
ValidationEvent ve = new ValidationEvent(desc, value, loc);
warnings.add(ve);
} | java | private void iaddWarning(String desc, String value, String loc) {
if (!validate) return;
ValidationEvent ve = new ValidationEvent(desc, value, loc);
warnings.add(ve);
} | [
"private",
"void",
"iaddWarning",
"(",
"String",
"desc",
",",
"String",
"value",
",",
"String",
"loc",
")",
"{",
"if",
"(",
"!",
"validate",
")",
"return",
";",
"ValidationEvent",
"ve",
"=",
"new",
"ValidationEvent",
"(",
"desc",
",",
"value",
",",
"loc"... | Adds a warning.
@param desc warning description
@param value the value that caused the warning
@param loc the location | [
"Adds",
"a",
"warning",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/ValidationResult.java#L92-L96 |
11,512 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/ValidationResult.java | ValidationResult.addWarning | public void addWarning(String desc, String value, String loc) {
iaddWarning(desc, value, loc);
} | java | public void addWarning(String desc, String value, String loc) {
iaddWarning(desc, value, loc);
} | [
"public",
"void",
"addWarning",
"(",
"String",
"desc",
",",
"String",
"value",
",",
"String",
"loc",
")",
"{",
"iaddWarning",
"(",
"desc",
",",
"value",
",",
"loc",
")",
";",
"}"
] | Adds an warning.
@param desc Warning description
@param value the String that caused the warning
@param loc the location | [
"Adds",
"an",
"warning",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/ValidationResult.java#L161-L163 |
11,513 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/ValidationResult.java | ValidationResult.add | public void add(ValidationResult validation) {
correct &= validation.correct;
if (!validate) return;
errors.addAll(validation.errors);
warnings.addAll(validation.warnings);
} | java | public void add(ValidationResult validation) {
correct &= validation.correct;
if (!validate) return;
errors.addAll(validation.errors);
warnings.addAll(validation.warnings);
} | [
"public",
"void",
"add",
"(",
"ValidationResult",
"validation",
")",
"{",
"correct",
"&=",
"validation",
".",
"correct",
";",
"if",
"(",
"!",
"validate",
")",
"return",
";",
"errors",
".",
"addAll",
"(",
"validation",
".",
"errors",
")",
";",
"warnings",
... | Adds a validation result to this.
@param validation the validation to add | [
"Adds",
"a",
"validation",
"result",
"to",
"this",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/ValidationResult.java#L170-L175 |
11,514 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/MathHelper.java | MathHelper.min | public static double min(double... nums) {
double min = nums[0];
for (int i = 1; i < nums.length; i++) {
if (nums[i] > min) {
min = nums[i];
}
}
return min;
} | java | public static double min(double... nums) {
double min = nums[0];
for (int i = 1; i < nums.length; i++) {
if (nums[i] > min) {
min = nums[i];
}
}
return min;
} | [
"public",
"static",
"double",
"min",
"(",
"double",
"...",
"nums",
")",
"{",
"double",
"min",
"=",
"nums",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"nums",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"nums"... | Find the minimum in an array of numbers. | [
"Find",
"the",
"minimum",
"in",
"an",
"array",
"of",
"numbers",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/MathHelper.java#L31-L39 |
11,515 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/fileio/chunk/ChunkedFile.java | ChunkedFile.init | public void init() throws IOException {
if (!Files.exists(path)) {
throw new FileNotFoundException(
"Could not find a file under path: " + path.toAbsolutePath().toString());
}
if (Files.size(path) == 0) {
throw new IllegalStateException("File size can't be zero for chunked files");
... | java | public void init() throws IOException {
if (!Files.exists(path)) {
throw new FileNotFoundException(
"Could not find a file under path: " + path.toAbsolutePath().toString());
}
if (Files.size(path) == 0) {
throw new IllegalStateException("File size can't be zero for chunked files");
... | [
"public",
"void",
"init",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"Files",
".",
"exists",
"(",
"path",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"\"Could not find a file under path: \"",
"+",
"path",
".",
"toAbsolutePath",
"(... | Check if the file is still valid. | [
"Check",
"if",
"the",
"file",
"is",
"still",
"valid",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/fileio/chunk/ChunkedFile.java#L156-L174 |
11,516 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/algo/exh/ExhaustiveSearch.java | ExhaustiveSearch.searchStep | @Override
protected void searchStep() {
// more solutions to generate ?
if(solutionIterator.hasNext()){
// generate next solution
SolutionType sol = solutionIterator.next();
// update best solution
updateBestSolution(sol);
} else {
... | java | @Override
protected void searchStep() {
// more solutions to generate ?
if(solutionIterator.hasNext()){
// generate next solution
SolutionType sol = solutionIterator.next();
// update best solution
updateBestSolution(sol);
} else {
... | [
"@",
"Override",
"protected",
"void",
"searchStep",
"(",
")",
"{",
"// more solutions to generate ?",
"if",
"(",
"solutionIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"// generate next solution",
"SolutionType",
"sol",
"=",
"solutionIterator",
".",
"next",
"(",
... | In every search step it is verified whether there are more solution to be generated using the solution iterator.
If so, the next solution is generated, evaluated, and presented for comparison with the current best solution.
Else, the search stops. | [
"In",
"every",
"search",
"step",
"it",
"is",
"verified",
"whether",
"there",
"are",
"more",
"solution",
"to",
"be",
"generated",
"using",
"the",
"solution",
"iterator",
".",
"If",
"so",
"the",
"next",
"solution",
"is",
"generated",
"evaluated",
"and",
"prese... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/algo/exh/ExhaustiveSearch.java#L80-L92 |
11,517 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/Interval1D.java | Interval1D.intersects | public boolean intersects(Interval1D<V> other) {
if (other.hi.compareTo(this.lo) < 0) {
return false;
}
if (this.hi.compareTo(other.lo) < 0) {
return false;
}
return true;
} | java | public boolean intersects(Interval1D<V> other) {
if (other.hi.compareTo(this.lo) < 0) {
return false;
}
if (this.hi.compareTo(other.lo) < 0) {
return false;
}
return true;
} | [
"public",
"boolean",
"intersects",
"(",
"Interval1D",
"<",
"V",
">",
"other",
")",
"{",
"if",
"(",
"other",
".",
"hi",
".",
"compareTo",
"(",
"this",
".",
"lo",
")",
"<",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"hi",
... | Does this interval intersect that one?
@return true, if intervals share at least one point | [
"Does",
"this",
"interval",
"intersect",
"that",
"one?"
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/Interval1D.java#L74-L83 |
11,518 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/SubsetSolution.java | SubsetSolution.selectAll | public boolean selectAll(Collection<Integer> IDs) {
boolean modified = false;
for(int ID : IDs){
if(select(ID)){
modified = true;
}
}
return modified;
} | java | public boolean selectAll(Collection<Integer> IDs) {
boolean modified = false;
for(int ID : IDs){
if(select(ID)){
modified = true;
}
}
return modified;
} | [
"public",
"boolean",
"selectAll",
"(",
"Collection",
"<",
"Integer",
">",
"IDs",
")",
"{",
"boolean",
"modified",
"=",
"false",
";",
"for",
"(",
"int",
"ID",
":",
"IDs",
")",
"{",
"if",
"(",
"select",
"(",
"ID",
")",
")",
"{",
"modified",
"=",
"tru... | Select all IDs contained in the given collection. Returns true if the subset solution was modified by this
operation, i.e. if at least one previously unselected ID has been selected.
@param IDs collection of IDs to be selected
@throws SolutionModificationException if the given collection contains at least one ID which... | [
"Select",
"all",
"IDs",
"contained",
"in",
"the",
"given",
"collection",
".",
"Returns",
"true",
"if",
"the",
"subset",
"solution",
"was",
"modified",
"by",
"this",
"operation",
"i",
".",
"e",
".",
"if",
"at",
"least",
"one",
"previously",
"unselected",
"I... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/SubsetSolution.java#L333-L341 |
11,519 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/SubsetSolution.java | SubsetSolution.deselectAll | public boolean deselectAll(Collection<Integer> IDs) {
boolean modified = false;
for(int ID : IDs){
if(deselect(ID)){
modified = true;
}
}
return modified;
} | java | public boolean deselectAll(Collection<Integer> IDs) {
boolean modified = false;
for(int ID : IDs){
if(deselect(ID)){
modified = true;
}
}
return modified;
} | [
"public",
"boolean",
"deselectAll",
"(",
"Collection",
"<",
"Integer",
">",
"IDs",
")",
"{",
"boolean",
"modified",
"=",
"false",
";",
"for",
"(",
"int",
"ID",
":",
"IDs",
")",
"{",
"if",
"(",
"deselect",
"(",
"ID",
")",
")",
"{",
"modified",
"=",
... | Deselect all IDs contained in the given collection. Returns true if the subset solution was modified by this
operation, i.e. if at least one previously selected ID has been deselected.
@param IDs collection of IDs to be deselected
@throws SolutionModificationException if the given collection contains at least one ID w... | [
"Deselect",
"all",
"IDs",
"contained",
"in",
"the",
"given",
"collection",
".",
"Returns",
"true",
"if",
"the",
"subset",
"solution",
"was",
"modified",
"by",
"this",
"operation",
"i",
".",
"e",
".",
"if",
"at",
"least",
"one",
"previously",
"selected",
"I... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/SubsetSolution.java#L352-L360 |
11,520 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/logging/LogHelper.java | LogHelper.setJavolutionLogLevel | public static final void setJavolutionLogLevel(org.slf4j.Logger log) {
// disable Javolution info-level logging
if (log.isTraceEnabled()) {
javolution.context.LogContext.enter().setLevel(LogContext.Level.DEBUG);
} else if (log.isDebugEnabled()) {
javolution.context.LogContext.enter().setLevel(Lo... | java | public static final void setJavolutionLogLevel(org.slf4j.Logger log) {
// disable Javolution info-level logging
if (log.isTraceEnabled()) {
javolution.context.LogContext.enter().setLevel(LogContext.Level.DEBUG);
} else if (log.isDebugEnabled()) {
javolution.context.LogContext.enter().setLevel(Lo... | [
"public",
"static",
"final",
"void",
"setJavolutionLogLevel",
"(",
"org",
".",
"slf4j",
".",
"Logger",
"log",
")",
"{",
"// disable Javolution info-level logging",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"javolution",
".",
"context",
".",
... | Set Javolution log level according to the provided logger.
@param log SLF4J wrapper for many logging frameworks | [
"Set",
"Javolution",
"log",
"level",
"according",
"to",
"the",
"provided",
"logger",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/logging/LogHelper.java#L36-L51 |
11,521 | maxirosson/jdroid-android | jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/MapRepository.java | MapRepository.getChildrenMap | public Map<String, String> getChildrenMap(String parentId) {
Map<String, String> map = new HashMap<>();
List<StringEntity> children = getByField(Column.PARENT_ID, parentId);
for (StringEntity stringEntity : children) {
map.put(stringEntity.getId(), stringEntity.getValue());
}
return map;
} | java | public Map<String, String> getChildrenMap(String parentId) {
Map<String, String> map = new HashMap<>();
List<StringEntity> children = getByField(Column.PARENT_ID, parentId);
for (StringEntity stringEntity : children) {
map.put(stringEntity.getId(), stringEntity.getValue());
}
return map;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getChildrenMap",
"(",
"String",
"parentId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"List",
"<",
"StringEntity",
">",
"children",
"=",
... | This method returns the map of children associated with given parent id.
@param parentId of parent entity.
@return map of children | [
"This",
"method",
"returns",
"the",
"map",
"of",
"children",
"associated",
"with",
"given",
"parent",
"id",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/MapRepository.java#L26-L33 |
11,522 | maxirosson/jdroid-android | jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/MapRepository.java | MapRepository.replaceMapChildren | public void replaceMapChildren(Map<String, String> map, String parentId) {
ArrayList<StringEntity> entities = new ArrayList<>();
for (String key : map.keySet()) {
StringEntity entity = new StringEntity();
entity.setParentId(parentId);
entity.setId(key);
entity.setValue(map.get(key));
entities.add(ent... | java | public void replaceMapChildren(Map<String, String> map, String parentId) {
ArrayList<StringEntity> entities = new ArrayList<>();
for (String key : map.keySet()) {
StringEntity entity = new StringEntity();
entity.setParentId(parentId);
entity.setId(key);
entity.setValue(map.get(key));
entities.add(ent... | [
"public",
"void",
"replaceMapChildren",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"String",
"parentId",
")",
"{",
"ArrayList",
"<",
"StringEntity",
">",
"entities",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"key... | This method allows to replace all children of a given parent, it will remove any children which are not in the
list, add the new ones and update which are in the list.
@param map map of list to replace.
@param parentId id of parent entity. | [
"This",
"method",
"allows",
"to",
"replace",
"all",
"children",
"of",
"a",
"given",
"parent",
"it",
"will",
"remove",
"any",
"children",
"which",
"are",
"not",
"in",
"the",
"list",
"add",
"the",
"new",
"ones",
"and",
"update",
"which",
"are",
"in",
"the"... | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/MapRepository.java#L42-L52 |
11,523 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/algo/vns/VariableNeighbourhoodDescent.java | VariableNeighbourhoodDescent.searchStep | @Override
protected void searchStep() {
// stop if no more neighbourhoods available
if(k >= getNeighbourhoods().size()){
stop();
} else {
// use k-th neighbourhood to get best valid move with positive delta, if any
Neighbourhood<? super SolutionType> neigh... | java | @Override
protected void searchStep() {
// stop if no more neighbourhoods available
if(k >= getNeighbourhoods().size()){
stop();
} else {
// use k-th neighbourhood to get best valid move with positive delta, if any
Neighbourhood<? super SolutionType> neigh... | [
"@",
"Override",
"protected",
"void",
"searchStep",
"(",
")",
"{",
"// stop if no more neighbourhoods available",
"if",
"(",
"k",
">=",
"getNeighbourhoods",
"(",
")",
".",
"size",
"(",
")",
")",
"{",
"stop",
"(",
")",
";",
"}",
"else",
"{",
"// use k-th neig... | Investigates all neighbours of the current solution, using the k-th neighbourhood, and adopts the best one
as the new current solution, if it is an improvement. If no improvement is found, k is increased. Upon each
improvement, k is reset to 0, and when k has reached the number of available neighbourhoods, the search s... | [
"Investigates",
"all",
"neighbours",
"of",
"the",
"current",
"solution",
"using",
"the",
"k",
"-",
"th",
"neighbourhood",
"and",
"adopts",
"the",
"best",
"one",
"as",
"the",
"new",
"current",
"solution",
"if",
"it",
"is",
"an",
"improvement",
".",
"If",
"n... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/algo/vns/VariableNeighbourhoodDescent.java#L93-L114 |
11,524 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/algo/tabu/TabuSearch.java | TabuSearch.accept | @Override
protected boolean accept(Move<? super SolutionType> move){
// call super
if(super.accept(move)){
// update tabu memory
tabuMemory.registerVisitedSolution(getCurrentSolution(), move);
// update successful
return true;
} else {
... | java | @Override
protected boolean accept(Move<? super SolutionType> move){
// call super
if(super.accept(move)){
// update tabu memory
tabuMemory.registerVisitedSolution(getCurrentSolution(), move);
// update successful
return true;
} else {
... | [
"@",
"Override",
"protected",
"boolean",
"accept",
"(",
"Move",
"<",
"?",
"super",
"SolutionType",
">",
"move",
")",
"{",
"// call super",
"if",
"(",
"super",
".",
"accept",
"(",
"move",
")",
")",
"{",
"// update tabu memory",
"tabuMemory",
".",
"registerVis... | Overrides acceptance of a move to update the tabu memory by registering the newly visited solution.
@param move move to be accepted
@return <code>true</code> if the update was successful, <code>false</code> if the move is invalid | [
"Overrides",
"acceptance",
"of",
"a",
"move",
"to",
"update",
"the",
"tabu",
"memory",
"by",
"registering",
"the",
"newly",
"visited",
"solution",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/algo/tabu/TabuSearch.java#L133-L144 |
11,525 | hdbeukel/james-core | src/main/java/org/jamesframework/core/problems/objectives/evaluations/PenalizedEvaluation.java | PenalizedEvaluation.addPenalizingValidation | public void addPenalizingValidation(Object key, PenalizingValidation penalizingValidation){
initMapOnce();
penalties.put(key, penalizingValidation);
// update penalized value
if(!penalizingValidation.passed()){
assignedPenalties = true;
double p = penalizingValida... | java | public void addPenalizingValidation(Object key, PenalizingValidation penalizingValidation){
initMapOnce();
penalties.put(key, penalizingValidation);
// update penalized value
if(!penalizingValidation.passed()){
assignedPenalties = true;
double p = penalizingValida... | [
"public",
"void",
"addPenalizingValidation",
"(",
"Object",
"key",
",",
"PenalizingValidation",
"penalizingValidation",
")",
"{",
"initMapOnce",
"(",
")",
";",
"penalties",
".",
"put",
"(",
"key",
",",
"penalizingValidation",
")",
";",
"// update penalized value",
"... | Add a penalty expressed by a penalizing validation object. A key is
required that can be used to retrieve the validation object later.
@param key key used to retrieve the validation object later
@param penalizingValidation penalizing validation that indicates the assigned penalty | [
"Add",
"a",
"penalty",
"expressed",
"by",
"a",
"penalizing",
"validation",
"object",
".",
"A",
"key",
"is",
"required",
"that",
"can",
"be",
"used",
"to",
"retrieve",
"the",
"validation",
"object",
"later",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/problems/objectives/evaluations/PenalizedEvaluation.java#L78-L87 |
11,526 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/LCMSDataSourceFactory.java | LCMSDataSourceFactory.create | public static LCMSDataSource<?> create(Path path) {
path = path.toAbsolutePath();
String lowerCaseName = path.getFileName().toString().toLowerCase();
if (lowerCaseName.endsWith(".mzxml")) {
return new MZXMLFile(path.toString());
} else if (lowerCaseName.endsWith(".mzml")) {
return new MZMLFi... | java | public static LCMSDataSource<?> create(Path path) {
path = path.toAbsolutePath();
String lowerCaseName = path.getFileName().toString().toLowerCase();
if (lowerCaseName.endsWith(".mzxml")) {
return new MZXMLFile(path.toString());
} else if (lowerCaseName.endsWith(".mzml")) {
return new MZMLFi... | [
"public",
"static",
"LCMSDataSource",
"<",
"?",
">",
"create",
"(",
"Path",
"path",
")",
"{",
"path",
"=",
"path",
".",
"toAbsolutePath",
"(",
")",
";",
"String",
"lowerCaseName",
"=",
"path",
".",
"getFileName",
"(",
")",
".",
"toString",
"(",
")",
".... | Try and create a data source from a given file path.
@return null if the provided path was not recognized | [
"Try",
"and",
"create",
"a",
"data",
"source",
"from",
"a",
"given",
"file",
"path",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/LCMSDataSourceFactory.java#L39-L48 |
11,527 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java | SingleEvaluatedMoveCache.cacheMoveEvaluation | @Override
public final void cacheMoveEvaluation(Move<?> move, Evaluation evaluation) {
evaluatedMove = move;
this.evaluation = evaluation;
} | java | @Override
public final void cacheMoveEvaluation(Move<?> move, Evaluation evaluation) {
evaluatedMove = move;
this.evaluation = evaluation;
} | [
"@",
"Override",
"public",
"final",
"void",
"cacheMoveEvaluation",
"(",
"Move",
"<",
"?",
">",
"move",
",",
"Evaluation",
"evaluation",
")",
"{",
"evaluatedMove",
"=",
"move",
";",
"this",
".",
"evaluation",
"=",
"evaluation",
";",
"}"
] | Cache the given evaluation, discarding any previously cached evaluations.
@param move move applied to the current solution
@param evaluation evaluation of obtained neighbour | [
"Cache",
"the",
"given",
"evaluation",
"discarding",
"any",
"previously",
"cached",
"evaluations",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java#L58-L62 |
11,528 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java | SingleEvaluatedMoveCache.getCachedMoveEvaluation | @Override
public final Evaluation getCachedMoveEvaluation(Move<?> move) {
if(evaluatedMove == null || !evaluatedMove.equals(move)){
// cache miss
return null;
} else {
// cache hit
return evaluation;
}
} | java | @Override
public final Evaluation getCachedMoveEvaluation(Move<?> move) {
if(evaluatedMove == null || !evaluatedMove.equals(move)){
// cache miss
return null;
} else {
// cache hit
return evaluation;
}
} | [
"@",
"Override",
"public",
"final",
"Evaluation",
"getCachedMoveEvaluation",
"(",
"Move",
"<",
"?",
">",
"move",
")",
"{",
"if",
"(",
"evaluatedMove",
"==",
"null",
"||",
"!",
"evaluatedMove",
".",
"equals",
"(",
"move",
")",
")",
"{",
"// cache miss",
"re... | Retrieve a cached evaluation, if still available. If the evaluation of any
other move has been cached at a later point in time, the value for this move
will have been overwritten.
@param move move applied to the current solution
@return cached evaluation of the obtained neighbour, if available, <code>null</code> if no... | [
"Retrieve",
"a",
"cached",
"evaluation",
"if",
"still",
"available",
".",
"If",
"the",
"evaluation",
"of",
"any",
"other",
"move",
"has",
"been",
"cached",
"at",
"a",
"later",
"point",
"in",
"time",
"the",
"value",
"for",
"this",
"move",
"will",
"have",
... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java#L72-L81 |
11,529 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java | SingleEvaluatedMoveCache.cacheMoveValidation | @Override
public final void cacheMoveValidation(Move<?> move, Validation validation) {
validatedMove = move;
this.validation = validation;
} | java | @Override
public final void cacheMoveValidation(Move<?> move, Validation validation) {
validatedMove = move;
this.validation = validation;
} | [
"@",
"Override",
"public",
"final",
"void",
"cacheMoveValidation",
"(",
"Move",
"<",
"?",
">",
"move",
",",
"Validation",
"validation",
")",
"{",
"validatedMove",
"=",
"move",
";",
"this",
".",
"validation",
"=",
"validation",
";",
"}"
] | Cache validation of the given move, discarding any previously cached value.
@param move move applied to the current solution
@param validation validation of obtained neighbour | [
"Cache",
"validation",
"of",
"the",
"given",
"move",
"discarding",
"any",
"previously",
"cached",
"value",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java#L89-L93 |
11,530 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java | SingleEvaluatedMoveCache.getCachedMoveValidation | @Override
public final Validation getCachedMoveValidation(Move<?> move) {
if(validatedMove == null || !validatedMove.equals(move)){
// cache miss
return null;
} else {
// cache hit
return validation;
}
} | java | @Override
public final Validation getCachedMoveValidation(Move<?> move) {
if(validatedMove == null || !validatedMove.equals(move)){
// cache miss
return null;
} else {
// cache hit
return validation;
}
} | [
"@",
"Override",
"public",
"final",
"Validation",
"getCachedMoveValidation",
"(",
"Move",
"<",
"?",
">",
"move",
")",
"{",
"if",
"(",
"validatedMove",
"==",
"null",
"||",
"!",
"validatedMove",
".",
"equals",
"(",
"move",
")",
")",
"{",
"// cache miss",
"re... | Retrieve a cached validation, if still available. If the validation of any other move has
been cached at a later point in time, the value for this move will have been overwritten.
@param move move applied to the current solution
@return cached validation of the obtained neighbour, if available, <code>null</code> if no... | [
"Retrieve",
"a",
"cached",
"validation",
"if",
"still",
"available",
".",
"If",
"the",
"validation",
"of",
"any",
"other",
"move",
"has",
"been",
"cached",
"at",
"a",
"later",
"point",
"in",
"time",
"the",
"value",
"for",
"this",
"move",
"will",
"have",
... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java#L102-L111 |
11,531 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java | SingleEvaluatedMoveCache.clear | @Override
public final void clear() {
evaluatedMove = null;
evaluation = null;
validatedMove = null;
validation = null;
} | java | @Override
public final void clear() {
evaluatedMove = null;
evaluation = null;
validatedMove = null;
validation = null;
} | [
"@",
"Override",
"public",
"final",
"void",
"clear",
"(",
")",
"{",
"evaluatedMove",
"=",
"null",
";",
"evaluation",
"=",
"null",
";",
"validatedMove",
"=",
"null",
";",
"validation",
"=",
"null",
";",
"}"
] | Clear all cached values. | [
"Clear",
"all",
"cached",
"values",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/cache/SingleEvaluatedMoveCache.java#L116-L122 |
11,532 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java | NeighbourhoodSearch.updateCurrentSolution | @Override
protected void updateCurrentSolution(SolutionType solution, Evaluation evaluation, Validation validation){
// call super
super.updateCurrentSolution(solution, evaluation, validation);
// clear evaluated move cache
if(cache != null){
cache.clear();
}
... | java | @Override
protected void updateCurrentSolution(SolutionType solution, Evaluation evaluation, Validation validation){
// call super
super.updateCurrentSolution(solution, evaluation, validation);
// clear evaluated move cache
if(cache != null){
cache.clear();
}
... | [
"@",
"Override",
"protected",
"void",
"updateCurrentSolution",
"(",
"SolutionType",
"solution",
",",
"Evaluation",
"evaluation",
",",
"Validation",
"validation",
")",
"{",
"// call super",
"super",
".",
"updateCurrentSolution",
"(",
"solution",
",",
"evaluation",
",",... | When updating the current solution in a neighbourhood search, the evaluated move cache is
cleared because it is no longer valid for the new current solution.
@param solution new current solution
@param evaluation evaluation of new current solution
@param validation validation of new current solution | [
"When",
"updating",
"the",
"current",
"solution",
"in",
"a",
"neighbourhood",
"search",
"the",
"evaluated",
"move",
"cache",
"is",
"cleared",
"because",
"it",
"is",
"no",
"longer",
"valid",
"for",
"the",
"new",
"current",
"solution",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java#L220-L228 |
11,533 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java | NeighbourhoodSearch.evaluate | protected Evaluation evaluate(Move<? super SolutionType> move){
Evaluation eval = null;
// check cache
if(cache != null){
eval = cache.getCachedMoveEvaluation(move);
}
if(eval != null){
// cache hit: return cached value
return eval;
} e... | java | protected Evaluation evaluate(Move<? super SolutionType> move){
Evaluation eval = null;
// check cache
if(cache != null){
eval = cache.getCachedMoveEvaluation(move);
}
if(eval != null){
// cache hit: return cached value
return eval;
} e... | [
"protected",
"Evaluation",
"evaluate",
"(",
"Move",
"<",
"?",
"super",
"SolutionType",
">",
"move",
")",
"{",
"Evaluation",
"eval",
"=",
"null",
";",
"// check cache",
"if",
"(",
"cache",
"!=",
"null",
")",
"{",
"eval",
"=",
"cache",
".",
"getCachedMoveEva... | Evaluates a move to be applied to the current solution. If this move has been evaluated
before and the obtained evaluation is still available in the cache, the cached evaluation
will be returned. Else, the evaluation will be computed and offered to the cache.
@param move move to be applied to the current solution
@ret... | [
"Evaluates",
"a",
"move",
"to",
"be",
"applied",
"to",
"the",
"current",
"solution",
".",
"If",
"this",
"move",
"has",
"been",
"evaluated",
"before",
"and",
"the",
"obtained",
"evaluation",
"is",
"still",
"available",
"in",
"the",
"cache",
"the",
"cached",
... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java#L238-L255 |
11,534 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java | NeighbourhoodSearch.validate | protected Validation validate(Move<? super SolutionType> move){
Validation val = null;
// check cache
if(cache != null){
val = cache.getCachedMoveValidation(move);
}
if(val != null){
// cache hit: return cached value
return val;
} else ... | java | protected Validation validate(Move<? super SolutionType> move){
Validation val = null;
// check cache
if(cache != null){
val = cache.getCachedMoveValidation(move);
}
if(val != null){
// cache hit: return cached value
return val;
} else ... | [
"protected",
"Validation",
"validate",
"(",
"Move",
"<",
"?",
"super",
"SolutionType",
">",
"move",
")",
"{",
"Validation",
"val",
"=",
"null",
";",
"// check cache",
"if",
"(",
"cache",
"!=",
"null",
")",
"{",
"val",
"=",
"cache",
".",
"getCachedMoveValid... | Validates a move to be applied to the current solution. If this move has been validated
before and the obtained validation is still available in the cache, the cached validation
will be returned. Else, the validation will be computed and offered to the cache.
@param move move to be applied to the current solution
@ret... | [
"Validates",
"a",
"move",
"to",
"be",
"applied",
"to",
"the",
"current",
"solution",
".",
"If",
"this",
"move",
"has",
"been",
"validated",
"before",
"and",
"the",
"obtained",
"validation",
"is",
"still",
"available",
"in",
"the",
"cache",
"the",
"cached",
... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java#L265-L282 |
11,535 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.validate | @Override
public void validate() {
int n = 0;
try {
for (TiffObject o : model.getImageIfds()) {
IFD ifd = (IFD) o;
IfdTags metadata = ifd.getMetadata();
validateMetadata(metadata);
checkImage(ifd, n, metadata);
n++;
}
} catch (Exception ex) {
}
} | java | @Override
public void validate() {
int n = 0;
try {
for (TiffObject o : model.getImageIfds()) {
IFD ifd = (IFD) o;
IfdTags metadata = ifd.getMetadata();
validateMetadata(metadata);
checkImage(ifd, n, metadata);
n++;
}
} catch (Exception ex) {
}
} | [
"@",
"Override",
"public",
"void",
"validate",
"(",
")",
"{",
"int",
"n",
"=",
"0",
";",
"try",
"{",
"for",
"(",
"TiffObject",
"o",
":",
"model",
".",
"getImageIfds",
"(",
")",
")",
"{",
"IFD",
"ifd",
"=",
"(",
"IFD",
")",
"o",
";",
"IfdTags",
... | Validates the IFD. | [
"Validates",
"the",
"IFD",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L115-L129 |
11,536 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.validateMetadata | public void validateMetadata(IfdTags metadata) {
int prevTagId = 0;
try {
TiffTags.getTiffTags();
} catch (ReadTagsIOException e) {
}
for (TagValue ie : metadata.getTags()) {
if (!TiffTags.tagMap.containsKey(ie.getId())) {
validation.addWarning("Ignoring undefined tag id " + ie.g... | java | public void validateMetadata(IfdTags metadata) {
int prevTagId = 0;
try {
TiffTags.getTiffTags();
} catch (ReadTagsIOException e) {
}
for (TagValue ie : metadata.getTags()) {
if (!TiffTags.tagMap.containsKey(ie.getId())) {
validation.addWarning("Ignoring undefined tag id " + ie.g... | [
"public",
"void",
"validateMetadata",
"(",
"IfdTags",
"metadata",
")",
"{",
"int",
"prevTagId",
"=",
"0",
";",
"try",
"{",
"TiffTags",
".",
"getTiffTags",
"(",
")",
";",
"}",
"catch",
"(",
"ReadTagsIOException",
"e",
")",
"{",
"}",
"for",
"(",
"TagValue"... | Validates that the ifd entries have correct types and cardinalities, as they are defined in the
JSONs tag configuration files.
@param metadata the ifd metadata | [
"Validates",
"that",
"the",
"ifd",
"entries",
"have",
"correct",
"types",
"and",
"cardinalities",
"as",
"they",
"are",
"defined",
"in",
"the",
"JSONs",
"tag",
"configuration",
"files",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L137-L184 |
11,537 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.checkImage | public void checkImage(IFD ifd, int n, IfdTags metadata) {
CheckCommonFields(ifd, n, metadata);
if (!metadata.containsTagId(TiffTags.getTagId("PhotometricInterpretation"))) {
validation.addErrorLoc("Missing Photometric Interpretation", "IFD" + n);
} else if (metadata.get(TiffTags.getTagId("Photometri... | java | public void checkImage(IFD ifd, int n, IfdTags metadata) {
CheckCommonFields(ifd, n, metadata);
if (!metadata.containsTagId(TiffTags.getTagId("PhotometricInterpretation"))) {
validation.addErrorLoc("Missing Photometric Interpretation", "IFD" + n);
} else if (metadata.get(TiffTags.getTagId("Photometri... | [
"public",
"void",
"checkImage",
"(",
"IFD",
"ifd",
",",
"int",
"n",
",",
"IfdTags",
"metadata",
")",
"{",
"CheckCommonFields",
"(",
"ifd",
",",
"n",
",",
"metadata",
")",
";",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"get... | Check if the tags that define the image are correct and consistent.
@param ifd the ifd
@param n the ifd number
@param metadata the ifd metadata | [
"Check",
"if",
"the",
"tags",
"that",
"define",
"the",
"image",
"are",
"correct",
"and",
"consistent",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L193-L246 |
11,538 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckBilevelImage | private void CheckBilevelImage(IfdTags metadata, int n) {
// Compression
long comp = metadata.get(TiffTags.getTagId("Compression")).getFirstNumericValue();
// if (comp != 1 && comp != 2 && comp != 32773)
if (comp < 1)
validation.addError("Invalid Compression", "IFD" + n, comp);
} | java | private void CheckBilevelImage(IfdTags metadata, int n) {
// Compression
long comp = metadata.get(TiffTags.getTagId("Compression")).getFirstNumericValue();
// if (comp != 1 && comp != 2 && comp != 32773)
if (comp < 1)
validation.addError("Invalid Compression", "IFD" + n, comp);
} | [
"private",
"void",
"CheckBilevelImage",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Compression",
"long",
"comp",
"=",
"metadata",
".",
"get",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"Compression\"",
")",
")",
".",
"getFirstNumericValue",
"(",
... | Check Bilevel Image.
@param metadata the metadata
@param n the IFD number | [
"Check",
"Bilevel",
"Image",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L254-L260 |
11,539 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckGrayscaleImage | private void CheckGrayscaleImage(IfdTags metadata, int n) {
// Bits per Sample
long bps = metadata.get(TiffTags.getTagId("BitsPerSample")).getFirstNumericValue();
// if (bps != 4 && bps != 8)
if (bps < 1)
validation.addError("Invalid Bits per Sample", "IFD" + n, bps);
// Compression
long ... | java | private void CheckGrayscaleImage(IfdTags metadata, int n) {
// Bits per Sample
long bps = metadata.get(TiffTags.getTagId("BitsPerSample")).getFirstNumericValue();
// if (bps != 4 && bps != 8)
if (bps < 1)
validation.addError("Invalid Bits per Sample", "IFD" + n, bps);
// Compression
long ... | [
"private",
"void",
"CheckGrayscaleImage",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Bits per Sample",
"long",
"bps",
"=",
"metadata",
".",
"get",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"BitsPerSample\"",
")",
")",
".",
"getFirstNumericValue",
... | Check Grayscale Image.
@param metadata the metadata
@param n the IFD number | [
"Check",
"Grayscale",
"Image",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L268-L280 |
11,540 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckPalleteImage | private void CheckPalleteImage(IfdTags metadata, int nifd) {
// Color Map
if (!metadata.containsTagId(TiffTags.getTagId("ColorMap"))) {
validation.addErrorLoc("Missing Color Map", "IFD" + nifd);
} else {
int n = metadata.get(TiffTags.getTagId("ColorMap")).getCardinality();
if (n != 3 * (in... | java | private void CheckPalleteImage(IfdTags metadata, int nifd) {
// Color Map
if (!metadata.containsTagId(TiffTags.getTagId("ColorMap"))) {
validation.addErrorLoc("Missing Color Map", "IFD" + nifd);
} else {
int n = metadata.get(TiffTags.getTagId("ColorMap")).getCardinality();
if (n != 3 * (in... | [
"private",
"void",
"CheckPalleteImage",
"(",
"IfdTags",
"metadata",
",",
"int",
"nifd",
")",
"{",
"// Color Map",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"ColorMap\"",
")",
")",
")",
"{",
"validation",
".",
... | Check Pallete Color Image.
@param metadata the metadata
@param nifd the IFD number | [
"Check",
"Pallete",
"Color",
"Image",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L288-L310 |
11,541 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckTransparencyMask | private void CheckTransparencyMask(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
} else {
long spp = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstN... | java | private void CheckTransparencyMask(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
} else {
long spp = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstN... | [
"private",
"void",
"CheckTransparencyMask",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Samples per pixel",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"SamplesPerPixel\"",
")",
")",
")",
"{",
"vali... | Check transparency mask.
@param metadata the metadata
@param n the ifd number | [
"Check",
"transparency",
"mask",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L318-L338 |
11,542 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckCMYK | private void CheckCMYK(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
}
// BitsPerSample
if (!metadata.containsTagId(TiffTags.getTagId("BitsPerSample"))) {
... | java | private void CheckCMYK(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
}
// BitsPerSample
if (!metadata.containsTagId(TiffTags.getTagId("BitsPerSample"))) {
... | [
"private",
"void",
"CheckCMYK",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Samples per pixel",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"SamplesPerPixel\"",
")",
")",
")",
"{",
"validation",
"... | Check CMYK.
@param metadata the metadata
@param n the ifd number | [
"Check",
"CMYK",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L346-L356 |
11,543 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckYCbCr | private void CheckYCbCr(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
} else {
long spp = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstNumericValue... | java | private void CheckYCbCr(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
} else {
long spp = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstNumericValue... | [
"private",
"void",
"CheckYCbCr",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Samples per pixel",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"SamplesPerPixel\"",
")",
")",
")",
"{",
"validation",
... | Check YCbCr.
@param metadata the metadata
@param n the IFD number | [
"Check",
"YCbCr",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L364-L403 |
11,544 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckCIELab | private void CheckCIELab(IfdTags metadata, int n) {
// BitsPerSample
if (!metadata.containsTagId(TiffTags.getTagId("BitsPerSample"))) {
validation.addErrorLoc("Missing BitsPerSample", "IFD" + n);
} else {
for (abstractTiffType vi : metadata.get(TiffTags.getTagId("BitsPerSample")).getValue()) {
... | java | private void CheckCIELab(IfdTags metadata, int n) {
// BitsPerSample
if (!metadata.containsTagId(TiffTags.getTagId("BitsPerSample"))) {
validation.addErrorLoc("Missing BitsPerSample", "IFD" + n);
} else {
for (abstractTiffType vi : metadata.get(TiffTags.getTagId("BitsPerSample")).getValue()) {
... | [
"private",
"void",
"CheckCIELab",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// BitsPerSample",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"BitsPerSample\"",
")",
")",
")",
"{",
"validation",
".",
... | Check CIELab.
@param metadata the metadata
@param n the IFD number | [
"Check",
"CIELab",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L411-L423 |
11,545 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckRGBImage | private void CheckRGBImage(IfdTags metadata, int n) {
// Samples per Pixel
long samples = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstNumericValue();
if (samples < 3)
validation.addError("Invalid Samples per Pixel", "IFD" + n, samples);
// Compression
long comp = metadata.get(T... | java | private void CheckRGBImage(IfdTags metadata, int n) {
// Samples per Pixel
long samples = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstNumericValue();
if (samples < 3)
validation.addError("Invalid Samples per Pixel", "IFD" + n, samples);
// Compression
long comp = metadata.get(T... | [
"private",
"void",
"CheckRGBImage",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Samples per Pixel",
"long",
"samples",
"=",
"metadata",
".",
"get",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"SamplesPerPixel\"",
")",
")",
".",
"getFirstNumericValue"... | Check RGB Image.
@param metadata the metadata
@param n the IFD number | [
"Check",
"RGB",
"Image",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L431-L442 |
11,546 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckStrips | private void CheckStrips(IfdTags metadata, int n) {
long offset;
int id;
// Strip offsets
id = TiffTags.getTagId("StripOffsets");
offset = metadata.get(id).getFirstNumericValue();
int nso = metadata.get(id).getCardinality();
if (offset <= 0)
validation.addError("Invalid value for fiel... | java | private void CheckStrips(IfdTags metadata, int n) {
long offset;
int id;
// Strip offsets
id = TiffTags.getTagId("StripOffsets");
offset = metadata.get(id).getFirstNumericValue();
int nso = metadata.get(id).getCardinality();
if (offset <= 0)
validation.addError("Invalid value for fiel... | [
"private",
"void",
"CheckStrips",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"long",
"offset",
";",
"int",
"id",
";",
"// Strip offsets",
"id",
"=",
"TiffTags",
".",
"getTagId",
"(",
"\"StripOffsets\"",
")",
";",
"offset",
"=",
"metadata",
".",... | Check that the strips containing the image are well-formed.
@param metadata the metadata
@param n the IFD number | [
"Check",
"that",
"the",
"strips",
"containing",
"the",
"image",
"are",
"well",
"-",
"formed",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L592-L646 |
11,547 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java | SharedPreferencesHelper.loadPreference | public String loadPreference(String key, String defaultValue) {
String value = getSharedPreferences().getString(key, defaultValue);
logLoad(key, value);
return value;
} | java | public String loadPreference(String key, String defaultValue) {
String value = getSharedPreferences().getString(key, defaultValue);
logLoad(key, value);
return value;
} | [
"public",
"String",
"loadPreference",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getSharedPreferences",
"(",
")",
".",
"getString",
"(",
"key",
",",
"defaultValue",
")",
";",
"logLoad",
"(",
"key",
",",
"value",
... | Retrieve a string value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue. | [
"Retrieve",
"a",
"string",
"value",
"from",
"the",
"preferences",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java#L179-L183 |
11,548 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java | SharedPreferencesHelper.loadPreferenceAsBoolean | public Boolean loadPreferenceAsBoolean(String key, Boolean defaultValue) {
Boolean value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getBoolean(key, false);
}
logLoad(key, value);
return value;
} | java | public Boolean loadPreferenceAsBoolean(String key, Boolean defaultValue) {
Boolean value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getBoolean(key, false);
}
logLoad(key, value);
return value;
} | [
"public",
"Boolean",
"loadPreferenceAsBoolean",
"(",
"String",
"key",
",",
"Boolean",
"defaultValue",
")",
"{",
"Boolean",
"value",
"=",
"defaultValue",
";",
"if",
"(",
"hasPreference",
"(",
"key",
")",
")",
"{",
"value",
"=",
"getSharedPreferences",
"(",
")",... | Retrieve a boolean value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue. | [
"Retrieve",
"a",
"boolean",
"value",
"from",
"the",
"preferences",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java#L202-L209 |
11,549 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java | SharedPreferencesHelper.loadPreferenceAsLong | public Long loadPreferenceAsLong(String key, Long defaultValue) {
Long value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getLong(key, 0L);
}
logLoad(key, value);
return value;
} | java | public Long loadPreferenceAsLong(String key, Long defaultValue) {
Long value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getLong(key, 0L);
}
logLoad(key, value);
return value;
} | [
"public",
"Long",
"loadPreferenceAsLong",
"(",
"String",
"key",
",",
"Long",
"defaultValue",
")",
"{",
"Long",
"value",
"=",
"defaultValue",
";",
"if",
"(",
"hasPreference",
"(",
"key",
")",
")",
"{",
"value",
"=",
"getSharedPreferences",
"(",
")",
".",
"g... | Retrieve a long value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue. | [
"Retrieve",
"a",
"long",
"value",
"from",
"the",
"preferences",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java#L228-L236 |
11,550 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java | SharedPreferencesHelper.loadPreferenceAsInteger | public Integer loadPreferenceAsInteger(String key, Integer defaultValue) {
Integer value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getInt(key, 0);
}
logLoad(key, value);
return value;
} | java | public Integer loadPreferenceAsInteger(String key, Integer defaultValue) {
Integer value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getInt(key, 0);
}
logLoad(key, value);
return value;
} | [
"public",
"Integer",
"loadPreferenceAsInteger",
"(",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"Integer",
"value",
"=",
"defaultValue",
";",
"if",
"(",
"hasPreference",
"(",
"key",
")",
")",
"{",
"value",
"=",
"getSharedPreferences",
"(",
")",... | Retrieve an Integer value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue. | [
"Retrieve",
"an",
"Integer",
"value",
"from",
"the",
"preferences",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java#L255-L262 |
11,551 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java | SharedPreferencesHelper.loadPreferenceAsFloat | public Float loadPreferenceAsFloat(String key, Float defaultValue) {
Float value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getFloat(key, 0);
}
logLoad(key, value);
return value;
} | java | public Float loadPreferenceAsFloat(String key, Float defaultValue) {
Float value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getFloat(key, 0);
}
logLoad(key, value);
return value;
} | [
"public",
"Float",
"loadPreferenceAsFloat",
"(",
"String",
"key",
",",
"Float",
"defaultValue",
")",
"{",
"Float",
"value",
"=",
"defaultValue",
";",
"if",
"(",
"hasPreference",
"(",
"key",
")",
")",
"{",
"value",
"=",
"getSharedPreferences",
"(",
")",
".",
... | Retrieve a Float value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue. | [
"Retrieve",
"a",
"Float",
"value",
"from",
"the",
"preferences",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java#L281-L288 |
11,552 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/mzml/MZMLMultiSpectraParser.java | MZMLMultiSpectraParser.mapIdRefToInternalScanNum | protected int mapIdRefToInternalScanNum(CharArray id) throws FileParsingException {
String idStr = id.toString();
MZMLIndexElement byId = index.getById(idStr);
if (byId == null) {
String msg = String.format("Could not find a mapping from spectrum id"
+ " ref to an internal scan number for"
... | java | protected int mapIdRefToInternalScanNum(CharArray id) throws FileParsingException {
String idStr = id.toString();
MZMLIndexElement byId = index.getById(idStr);
if (byId == null) {
String msg = String.format("Could not find a mapping from spectrum id"
+ " ref to an internal scan number for"
... | [
"protected",
"int",
"mapIdRefToInternalScanNum",
"(",
"CharArray",
"id",
")",
"throws",
"FileParsingException",
"{",
"String",
"idStr",
"=",
"id",
".",
"toString",
"(",
")",
";",
"MZMLIndexElement",
"byId",
"=",
"index",
".",
"getById",
"(",
"idStr",
")",
";",... | Given a scan ID goes to the index and tries to find a mapping.
@throws umich.ms.fileio.exceptions.FileParsingException in case the mapping can't be done | [
"Given",
"a",
"scan",
"ID",
"goes",
"to",
"the",
"index",
"and",
"tries",
"to",
"find",
"a",
"mapping",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/mzml/MZMLMultiSpectraParser.java#L869-L881 |
11,553 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/xml/XmlUtils.java | XmlUtils.locate | public static List<Long> locate(List<byte[]> targets, List<POSITION> locations,
InputStream is, long maxOffset) throws IOException {
if (targets.isEmpty()) {
throw new IllegalArgumentException("Targets argument can't be empty");
}
if (locations.size() != targets.size()) {
throw new I... | java | public static List<Long> locate(List<byte[]> targets, List<POSITION> locations,
InputStream is, long maxOffset) throws IOException {
if (targets.isEmpty()) {
throw new IllegalArgumentException("Targets argument can't be empty");
}
if (locations.size() != targets.size()) {
throw new I... | [
"public",
"static",
"List",
"<",
"Long",
">",
"locate",
"(",
"List",
"<",
"byte",
"[",
"]",
">",
"targets",
",",
"List",
"<",
"POSITION",
">",
"locations",
",",
"InputStream",
"is",
",",
"long",
"maxOffset",
")",
"throws",
"IOException",
"{",
"if",
"("... | Locates specific sequences of bytes in the input stream.
@param targets Sequences of bytes to be searched for. The returned list will be of the same
size if all are found.
@param is The stream to search in, it won't be buffered, the stream will be left open and at
the position of the last occurrence of the target.
@pa... | [
"Locates",
"specific",
"sequences",
"of",
"bytes",
"in",
"the",
"input",
"stream",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/xml/XmlUtils.java#L58-L127 |
11,554 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/xml/XmlUtils.java | XmlUtils.advanceReaderToNext | public static boolean advanceReaderToNext(XMLStreamReader xsr, String tag)
throws javax.xml.stream.XMLStreamException {
if (tag == null) {
throw new IllegalArgumentException("Tag name can't be null");
}
if (xsr == null) {
throw new IllegalArgumentException("Stream Reader can't be nul... | java | public static boolean advanceReaderToNext(XMLStreamReader xsr, String tag)
throws javax.xml.stream.XMLStreamException {
if (tag == null) {
throw new IllegalArgumentException("Tag name can't be null");
}
if (xsr == null) {
throw new IllegalArgumentException("Stream Reader can't be nul... | [
"public",
"static",
"boolean",
"advanceReaderToNext",
"(",
"XMLStreamReader",
"xsr",
",",
"String",
"tag",
")",
"throws",
"javax",
".",
"xml",
".",
"stream",
".",
"XMLStreamException",
"{",
"if",
"(",
"tag",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalAr... | Advances the Stream Reader to the next occurrence of a user-specified tag.
@param xsr The reader to advance.
@param tag The tag to advance to. No brackets, just the name.
@return True if advanced successfully, false when the end of document was successfully reached.
@throws javax.xml.stream.XMLStreamException In all c... | [
"Advances",
"the",
"Stream",
"Reader",
"to",
"the",
"next",
"occurrence",
"of",
"a",
"user",
"-",
"specified",
"tag",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/xml/XmlUtils.java#L256-L271 |
11,555 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/LocalizationUtils.java | LocalizationUtils.getString | public static String getString(int resId, Object... args) {
return AbstractApplication.get().getString(resId, args);
} | java | public static String getString(int resId, Object... args) {
return AbstractApplication.get().getString(resId, args);
} | [
"public",
"static",
"String",
"getString",
"(",
"int",
"resId",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"AbstractApplication",
".",
"get",
"(",
")",
".",
"getString",
"(",
"resId",
",",
"args",
")",
";",
"}"
] | Returns a formatted string, using the localized resource as format and the supplied arguments
@param resId The resource id to obtain the format
@param args arguments to replace format specifiers
@return The localized and formatted string | [
"Returns",
"a",
"formatted",
"string",
"using",
"the",
"localized",
"resource",
"as",
"format",
"and",
"the",
"supplied",
"arguments"
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/LocalizationUtils.java#L15-L17 |
11,556 | matzew/simple-websocket-client | src/main/java/net/wessendorf/websocket/SimpleWebSocketClient.java | SimpleWebSocketClient.connect | public void connect() {
readyState = ReadyState.CONNECTING;
try {
if (webSocketHandler == null) {
webSocketHandler = new WebSocketHandlerAdapter();
}
container.connectToServer(new SimpleWebSocketClientEndpoint(), ClientEndpointConfig.Builder.create(... | java | public void connect() {
readyState = ReadyState.CONNECTING;
try {
if (webSocketHandler == null) {
webSocketHandler = new WebSocketHandlerAdapter();
}
container.connectToServer(new SimpleWebSocketClientEndpoint(), ClientEndpointConfig.Builder.create(... | [
"public",
"void",
"connect",
"(",
")",
"{",
"readyState",
"=",
"ReadyState",
".",
"CONNECTING",
";",
"try",
"{",
"if",
"(",
"webSocketHandler",
"==",
"null",
")",
"{",
"webSocketHandler",
"=",
"new",
"WebSocketHandlerAdapter",
"(",
")",
";",
"}",
"container"... | Establishes the connection to the given WebSocket Server Address. | [
"Establishes",
"the",
"connection",
"to",
"the",
"given",
"WebSocket",
"Server",
"Address",
"."
] | 67c207de9de2310feddf70cf90994b1af028b012 | https://github.com/matzew/simple-websocket-client/blob/67c207de9de2310feddf70cf90994b1af028b012/src/main/java/net/wessendorf/websocket/SimpleWebSocketClient.java#L82-L99 |
11,557 | matzew/simple-websocket-client | src/main/java/net/wessendorf/websocket/SimpleWebSocketClient.java | SimpleWebSocketClient.close | public void close() {
readyState = ReadyState.CLOSING;
try {
webSocketSession.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, null));
} catch (IOException e) {
e.printStackTrace();
}
} | java | public void close() {
readyState = ReadyState.CLOSING;
try {
webSocketSession.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, null));
} catch (IOException e) {
e.printStackTrace();
}
} | [
"public",
"void",
"close",
"(",
")",
"{",
"readyState",
"=",
"ReadyState",
".",
"CLOSING",
";",
"try",
"{",
"webSocketSession",
".",
"close",
"(",
"new",
"CloseReason",
"(",
"CloseReason",
".",
"CloseCodes",
".",
"NORMAL_CLOSURE",
",",
"null",
")",
")",
";... | Shutting down the current connection. | [
"Shutting",
"down",
"the",
"current",
"connection",
"."
] | 67c207de9de2310feddf70cf90994b1af028b012 | https://github.com/matzew/simple-websocket-client/blob/67c207de9de2310feddf70cf90994b1af028b012/src/main/java/net/wessendorf/websocket/SimpleWebSocketClient.java#L104-L112 |
11,558 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRangeSet.java | LCMSRangeSet.add | public void add(LCMSRange range) {
Integer msLevel = range.getMsLevel();
DoubleRange mzRange = range.getMzRange();
Range<Integer> scanRange = range.getScanRange();
if (msLevel == null) {
// add to the top level range set
anyLvlSet.add(scanRange);
// remove from all underlying sets
... | java | public void add(LCMSRange range) {
Integer msLevel = range.getMsLevel();
DoubleRange mzRange = range.getMzRange();
Range<Integer> scanRange = range.getScanRange();
if (msLevel == null) {
// add to the top level range set
anyLvlSet.add(scanRange);
// remove from all underlying sets
... | [
"public",
"void",
"add",
"(",
"LCMSRange",
"range",
")",
"{",
"Integer",
"msLevel",
"=",
"range",
".",
"getMsLevel",
"(",
")",
";",
"DoubleRange",
"mzRange",
"=",
"range",
".",
"getMzRange",
"(",
")",
";",
"Range",
"<",
"Integer",
">",
"scanRange",
"=",
... | This add method gradually removes scan-ranges from the input range as it descends down the
hierarchy. | [
"This",
"add",
"method",
"gradually",
"removes",
"scan",
"-",
"ranges",
"from",
"the",
"input",
"range",
"as",
"it",
"descends",
"down",
"the",
"hierarchy",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRangeSet.java#L85-L131 |
11,559 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRangeSet.java | LCMSRangeSet.subtract | public void subtract(LCMSRangeSet other) {
anyLvlSet.removeAll(other.anyLvlSet);
for (Map.Entry<Integer, MsLevelRangeSet> lvlMapEntry : lvlMap.entrySet()) {
Integer msLevel = lvlMapEntry.getKey();
MsLevelRangeSet msLevelRangeSet = lvlMapEntry.getValue();
// remove any top level scan ranges fr... | java | public void subtract(LCMSRangeSet other) {
anyLvlSet.removeAll(other.anyLvlSet);
for (Map.Entry<Integer, MsLevelRangeSet> lvlMapEntry : lvlMap.entrySet()) {
Integer msLevel = lvlMapEntry.getKey();
MsLevelRangeSet msLevelRangeSet = lvlMapEntry.getValue();
// remove any top level scan ranges fr... | [
"public",
"void",
"subtract",
"(",
"LCMSRangeSet",
"other",
")",
"{",
"anyLvlSet",
".",
"removeAll",
"(",
"other",
".",
"anyLvlSet",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"MsLevelRangeSet",
">",
"lvlMapEntry",
":",
"lvlMap",
".",
... | Will modify the set. Intended usage - when unloading data in LCMSData, create one range set for
data loaded by other users, then create a separate range set for the LCMSRange that you want to
unload. Subtract the "loaded by others" from the range set you want to unload. Use this range
set for unloading. | [
"Will",
"modify",
"the",
"set",
".",
"Intended",
"usage",
"-",
"when",
"unloading",
"data",
"in",
"LCMSData",
"create",
"one",
"range",
"set",
"for",
"data",
"loaded",
"by",
"other",
"users",
"then",
"create",
"a",
"separate",
"range",
"set",
"for",
"the",... | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRangeSet.java#L139-L173 |
11,560 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/writer/TiffWriter.java | TiffWriter.classifyTags | private int classifyTags(IFD ifd, ArrayList<TagValue> oversized, ArrayList<TagValue> undersized) {
int tagValueSize = 4;
int n = 0;
for (TagValue tag : ifd.getMetadata().getTags()) {
int tagsize = getTagSize(tag);
if (tagsize > tagValueSize) {
oversized.add(tag);
} else {
u... | java | private int classifyTags(IFD ifd, ArrayList<TagValue> oversized, ArrayList<TagValue> undersized) {
int tagValueSize = 4;
int n = 0;
for (TagValue tag : ifd.getMetadata().getTags()) {
int tagsize = getTagSize(tag);
if (tagsize > tagValueSize) {
oversized.add(tag);
} else {
u... | [
"private",
"int",
"classifyTags",
"(",
"IFD",
"ifd",
",",
"ArrayList",
"<",
"TagValue",
">",
"oversized",
",",
"ArrayList",
"<",
"TagValue",
">",
"undersized",
")",
"{",
"int",
"tagValueSize",
"=",
"4",
";",
"int",
"n",
"=",
"0",
";",
"for",
"(",
"TagV... | Gets the oversized tags.
@param ifd the ifd
@param oversized the oversized
@param undersized the undersized
@return the number of tags | [
"Gets",
"the",
"oversized",
"tags",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java#L175-L188 |
11,561 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/writer/TiffWriter.java | TiffWriter.getTagSize | private int getTagSize(TagValue tag) {
int n = tag.getCardinality();
int id = tag.getId();
// Calculate tag size
int type = tag.getType();
if (id == 330) {
// SubIFD
n = 1000;
}
if (id == 700) {
// XMP
if (tag.getValue().size() > 0)
n = tag.getValue().get(0)... | java | private int getTagSize(TagValue tag) {
int n = tag.getCardinality();
int id = tag.getId();
// Calculate tag size
int type = tag.getType();
if (id == 330) {
// SubIFD
n = 1000;
}
if (id == 700) {
// XMP
if (tag.getValue().size() > 0)
n = tag.getValue().get(0)... | [
"private",
"int",
"getTagSize",
"(",
"TagValue",
"tag",
")",
"{",
"int",
"n",
"=",
"tag",
".",
"getCardinality",
"(",
")",
";",
"int",
"id",
"=",
"tag",
".",
"getId",
"(",
")",
";",
"// Calculate tag size",
"int",
"type",
"=",
"tag",
".",
"getType",
... | Gets the tag size.
@param tag the tag
@return the tag size | [
"Gets",
"the",
"tag",
"size",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java#L328-L360 |
11,562 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/writer/TiffWriter.java | TiffWriter.writeStripData | private ArrayList<Integer> writeStripData(IFD ifd) throws IOException {
ArrayList<Integer> newStripOffsets = new ArrayList<Integer>();
IfdTags metadata = ifd.getMetadata();
TagValue stripOffsets = metadata.get(273);
TagValue stripSizes = metadata.get(279);
for (int i = 0; i < stripOffsets.getCardina... | java | private ArrayList<Integer> writeStripData(IFD ifd) throws IOException {
ArrayList<Integer> newStripOffsets = new ArrayList<Integer>();
IfdTags metadata = ifd.getMetadata();
TagValue stripOffsets = metadata.get(273);
TagValue stripSizes = metadata.get(279);
for (int i = 0; i < stripOffsets.getCardina... | [
"private",
"ArrayList",
"<",
"Integer",
">",
"writeStripData",
"(",
"IFD",
"ifd",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"Integer",
">",
"newStripOffsets",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")",
";",
"IfdTags",
"metadata",
"=",... | Write strip data.
@param ifd the ifd
@return the array list
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"strip",
"data",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java#L462-L487 |
11,563 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/writer/TiffWriter.java | TiffWriter.writeTileData | private ArrayList<Integer> writeTileData(IFD ifd) throws IOException {
ArrayList<Integer> newTileOffsets = new ArrayList<Integer>();
IfdTags metadata = ifd.getMetadata();
TagValue tileOffsets = metadata.get(324);
TagValue tileSizes = metadata.get(325);
for (int i = 0; i < tileOffsets.getCardinality(... | java | private ArrayList<Integer> writeTileData(IFD ifd) throws IOException {
ArrayList<Integer> newTileOffsets = new ArrayList<Integer>();
IfdTags metadata = ifd.getMetadata();
TagValue tileOffsets = metadata.get(324);
TagValue tileSizes = metadata.get(325);
for (int i = 0; i < tileOffsets.getCardinality(... | [
"private",
"ArrayList",
"<",
"Integer",
">",
"writeTileData",
"(",
"IFD",
"ifd",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"Integer",
">",
"newTileOffsets",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")",
";",
"IfdTags",
"metadata",
"=",
... | Write tile data.
@param ifd the ifd
@return the array list
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"tile",
"data",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/writer/TiffWriter.java#L496-L520 |
11,564 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java | SinglePerturbationNeighbourhood.getAllMoves | @Override
public List<SubsetMove> getAllMoves(SubsetSolution solution) {
// get set of candidate IDs for deletion and addition (fixed IDs are discarded)
Set<Integer> removeCandidates = getRemoveCandidates(solution);
Set<Integer> addCandidates = getAddCandidates(solution);
// create e... | java | @Override
public List<SubsetMove> getAllMoves(SubsetSolution solution) {
// get set of candidate IDs for deletion and addition (fixed IDs are discarded)
Set<Integer> removeCandidates = getRemoveCandidates(solution);
Set<Integer> addCandidates = getAddCandidates(solution);
// create e... | [
"@",
"Override",
"public",
"List",
"<",
"SubsetMove",
">",
"getAllMoves",
"(",
"SubsetSolution",
"solution",
")",
"{",
"// get set of candidate IDs for deletion and addition (fixed IDs are discarded)",
"Set",
"<",
"Integer",
">",
"removeCandidates",
"=",
"getRemoveCandidates"... | Generate all valid swap, deletion and addition moves that transform the given subset solution into
a neighbour within the minimum and maximum allowed subset size. The returned list may be empty,
if no valid moves exist. If any fixed IDs have been specified, these will not be considered
for deletion nor addition.
@para... | [
"Generate",
"all",
"valid",
"swap",
"deletion",
"and",
"addition",
"moves",
"that",
"transform",
"the",
"given",
"subset",
"solution",
"into",
"a",
"neighbour",
"within",
"the",
"minimum",
"and",
"maximum",
"allowed",
"subset",
"size",
".",
"The",
"returned",
... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java#L184-L212 |
11,565 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java | SinglePerturbationNeighbourhood.canAdd | private boolean canAdd(SubsetSolution solution, Set<Integer> addCandidates){
return !addCandidates.isEmpty()
&& isValidSubsetSize(solution.getNumSelectedIDs()+1);
} | java | private boolean canAdd(SubsetSolution solution, Set<Integer> addCandidates){
return !addCandidates.isEmpty()
&& isValidSubsetSize(solution.getNumSelectedIDs()+1);
} | [
"private",
"boolean",
"canAdd",
"(",
"SubsetSolution",
"solution",
",",
"Set",
"<",
"Integer",
">",
"addCandidates",
")",
"{",
"return",
"!",
"addCandidates",
".",
"isEmpty",
"(",
")",
"&&",
"isValidSubsetSize",
"(",
"solution",
".",
"getNumSelectedIDs",
"(",
... | Check if it is allowed to add one more item to the selection.
@param solution solution for which moves are generated
@param addCandidates set of candidate IDs to be added
@return <code>true</code> if it is allowed to add an item to the selection | [
"Check",
"if",
"it",
"is",
"allowed",
"to",
"add",
"one",
"more",
"item",
"to",
"the",
"selection",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java#L221-L224 |
11,566 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java | SinglePerturbationNeighbourhood.canRemove | private boolean canRemove(SubsetSolution solution, Set<Integer> deleteCandidates){
return !deleteCandidates.isEmpty()
&& isValidSubsetSize(solution.getNumSelectedIDs()-1);
} | java | private boolean canRemove(SubsetSolution solution, Set<Integer> deleteCandidates){
return !deleteCandidates.isEmpty()
&& isValidSubsetSize(solution.getNumSelectedIDs()-1);
} | [
"private",
"boolean",
"canRemove",
"(",
"SubsetSolution",
"solution",
",",
"Set",
"<",
"Integer",
">",
"deleteCandidates",
")",
"{",
"return",
"!",
"deleteCandidates",
".",
"isEmpty",
"(",
")",
"&&",
"isValidSubsetSize",
"(",
"solution",
".",
"getNumSelectedIDs",
... | Check if it is allowed to remove one more item from the selection.
@param solution solution for which moves are generated
@param deleteCandidates set of candidate IDs to be deleted
@return <code>true</code> if it is allowed to remove an item from the selection | [
"Check",
"if",
"it",
"is",
"allowed",
"to",
"remove",
"one",
"more",
"item",
"from",
"the",
"selection",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java#L233-L236 |
11,567 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java | SinglePerturbationNeighbourhood.canSwap | private boolean canSwap(SubsetSolution solution, Set<Integer> addCandidates, Set<Integer> deleteCandidates){
return !addCandidates.isEmpty()
&& !deleteCandidates.isEmpty()
&& isValidSubsetSize(solution.getNumSelectedIDs());
} | java | private boolean canSwap(SubsetSolution solution, Set<Integer> addCandidates, Set<Integer> deleteCandidates){
return !addCandidates.isEmpty()
&& !deleteCandidates.isEmpty()
&& isValidSubsetSize(solution.getNumSelectedIDs());
} | [
"private",
"boolean",
"canSwap",
"(",
"SubsetSolution",
"solution",
",",
"Set",
"<",
"Integer",
">",
"addCandidates",
",",
"Set",
"<",
"Integer",
">",
"deleteCandidates",
")",
"{",
"return",
"!",
"addCandidates",
".",
"isEmpty",
"(",
")",
"&&",
"!",
"deleteC... | Check if it is possible to swap a selected and unselected item.
@param solution solution for which moves are generated
@param addCandidates set of candidate IDs to be added
@param deleteCandidates set of candidate IDs to be deleted
@return <code>true</code> if it is possible to perform a swap | [
"Check",
"if",
"it",
"is",
"possible",
"to",
"swap",
"a",
"selected",
"and",
"unselected",
"item",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/SinglePerturbationNeighbourhood.java#L246-L250 |
11,568 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRange.java | LCMSRange.create | public static final LCMSRange create(Range<Integer> scanRange, Integer msLevel) {
return new LCMSRange(scanRange, msLevel, null);
} | java | public static final LCMSRange create(Range<Integer> scanRange, Integer msLevel) {
return new LCMSRange(scanRange, msLevel, null);
} | [
"public",
"static",
"final",
"LCMSRange",
"create",
"(",
"Range",
"<",
"Integer",
">",
"scanRange",
",",
"Integer",
"msLevel",
")",
"{",
"return",
"new",
"LCMSRange",
"(",
"scanRange",
",",
"msLevel",
",",
"null",
")",
";",
"}"
] | A range that will contain all scans with the scan number range, but only at a specific
MS-Level.
@param scanRange null means the whole range of scan numbers in the run
@param msLevel null means any ms-level | [
"A",
"range",
"that",
"will",
"contain",
"all",
"scans",
"with",
"the",
"scan",
"number",
"range",
"but",
"only",
"at",
"a",
"specific",
"MS",
"-",
"Level",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRange.java#L98-L100 |
11,569 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRange.java | LCMSRange.create | public static final LCMSRange create(Range<Integer> scanRange, Integer msLevel,
DoubleRange mzRange) {
return new LCMSRange(scanRange, msLevel, mzRange);
} | java | public static final LCMSRange create(Range<Integer> scanRange, Integer msLevel,
DoubleRange mzRange) {
return new LCMSRange(scanRange, msLevel, mzRange);
} | [
"public",
"static",
"final",
"LCMSRange",
"create",
"(",
"Range",
"<",
"Integer",
">",
"scanRange",
",",
"Integer",
"msLevel",
",",
"DoubleRange",
"mzRange",
")",
"{",
"return",
"new",
"LCMSRange",
"(",
"scanRange",
",",
"msLevel",
",",
"mzRange",
")",
";",
... | A range, containing all scans within the scan number range at a specific MS-Level and a
specific precursor range.
@param scanRange null means the whole range of scan numbers in the run
@param msLevel null means any ms-level
@param mzRange null means all ranges. You can't use non-null here, if {@code msLevel} is null | [
"A",
"range",
"containing",
"all",
"scans",
"within",
"the",
"scan",
"number",
"range",
"at",
"a",
"specific",
"MS",
"-",
"Level",
"and",
"a",
"specific",
"precursor",
"range",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSRange.java#L110-L113 |
11,570 | hdbeukel/james-core | src/main/java/org/jamesframework/core/problems/constraints/validations/UnanimousValidation.java | UnanimousValidation.addValidation | public void addValidation(Object key, Validation validation){
initMapOnce();
validations.put(key, validation);
// update aggregated value
passedAll = passedAll && validation.passed();
} | java | public void addValidation(Object key, Validation validation){
initMapOnce();
validations.put(key, validation);
// update aggregated value
passedAll = passedAll && validation.passed();
} | [
"public",
"void",
"addValidation",
"(",
"Object",
"key",
",",
"Validation",
"validation",
")",
"{",
"initMapOnce",
"(",
")",
";",
"validations",
".",
"put",
"(",
"key",
",",
"validation",
")",
";",
"// update aggregated value",
"passedAll",
"=",
"passedAll",
"... | Add a validation object. A key is required that can be used to retrieve the validation object.
@param key key used to retrieve the validation object
@param validation validation object | [
"Add",
"a",
"validation",
"object",
".",
"A",
"key",
"is",
"required",
"that",
"can",
"be",
"used",
"to",
"retrieve",
"the",
"validation",
"object",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/problems/constraints/validations/UnanimousValidation.java#L60-L65 |
11,571 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/pepxml/PepXmlParser.java | PepXmlParser.parse | public static MsmsPipelineAnalysis parse(Path path) throws FileParsingException {
try {
XMLStreamReader xsr = JaxbUtils.createXmlStreamReader(path, false);
MsmsPipelineAnalysis msmsPipelineAnalysis = JaxbUtils
.unmarshal(MsmsPipelineAnalysis.class, xsr);
return msmsPipelineAnalysis;
... | java | public static MsmsPipelineAnalysis parse(Path path) throws FileParsingException {
try {
XMLStreamReader xsr = JaxbUtils.createXmlStreamReader(path, false);
MsmsPipelineAnalysis msmsPipelineAnalysis = JaxbUtils
.unmarshal(MsmsPipelineAnalysis.class, xsr);
return msmsPipelineAnalysis;
... | [
"public",
"static",
"MsmsPipelineAnalysis",
"parse",
"(",
"Path",
"path",
")",
"throws",
"FileParsingException",
"{",
"try",
"{",
"XMLStreamReader",
"xsr",
"=",
"JaxbUtils",
".",
"createXmlStreamReader",
"(",
"path",
",",
"false",
")",
";",
"MsmsPipelineAnalysis",
... | The simplest method to parse the whole MsmsPipelineAnalysis from a file.
@param path Path to the file
@return MsmsPipelineAnalysis | [
"The",
"simplest",
"method",
"to",
"parse",
"the",
"whole",
"MsmsPipelineAnalysis",
"from",
"a",
"file",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/fileio/filetypes/pepxml/PepXmlParser.java#L50-L63 |
11,572 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSDataSubset.java | LCMSDataSubset.merge | public LCMSDataSubset merge(LCMSDataSubset other) {
LCMSDataSubset merged = new LCMSDataSubset();
Set<Integer> msLvlsThis = getMsLvls();
Set<Integer> msLvlsThat = other.getMsLvls();
// only merge if both are not null, otherwise null signifies the whole
// run, so we can keep it null in the merged v... | java | public LCMSDataSubset merge(LCMSDataSubset other) {
LCMSDataSubset merged = new LCMSDataSubset();
Set<Integer> msLvlsThis = getMsLvls();
Set<Integer> msLvlsThat = other.getMsLvls();
// only merge if both are not null, otherwise null signifies the whole
// run, so we can keep it null in the merged v... | [
"public",
"LCMSDataSubset",
"merge",
"(",
"LCMSDataSubset",
"other",
")",
"{",
"LCMSDataSubset",
"merged",
"=",
"new",
"LCMSDataSubset",
"(",
")",
";",
"Set",
"<",
"Integer",
">",
"msLvlsThis",
"=",
"getMsLvls",
"(",
")",
";",
"Set",
"<",
"Integer",
">",
"... | Doesn't modify original values, always returns a new one.
@return a new instance of LCMSDataSubset, even if this subset {@link
#contains(umich.ms.datatypes.LCMSDataSubset) } the other one. | [
"Doesn",
"t",
"modify",
"original",
"values",
"always",
"returns",
"a",
"new",
"one",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/LCMSDataSubset.java#L235-L270 |
11,573 | hdbeukel/james-core | src/main/java/org/jamesframework/core/search/Search.java | Search.addStopCriterion | public void addStopCriterion(StopCriterion stopCriterion){
// acquire status lock
synchronized(statusLock){
// assert idle
assertIdle("Cannot add stop criterion.");
// pass stop criterion to checker (throws error if incompatible)
stopCriterionChecker.add(s... | java | public void addStopCriterion(StopCriterion stopCriterion){
// acquire status lock
synchronized(statusLock){
// assert idle
assertIdle("Cannot add stop criterion.");
// pass stop criterion to checker (throws error if incompatible)
stopCriterionChecker.add(s... | [
"public",
"void",
"addStopCriterion",
"(",
"StopCriterion",
"stopCriterion",
")",
"{",
"// acquire status lock",
"synchronized",
"(",
"statusLock",
")",
"{",
"// assert idle",
"assertIdle",
"(",
"\"Cannot add stop criterion.\"",
")",
";",
"// pass stop criterion to checker (t... | Adds a stop criterion used to decide when the search should stop running. It is verified whether the given
stop criterion is compatible with the search and if not, an exception is thrown. Note that this method can
only be called when the search is idle.
@param stopCriterion stop criterion used to decide when the searc... | [
"Adds",
"a",
"stop",
"criterion",
"used",
"to",
"decide",
"when",
"the",
"search",
"should",
"stop",
"running",
".",
"It",
"is",
"verified",
"whether",
"the",
"given",
"stop",
"criterion",
"is",
"compatible",
"with",
"the",
"search",
"and",
"if",
"not",
"a... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/Search.java#L529-L539 |
11,574 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java | TooltipHelper.showCheatSheet | private static boolean showCheatSheet(View view, CharSequence text) {
if (TextUtils.isEmpty(text)) {
return false;
}
final int[] screenPos = new int[2]; // origin is device display
final Rect displayFrame = new Rect(); // includes decorations (e.g. status bar)
view.getLocationOnScreen(screenPos);
view.g... | java | private static boolean showCheatSheet(View view, CharSequence text) {
if (TextUtils.isEmpty(text)) {
return false;
}
final int[] screenPos = new int[2]; // origin is device display
final Rect displayFrame = new Rect(); // includes decorations (e.g. status bar)
view.getLocationOnScreen(screenPos);
view.g... | [
"private",
"static",
"boolean",
"showCheatSheet",
"(",
"View",
"view",
",",
"CharSequence",
"text",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"text",
")",
")",
"{",
"return",
"false",
";",
"}",
"final",
"int",
"[",
"]",
"screenPos",
"=",
"... | Internal helper method to show the cheat sheet toast. | [
"Internal",
"helper",
"method",
"to",
"show",
"the",
"cheat",
"sheet",
"toast",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java#L93-L126 |
11,575 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/location/LocationHelper.java | LocationHelper.startLocalization | @RequiresPermission(anyOf = { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION })
public synchronized void startLocalization() {
if (!started && hasSignificantlyOlderLocation()) {
started = true;
// get all enabled providers
List<String> enabledProviders = locationManag... | java | @RequiresPermission(anyOf = { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION })
public synchronized void startLocalization() {
if (!started && hasSignificantlyOlderLocation()) {
started = true;
// get all enabled providers
List<String> enabledProviders = locationManag... | [
"@",
"RequiresPermission",
"(",
"anyOf",
"=",
"{",
"Manifest",
".",
"permission",
".",
"ACCESS_COARSE_LOCATION",
",",
"Manifest",
".",
"permission",
".",
"ACCESS_FINE_LOCATION",
"}",
")",
"public",
"synchronized",
"void",
"startLocalization",
"(",
")",
"{",
"if",
... | Register the listener with the Location Manager to receive location updates | [
"Register",
"the",
"listener",
"with",
"the",
"Location",
"Manager",
"to",
"receive",
"location",
"updates"
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/location/LocationHelper.java#L78-L107 |
11,576 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/location/LocationHelper.java | LocationHelper.stopLocalization | @RequiresPermission(anyOf = { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION })
public synchronized void stopLocalization() {
if (started) {
AlarmUtils.cancelAlarm(getCancelPendingIntent());
locationManager.removeUpdates(this);
if (location == null) {
location = loc... | java | @RequiresPermission(anyOf = { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION })
public synchronized void stopLocalization() {
if (started) {
AlarmUtils.cancelAlarm(getCancelPendingIntent());
locationManager.removeUpdates(this);
if (location == null) {
location = loc... | [
"@",
"RequiresPermission",
"(",
"anyOf",
"=",
"{",
"Manifest",
".",
"permission",
".",
"ACCESS_COARSE_LOCATION",
",",
"Manifest",
".",
"permission",
".",
"ACCESS_FINE_LOCATION",
"}",
")",
"public",
"synchronized",
"void",
"stopLocalization",
"(",
")",
"{",
"if",
... | Remove the listener to receive location updates | [
"Remove",
"the",
"listener",
"to",
"receive",
"location",
"updates"
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/location/LocationHelper.java#L118-L133 |
11,577 | matzew/simple-websocket-client | src/main/java/net/wessendorf/websocket/WebSocketUtil.java | WebSocketUtil.containsWebSocketScheme | public static boolean containsWebSocketScheme(URI uri) {
Objects.requireNonNull(uri, "no URI object given");
final String scheme = uri.getScheme();
if (scheme != null && (scheme.equals(WS_SCHEME) || scheme.equals(WSS_SCHEME))) {
return true;
}
return false;
} | java | public static boolean containsWebSocketScheme(URI uri) {
Objects.requireNonNull(uri, "no URI object given");
final String scheme = uri.getScheme();
if (scheme != null && (scheme.equals(WS_SCHEME) || scheme.equals(WSS_SCHEME))) {
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"containsWebSocketScheme",
"(",
"URI",
"uri",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"uri",
",",
"\"no URI object given\"",
")",
";",
"final",
"String",
"scheme",
"=",
"uri",
".",
"getScheme",
"(",
")",
";",
"if",
"("... | Checks if the given URI is a contains a valid WebSocket scheme | [
"Checks",
"if",
"the",
"given",
"URI",
"is",
"a",
"contains",
"a",
"valid",
"WebSocket",
"scheme"
] | 67c207de9de2310feddf70cf90994b1af028b012 | https://github.com/matzew/simple-websocket-client/blob/67c207de9de2310feddf70cf90994b1af028b012/src/main/java/net/wessendorf/websocket/WebSocketUtil.java#L38-L47 |
11,578 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/lcmsrun/LCMSRunInfo.java | LCMSRunInfo.createDummyInfo | public static LCMSRunInfo createDummyInfo() {
LCMSRunInfo lcmsRunInfo = new LCMSRunInfo();
lcmsRunInfo.addInstrument(Instrument.getDummy(), Instrument.ID_UNKNOWN);
return lcmsRunInfo;
} | java | public static LCMSRunInfo createDummyInfo() {
LCMSRunInfo lcmsRunInfo = new LCMSRunInfo();
lcmsRunInfo.addInstrument(Instrument.getDummy(), Instrument.ID_UNKNOWN);
return lcmsRunInfo;
} | [
"public",
"static",
"LCMSRunInfo",
"createDummyInfo",
"(",
")",
"{",
"LCMSRunInfo",
"lcmsRunInfo",
"=",
"new",
"LCMSRunInfo",
"(",
")",
";",
"lcmsRunInfo",
".",
"addInstrument",
"(",
"Instrument",
".",
"getDummy",
"(",
")",
",",
"Instrument",
".",
"ID_UNKNOWN",
... | Only use if you can't get real run info. | [
"Only",
"use",
"if",
"you",
"can",
"t",
"get",
"real",
"run",
"info",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/lcmsrun/LCMSRunInfo.java#L51-L55 |
11,579 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/lcmsrun/LCMSRunInfo.java | LCMSRunInfo.addInstrument | public void addInstrument(Instrument instrument, String id) {
if (instrument == null || id == null) {
throw new IllegalArgumentException("Instruemnt and ID must be non-null values.");
}
if (instruments.size() == 0) {
defaultInstrumentID = id;
} else if (instruments.size() > 0 && !isDefaultE... | java | public void addInstrument(Instrument instrument, String id) {
if (instrument == null || id == null) {
throw new IllegalArgumentException("Instruemnt and ID must be non-null values.");
}
if (instruments.size() == 0) {
defaultInstrumentID = id;
} else if (instruments.size() > 0 && !isDefaultE... | [
"public",
"void",
"addInstrument",
"(",
"Instrument",
"instrument",
",",
"String",
"id",
")",
"{",
"if",
"(",
"instrument",
"==",
"null",
"||",
"id",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Instruemnt and ID must be non-null val... | If only one instrument is added, it will be set as the default instrument, all the scans, that
you add to the ScanCollection will implicitly refer to this one instrument.
@param id some identifier for mapping instruments. Instrumnt list is normally stored at the
beginning of the run file, so it's a mapping from this l... | [
"If",
"only",
"one",
"instrument",
"is",
"added",
"it",
"will",
"be",
"set",
"as",
"the",
"default",
"instrument",
"all",
"the",
"scans",
"that",
"you",
"add",
"to",
"the",
"ScanCollection",
"will",
"implicitly",
"refer",
"to",
"this",
"one",
"instrument",
... | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/lcmsrun/LCMSRunInfo.java#L82-L93 |
11,580 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/lcmsrun/LCMSRunInfo.java | LCMSRunInfo.setDefaultInstrumentID | public void setDefaultInstrumentID(String id) {
if (id == null) {
unsetDefaultInstrument();
return;
}
if (instruments.containsKey(id)) {
defaultInstrumentID = id;
isDefaultExplicitlySet = true;
} else {
throw new IllegalArgumentException(
"The instrument map did ... | java | public void setDefaultInstrumentID(String id) {
if (id == null) {
unsetDefaultInstrument();
return;
}
if (instruments.containsKey(id)) {
defaultInstrumentID = id;
isDefaultExplicitlySet = true;
} else {
throw new IllegalArgumentException(
"The instrument map did ... | [
"public",
"void",
"setDefaultInstrumentID",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"unsetDefaultInstrument",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"instruments",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"de... | Call with null parameter to unset.
@param id this id must be present in the run info already. | [
"Call",
"with",
"null",
"parameter",
"to",
"unset",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/lcmsrun/LCMSRunInfo.java#L143-L157 |
11,581 | jboss/jboss-el-api_spec | src/main/java/javax/el/ListELResolver.java | ListELResolver.getType | public Class<?> getType(ELContext context,
Object base,
Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base != null && base instanceof List) {
context.setPropertyResolved(true);
... | java | public Class<?> getType(ELContext context,
Object base,
Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base != null && base instanceof List) {
context.setPropertyResolved(true);
... | [
"public",
"Class",
"<",
"?",
">",
"getType",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"if",
"(",
... | If the base object is a list, returns the most general acceptable type
for a value in this list.
<p>If the base is a <code>List</code>, the <code>propertyResolved</code>
property of the <code>ELContext</code> object must be set to
<code>true</code> by this resolver, before returning. If this property
is not <code>true... | [
"If",
"the",
"base",
"object",
"is",
"a",
"list",
"returns",
"the",
"most",
"general",
"acceptable",
"type",
"for",
"a",
"value",
"in",
"this",
"list",
"."
] | 4cef117cae3ccf9f76439845687a8d219ad2eb43 | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ListELResolver.java#L141-L159 |
11,582 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/moves/SwapMove.java | SwapMove.undo | @Override
public void undo(SubsetSolution solution) {
// re-add deleted ID
solution.select(delete);
// remove newly added ID
solution.deselect(add);
} | java | @Override
public void undo(SubsetSolution solution) {
// re-add deleted ID
solution.select(delete);
// remove newly added ID
solution.deselect(add);
} | [
"@",
"Override",
"public",
"void",
"undo",
"(",
"SubsetSolution",
"solution",
")",
"{",
"// re-add deleted ID",
"solution",
".",
"select",
"(",
"delete",
")",
";",
"// remove newly added ID",
"solution",
".",
"deselect",
"(",
"add",
")",
";",
"}"
] | Undo this swap move after it has been successfully applied to the given subset solution,
by removing the newly added ID and re-adding the deleted ID.
@param solution solution to which the move has been applied | [
"Undo",
"this",
"swap",
"move",
"after",
"it",
"has",
"been",
"successfully",
"applied",
"to",
"the",
"given",
"subset",
"solution",
"by",
"removing",
"the",
"newly",
"added",
"ID",
"and",
"re",
"-",
"adding",
"the",
"deleted",
"ID",
"."
] | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/moves/SwapMove.java#L84-L90 |
11,583 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/usecase/AbstractUseCase.java | AbstractUseCase.run | @Override
public final void run() {
LOGGER.debug("Executing " + getClass().getSimpleName());
markAsInProgress();
if (!Lists.isNullOrEmpty(listeners)) {
Runnable startUseCaseRunnable = new Runnable() {
@Override
public void run() {
for (UseCaseListener listener : listeners) {
notifyUseCase... | java | @Override
public final void run() {
LOGGER.debug("Executing " + getClass().getSimpleName());
markAsInProgress();
if (!Lists.isNullOrEmpty(listeners)) {
Runnable startUseCaseRunnable = new Runnable() {
@Override
public void run() {
for (UseCaseListener listener : listeners) {
notifyUseCase... | [
"@",
"Override",
"public",
"final",
"void",
"run",
"(",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Executing \"",
"+",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
")",
";",
"markAsInProgress",
"(",
")",
";",
"if",
"(",
"!",
"Lists",
".",
"is... | Executes the use case. | [
"Executes",
"the",
"use",
"case",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/usecase/AbstractUseCase.java#L54-L144 |
11,584 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/AndroidEncryptionUtils.java | AndroidEncryptionUtils.encrypt | public static String encrypt(String cleartext) {
if (cleartext != null) {
byte[] result = doFinal(Base64.decode(getBase64Key(), Base64.DEFAULT), Cipher.ENCRYPT_MODE,
cleartext.getBytes());
return Base64.encodeToString(result, Base64.DEFAULT);
}
return null;
} | java | public static String encrypt(String cleartext) {
if (cleartext != null) {
byte[] result = doFinal(Base64.decode(getBase64Key(), Base64.DEFAULT), Cipher.ENCRYPT_MODE,
cleartext.getBytes());
return Base64.encodeToString(result, Base64.DEFAULT);
}
return null;
} | [
"public",
"static",
"String",
"encrypt",
"(",
"String",
"cleartext",
")",
"{",
"if",
"(",
"cleartext",
"!=",
"null",
")",
"{",
"byte",
"[",
"]",
"result",
"=",
"doFinal",
"(",
"Base64",
".",
"decode",
"(",
"getBase64Key",
"(",
")",
",",
"Base64",
".",
... | Returns the data encrypted. Avoid calling this method on the UI thread if possible, since it may access to shared
preferences.
@param cleartext
@return encrypted data | [
"Returns",
"the",
"data",
"encrypted",
".",
"Avoid",
"calling",
"this",
"method",
"on",
"the",
"UI",
"thread",
"if",
"possible",
"since",
"it",
"may",
"access",
"to",
"shared",
"preferences",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/AndroidEncryptionUtils.java#L39-L46 |
11,585 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/AndroidEncryptionUtils.java | AndroidEncryptionUtils.decrypt | public static String decrypt(String base64Encrypted) {
if (base64Encrypted != null) {
byte[] enc = Base64.decode(base64Encrypted, Base64.DEFAULT);
byte[] result = doFinal(Base64.decode(getBase64Key(), Base64.DEFAULT), Cipher.DECRYPT_MODE, enc);
return new String(result);
}
return null;
} | java | public static String decrypt(String base64Encrypted) {
if (base64Encrypted != null) {
byte[] enc = Base64.decode(base64Encrypted, Base64.DEFAULT);
byte[] result = doFinal(Base64.decode(getBase64Key(), Base64.DEFAULT), Cipher.DECRYPT_MODE, enc);
return new String(result);
}
return null;
} | [
"public",
"static",
"String",
"decrypt",
"(",
"String",
"base64Encrypted",
")",
"{",
"if",
"(",
"base64Encrypted",
"!=",
"null",
")",
"{",
"byte",
"[",
"]",
"enc",
"=",
"Base64",
".",
"decode",
"(",
"base64Encrypted",
",",
"Base64",
".",
"DEFAULT",
")",
... | Returns the original data. Avoid calling this method on the UI thread if possible, since it may access to shared
preferences.
@param base64Encrypted
@return the original data | [
"Returns",
"the",
"original",
"data",
".",
"Avoid",
"calling",
"this",
"method",
"on",
"the",
"UI",
"thread",
"if",
"possible",
"since",
"it",
"may",
"access",
"to",
"shared",
"preferences",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/AndroidEncryptionUtils.java#L55-L62 |
11,586 | maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/AndroidEncryptionUtils.java | AndroidEncryptionUtils.generateShaHash | public static String generateShaHash(String text) {
try {
MessageDigest digest = MessageDigest.getInstance(SHA_ALGORITHM);
byte[] bytes = text.getBytes(UTF_8);
bytes = digest.digest(bytes);
return toHexEncode(bytes);
} catch (Exception e) {
throw new UnexpectedException(e);
}
} | java | public static String generateShaHash(String text) {
try {
MessageDigest digest = MessageDigest.getInstance(SHA_ALGORITHM);
byte[] bytes = text.getBytes(UTF_8);
bytes = digest.digest(bytes);
return toHexEncode(bytes);
} catch (Exception e) {
throw new UnexpectedException(e);
}
} | [
"public",
"static",
"String",
"generateShaHash",
"(",
"String",
"text",
")",
"{",
"try",
"{",
"MessageDigest",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"SHA_ALGORITHM",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"text",
".",
"getBytes",
"(",
... | Generates the SHA hash for the input string.
@param text the input string to hash
@return the hash for the input string in hexadecimal encoding | [
"Generates",
"the",
"SHA",
"hash",
"for",
"the",
"input",
"string",
"."
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/AndroidEncryptionUtils.java#L123-L132 |
11,587 | hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/moves/GeneralSubsetMove.java | GeneralSubsetMove.undo | @Override
public void undo(SubsetSolution solution) {
// remove all added IDs
solution.deselectAll(add);
// add all removed IDs
solution.selectAll(delete);
} | java | @Override
public void undo(SubsetSolution solution) {
// remove all added IDs
solution.deselectAll(add);
// add all removed IDs
solution.selectAll(delete);
} | [
"@",
"Override",
"public",
"void",
"undo",
"(",
"SubsetSolution",
"solution",
")",
"{",
"// remove all added IDs",
"solution",
".",
"deselectAll",
"(",
"add",
")",
";",
"// add all removed IDs",
"solution",
".",
"selectAll",
"(",
"delete",
")",
";",
"}"
] | Undo this move after it has been successfully applied to the given subset solution,
by removing all added IDs and adding all removed IDs. If the subset solution has been
modified since successful application of this move, the result of this operation is
undefined.
@param solution solution to which the move has been su... | [
"Undo",
"this",
"move",
"after",
"it",
"has",
"been",
"successfully",
"applied",
"to",
"the",
"given",
"subset",
"solution",
"by",
"removing",
"all",
"added",
"IDs",
"and",
"adding",
"all",
"removed",
"IDs",
".",
"If",
"the",
"subset",
"solution",
"has",
"... | 4e85c20c142902373e5b5e8b5d12a2558650f66d | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/moves/GeneralSubsetMove.java#L128-L134 |
11,588 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/types/IPTC.java | IPTC.createMetadata | @Override
public Metadata createMetadata() {
Metadata metadata = new Metadata();
try {
for (DataSet ds : iimFile.getDataSets()) {
Object value = "";
try {
value = ds.getValue();
} catch (Exception ex) {
}
DataSetInfo info = ds.getInfo();
//Syste... | java | @Override
public Metadata createMetadata() {
Metadata metadata = new Metadata();
try {
for (DataSet ds : iimFile.getDataSets()) {
Object value = "";
try {
value = ds.getValue();
} catch (Exception ex) {
}
DataSetInfo info = ds.getInfo();
//Syste... | [
"@",
"Override",
"public",
"Metadata",
"createMetadata",
"(",
")",
"{",
"Metadata",
"metadata",
"=",
"new",
"Metadata",
"(",
")",
";",
"try",
"{",
"for",
"(",
"DataSet",
"ds",
":",
"iimFile",
".",
"getDataSets",
"(",
")",
")",
"{",
"Object",
"value",
"... | Creates the metadata.
@return the hash map | [
"Creates",
"the",
"metadata",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/types/IPTC.java#L119-L140 |
11,589 | EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/types/IPTC.java | IPTC.read | public void read(TagValue tv, String filename) {
originalValue = tv.getValue();
File file = new File(filename);
IIMReader reader = null;
SubIIMInputStream subStream = null;
try {
int offset = tv.getReadOffset();
int length = tv.getReadlength();
subStream = new SubIIMInputStream(new... | java | public void read(TagValue tv, String filename) {
originalValue = tv.getValue();
File file = new File(filename);
IIMReader reader = null;
SubIIMInputStream subStream = null;
try {
int offset = tv.getReadOffset();
int length = tv.getReadlength();
subStream = new SubIIMInputStream(new... | [
"public",
"void",
"read",
"(",
"TagValue",
"tv",
",",
"String",
"filename",
")",
"{",
"originalValue",
"=",
"tv",
".",
"getValue",
"(",
")",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"filename",
")",
";",
"IIMReader",
"reader",
"=",
"null",
";",
... | Reads the IPTC.
@param tv the TagValue containing the array of bytes of the IPTC | [
"Reads",
"the",
"IPTC",
"."
] | 682605d3ed207a66213278c054c98f1b909472b7 | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/types/IPTC.java#L266-L311 |
11,590 | maxirosson/jdroid-android | jdroid-android-firebase-fcm/src/main/java/com/jdroid/android/firebase/fcm/FcmListenerResolver.java | FcmListenerResolver.onMessageReceived | public void onMessageReceived(RemoteMessage remoteMessage) {
if (LoggerUtils.isEnabled()) {
StringBuilder builder = new StringBuilder();
builder.append("Message received. ");
builder.append("from: ");
builder.append(remoteMessage.getFrom());
if (remoteMessage.getMessageType() != null) {
builder.a... | java | public void onMessageReceived(RemoteMessage remoteMessage) {
if (LoggerUtils.isEnabled()) {
StringBuilder builder = new StringBuilder();
builder.append("Message received. ");
builder.append("from: ");
builder.append(remoteMessage.getFrom());
if (remoteMessage.getMessageType() != null) {
builder.a... | [
"public",
"void",
"onMessageReceived",
"(",
"RemoteMessage",
"remoteMessage",
")",
"{",
"if",
"(",
"LoggerUtils",
".",
"isEnabled",
"(",
")",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"... | Called when message is received. Since Android O, have a guaranteed life cycle limited to 10 seconds for this method execution | [
"Called",
"when",
"message",
"is",
"received",
".",
"Since",
"Android",
"O",
"have",
"a",
"guaranteed",
"life",
"cycle",
"limited",
"to",
"10",
"seconds",
"for",
"this",
"method",
"execution"
] | 1ba9cae56a16fa36bdb2c9c04379853f0300707f | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-firebase-fcm/src/main/java/com/jdroid/android/firebase/fcm/FcmListenerResolver.java#L16-L68 |
11,591 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScanByNum | @Override
public IScan getScanByNum(int scanNum) {
IScan scan = getNum2scan().get(scanNum);
if (scan != null) {
return scan;
}
return null;
} | java | @Override
public IScan getScanByNum(int scanNum) {
IScan scan = getNum2scan().get(scanNum);
if (scan != null) {
return scan;
}
return null;
} | [
"@",
"Override",
"public",
"IScan",
"getScanByNum",
"(",
"int",
"scanNum",
")",
"{",
"IScan",
"scan",
"=",
"getNum2scan",
"(",
")",
".",
"get",
"(",
"scanNum",
")",
";",
"if",
"(",
"scan",
"!=",
"null",
")",
"{",
"return",
"scan",
";",
"}",
"return",... | The name says it all.
@param scanNum Scan number as it was in the original MS file
@return Scan or null, if no such scan number exists in this ScanCollection | [
"The",
"name",
"says",
"it",
"all",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L338-L345 |
11,592 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScanByNumLower | @Override
public IScan getScanByNumLower(int scanNum) {
IScan scan = getNum2scan().lowerEntry(scanNum).getValue();
if (scan != null) {
return scan;
}
return null;
} | java | @Override
public IScan getScanByNumLower(int scanNum) {
IScan scan = getNum2scan().lowerEntry(scanNum).getValue();
if (scan != null) {
return scan;
}
return null;
} | [
"@",
"Override",
"public",
"IScan",
"getScanByNumLower",
"(",
"int",
"scanNum",
")",
"{",
"IScan",
"scan",
"=",
"getNum2scan",
"(",
")",
".",
"lowerEntry",
"(",
"scanNum",
")",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"scan",
"!=",
"null",
")",
"{",
... | Scan with closest Number STRICTLY less than the provided one is returned.
@param scanNum scan number
@return Scan or null, if the ScanCollection didn't have any scans with numbers <= than this one | [
"Scan",
"with",
"closest",
"Number",
"STRICTLY",
"less",
"than",
"the",
"provided",
"one",
"is",
"returned",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L353-L360 |
11,593 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScanByNumUpper | @Override
public IScan getScanByNumUpper(int scanNum) {
IScan scan = getNum2scan().ceilingEntry(scanNum).getValue();
if (scan != null) {
return scan;
}
return null;
} | java | @Override
public IScan getScanByNumUpper(int scanNum) {
IScan scan = getNum2scan().ceilingEntry(scanNum).getValue();
if (scan != null) {
return scan;
}
return null;
} | [
"@",
"Override",
"public",
"IScan",
"getScanByNumUpper",
"(",
"int",
"scanNum",
")",
"{",
"IScan",
"scan",
"=",
"getNum2scan",
"(",
")",
".",
"ceilingEntry",
"(",
"scanNum",
")",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"scan",
"!=",
"null",
")",
"{"... | Scan with the closest Number greater or equal to the provided one is returned.
@param scanNum scan number
@return Scan or null, if the ScanCollection didn't have any scans with numbers >= than this
one | [
"Scan",
"with",
"the",
"closest",
"Number",
"greater",
"or",
"equal",
"to",
"the",
"provided",
"one",
"is",
"returned",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L369-L376 |
11,594 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScanByNumClosest | @Override
public IScan getScanByNumClosest(int scanNum) {
IScan result = null;
Map.Entry<Integer, IScan> lower = getNum2scan().lowerEntry(scanNum);
Map.Entry<Integer, IScan> upper = getNum2scan().ceilingEntry(scanNum);
if (upper != null && lower != null) {
result =
Integer.compare(lowe... | java | @Override
public IScan getScanByNumClosest(int scanNum) {
IScan result = null;
Map.Entry<Integer, IScan> lower = getNum2scan().lowerEntry(scanNum);
Map.Entry<Integer, IScan> upper = getNum2scan().ceilingEntry(scanNum);
if (upper != null && lower != null) {
result =
Integer.compare(lowe... | [
"@",
"Override",
"public",
"IScan",
"getScanByNumClosest",
"(",
"int",
"scanNum",
")",
"{",
"IScan",
"result",
"=",
"null",
";",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"IScan",
">",
"lower",
"=",
"getNum2scan",
"(",
")",
".",
"lowerEntry",
"(",
"scanN... | Scan with the closest Number is returned.
@param scanNum scan number
@return null might be returned in an extreme case when the scan collection is empty. | [
"Scan",
"with",
"the",
"closest",
"Number",
"is",
"returned",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L384-L398 |
11,595 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScansByRtLower | @Override
public List<IScan> getScansByRtLower(double rt) {
Map.Entry<Double, List<IScan>> lowerEntry = getRt2scan().lowerEntry(rt);
if (lowerEntry == null) {
return null;
}
List<IScan> scans = lowerEntry.getValue();
if (scans != null) {
return scans;
}
return null;
} | java | @Override
public List<IScan> getScansByRtLower(double rt) {
Map.Entry<Double, List<IScan>> lowerEntry = getRt2scan().lowerEntry(rt);
if (lowerEntry == null) {
return null;
}
List<IScan> scans = lowerEntry.getValue();
if (scans != null) {
return scans;
}
return null;
} | [
"@",
"Override",
"public",
"List",
"<",
"IScan",
">",
"getScansByRtLower",
"(",
"double",
"rt",
")",
"{",
"Map",
".",
"Entry",
"<",
"Double",
",",
"List",
"<",
"IScan",
">",
">",
"lowerEntry",
"=",
"getRt2scan",
"(",
")",
".",
"lowerEntry",
"(",
"rt",
... | Scan List with closest RT less or equal to the provided one are returned. | [
"Scan",
"List",
"with",
"closest",
"RT",
"less",
"or",
"equal",
"to",
"the",
"provided",
"one",
"are",
"returned",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L418-L429 |
11,596 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScansByRtUpper | @Override
public List<IScan> getScansByRtUpper(double rt) {
Map.Entry<Double, List<IScan>> ceilingEntry = getMapRt2scan().ceilingEntry(rt);
if (ceilingEntry == null) {
return null;
}
List<IScan> scans = ceilingEntry.getValue();
if (scans != null) {
return scans;
}
return null;
... | java | @Override
public List<IScan> getScansByRtUpper(double rt) {
Map.Entry<Double, List<IScan>> ceilingEntry = getMapRt2scan().ceilingEntry(rt);
if (ceilingEntry == null) {
return null;
}
List<IScan> scans = ceilingEntry.getValue();
if (scans != null) {
return scans;
}
return null;
... | [
"@",
"Override",
"public",
"List",
"<",
"IScan",
">",
"getScansByRtUpper",
"(",
"double",
"rt",
")",
"{",
"Map",
".",
"Entry",
"<",
"Double",
",",
"List",
"<",
"IScan",
">",
">",
"ceilingEntry",
"=",
"getMapRt2scan",
"(",
")",
".",
"ceilingEntry",
"(",
... | Scan List with the closest RT greater or equal to the provided one are returned. | [
"Scan",
"List",
"with",
"the",
"closest",
"RT",
"greater",
"or",
"equal",
"to",
"the",
"provided",
"one",
"are",
"returned",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L434-L445 |
11,597 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScansByRtClosest | @Override
public List<IScan> getScansByRtClosest(double rt) {
List<IScan> result = null;
Map.Entry<Double, List<IScan>> lower = getMapRt2scan().lowerEntry(rt);
Map.Entry<Double, List<IScan>> upper = getMapRt2scan().ceilingEntry(rt);
if (upper != null && lower != null) {
if (Math.abs(rt - lower.g... | java | @Override
public List<IScan> getScansByRtClosest(double rt) {
List<IScan> result = null;
Map.Entry<Double, List<IScan>> lower = getMapRt2scan().lowerEntry(rt);
Map.Entry<Double, List<IScan>> upper = getMapRt2scan().ceilingEntry(rt);
if (upper != null && lower != null) {
if (Math.abs(rt - lower.g... | [
"@",
"Override",
"public",
"List",
"<",
"IScan",
">",
"getScansByRtClosest",
"(",
"double",
"rt",
")",
"{",
"List",
"<",
"IScan",
">",
"result",
"=",
"null",
";",
"Map",
".",
"Entry",
"<",
"Double",
",",
"List",
"<",
"IScan",
">",
">",
"lower",
"=",
... | Scans with the closest RT are returned.
@return null if no scans were found at all, but this should only happen if your ScanCollection
is empty. | [
"Scans",
"with",
"the",
"closest",
"RT",
"are",
"returned",
"."
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L453-L471 |
11,598 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScanCountAtMsLevel | @Override
public Integer getScanCountAtMsLevel(int msLevel) {
TreeMap<Integer, IScan> msLevelScanMap = getMapMsLevel2index().get(msLevel).getNum2scan();
if (msLevelScanMap != null) {
return msLevelScanMap.size();
}
return null;
} | java | @Override
public Integer getScanCountAtMsLevel(int msLevel) {
TreeMap<Integer, IScan> msLevelScanMap = getMapMsLevel2index().get(msLevel).getNum2scan();
if (msLevelScanMap != null) {
return msLevelScanMap.size();
}
return null;
} | [
"@",
"Override",
"public",
"Integer",
"getScanCountAtMsLevel",
"(",
"int",
"msLevel",
")",
"{",
"TreeMap",
"<",
"Integer",
",",
"IScan",
">",
"msLevelScanMap",
"=",
"getMapMsLevel2index",
"(",
")",
".",
"get",
"(",
"msLevel",
")",
".",
"getNum2scan",
"(",
")... | If the msLevel doesn't exist in this ScanCollectionDefault, returns null
@return null, if msLevel doesn't exist. Actual number of scans otherwise. | [
"If",
"the",
"msLevel",
"doesn",
"t",
"exist",
"in",
"this",
"ScanCollectionDefault",
"returns",
"null"
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L599-L606 |
11,599 | chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java | ScanCollectionDefault.getScansInSubsetByNumber | private NavigableMap<Integer, IScan> getScansInSubsetByNumber(
NavigableMap<Integer, IScan> scanMap, LCMSDataSubset subset) {
NavigableMap<Integer, IScan> scansInSubsetByNumber = scanMap;
if (subset.getScanNumLo() != null) {
scansInSubsetByNumber
.subMap(subset.getScanNumLo(), true, scansI... | java | private NavigableMap<Integer, IScan> getScansInSubsetByNumber(
NavigableMap<Integer, IScan> scanMap, LCMSDataSubset subset) {
NavigableMap<Integer, IScan> scansInSubsetByNumber = scanMap;
if (subset.getScanNumLo() != null) {
scansInSubsetByNumber
.subMap(subset.getScanNumLo(), true, scansI... | [
"private",
"NavigableMap",
"<",
"Integer",
",",
"IScan",
">",
"getScansInSubsetByNumber",
"(",
"NavigableMap",
"<",
"Integer",
",",
"IScan",
">",
"scanMap",
",",
"LCMSDataSubset",
"subset",
")",
"{",
"NavigableMap",
"<",
"Integer",
",",
"IScan",
">",
"scansInSub... | It won't filter the scanMap according the the full subset predicate, it only selects scan
number range. Further checks for ms-levels and precursor ranges is required. It's just a
convenience method.
@param scanMap use {@link #getMapNum2scan() } for the broadest use
@param subset only scan numbers will be used for filt... | [
"It",
"won",
"t",
"filter",
"the",
"scanMap",
"according",
"the",
"the",
"full",
"subset",
"predicate",
"it",
"only",
"selects",
"scan",
"number",
"range",
".",
"Further",
"checks",
"for",
"ms",
"-",
"levels",
"and",
"precursor",
"ranges",
"is",
"required",
... | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/datatypes/scancollection/impl/ScanCollectionDefault.java#L750-L762 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.