repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.convertURLToFile | @Pure
@SuppressWarnings("checkstyle:npathcomplexity")
public static File convertURLToFile(URL url) {
URL theUrl = url;
if (theUrl == null) {
return null;
}
if (URISchemeType.RESOURCE.isURL(theUrl)) {
theUrl = Resources.getResource(decodeHTMLEntities(theUrl.getFile()));
if (theUrl == null) {
theUrl = url;
}
}
URI uri;
try {
// this is the step that can fail, and so
// it should be this step that should be fixed
uri = theUrl.toURI();
} catch (URISyntaxException e) {
// OK if we are here, then obviously the URL did
// not comply with RFC 2396. This can only
// happen if we have illegal unescaped characters.
// If we have one unescaped character, then
// the only automated fix we can apply, is to assume
// all characters are unescaped.
// If we want to construct a URI from unescaped
// characters, then we have to use the component
// constructors:
try {
uri = new URI(theUrl.getProtocol(), theUrl.getUserInfo(),
theUrl.getHost(), theUrl.getPort(),
decodeHTMLEntities(theUrl.getPath()),
decodeHTMLEntities(theUrl.getQuery()),
theUrl.getRef());
} catch (URISyntaxException e1) {
// The URL is broken beyond automatic repair
throw new IllegalArgumentException(Locale.getString("E1", theUrl)); //$NON-NLS-1$
}
}
if (uri != null && URISchemeType.FILE.isURI(uri)) {
final String auth = uri.getAuthority();
String path = uri.getPath();
if (path == null) {
path = uri.getRawPath();
}
if (path == null) {
path = uri.getSchemeSpecificPart();
}
if (path == null) {
path = uri.getRawSchemeSpecificPart();
}
if (path != null) {
if (auth == null || "".equals(auth)) { //$NON-NLS-1$
// absolute filename in URI
path = decodeHTMLEntities(path);
} else {
// relative filename in URI, extract it directly
path = decodeHTMLEntities(auth + path);
}
if (Pattern.matches("^" + Pattern.quote(URL_PATH_SEPARATOR) //$NON-NLS-1$
+ "[a-zA-Z][:|].*$", path)) { //$NON-NLS-1$
path = path.substring(URL_PATH_SEPARATOR.length());
}
return new File(path);
}
}
throw new IllegalArgumentException(Locale.getString("E2", theUrl)); //$NON-NLS-1$
} | java | @Pure
@SuppressWarnings("checkstyle:npathcomplexity")
public static File convertURLToFile(URL url) {
URL theUrl = url;
if (theUrl == null) {
return null;
}
if (URISchemeType.RESOURCE.isURL(theUrl)) {
theUrl = Resources.getResource(decodeHTMLEntities(theUrl.getFile()));
if (theUrl == null) {
theUrl = url;
}
}
URI uri;
try {
// this is the step that can fail, and so
// it should be this step that should be fixed
uri = theUrl.toURI();
} catch (URISyntaxException e) {
// OK if we are here, then obviously the URL did
// not comply with RFC 2396. This can only
// happen if we have illegal unescaped characters.
// If we have one unescaped character, then
// the only automated fix we can apply, is to assume
// all characters are unescaped.
// If we want to construct a URI from unescaped
// characters, then we have to use the component
// constructors:
try {
uri = new URI(theUrl.getProtocol(), theUrl.getUserInfo(),
theUrl.getHost(), theUrl.getPort(),
decodeHTMLEntities(theUrl.getPath()),
decodeHTMLEntities(theUrl.getQuery()),
theUrl.getRef());
} catch (URISyntaxException e1) {
// The URL is broken beyond automatic repair
throw new IllegalArgumentException(Locale.getString("E1", theUrl)); //$NON-NLS-1$
}
}
if (uri != null && URISchemeType.FILE.isURI(uri)) {
final String auth = uri.getAuthority();
String path = uri.getPath();
if (path == null) {
path = uri.getRawPath();
}
if (path == null) {
path = uri.getSchemeSpecificPart();
}
if (path == null) {
path = uri.getRawSchemeSpecificPart();
}
if (path != null) {
if (auth == null || "".equals(auth)) { //$NON-NLS-1$
// absolute filename in URI
path = decodeHTMLEntities(path);
} else {
// relative filename in URI, extract it directly
path = decodeHTMLEntities(auth + path);
}
if (Pattern.matches("^" + Pattern.quote(URL_PATH_SEPARATOR) //$NON-NLS-1$
+ "[a-zA-Z][:|].*$", path)) { //$NON-NLS-1$
path = path.substring(URL_PATH_SEPARATOR.length());
}
return new File(path);
}
}
throw new IllegalArgumentException(Locale.getString("E2", theUrl)); //$NON-NLS-1$
} | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"public",
"static",
"File",
"convertURLToFile",
"(",
"URL",
"url",
")",
"{",
"URL",
"theUrl",
"=",
"url",
";",
"if",
"(",
"theUrl",
"==",
"null",
")",
"{",
"return",
"null",
... | Convert an URL which represents a local file or a resource into a File.
@param url is the URL to convert.
@return the file.
@throws IllegalArgumentException is the URL was malformed. | [
"Convert",
"an",
"URL",
"which",
"represents",
"a",
"local",
"file",
"or",
"a",
"resource",
"into",
"a",
"File",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L1883-L1951 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.getParentURL | @Pure
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
public static URL getParentURL(URL url) throws MalformedURLException {
if (url == null) {
return url;
}
String path = url.getPath();
final String prefix;
final String parentStr;
switch (URISchemeType.getSchemeType(url)) {
case JAR:
final int index = path.indexOf(JAR_URL_FILE_ROOT);
assert index > 0;
prefix = path.substring(0, index + 1);
path = path.substring(index + 1);
parentStr = URL_PATH_SEPARATOR;
break;
case FILE:
prefix = null;
parentStr = ".." + URL_PATH_SEPARATOR; //$NON-NLS-1$
break;
//$CASES-OMITTED$
default:
prefix = null;
parentStr = URL_PATH_SEPARATOR;
}
if (path == null || "".equals(path)) { //$NON-NLS-1$
path = parentStr;
}
int index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR);
if (index == -1) {
path = parentStr;
} else if (index == path.length() - 1) {
index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR, index - 1);
if (index == -1) {
path = parentStr;
} else {
path = path.substring(0, index + 1);
}
} else {
path = path.substring(0, index + 1);
}
if (prefix != null) {
path = prefix + path;
}
return new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
} | java | @Pure
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
public static URL getParentURL(URL url) throws MalformedURLException {
if (url == null) {
return url;
}
String path = url.getPath();
final String prefix;
final String parentStr;
switch (URISchemeType.getSchemeType(url)) {
case JAR:
final int index = path.indexOf(JAR_URL_FILE_ROOT);
assert index > 0;
prefix = path.substring(0, index + 1);
path = path.substring(index + 1);
parentStr = URL_PATH_SEPARATOR;
break;
case FILE:
prefix = null;
parentStr = ".." + URL_PATH_SEPARATOR; //$NON-NLS-1$
break;
//$CASES-OMITTED$
default:
prefix = null;
parentStr = URL_PATH_SEPARATOR;
}
if (path == null || "".equals(path)) { //$NON-NLS-1$
path = parentStr;
}
int index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR);
if (index == -1) {
path = parentStr;
} else if (index == path.length() - 1) {
index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR, index - 1);
if (index == -1) {
path = parentStr;
} else {
path = path.substring(0, index + 1);
}
} else {
path = path.substring(0, index + 1);
}
if (prefix != null) {
path = prefix + path;
}
return new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
} | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:cyclomaticcomplexity\"",
",",
"\"checkstyle:npathcomplexity\"",
"}",
")",
"public",
"static",
"URL",
"getParentURL",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"url",
"==",... | Replies the parent URL for the given URL.
@param url the URL.
@return the parent URL
@throws MalformedURLException if the parent URL cannot be built. | [
"Replies",
"the",
"parent",
"URL",
"for",
"the",
"given",
"URL",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2468-L2518 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.extractLocalPath | @Pure
@SuppressWarnings("checkstyle:magicnumber")
private static String extractLocalPath(String filename) {
if (filename == null) {
return null;
}
final int max = Math.min(FILE_PREFIX.length, filename.length());
final int inner = max - 2;
if (inner <= 0) {
return filename;
}
boolean foundInner = false;
boolean foundFull = false;
for (int i = 0; i < max; ++i) {
final char c = Character.toLowerCase(filename.charAt(i));
if (FILE_PREFIX[i] != c) {
foundFull = false;
foundInner = i >= inner;
break;
}
foundFull = true;
}
String fn;
if (foundFull) {
fn = filename.substring(FILE_PREFIX.length);
} else if (foundInner) {
fn = filename.substring(inner);
} else {
fn = filename;
}
if (Pattern.matches("^(" + Pattern.quote(URL_PATH_SEPARATOR) + "|" //$NON-NLS-1$ //$NON-NLS-2$
+ Pattern.quote(WINDOWS_SEPARATOR_STRING) + ")[a-zA-Z][:|].*$", fn)) { //$NON-NLS-1$
fn = fn.substring(1);
}
return fn;
} | java | @Pure
@SuppressWarnings("checkstyle:magicnumber")
private static String extractLocalPath(String filename) {
if (filename == null) {
return null;
}
final int max = Math.min(FILE_PREFIX.length, filename.length());
final int inner = max - 2;
if (inner <= 0) {
return filename;
}
boolean foundInner = false;
boolean foundFull = false;
for (int i = 0; i < max; ++i) {
final char c = Character.toLowerCase(filename.charAt(i));
if (FILE_PREFIX[i] != c) {
foundFull = false;
foundInner = i >= inner;
break;
}
foundFull = true;
}
String fn;
if (foundFull) {
fn = filename.substring(FILE_PREFIX.length);
} else if (foundInner) {
fn = filename.substring(inner);
} else {
fn = filename;
}
if (Pattern.matches("^(" + Pattern.quote(URL_PATH_SEPARATOR) + "|" //$NON-NLS-1$ //$NON-NLS-2$
+ Pattern.quote(WINDOWS_SEPARATOR_STRING) + ")[a-zA-Z][:|].*$", fn)) { //$NON-NLS-1$
fn = fn.substring(1);
}
return fn;
} | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"private",
"static",
"String",
"extractLocalPath",
"(",
"String",
"filename",
")",
"{",
"if",
"(",
"filename",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"... | Test if the given filename is a local filename and extract
the path component.
@param filename the filename.
@return the path. | [
"Test",
"if",
"the",
"given",
"filename",
"is",
"a",
"local",
"filename",
"and",
"extract",
"the",
"path",
"component",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2526-L2561 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.isWindowsNativeFilename | @Pure
public static boolean isWindowsNativeFilename(String filename) {
final String fn = extractLocalPath(filename);
if (fn == null || fn.length() == 0) {
return false;
}
final Pattern pattern = Pattern.compile(WINDOW_NATIVE_FILENAME_PATTERN);
final Matcher matcher = pattern.matcher(fn);
return matcher.matches();
} | java | @Pure
public static boolean isWindowsNativeFilename(String filename) {
final String fn = extractLocalPath(filename);
if (fn == null || fn.length() == 0) {
return false;
}
final Pattern pattern = Pattern.compile(WINDOW_NATIVE_FILENAME_PATTERN);
final Matcher matcher = pattern.matcher(fn);
return matcher.matches();
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isWindowsNativeFilename",
"(",
"String",
"filename",
")",
"{",
"final",
"String",
"fn",
"=",
"extractLocalPath",
"(",
"filename",
")",
";",
"if",
"(",
"fn",
"==",
"null",
"||",
"fn",
".",
"length",
"(",
")",
"... | Replies if the given string contains a Windows® native long filename.
<p>Long filenames (LFN), spelled "long file names" by Microsoft Corporation,
are Microsoft's way of implementing filenames longer than the 8.3,
or short-filename, naming scheme used in Microsoft DOS in their modern
FAT and NTFS filesystems. Because these filenames can be longer than the
8.3 filename, they can be more descriptive. Another advantage of this
scheme is that it allows for use of *nix files ending in (e.g. .jpeg,
.tiff, .html, and .xhtml) rather than specialized shortened names
(e.g. .jpg, .tif, .htm, .xht).
<p>The long filename system allows a maximum length of 255 UTF-16 characters,
including spaces and non-alphanumeric characters; excluding the following
characters, which have special meaning within the command interpreter or
the operating system kernel: <code>\</code> <code>/</code> <code>:</code>
<code>*</code> <code>?</code> <code>"</code> <code><</code>
<code>></code> <code>|</code>
@param filename the filename to test.
@return <code>true</code> if the given filename is a long filename,
otherwise <code>false</code>
@see #normalizeWindowsNativeFilename(String) | [
"Replies",
"if",
"the",
"given",
"string",
"contains",
"a",
"Windows®",
";",
"native",
"long",
"filename",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2586-L2595 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.normalizeWindowsNativeFilename | @Pure
public static File normalizeWindowsNativeFilename(String filename) {
final String fn = extractLocalPath(filename);
if (fn != null && fn.length() > 0) {
final Pattern pattern = Pattern.compile(WINDOW_NATIVE_FILENAME_PATTERN);
final Matcher matcher = pattern.matcher(fn);
if (matcher.find()) {
return new File(fn.replace(WINDOWS_SEPARATOR_CHAR, File.separatorChar));
}
}
return null;
} | java | @Pure
public static File normalizeWindowsNativeFilename(String filename) {
final String fn = extractLocalPath(filename);
if (fn != null && fn.length() > 0) {
final Pattern pattern = Pattern.compile(WINDOW_NATIVE_FILENAME_PATTERN);
final Matcher matcher = pattern.matcher(fn);
if (matcher.find()) {
return new File(fn.replace(WINDOWS_SEPARATOR_CHAR, File.separatorChar));
}
}
return null;
} | [
"@",
"Pure",
"public",
"static",
"File",
"normalizeWindowsNativeFilename",
"(",
"String",
"filename",
")",
"{",
"final",
"String",
"fn",
"=",
"extractLocalPath",
"(",
"filename",
")",
";",
"if",
"(",
"fn",
"!=",
"null",
"&&",
"fn",
".",
"length",
"(",
")",... | Normalize the given string contains a Windows® native long filename
and replies a Java-standard version.
<p>Long filenames (LFN), spelled "long file names" by Microsoft Corporation,
are Microsoft's way of implementing filenames longer than the 8.3,
or short-filename, naming scheme used in Microsoft DOS in their modern
FAT and NTFS filesystems. Because these filenames can be longer than the
8.3 filename, they can be more descriptive. Another advantage of this
scheme is that it allows for use of *nix files ending in (e.g. .jpeg,
.tiff, .html, and .xhtml) rather than specialized shortened names
(e.g. .jpg, .tif, .htm, .xht).
<p>The long filename system allows a maximum length of 255 UTF-16 characters,
including spaces and non-alphanumeric characters; excluding the following
characters, which have special meaning within the command interpreter or
the operating system kernel: <code>\</code> <code>/</code> <code>:</code>
<code>*</code> <code>?</code> <code>"</code> <code><</code>
<code>></code> <code>|</code>
@param filename the filename to test.
@return the normalized path or <code>null</code> if not a windows native path.
@see #isWindowsNativeFilename(String) | [
"Normalize",
"the",
"given",
"string",
"contains",
"a",
"Windows®",
";",
"native",
"long",
"filename",
"and",
"replies",
"a",
"Java",
"-",
"standard",
"version",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2620-L2631 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.makeCanonicalURL | @Pure
public static URL makeCanonicalURL(URL url) {
if (url != null) {
final String[] pathComponents = url.getPath().split(Pattern.quote(URL_PATH_SEPARATOR));
final List<String> canonicalPath = new LinkedList<>();
for (final String component : pathComponents) {
if (!CURRENT_DIRECTORY.equals(component)) {
if (PARENT_DIRECTORY.equals(component)) {
if (!canonicalPath.isEmpty()) {
canonicalPath.remove(canonicalPath.size() - 1);
} else {
canonicalPath.add(component);
}
} else {
canonicalPath.add(component);
}
}
}
final StringBuilder newPathBuffer = new StringBuilder();
boolean isFirst = true;
for (final String component : canonicalPath) {
if (!isFirst) {
newPathBuffer.append(URL_PATH_SEPARATOR_CHAR);
} else {
isFirst = false;
}
newPathBuffer.append(component);
}
try {
return new URI(
url.getProtocol(),
url.getUserInfo(),
url.getHost(),
url.getPort(),
newPathBuffer.toString(),
url.getQuery(),
url.getRef()).toURL();
} catch (MalformedURLException | URISyntaxException exception) {
//
}
try {
return new URL(
url.getProtocol(),
url.getHost(),
newPathBuffer.toString());
} catch (Throwable exception) {
//
}
}
return url;
} | java | @Pure
public static URL makeCanonicalURL(URL url) {
if (url != null) {
final String[] pathComponents = url.getPath().split(Pattern.quote(URL_PATH_SEPARATOR));
final List<String> canonicalPath = new LinkedList<>();
for (final String component : pathComponents) {
if (!CURRENT_DIRECTORY.equals(component)) {
if (PARENT_DIRECTORY.equals(component)) {
if (!canonicalPath.isEmpty()) {
canonicalPath.remove(canonicalPath.size() - 1);
} else {
canonicalPath.add(component);
}
} else {
canonicalPath.add(component);
}
}
}
final StringBuilder newPathBuffer = new StringBuilder();
boolean isFirst = true;
for (final String component : canonicalPath) {
if (!isFirst) {
newPathBuffer.append(URL_PATH_SEPARATOR_CHAR);
} else {
isFirst = false;
}
newPathBuffer.append(component);
}
try {
return new URI(
url.getProtocol(),
url.getUserInfo(),
url.getHost(),
url.getPort(),
newPathBuffer.toString(),
url.getQuery(),
url.getRef()).toURL();
} catch (MalformedURLException | URISyntaxException exception) {
//
}
try {
return new URL(
url.getProtocol(),
url.getHost(),
newPathBuffer.toString());
} catch (Throwable exception) {
//
}
}
return url;
} | [
"@",
"Pure",
"public",
"static",
"URL",
"makeCanonicalURL",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"final",
"String",
"[",
"]",
"pathComponents",
"=",
"url",
".",
"getPath",
"(",
")",
".",
"split",
"(",
"Pattern",
".",... | Make the given URL canonical.
<p>A canonical pathname is both absolute and unique. This method maps
the pathname to its unique form. This typically involves removing redundant names
such as <tt>"."</tt> and <tt>".."</tt> from the pathname.
@param url is the URL to make canonical
@return the canonical form of the given URL.
@since 6.0 | [
"Make",
"the",
"given",
"URL",
"canonical",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2859-L2913 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.zipFile | public static void zipFile(File input, File output) throws IOException {
try (FileOutputStream fos = new FileOutputStream(output)) {
zipFile(input, fos);
}
} | java | public static void zipFile(File input, File output) throws IOException {
try (FileOutputStream fos = new FileOutputStream(output)) {
zipFile(input, fos);
}
} | [
"public",
"static",
"void",
"zipFile",
"(",
"File",
"input",
",",
"File",
"output",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"output",
")",
")",
"{",
"zipFile",
"(",
"input",
",",
"fos",... | Create a zip file from the given input file.
@param input the name of the file to compress.
@param output the name of the ZIP file to create.
@throws IOException when ziiping is failing.
@since 6.2 | [
"Create",
"a",
"zip",
"file",
"from",
"the",
"given",
"input",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2923-L2927 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.zipFile | @SuppressWarnings("checkstyle:npathcomplexity")
public static void zipFile(File input, OutputStream output) throws IOException {
try (ZipOutputStream zos = new ZipOutputStream(output)) {
if (input == null) {
return;
}
final LinkedList<File> candidates = new LinkedList<>();
candidates.add(input);
final byte[] buffer = new byte[BUFFER_SIZE];
int len;
File file;
File relativeFile;
String zipFilename;
final File rootDirectory = (input.isDirectory()) ? input : input.getParentFile();
while (!candidates.isEmpty()) {
file = candidates.removeFirst();
assert file != null;
if (file.getAbsoluteFile().equals(rootDirectory.getAbsoluteFile())) {
relativeFile = null;
} else {
relativeFile = makeRelative(file, rootDirectory, false);
}
if (file.isDirectory()) {
if (relativeFile != null) {
zipFilename = fromFileStandardToURLStandard(relativeFile) + URL_PATH_SEPARATOR;
final ZipEntry zipEntry = new ZipEntry(zipFilename);
zos.putNextEntry(zipEntry);
zos.closeEntry();
}
candidates.addAll(Arrays.asList(file.listFiles()));
} else if (relativeFile != null) {
try (FileInputStream fis = new FileInputStream(file)) {
zipFilename = fromFileStandardToURLStandard(relativeFile);
final ZipEntry zipEntry = new ZipEntry(zipFilename);
zos.putNextEntry(zipEntry);
while ((len = fis.read(buffer)) > 0) {
zos.write(buffer, 0, len);
}
zos.closeEntry();
}
}
}
}
} | java | @SuppressWarnings("checkstyle:npathcomplexity")
public static void zipFile(File input, OutputStream output) throws IOException {
try (ZipOutputStream zos = new ZipOutputStream(output)) {
if (input == null) {
return;
}
final LinkedList<File> candidates = new LinkedList<>();
candidates.add(input);
final byte[] buffer = new byte[BUFFER_SIZE];
int len;
File file;
File relativeFile;
String zipFilename;
final File rootDirectory = (input.isDirectory()) ? input : input.getParentFile();
while (!candidates.isEmpty()) {
file = candidates.removeFirst();
assert file != null;
if (file.getAbsoluteFile().equals(rootDirectory.getAbsoluteFile())) {
relativeFile = null;
} else {
relativeFile = makeRelative(file, rootDirectory, false);
}
if (file.isDirectory()) {
if (relativeFile != null) {
zipFilename = fromFileStandardToURLStandard(relativeFile) + URL_PATH_SEPARATOR;
final ZipEntry zipEntry = new ZipEntry(zipFilename);
zos.putNextEntry(zipEntry);
zos.closeEntry();
}
candidates.addAll(Arrays.asList(file.listFiles()));
} else if (relativeFile != null) {
try (FileInputStream fis = new FileInputStream(file)) {
zipFilename = fromFileStandardToURLStandard(relativeFile);
final ZipEntry zipEntry = new ZipEntry(zipFilename);
zos.putNextEntry(zipEntry);
while ((len = fis.read(buffer)) > 0) {
zos.write(buffer, 0, len);
}
zos.closeEntry();
}
}
}
}
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"public",
"static",
"void",
"zipFile",
"(",
"File",
"input",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"try",
"(",
"ZipOutputStream",
"zos",
"=",
"new",
"ZipOutputStream",
... | Create a zip file from the given input file.
If the input file is a directory, the content of the directory is zipped.
If the input file is a standard file, it is zipped.
@param input the name of the file to compress.
@param output the name of the ZIP file to create.
@throws IOException when ziiping is failing.
@since 6.2 | [
"Create",
"a",
"zip",
"file",
"from",
"the",
"given",
"input",
"file",
".",
"If",
"the",
"input",
"file",
"is",
"a",
"directory",
"the",
"content",
"of",
"the",
"directory",
"is",
"zipped",
".",
"If",
"the",
"input",
"file",
"is",
"a",
"standard",
"fil... | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2940-L2990 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.unzipFile | public static void unzipFile(InputStream input, File output) throws IOException {
if (output == null) {
return;
}
output.mkdirs();
if (!output.isDirectory()) {
throw new IOException(Locale.getString("E3", output)); //$NON-NLS-1$
}
try (ZipInputStream zis = new ZipInputStream(input)) {
final byte[] buffer = new byte[BUFFER_SIZE];
int len;
ZipEntry zipEntry = zis.getNextEntry();
while (zipEntry != null) {
final String name = zipEntry.getName();
final File outFile = new File(output, name).getCanonicalFile();
if (zipEntry.isDirectory()) {
outFile.mkdirs();
} else {
outFile.getParentFile().mkdirs();
try (FileOutputStream fos = new FileOutputStream(outFile)) {
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
}
}
zipEntry = zis.getNextEntry();
}
}
} | java | public static void unzipFile(InputStream input, File output) throws IOException {
if (output == null) {
return;
}
output.mkdirs();
if (!output.isDirectory()) {
throw new IOException(Locale.getString("E3", output)); //$NON-NLS-1$
}
try (ZipInputStream zis = new ZipInputStream(input)) {
final byte[] buffer = new byte[BUFFER_SIZE];
int len;
ZipEntry zipEntry = zis.getNextEntry();
while (zipEntry != null) {
final String name = zipEntry.getName();
final File outFile = new File(output, name).getCanonicalFile();
if (zipEntry.isDirectory()) {
outFile.mkdirs();
} else {
outFile.getParentFile().mkdirs();
try (FileOutputStream fos = new FileOutputStream(outFile)) {
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
}
}
zipEntry = zis.getNextEntry();
}
}
} | [
"public",
"static",
"void",
"unzipFile",
"(",
"InputStream",
"input",
",",
"File",
"output",
")",
"throws",
"IOException",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"return",
";",
"}",
"output",
".",
"mkdirs",
"(",
")",
";",
"if",
"(",
"!",
"... | Unzip the given stream and write out the file in the output.
If the input file is a directory, the content of the directory is zipped.
If the input file is a standard file, it is zipped.
@param input the ZIP file to uncompress.
@param output the uncompressed file to create.
@throws IOException when uncompressing is failing.
@since 6.2 | [
"Unzip",
"the",
"given",
"stream",
"and",
"write",
"out",
"the",
"file",
"in",
"the",
"output",
".",
"If",
"the",
"input",
"file",
"is",
"a",
"directory",
"the",
"content",
"of",
"the",
"directory",
"is",
"zipped",
".",
"If",
"the",
"input",
"file",
"i... | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L3002-L3031 | train |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.unzipFile | public static void unzipFile(File input, File output) throws IOException {
try (FileInputStream fis = new FileInputStream(input)) {
unzipFile(fis, output);
}
} | java | public static void unzipFile(File input, File output) throws IOException {
try (FileInputStream fis = new FileInputStream(input)) {
unzipFile(fis, output);
}
} | [
"public",
"static",
"void",
"unzipFile",
"(",
"File",
"input",
",",
"File",
"output",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"input",
")",
")",
"{",
"unzipFile",
"(",
"fis",
",",
"output... | Unzip a file into the output directory.
@param input the ZIP file to uncompress.
@param output the uncompressed file to create.
@throws IOException when uncompressing is failing.
@since 6.2 | [
"Unzip",
"a",
"file",
"into",
"the",
"output",
"directory",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L3041-L3045 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/files/KeyValueSinks.java | KeyValueSinks.forPalDB | @Nonnull
public static KeyValueSink<Symbol, byte[]> forPalDB(final File dbFile,
final boolean compressValues)
throws IOException {
return PalDBKeyValueSink.forFile(dbFile, compressValues);
} | java | @Nonnull
public static KeyValueSink<Symbol, byte[]> forPalDB(final File dbFile,
final boolean compressValues)
throws IOException {
return PalDBKeyValueSink.forFile(dbFile, compressValues);
} | [
"@",
"Nonnull",
"public",
"static",
"KeyValueSink",
"<",
"Symbol",
",",
"byte",
"[",
"]",
">",
"forPalDB",
"(",
"final",
"File",
"dbFile",
",",
"final",
"boolean",
"compressValues",
")",
"throws",
"IOException",
"{",
"return",
"PalDBKeyValueSink",
".",
"forFil... | Creates a new key-value sink backed by an embedded database.
Compression should generally be used unless the values are very small or already compressed.
@param dbFile the file to use for the database
@param compressValues whether to compress values
@return a key-value sink
@throws IOException if the file could not be opened for writing | [
"Creates",
"a",
"new",
"key",
"-",
"value",
"sink",
"backed",
"by",
"an",
"embedded",
"database",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/KeyValueSinks.java#L34-L39 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/RandomUtils.java | RandomUtils.sampleHashingSetWithoutReplacement | public static <T> Set<T> sampleHashingSetWithoutReplacement(final Set<T> sourceSet,
final int numSamples,
final Random rng) {
checkArgument(numSamples <= sourceSet.size());
// first we find the indices of the selected elements
final List<Integer> selectedItems =
distinctRandomIntsInRange(rng, 0, sourceSet.size(), numSamples);
final Set<T> ret = Sets.newHashSet();
final Iterator<Integer> selectedItemsIterator = selectedItems.iterator();
if (numSamples > 0) {
// now we walk through sourceSet in order to find the items at
// the indices we selected. It doens't matter that the iteration
// order over the set isn't guaranteed because the indices are
// random anyway
int nextSelectedIdx = selectedItemsIterator.next();
int idx = 0;
for (final T item : sourceSet) {
if (idx == nextSelectedIdx) {
ret.add(item);
if (selectedItemsIterator.hasNext()) {
nextSelectedIdx = selectedItemsIterator.next();
} else {
// we may (and probably will) run out of selected indices
// before we run out of items in the set, unless the
// last index is selected.
break;
}
}
++idx;
}
}
return ret;
} | java | public static <T> Set<T> sampleHashingSetWithoutReplacement(final Set<T> sourceSet,
final int numSamples,
final Random rng) {
checkArgument(numSamples <= sourceSet.size());
// first we find the indices of the selected elements
final List<Integer> selectedItems =
distinctRandomIntsInRange(rng, 0, sourceSet.size(), numSamples);
final Set<T> ret = Sets.newHashSet();
final Iterator<Integer> selectedItemsIterator = selectedItems.iterator();
if (numSamples > 0) {
// now we walk through sourceSet in order to find the items at
// the indices we selected. It doens't matter that the iteration
// order over the set isn't guaranteed because the indices are
// random anyway
int nextSelectedIdx = selectedItemsIterator.next();
int idx = 0;
for (final T item : sourceSet) {
if (idx == nextSelectedIdx) {
ret.add(item);
if (selectedItemsIterator.hasNext()) {
nextSelectedIdx = selectedItemsIterator.next();
} else {
// we may (and probably will) run out of selected indices
// before we run out of items in the set, unless the
// last index is selected.
break;
}
}
++idx;
}
}
return ret;
} | [
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"sampleHashingSetWithoutReplacement",
"(",
"final",
"Set",
"<",
"T",
">",
"sourceSet",
",",
"final",
"int",
"numSamples",
",",
"final",
"Random",
"rng",
")",
"{",
"checkArgument",
"(",
"numSamples",
... | Given a hash-based set and a desired number of samples N, will create a new set by drawing N
items without replacement from the original set. This takes at least linear time in the size of
the source set, since there is no way to pick out arbitrary elements of a set except by
iteration.
WARNING: If the desired number of samples is close to the size of the source set, the current
implementation could be very slow. | [
"Given",
"a",
"hash",
"-",
"based",
"set",
"and",
"a",
"desired",
"number",
"of",
"samples",
"N",
"will",
"create",
"a",
"new",
"set",
"by",
"drawing",
"N",
"items",
"without",
"replacement",
"from",
"the",
"original",
"set",
".",
"This",
"takes",
"at",
... | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/RandomUtils.java#L59-L95 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java | Transform1D.getPath | @Pure
public List<S> getPath() {
if (this.path == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(this.path);
} | java | @Pure
public List<S> getPath() {
if (this.path == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(this.path);
} | [
"@",
"Pure",
"public",
"List",
"<",
"S",
">",
"getPath",
"(",
")",
"{",
"if",
"(",
"this",
".",
"path",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"return",
"Collections",
".",
"unmodifiableList",
"(",
"thi... | Replies the path used by this transformation.
@return the path. | [
"Replies",
"the",
"path",
"used",
"by",
"this",
"transformation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java#L220-L226 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java | Transform1D.setPath | public void setPath(List<? extends S> path, Direction1D direction) {
this.path = path == null || path.isEmpty() ? null : new ArrayList<>(path);
this.firstSegmentDirection = detectFirstSegmentDirection(direction);
} | java | public void setPath(List<? extends S> path, Direction1D direction) {
this.path = path == null || path.isEmpty() ? null : new ArrayList<>(path);
this.firstSegmentDirection = detectFirstSegmentDirection(direction);
} | [
"public",
"void",
"setPath",
"(",
"List",
"<",
"?",
"extends",
"S",
">",
"path",
",",
"Direction1D",
"direction",
")",
"{",
"this",
".",
"path",
"=",
"path",
"==",
"null",
"||",
"path",
".",
"isEmpty",
"(",
")",
"?",
"null",
":",
"new",
"ArrayList",
... | Set the path used by this transformation.
@param path is the new path
@param direction is the direction to follow on the path if the path contains only one segment. | [
"Set",
"the",
"path",
"used",
"by",
"this",
"transformation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java#L254-L257 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java | Transform1D.setIdentity | public void setIdentity() {
this.path = null;
this.firstSegmentDirection = detectFirstSegmentDirection(null);
this.curvilineTranslation = 0.;
this.shiftTranslation = 0.;
this.isIdentity = Boolean.TRUE;
} | java | public void setIdentity() {
this.path = null;
this.firstSegmentDirection = detectFirstSegmentDirection(null);
this.curvilineTranslation = 0.;
this.shiftTranslation = 0.;
this.isIdentity = Boolean.TRUE;
} | [
"public",
"void",
"setIdentity",
"(",
")",
"{",
"this",
".",
"path",
"=",
"null",
";",
"this",
".",
"firstSegmentDirection",
"=",
"detectFirstSegmentDirection",
"(",
"null",
")",
";",
"this",
".",
"curvilineTranslation",
"=",
"0.",
";",
"this",
".",
"shiftTr... | Set this transformation as identify, ie all set to zero and no path. | [
"Set",
"this",
"transformation",
"as",
"identify",
"ie",
"all",
"set",
"to",
"zero",
"and",
"no",
"path",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java#L261-L267 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java | Transform1D.isIdentity | @Pure
public boolean isIdentity() {
if (this.isIdentity == null) {
this.isIdentity = MathUtil.isEpsilonZero(this.curvilineTranslation)
&& MathUtil.isEpsilonZero(this.curvilineTranslation);
}
return this.isIdentity.booleanValue();
} | java | @Pure
public boolean isIdentity() {
if (this.isIdentity == null) {
this.isIdentity = MathUtil.isEpsilonZero(this.curvilineTranslation)
&& MathUtil.isEpsilonZero(this.curvilineTranslation);
}
return this.isIdentity.booleanValue();
} | [
"@",
"Pure",
"public",
"boolean",
"isIdentity",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isIdentity",
"==",
"null",
")",
"{",
"this",
".",
"isIdentity",
"=",
"MathUtil",
".",
"isEpsilonZero",
"(",
"this",
".",
"curvilineTranslation",
")",
"&&",
"MathUtil",
... | Replies if the transformation is the identity transformation.
@return {@code true} if the transformation is identity. | [
"Replies",
"if",
"the",
"transformation",
"is",
"the",
"identity",
"transformation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java#L273-L280 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java | Transform1D.setTranslation | public void setTranslation(Tuple2D<?> position) {
assert position != null : AssertMessages.notNullParameter();
this.curvilineTranslation = position.getX();
this.shiftTranslation = position.getY();
this.isIdentity = null;
} | java | public void setTranslation(Tuple2D<?> position) {
assert position != null : AssertMessages.notNullParameter();
this.curvilineTranslation = position.getX();
this.shiftTranslation = position.getY();
this.isIdentity = null;
} | [
"public",
"void",
"setTranslation",
"(",
"Tuple2D",
"<",
"?",
">",
"position",
")",
"{",
"assert",
"position",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
")",
";",
"this",
".",
"curvilineTranslation",
"=",
"position",
".",
"getX",
"("... | Set the position. This function does not change the path.
@param position where <code>x</code> is the curviline coordinate and <code>y</code> is the shift coordinate. | [
"Set",
"the",
"position",
".",
"This",
"function",
"does",
"not",
"change",
"the",
"path",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java#L326-L331 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java | Transform1D.translate | public void translate(Tuple2D<?> move) {
assert move != null : AssertMessages.notNullParameter();
this.curvilineTranslation += move.getX();
this.shiftTranslation += move.getY();
this.isIdentity = null;
} | java | public void translate(Tuple2D<?> move) {
assert move != null : AssertMessages.notNullParameter();
this.curvilineTranslation += move.getX();
this.shiftTranslation += move.getY();
this.isIdentity = null;
} | [
"public",
"void",
"translate",
"(",
"Tuple2D",
"<",
"?",
">",
"move",
")",
"{",
"assert",
"move",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
")",
";",
"this",
".",
"curvilineTranslation",
"+=",
"move",
".",
"getX",
"(",
")",
";",
... | Translate the coordinates. This function does not change the path.
@param move where <code>x</code> is the curviline coordinate and <code>y</code> is the shift coordinate. | [
"Translate",
"the",
"coordinates",
".",
"This",
"function",
"does",
"not",
"change",
"the",
"path",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/Transform1D.java#L405-L410 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphPoint.java | SGraphPoint.add | void add(Iterable<SGraphSegment> segments) {
for (final SGraphSegment segment : segments) {
this.segments.add(segment);
}
} | java | void add(Iterable<SGraphSegment> segments) {
for (final SGraphSegment segment : segments) {
this.segments.add(segment);
}
} | [
"void",
"add",
"(",
"Iterable",
"<",
"SGraphSegment",
">",
"segments",
")",
"{",
"for",
"(",
"final",
"SGraphSegment",
"segment",
":",
"segments",
")",
"{",
"this",
".",
"segments",
".",
"add",
"(",
"segment",
")",
";",
"}",
"}"
] | Add the given segments in the connection.
@param segments the segments to add. | [
"Add",
"the",
"given",
"segments",
"in",
"the",
"connection",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphPoint.java#L68-L72 | train |
gallandarakhneorg/afc | advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java | Configs.extractConfigs | public static List<ConfigMetadataNode> extractConfigs(ModulesMetadata modulesMetadata) {
final List<ModuleMetadata> modules = modulesMetadata
.getModules()
.stream()
.collect(Collectors.toList());
return modules.stream()
.map(ModuleMetadata::getConfigs)
.flatMap(Collection::stream)
.sorted(Comparator.comparing(MetadataNode::getName))
.collect(Collectors.toList());
} | java | public static List<ConfigMetadataNode> extractConfigs(ModulesMetadata modulesMetadata) {
final List<ModuleMetadata> modules = modulesMetadata
.getModules()
.stream()
.collect(Collectors.toList());
return modules.stream()
.map(ModuleMetadata::getConfigs)
.flatMap(Collection::stream)
.sorted(Comparator.comparing(MetadataNode::getName))
.collect(Collectors.toList());
} | [
"public",
"static",
"List",
"<",
"ConfigMetadataNode",
">",
"extractConfigs",
"(",
"ModulesMetadata",
"modulesMetadata",
")",
"{",
"final",
"List",
"<",
"ModuleMetadata",
">",
"modules",
"=",
"modulesMetadata",
".",
"getModules",
"(",
")",
".",
"stream",
"(",
")... | Extract the configuration metadata nodes from the given metadata.
@param modulesMetadata the metadata of the bootique modules.
@return the configuration metadata nodes. | [
"Extract",
"the",
"configuration",
"metadata",
"nodes",
"from",
"the",
"given",
"metadata",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java#L62-L72 | train |
gallandarakhneorg/afc | advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java | Configs.defineConfig | @SuppressWarnings("checkstyle:npathcomplexity")
public static void defineConfig(Map<String, Object> content, ConfigMetadataNode config, Injector injector) {
assert content != null;
assert config != null;
final Class<?> type = (Class<?>) config.getType();
final String sectionName = config.getName();
final Pattern setPattern = Pattern.compile("^set([A-Z])([a-zA-Z0-9]+)$"); //$NON-NLS-1$
Object theConfig = null;
for (final Method setterMethod : type.getMethods()) {
final Matcher matcher = setPattern.matcher(setterMethod.getName());
if (matcher.matches()) {
final String firstLetter = matcher.group(1);
final String rest = matcher.group(2);
final String getterName = "get" + firstLetter + rest; //$NON-NLS-1$
Method getterMethod = null;
try {
getterMethod = type.getMethod(getterName);
} catch (Throwable exception) {
//
}
if (getterMethod != null && Modifier.isPublic(getterMethod.getModifiers())
&& !Modifier.isAbstract(getterMethod.getModifiers())
&& !Modifier.isStatic(getterMethod.getModifiers())) {
try {
if (theConfig == null) {
theConfig = injector.getInstance(type);
}
if (theConfig != null) {
final Object value = filterValue(getterMethod.getReturnType(), getterMethod.invoke(theConfig));
final String id = sectionName + "." + firstLetter.toLowerCase() + rest; //$NON-NLS-1$
defineScalar(content, id, value);
}
} catch (Throwable exception) {
//
}
}
}
}
} | java | @SuppressWarnings("checkstyle:npathcomplexity")
public static void defineConfig(Map<String, Object> content, ConfigMetadataNode config, Injector injector) {
assert content != null;
assert config != null;
final Class<?> type = (Class<?>) config.getType();
final String sectionName = config.getName();
final Pattern setPattern = Pattern.compile("^set([A-Z])([a-zA-Z0-9]+)$"); //$NON-NLS-1$
Object theConfig = null;
for (final Method setterMethod : type.getMethods()) {
final Matcher matcher = setPattern.matcher(setterMethod.getName());
if (matcher.matches()) {
final String firstLetter = matcher.group(1);
final String rest = matcher.group(2);
final String getterName = "get" + firstLetter + rest; //$NON-NLS-1$
Method getterMethod = null;
try {
getterMethod = type.getMethod(getterName);
} catch (Throwable exception) {
//
}
if (getterMethod != null && Modifier.isPublic(getterMethod.getModifiers())
&& !Modifier.isAbstract(getterMethod.getModifiers())
&& !Modifier.isStatic(getterMethod.getModifiers())) {
try {
if (theConfig == null) {
theConfig = injector.getInstance(type);
}
if (theConfig != null) {
final Object value = filterValue(getterMethod.getReturnType(), getterMethod.invoke(theConfig));
final String id = sectionName + "." + firstLetter.toLowerCase() + rest; //$NON-NLS-1$
defineScalar(content, id, value);
}
} catch (Throwable exception) {
//
}
}
}
}
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:npathcomplexity\"",
")",
"public",
"static",
"void",
"defineConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
",",
"ConfigMetadataNode",
"config",
",",
"Injector",
"injector",
")",
"{",
"assert",
"conten... | Add a config to a Yaml configuration map.
@param content the Yaml configuration map.
@param config the configuration.
@param injector the injector to be used for creating the configuration objects. | [
"Add",
"a",
"config",
"to",
"a",
"Yaml",
"configuration",
"map",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java#L80-L118 | train |
gallandarakhneorg/afc | advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java | Configs.defineScalar | public static void defineScalar(Map<String, Object> content, String bootiqueVariable, Object value) throws Exception {
final String[] elements = bootiqueVariable.split("\\."); //$NON-NLS-1$
final Map<String, Object> entry = getScalarParent(content, elements);
entry.put(elements[elements.length - 1], value);
} | java | public static void defineScalar(Map<String, Object> content, String bootiqueVariable, Object value) throws Exception {
final String[] elements = bootiqueVariable.split("\\."); //$NON-NLS-1$
final Map<String, Object> entry = getScalarParent(content, elements);
entry.put(elements[elements.length - 1], value);
} | [
"public",
"static",
"void",
"defineScalar",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
",",
"String",
"bootiqueVariable",
",",
"Object",
"value",
")",
"throws",
"Exception",
"{",
"final",
"String",
"[",
"]",
"elements",
"=",
"bootiqueVariable",
... | Add a scalar to a Yaml configuration map.
@param content the Yaml configuration map.
@param bootiqueVariable the name of the bootique variable.
@param value the value.
@throws Exception if a map cannot be created internally. | [
"Add",
"a",
"scalar",
"to",
"a",
"Yaml",
"configuration",
"map",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java#L143-L147 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/math/Permutation.java | Permutation.createForNElements | public static Permutation createForNElements(final int numElements, final Random rng) {
final int[] permutation = IntUtils.arange(numElements);
IntUtils.shuffle(permutation, checkNotNull(rng));
return new Permutation(permutation);
} | java | public static Permutation createForNElements(final int numElements, final Random rng) {
final int[] permutation = IntUtils.arange(numElements);
IntUtils.shuffle(permutation, checkNotNull(rng));
return new Permutation(permutation);
} | [
"public",
"static",
"Permutation",
"createForNElements",
"(",
"final",
"int",
"numElements",
",",
"final",
"Random",
"rng",
")",
"{",
"final",
"int",
"[",
"]",
"permutation",
"=",
"IntUtils",
".",
"arange",
"(",
"numElements",
")",
";",
"IntUtils",
".",
"shu... | Creates a random permutation of n elements using the supplied random number generator. Note
that for all but small numbers of elements most possible permutations will not be sampled by
this because the random generator's space is much smaller than the number of possible
permutations. | [
"Creates",
"a",
"random",
"permutation",
"of",
"n",
"elements",
"using",
"the",
"supplied",
"random",
"number",
"generator",
".",
"Note",
"that",
"for",
"all",
"but",
"small",
"numbers",
"of",
"elements",
"most",
"possible",
"permutations",
"will",
"not",
"be"... | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/math/Permutation.java#L44-L48 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/math/Permutation.java | Permutation.permute | public void permute(final int[] arr) {
checkArgument(arr.length == sources.length);
final int[] tmp = new int[arr.length];
for (int i = 0; i < tmp.length; ++i) {
tmp[i] = arr[sources[i]];
}
System.arraycopy(tmp, 0, arr, 0, arr.length);
} | java | public void permute(final int[] arr) {
checkArgument(arr.length == sources.length);
final int[] tmp = new int[arr.length];
for (int i = 0; i < tmp.length; ++i) {
tmp[i] = arr[sources[i]];
}
System.arraycopy(tmp, 0, arr, 0, arr.length);
} | [
"public",
"void",
"permute",
"(",
"final",
"int",
"[",
"]",
"arr",
")",
"{",
"checkArgument",
"(",
"arr",
".",
"length",
"==",
"sources",
".",
"length",
")",
";",
"final",
"int",
"[",
"]",
"tmp",
"=",
"new",
"int",
"[",
"arr",
".",
"length",
"]",
... | Applies this permutation in-place to the elements of an integer array | [
"Applies",
"this",
"permutation",
"in",
"-",
"place",
"to",
"the",
"elements",
"of",
"an",
"integer",
"array"
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/math/Permutation.java#L68-L75 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java | PentaTreeNode.setChild1 | private boolean setChild1(N newChild) {
if (this.child1 == newChild) {
return false;
}
if (this.child1 != null) {
this.child1.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, this.child1);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child1 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(0, newChild);
}
return true;
} | java | private boolean setChild1(N newChild) {
if (this.child1 == newChild) {
return false;
}
if (this.child1 != null) {
this.child1.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, this.child1);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child1 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(0, newChild);
}
return true;
} | [
"private",
"boolean",
"setChild1",
"(",
"N",
"newChild",
")",
"{",
"if",
"(",
"this",
".",
"child1",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"child1",
"!=",
"null",
")",
"{",
"this",
".",
"child1",
".",
"set... | Set the child 1.
@param newChild is the new child
@return <code>true</code> on success, otherwise <code>false</code> | [
"Set",
"the",
"child",
"1",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java#L255-L282 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java | PentaTreeNode.setChild2 | private boolean setChild2(N newChild) {
if (this.child2 == newChild) {
return false;
}
if (this.child2 != null) {
this.child2.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, this.child2);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child2 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(1, newChild);
}
return true;
} | java | private boolean setChild2(N newChild) {
if (this.child2 == newChild) {
return false;
}
if (this.child2 != null) {
this.child2.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, this.child2);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child2 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(1, newChild);
}
return true;
} | [
"private",
"boolean",
"setChild2",
"(",
"N",
"newChild",
")",
"{",
"if",
"(",
"this",
".",
"child2",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"child2",
"!=",
"null",
")",
"{",
"this",
".",
"child2",
".",
"set... | Set the child 2.
@param newChild is the new child
@return <code>true</code> on success, otherwise <code>false</code> | [
"Set",
"the",
"child",
"2",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java#L289-L316 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java | PentaTreeNode.setChild3 | private boolean setChild3(N newChild) {
if (this.child3 == newChild) {
return false;
}
if (this.child3 != null) {
this.child3.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(2, this.child3);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child3 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(2, newChild);
}
return true;
} | java | private boolean setChild3(N newChild) {
if (this.child3 == newChild) {
return false;
}
if (this.child3 != null) {
this.child3.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(2, this.child3);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child3 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(2, newChild);
}
return true;
} | [
"private",
"boolean",
"setChild3",
"(",
"N",
"newChild",
")",
"{",
"if",
"(",
"this",
".",
"child3",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"child3",
"!=",
"null",
")",
"{",
"this",
".",
"child3",
".",
"set... | Set the child 3.
@param newChild is the new child
@return <code>true</code> on success, otherwise <code>false</code> | [
"Set",
"the",
"child",
"3",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java#L323-L350 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java | PentaTreeNode.setChild4 | private boolean setChild4(N newChild) {
if (this.child4 == newChild) {
return false;
}
if (this.child4 != null) {
this.child4.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(3, this.child4);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child4 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(3, newChild);
}
return true;
} | java | private boolean setChild4(N newChild) {
if (this.child4 == newChild) {
return false;
}
if (this.child4 != null) {
this.child4.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(3, this.child4);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.child4 = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(3, newChild);
}
return true;
} | [
"private",
"boolean",
"setChild4",
"(",
"N",
"newChild",
")",
"{",
"if",
"(",
"this",
".",
"child4",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"child4",
"!=",
"null",
")",
"{",
"this",
".",
"child4",
".",
"set... | Set the child 4.
@param newChild is the new child
@return <code>true</code> on success, otherwise <code>false</code> | [
"Set",
"the",
"child",
"4",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java#L357-L384 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/i/Vector2i.java | Vector2i.convert | public static Vector2i convert(Tuple2D<?> tuple) {
if (tuple instanceof Vector2i) {
return (Vector2i) tuple;
}
return new Vector2i(tuple.getX(), tuple.getY());
} | java | public static Vector2i convert(Tuple2D<?> tuple) {
if (tuple instanceof Vector2i) {
return (Vector2i) tuple;
}
return new Vector2i(tuple.getX(), tuple.getY());
} | [
"public",
"static",
"Vector2i",
"convert",
"(",
"Tuple2D",
"<",
"?",
">",
"tuple",
")",
"{",
"if",
"(",
"tuple",
"instanceof",
"Vector2i",
")",
"{",
"return",
"(",
"Vector2i",
")",
"tuple",
";",
"}",
"return",
"new",
"Vector2i",
"(",
"tuple",
".",
"get... | Convert the given tuple to a real Vector2i.
<p>If the given tuple is already a Vector2i, it is replied.
@param tuple the tuple.
@return the Vector2i.
@since 14.0 | [
"Convert",
"the",
"given",
"tuple",
"to",
"a",
"real",
"Vector2i",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/i/Vector2i.java#L113-L118 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/parameters/ParameterAccessListener.java | ParameterAccessListener.constructLogMsg | String constructLogMsg() {
final StringBuilder msg = new StringBuilder();
for (final Map.Entry<String, List<StackTraceElement>> e : paramToStackTrace.build().entries()) {
msg.append("Parameter ").append(e.getKey()).append(" accessed at \n");
msg.append(FluentIterable.from(e.getValue())
// but exclude code in Parameters itself
.filter(not(IS_THIS_CLASS))
.filter(not(IS_PARAMETERS_ITSELF))
.filter(not(IS_THREAD_CLASS))
.join(StringUtils.unixNewlineJoiner()));
msg.append("\n\n");
}
return msg.toString();
} | java | String constructLogMsg() {
final StringBuilder msg = new StringBuilder();
for (final Map.Entry<String, List<StackTraceElement>> e : paramToStackTrace.build().entries()) {
msg.append("Parameter ").append(e.getKey()).append(" accessed at \n");
msg.append(FluentIterable.from(e.getValue())
// but exclude code in Parameters itself
.filter(not(IS_THIS_CLASS))
.filter(not(IS_PARAMETERS_ITSELF))
.filter(not(IS_THREAD_CLASS))
.join(StringUtils.unixNewlineJoiner()));
msg.append("\n\n");
}
return msg.toString();
} | [
"String",
"constructLogMsg",
"(",
")",
"{",
"final",
"StringBuilder",
"msg",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"StackTraceElement",
">",
">",
"e",
":",
"paramToStackTrace"... | pulled into method for testing | [
"pulled",
"into",
"method",
"for",
"testing"
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/parameters/ParameterAccessListener.java#L50-L64 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/GraphicsDeviceExtensions.java | GraphicsDeviceExtensions.getAvailableScreens | public static GraphicsDevice[] getAvailableScreens()
{
final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment
.getLocalGraphicsEnvironment();
final GraphicsDevice[] graphicsDevices = graphicsEnvironment.getScreenDevices();
return graphicsDevices;
} | java | public static GraphicsDevice[] getAvailableScreens()
{
final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment
.getLocalGraphicsEnvironment();
final GraphicsDevice[] graphicsDevices = graphicsEnvironment.getScreenDevices();
return graphicsDevices;
} | [
"public",
"static",
"GraphicsDevice",
"[",
"]",
"getAvailableScreens",
"(",
")",
"{",
"final",
"GraphicsEnvironment",
"graphicsEnvironment",
"=",
"GraphicsEnvironment",
".",
"getLocalGraphicsEnvironment",
"(",
")",
";",
"final",
"GraphicsDevice",
"[",
"]",
"graphicsDevi... | Gets the available screens.
@return the available screens | [
"Gets",
"the",
"available",
"screens",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/GraphicsDeviceExtensions.java#L46-L52 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/GraphicsDeviceExtensions.java | GraphicsDeviceExtensions.isScreenAvailableToShow | public static boolean isScreenAvailableToShow(final int screen)
{
final GraphicsDevice[] graphicsDevices = getAvailableScreens();
boolean screenAvailableToShow = false;
if ((screen > -1 && screen < graphicsDevices.length) || (graphicsDevices.length > 0))
{
screenAvailableToShow = true;
}
return screenAvailableToShow;
} | java | public static boolean isScreenAvailableToShow(final int screen)
{
final GraphicsDevice[] graphicsDevices = getAvailableScreens();
boolean screenAvailableToShow = false;
if ((screen > -1 && screen < graphicsDevices.length) || (graphicsDevices.length > 0))
{
screenAvailableToShow = true;
}
return screenAvailableToShow;
} | [
"public",
"static",
"boolean",
"isScreenAvailableToShow",
"(",
"final",
"int",
"screen",
")",
"{",
"final",
"GraphicsDevice",
"[",
"]",
"graphicsDevices",
"=",
"getAvailableScreens",
"(",
")",
";",
"boolean",
"screenAvailableToShow",
"=",
"false",
";",
"if",
"(",
... | Checks if the given screen number is available to show.
@param screen
the screen
@return true, if is screen available to show | [
"Checks",
"if",
"the",
"given",
"screen",
"number",
"is",
"available",
"to",
"show",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/GraphicsDeviceExtensions.java#L118-L127 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/ModuleUtils.java | ModuleUtils.classNameToModule | @Nonnull
// it's reflection, can't avoid unchecked cast
@SuppressWarnings("unchecked")
public static Module classNameToModule(final Parameters parameters, final Class<?> clazz,
Optional<? extends Class<? extends Annotation>> annotation)
throws IllegalAccessException, InvocationTargetException, InstantiationException {
if (Module.class.isAssignableFrom(clazz)) {
return instantiateModule((Class<? extends Module>) clazz, parameters, annotation);
} else {
// to abbreviate the names of modules in param files, if a class name is provided which
// is not a Module, we check if there is an inner-class named Module which is a Module
for (final String fallbackInnerClassName : FALLBACK_INNER_CLASS_NAMES) {
final String fullyQualifiedName = clazz.getName() + "$" + fallbackInnerClassName;
final Class<? extends Module> innerModuleClazz;
try {
innerModuleClazz = (Class<? extends Module>) Class.forName(fullyQualifiedName);
} catch (ClassNotFoundException cnfe) {
// it's okay, we just try the next one
continue;
}
if (Module.class.isAssignableFrom(innerModuleClazz)) {
return instantiateModule(innerModuleClazz, parameters, annotation);
} else {
throw new RuntimeException(clazz.getName() + " is not a module; "
+ fullyQualifiedName + " exists but is not a module");
}
}
// if we got here, we didn't find any module
throw new RuntimeException("Could not find inner class of " + clazz.getName()
+ " matching any of " + FALLBACK_INNER_CLASS_NAMES);
}
} | java | @Nonnull
// it's reflection, can't avoid unchecked cast
@SuppressWarnings("unchecked")
public static Module classNameToModule(final Parameters parameters, final Class<?> clazz,
Optional<? extends Class<? extends Annotation>> annotation)
throws IllegalAccessException, InvocationTargetException, InstantiationException {
if (Module.class.isAssignableFrom(clazz)) {
return instantiateModule((Class<? extends Module>) clazz, parameters, annotation);
} else {
// to abbreviate the names of modules in param files, if a class name is provided which
// is not a Module, we check if there is an inner-class named Module which is a Module
for (final String fallbackInnerClassName : FALLBACK_INNER_CLASS_NAMES) {
final String fullyQualifiedName = clazz.getName() + "$" + fallbackInnerClassName;
final Class<? extends Module> innerModuleClazz;
try {
innerModuleClazz = (Class<? extends Module>) Class.forName(fullyQualifiedName);
} catch (ClassNotFoundException cnfe) {
// it's okay, we just try the next one
continue;
}
if (Module.class.isAssignableFrom(innerModuleClazz)) {
return instantiateModule(innerModuleClazz, parameters, annotation);
} else {
throw new RuntimeException(clazz.getName() + " is not a module; "
+ fullyQualifiedName + " exists but is not a module");
}
}
// if we got here, we didn't find any module
throw new RuntimeException("Could not find inner class of " + clazz.getName()
+ " matching any of " + FALLBACK_INNER_CLASS_NAMES);
}
} | [
"@",
"Nonnull",
"// it's reflection, can't avoid unchecked cast",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Module",
"classNameToModule",
"(",
"final",
"Parameters",
"parameters",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"Opti... | Attempts to convert a module class name to an instantiate module by applying heuristics to
construct it.
It first tries to instantiate the provided class itself as a module, if possible. If it is not
a module, it looks for an inner class called "Module",
"FromParametersModule", or "FromParamsModule" which is a {@link Module}.
When instantiating a module, it tries to find a constructor taking parameters and an annotation
(if annotation is present), just an annotation, just parameters, or zero arguments. | [
"Attempts",
"to",
"convert",
"a",
"module",
"class",
"name",
"to",
"an",
"instantiate",
"module",
"by",
"applying",
"heuristics",
"to",
"construct",
"it",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/ModuleUtils.java#L47-L80 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/ModuleUtils.java | ModuleUtils.instantiateWithPrivateConstructor | private static Optional<Module> instantiateWithPrivateConstructor(Class<?> clazz,
Class<?>[] parameters,
Object... paramVals)
throws InvocationTargetException, IllegalAccessException, InstantiationException {
final Constructor<?> constructor;
try {
constructor = clazz.getDeclaredConstructor(parameters);
} catch (NoSuchMethodException e) {
return Optional.absent();
}
final boolean oldAccessible = constructor.isAccessible();
constructor.setAccessible(true);
try {
return Optional.of((Module) constructor.newInstance(paramVals));
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw e;
} finally {
constructor.setAccessible(oldAccessible);
}
} | java | private static Optional<Module> instantiateWithPrivateConstructor(Class<?> clazz,
Class<?>[] parameters,
Object... paramVals)
throws InvocationTargetException, IllegalAccessException, InstantiationException {
final Constructor<?> constructor;
try {
constructor = clazz.getDeclaredConstructor(parameters);
} catch (NoSuchMethodException e) {
return Optional.absent();
}
final boolean oldAccessible = constructor.isAccessible();
constructor.setAccessible(true);
try {
return Optional.of((Module) constructor.newInstance(paramVals));
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw e;
} finally {
constructor.setAccessible(oldAccessible);
}
} | [
"private",
"static",
"Optional",
"<",
"Module",
">",
"instantiateWithPrivateConstructor",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameters",
",",
"Object",
"...",
"paramVals",
")",
"throws",
"InvocationTargetException",
... | Instantiates a module which may have a private constructor. You can't call private
constructors in Java unless you first make the constructor un-private. After doing so,
however, we should clean up after ourselves and restore the previous state.
If we fail to instantiate the class, we return absent. | [
"Instantiates",
"a",
"module",
"which",
"may",
"have",
"a",
"private",
"constructor",
".",
"You",
"can",
"t",
"call",
"private",
"constructors",
"in",
"Java",
"unless",
"you",
"first",
"make",
"the",
"constructor",
"un",
"-",
"private",
".",
"After",
"doing"... | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/ModuleUtils.java#L144-L164 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java | MapUtils.zipValues | public static <K, V> PairedMapValues<V> zipValues(final Map<K, V> left, final Map<K, V> right) {
checkNotNull(left);
checkNotNull(right);
final ImmutableList.Builder<ZipPair<V, V>> pairedValues =
ImmutableList.builder();
final ImmutableList.Builder<V> leftOnly = ImmutableList.builder();
final ImmutableList.Builder<V> rightOnly = ImmutableList.builder();
for (final Map.Entry<K, V> leftEntry : left.entrySet()) {
final K key = leftEntry.getKey();
if (right.containsKey(key)) {
pairedValues.add(ZipPair.from(leftEntry.getValue(), right.get(key)));
} else {
leftOnly.add(leftEntry.getValue());
}
}
for (final Map.Entry<K, V> rightEntry : right.entrySet()) {
if (!left.containsKey(rightEntry.getKey())) {
rightOnly.add(rightEntry.getValue());
}
}
return new PairedMapValues<V>(pairedValues.build(), leftOnly.build(),
rightOnly.build());
} | java | public static <K, V> PairedMapValues<V> zipValues(final Map<K, V> left, final Map<K, V> right) {
checkNotNull(left);
checkNotNull(right);
final ImmutableList.Builder<ZipPair<V, V>> pairedValues =
ImmutableList.builder();
final ImmutableList.Builder<V> leftOnly = ImmutableList.builder();
final ImmutableList.Builder<V> rightOnly = ImmutableList.builder();
for (final Map.Entry<K, V> leftEntry : left.entrySet()) {
final K key = leftEntry.getKey();
if (right.containsKey(key)) {
pairedValues.add(ZipPair.from(leftEntry.getValue(), right.get(key)));
} else {
leftOnly.add(leftEntry.getValue());
}
}
for (final Map.Entry<K, V> rightEntry : right.entrySet()) {
if (!left.containsKey(rightEntry.getKey())) {
rightOnly.add(rightEntry.getValue());
}
}
return new PairedMapValues<V>(pairedValues.build(), leftOnly.build(),
rightOnly.build());
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"PairedMapValues",
"<",
"V",
">",
"zipValues",
"(",
"final",
"Map",
"<",
"K",
",",
"V",
">",
"left",
",",
"final",
"Map",
"<",
"K",
",",
"V",
">",
"right",
")",
"{",
"checkNotNull",
"(",
"left",
")",
... | Pairs up the values of a map by their common keys. | [
"Pairs",
"up",
"the",
"values",
"of",
"a",
"map",
"by",
"their",
"common",
"keys",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java#L41-L66 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java | MapUtils.indexMap | public static <T> ImmutableMap<T, Integer> indexMap(Iterable<? extends T> items) {
final ImmutableMap.Builder<T, Integer> ret = ImmutableMap.builder();
int idx = 0;
for (final T item : items) {
ret.put(item, idx++);
}
return ret.build();
} | java | public static <T> ImmutableMap<T, Integer> indexMap(Iterable<? extends T> items) {
final ImmutableMap.Builder<T, Integer> ret = ImmutableMap.builder();
int idx = 0;
for (final T item : items) {
ret.put(item, idx++);
}
return ret.build();
} | [
"public",
"static",
"<",
"T",
">",
"ImmutableMap",
"<",
"T",
",",
"Integer",
">",
"indexMap",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"items",
")",
"{",
"final",
"ImmutableMap",
".",
"Builder",
"<",
"T",
",",
"Integer",
">",
"ret",
"=",
"Immu... | Builds a map from sequence items to their zero-indexed positions in the sequence. | [
"Builds",
"a",
"map",
"from",
"sequence",
"items",
"to",
"their",
"zero",
"-",
"indexed",
"positions",
"in",
"the",
"sequence",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java#L121-L128 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java | MapUtils.longestKeyLength | public static <V> int longestKeyLength(Map<String, V> map) {
if (map.isEmpty()) {
return 0;
}
return Ordering.natural().max(
FluentIterable.from(map.keySet())
.transform(StringUtils.lengthFunction()));
} | java | public static <V> int longestKeyLength(Map<String, V> map) {
if (map.isEmpty()) {
return 0;
}
return Ordering.natural().max(
FluentIterable.from(map.keySet())
.transform(StringUtils.lengthFunction()));
} | [
"public",
"static",
"<",
"V",
">",
"int",
"longestKeyLength",
"(",
"Map",
"<",
"String",
",",
"V",
">",
"map",
")",
"{",
"if",
"(",
"map",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"return",
"Ordering",
".",
"natural",
"(",
")"... | Returns the length of the longest key in a map, or 0 if the map is empty. Useful for printing
tables, etc. The map may not have any null keys. | [
"Returns",
"the",
"length",
"of",
"the",
"longest",
"key",
"in",
"a",
"map",
"or",
"0",
"if",
"the",
"map",
"is",
"empty",
".",
"Useful",
"for",
"printing",
"tables",
"etc",
".",
"The",
"map",
"may",
"not",
"have",
"any",
"null",
"keys",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/collections/MapUtils.java#L338-L346 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java | MapElementConstants.getPreferredRadius | @Pure
public static double getPreferredRadius() {
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
return prefs.getDouble("RADIUS", DEFAULT_RADIUS); //$NON-NLS-1$
}
return DEFAULT_RADIUS;
} | java | @Pure
public static double getPreferredRadius() {
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
return prefs.getDouble("RADIUS", DEFAULT_RADIUS); //$NON-NLS-1$
}
return DEFAULT_RADIUS;
} | [
"@",
"Pure",
"public",
"static",
"double",
"getPreferredRadius",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"MapElementConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"r... | Replies the default radius for map elements.
@return the default radius for map elements. | [
"Replies",
"the",
"default",
"radius",
"for",
"map",
"elements",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java#L67-L74 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java | MapElementConstants.setPreferredRadius | public static void setPreferredRadius(double radius) {
assert !Double.isNaN(radius);
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
prefs.putDouble("RADIUS", radius); //$NON-NLS-1$
try {
prefs.flush();
} catch (BackingStoreException exception) {
//
}
}
} | java | public static void setPreferredRadius(double radius) {
assert !Double.isNaN(radius);
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
prefs.putDouble("RADIUS", radius); //$NON-NLS-1$
try {
prefs.flush();
} catch (BackingStoreException exception) {
//
}
}
} | [
"public",
"static",
"void",
"setPreferredRadius",
"(",
"double",
"radius",
")",
"{",
"assert",
"!",
"Double",
".",
"isNaN",
"(",
"radius",
")",
";",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"MapElementConstants",
".",
... | Set the default radius for map elements.
@param radius is the default radius for map elements. | [
"Set",
"the",
"default",
"radius",
"for",
"map",
"elements",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java#L80-L91 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java | MapElementConstants.getPreferredColor | @Pure
public static int getPreferredColor() {
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
return prefs.getInt("COLOR", DEFAULT_COLOR); //$NON-NLS-1$
}
return DEFAULT_COLOR;
} | java | @Pure
public static int getPreferredColor() {
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
return prefs.getInt("COLOR", DEFAULT_COLOR); //$NON-NLS-1$
}
return DEFAULT_COLOR;
} | [
"@",
"Pure",
"public",
"static",
"int",
"getPreferredColor",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"MapElementConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"retur... | Replies the default color for map elements.
@return the default color for map elements. | [
"Replies",
"the",
"default",
"color",
"for",
"map",
"elements",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java#L97-L104 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java | MapElementConstants.setPreferredColor | public static void setPreferredColor(int color) {
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
prefs.putInt("COLOR", color); //$NON-NLS-1$
try {
prefs.flush();
} catch (BackingStoreException exception) {
//
}
}
} | java | public static void setPreferredColor(int color) {
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
prefs.putInt("COLOR", color); //$NON-NLS-1$
try {
prefs.flush();
} catch (BackingStoreException exception) {
//
}
}
} | [
"public",
"static",
"void",
"setPreferredColor",
"(",
"int",
"color",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"MapElementConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"p... | Set the default color for map elements.
@param color is the default color for map elements. | [
"Set",
"the",
"default",
"color",
"for",
"map",
"elements",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapElementConstants.java#L110-L120 | train |
gallandarakhneorg/afc | core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/PhysicsUtil.java | PhysicsUtil.setPhysicsEngine | public static PhysicsEngine setPhysicsEngine(PhysicsEngine newEngine) {
final PhysicsEngine oldEngine = engine;
if (newEngine == null) {
engine = new JavaPhysicsEngine();
} else {
engine = newEngine;
}
return oldEngine;
} | java | public static PhysicsEngine setPhysicsEngine(PhysicsEngine newEngine) {
final PhysicsEngine oldEngine = engine;
if (newEngine == null) {
engine = new JavaPhysicsEngine();
} else {
engine = newEngine;
}
return oldEngine;
} | [
"public",
"static",
"PhysicsEngine",
"setPhysicsEngine",
"(",
"PhysicsEngine",
"newEngine",
")",
"{",
"final",
"PhysicsEngine",
"oldEngine",
"=",
"engine",
";",
"if",
"(",
"newEngine",
"==",
"null",
")",
"{",
"engine",
"=",
"new",
"JavaPhysicsEngine",
"(",
")",
... | Set the current physics engine.
<p>If the given engine is <code>null</code>, the default physics engine
is used (java implementation).
@param newEngine the current physics engine, or <code>null</code> for default engine.
@return previous physics engine. | [
"Set",
"the",
"current",
"physics",
"engine",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/PhysicsUtil.java#L71-L79 | train |
gallandarakhneorg/afc | core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/PhysicsUtil.java | PhysicsUtil.speed | @Pure
@Inline(value = "PhysicsUtil.getPhysicsEngine().speed(($1), ($2))",
imported = {PhysicsUtil.class})
public static double speed(double movement, double dt) {
return engine.speed(movement, dt);
} | java | @Pure
@Inline(value = "PhysicsUtil.getPhysicsEngine().speed(($1), ($2))",
imported = {PhysicsUtil.class})
public static double speed(double movement, double dt) {
return engine.speed(movement, dt);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"PhysicsUtil.getPhysicsEngine().speed(($1), ($2))\"",
",",
"imported",
"=",
"{",
"PhysicsUtil",
".",
"class",
"}",
")",
"public",
"static",
"double",
"speed",
"(",
"double",
"movement",
",",
"double",
"dt",
")",
... | Replies the new velocity according to a previous velocity and
a mouvement during a given time.
<p><code>velocity = movement / dt</code>
@param movement is the movement distance.
@param dt is the time
@return a new speed | [
"Replies",
"the",
"new",
"velocity",
"according",
"to",
"a",
"previous",
"velocity",
"and",
"a",
"mouvement",
"during",
"a",
"given",
"time",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/PhysicsUtil.java#L430-L435 | train |
gallandarakhneorg/afc | core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/PhysicsUtil.java | PhysicsUtil.acceleration | @Pure
@Inline(value = "PhysicsUtil.getPhysicsEngine().acceleration(($1), ($2), ($3))",
imported = {PhysicsUtil.class})
public static double acceleration(
double previousSpeed,
double currentSpeed,
double dt) {
return engine.acceleration(previousSpeed, currentSpeed, dt);
} | java | @Pure
@Inline(value = "PhysicsUtil.getPhysicsEngine().acceleration(($1), ($2), ($3))",
imported = {PhysicsUtil.class})
public static double acceleration(
double previousSpeed,
double currentSpeed,
double dt) {
return engine.acceleration(previousSpeed, currentSpeed, dt);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"PhysicsUtil.getPhysicsEngine().acceleration(($1), ($2), ($3))\"",
",",
"imported",
"=",
"{",
"PhysicsUtil",
".",
"class",
"}",
")",
"public",
"static",
"double",
"acceleration",
"(",
"double",
"previousSpeed",
",",
"... | Replies the new acceleration according to a previous
velocity and a current velocity, and given time.
<p><code>(currentVelocity - previousVelocity) / dt</code>
@param previousSpeed is the previous speed of the object.
@param currentSpeed is the current speed of the object.
@param dt is the time
@return a new acceleration | [
"Replies",
"the",
"new",
"acceleration",
"according",
"to",
"a",
"previous",
"velocity",
"and",
"a",
"current",
"velocity",
"and",
"given",
"time",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/PhysicsUtil.java#L447-L455 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java | ScreenSizeExtensions.computeDialogPositions | public static List<Point> computeDialogPositions(final int dialogWidth, final int dialogHeight)
{
List<Point> dialogPosition = null;
final int windowBesides = ScreenSizeExtensions.getScreenWidth() / dialogWidth;
final int windowBelow = ScreenSizeExtensions.getScreenHeight() / dialogHeight;
final int listSize = windowBesides * windowBelow;
dialogPosition = new ArrayList<>(listSize);
int dotWidth = 0;
int dotHeight = 0;
for (int y = 0; y < windowBelow; y++)
{
dotWidth = 0;
for (int x = 0; x < windowBesides; x++)
{
final Point p = new Point(dotWidth, dotHeight);
dialogPosition.add(p);
dotWidth = dotWidth + dialogWidth;
}
dotHeight = dotHeight + dialogHeight;
}
return dialogPosition;
} | java | public static List<Point> computeDialogPositions(final int dialogWidth, final int dialogHeight)
{
List<Point> dialogPosition = null;
final int windowBesides = ScreenSizeExtensions.getScreenWidth() / dialogWidth;
final int windowBelow = ScreenSizeExtensions.getScreenHeight() / dialogHeight;
final int listSize = windowBesides * windowBelow;
dialogPosition = new ArrayList<>(listSize);
int dotWidth = 0;
int dotHeight = 0;
for (int y = 0; y < windowBelow; y++)
{
dotWidth = 0;
for (int x = 0; x < windowBesides; x++)
{
final Point p = new Point(dotWidth, dotHeight);
dialogPosition.add(p);
dotWidth = dotWidth + dialogWidth;
}
dotHeight = dotHeight + dialogHeight;
}
return dialogPosition;
} | [
"public",
"static",
"List",
"<",
"Point",
">",
"computeDialogPositions",
"(",
"final",
"int",
"dialogWidth",
",",
"final",
"int",
"dialogHeight",
")",
"{",
"List",
"<",
"Point",
">",
"dialogPosition",
"=",
"null",
";",
"final",
"int",
"windowBesides",
"=",
"... | Compute how much dialog can be put into the screen and returns a list with the coordinates
from the dialog positions as Point objects.
@param dialogWidth
the dialog width
@param dialogHeight
the dialog height
@return the list with the computed Point objects. | [
"Compute",
"how",
"much",
"dialog",
"can",
"be",
"put",
"into",
"the",
"screen",
"and",
"returns",
"a",
"list",
"with",
"the",
"coordinates",
"from",
"the",
"dialog",
"positions",
"as",
"Point",
"objects",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java#L65-L86 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java | ScreenSizeExtensions.getScreenDevices | public static GraphicsDevice[] getScreenDevices()
{
final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
final GraphicsDevice[] gs = ge.getScreenDevices();
return gs;
} | java | public static GraphicsDevice[] getScreenDevices()
{
final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
final GraphicsDevice[] gs = ge.getScreenDevices();
return gs;
} | [
"public",
"static",
"GraphicsDevice",
"[",
"]",
"getScreenDevices",
"(",
")",
"{",
"final",
"GraphicsEnvironment",
"ge",
"=",
"GraphicsEnvironment",
".",
"getLocalGraphicsEnvironment",
"(",
")",
";",
"final",
"GraphicsDevice",
"[",
"]",
"gs",
"=",
"ge",
".",
"ge... | Gets all the screen devices.
@return the screen devices | [
"Gets",
"all",
"the",
"screen",
"devices",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java#L160-L165 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java | ScreenSizeExtensions.getScreenDimension | public static Dimension getScreenDimension(Component component)
{
int screenID = getScreenID(component);
Dimension dimension = new Dimension(0, 0);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsConfiguration defaultConfiguration = ge.getScreenDevices()[screenID]
.getDefaultConfiguration();
Rectangle rectangle = defaultConfiguration.getBounds();
dimension.setSize(rectangle.getWidth(), rectangle.getHeight());
return dimension;
} | java | public static Dimension getScreenDimension(Component component)
{
int screenID = getScreenID(component);
Dimension dimension = new Dimension(0, 0);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsConfiguration defaultConfiguration = ge.getScreenDevices()[screenID]
.getDefaultConfiguration();
Rectangle rectangle = defaultConfiguration.getBounds();
dimension.setSize(rectangle.getWidth(), rectangle.getHeight());
return dimension;
} | [
"public",
"static",
"Dimension",
"getScreenDimension",
"(",
"Component",
"component",
")",
"{",
"int",
"screenID",
"=",
"getScreenID",
"(",
"component",
")",
";",
"Dimension",
"dimension",
"=",
"new",
"Dimension",
"(",
"0",
",",
"0",
")",
";",
"GraphicsEnviron... | Gets the screen dimension.
@param component
the component
@return the screen dimension | [
"Gets",
"the",
"screen",
"dimension",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java#L174-L185 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java | ScreenSizeExtensions.getScreenID | public static int getScreenID(Component component)
{
int screenID;
final AtomicInteger counter = new AtomicInteger(-1);
Stream.of(getScreenDevices()).forEach(graphicsDevice -> {
GraphicsConfiguration gc = graphicsDevice.getDefaultConfiguration();
Rectangle rectangle = gc.getBounds();
if (rectangle.contains(component.getLocation()))
{
try
{
Object object = ReflectionExtensions.getFieldValue(graphicsDevice, "screen");
Integer sid = (Integer)object;
counter.set(sid);
}
catch (NoSuchFieldException | SecurityException | IllegalArgumentException
| IllegalAccessException e)
{
e.printStackTrace();
}
}
});
screenID = counter.get();
return screenID;
} | java | public static int getScreenID(Component component)
{
int screenID;
final AtomicInteger counter = new AtomicInteger(-1);
Stream.of(getScreenDevices()).forEach(graphicsDevice -> {
GraphicsConfiguration gc = graphicsDevice.getDefaultConfiguration();
Rectangle rectangle = gc.getBounds();
if (rectangle.contains(component.getLocation()))
{
try
{
Object object = ReflectionExtensions.getFieldValue(graphicsDevice, "screen");
Integer sid = (Integer)object;
counter.set(sid);
}
catch (NoSuchFieldException | SecurityException | IllegalArgumentException
| IllegalAccessException e)
{
e.printStackTrace();
}
}
});
screenID = counter.get();
return screenID;
} | [
"public",
"static",
"int",
"getScreenID",
"(",
"Component",
"component",
")",
"{",
"int",
"screenID",
";",
"final",
"AtomicInteger",
"counter",
"=",
"new",
"AtomicInteger",
"(",
"-",
"1",
")",
";",
"Stream",
".",
"of",
"(",
"getScreenDevices",
"(",
")",
")... | Gets the screen ID from the given component
@param component
the component
@return the screen ID | [
"Gets",
"the",
"screen",
"ID",
"from",
"the",
"given",
"component"
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/ScreenSizeExtensions.java#L240-L265 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.getCellBounds | @Pure
public Rectangle2d getCellBounds(int row, int column) {
final double cellWidth = getCellWidth();
final double cellHeight = getCellHeight();
final double x = this.bounds.getMinX() + cellWidth * column;
final double y = this.bounds.getMinY() + cellHeight * row;
return new Rectangle2d(x, y, cellWidth, cellHeight);
} | java | @Pure
public Rectangle2d getCellBounds(int row, int column) {
final double cellWidth = getCellWidth();
final double cellHeight = getCellHeight();
final double x = this.bounds.getMinX() + cellWidth * column;
final double y = this.bounds.getMinY() + cellHeight * row;
return new Rectangle2d(x, y, cellWidth, cellHeight);
} | [
"@",
"Pure",
"public",
"Rectangle2d",
"getCellBounds",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"final",
"double",
"cellWidth",
"=",
"getCellWidth",
"(",
")",
";",
"final",
"double",
"cellHeight",
"=",
"getCellHeight",
"(",
")",
";",
"final",
"do... | Replies the bounds covered by a cell at the specified location.
@param row the row index.
@param column the column index.
@return the bounds. | [
"Replies",
"the",
"bounds",
"covered",
"by",
"a",
"cell",
"at",
"the",
"specified",
"location",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L152-L159 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.createCellAt | public GridCell<P> createCellAt(int row, int column) {
GridCell<P> cell = this.cells[row][column];
if (cell == null) {
cell = new GridCell<>(row, column, getCellBounds(row, column));
this.cells[row][column] = cell;
++this.cellCount;
}
return cell;
} | java | public GridCell<P> createCellAt(int row, int column) {
GridCell<P> cell = this.cells[row][column];
if (cell == null) {
cell = new GridCell<>(row, column, getCellBounds(row, column));
this.cells[row][column] = cell;
++this.cellCount;
}
return cell;
} | [
"public",
"GridCell",
"<",
"P",
">",
"createCellAt",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"GridCell",
"<",
"P",
">",
"cell",
"=",
"this",
".",
"cells",
"[",
"row",
"]",
"[",
"column",
"]",
";",
"if",
"(",
"cell",
"==",
"null",
")",
... | Create a cell at the specified location if there is no
cell at this location.
@param row the row index.
@param column the column index.
@return the cell. | [
"Create",
"a",
"cell",
"at",
"the",
"specified",
"location",
"if",
"there",
"is",
"no",
"cell",
"at",
"this",
"location",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L168-L176 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.removeCellAt | public GridCell<P> removeCellAt(int row, int column) {
final GridCell<P> cell = this.cells[row][column];
if (cell != null) {
this.cells[row][column] = null;
--this.cellCount;
for (final P element : cell) {
removeElement(element);
}
}
return cell;
} | java | public GridCell<P> removeCellAt(int row, int column) {
final GridCell<P> cell = this.cells[row][column];
if (cell != null) {
this.cells[row][column] = null;
--this.cellCount;
for (final P element : cell) {
removeElement(element);
}
}
return cell;
} | [
"public",
"GridCell",
"<",
"P",
">",
"removeCellAt",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"final",
"GridCell",
"<",
"P",
">",
"cell",
"=",
"this",
".",
"cells",
"[",
"row",
"]",
"[",
"column",
"]",
";",
"if",
"(",
"cell",
"!=",
"nul... | Remove the cell at the specified location.
@param row the row index.
@param column the column index.
@return the removed cell or <code>null</code> if no element at
the specified location. | [
"Remove",
"the",
"cell",
"at",
"the",
"specified",
"location",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L185-L195 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.addElement | public boolean addElement(P element) {
boolean changed = false;
if (element != null) {
final GridCellElement<P> gridElement = new GridCellElement<>(element);
for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D(), true)) {
if (cell.addElement(gridElement)) {
changed = true;
}
}
}
if (changed) {
++this.elementCount;
}
return changed;
} | java | public boolean addElement(P element) {
boolean changed = false;
if (element != null) {
final GridCellElement<P> gridElement = new GridCellElement<>(element);
for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D(), true)) {
if (cell.addElement(gridElement)) {
changed = true;
}
}
}
if (changed) {
++this.elementCount;
}
return changed;
} | [
"public",
"boolean",
"addElement",
"(",
"P",
"element",
")",
"{",
"boolean",
"changed",
"=",
"false",
";",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"final",
"GridCellElement",
"<",
"P",
">",
"gridElement",
"=",
"new",
"GridCellElement",
"<>",
"(",
"... | Add the element in the grid.
@param element the element.
@return <code>true</code> if the element was added;
otherwise <code>false</code>. | [
"Add",
"the",
"element",
"in",
"the",
"grid",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L203-L217 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.removeElement | public boolean removeElement(P element) {
boolean changed = false;
if (element != null) {
GridCellElement<P> gridElement;
for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D())) {
gridElement = cell.removeElement(element);
if (gridElement != null) {
if (cell.isEmpty()) {
this.cells[cell.row()][cell.column()] = null;
--this.cellCount;
}
for (final GridCell<P> otherCell : gridElement.consumeCells()) {
assert otherCell != cell;
otherCell.removeElement(element);
if (otherCell.isEmpty()) {
this.cells[otherCell.row()][otherCell.column()] = null;
--this.cellCount;
}
}
changed = true;
}
}
}
if (changed) {
--this.elementCount;
}
return changed;
} | java | public boolean removeElement(P element) {
boolean changed = false;
if (element != null) {
GridCellElement<P> gridElement;
for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D())) {
gridElement = cell.removeElement(element);
if (gridElement != null) {
if (cell.isEmpty()) {
this.cells[cell.row()][cell.column()] = null;
--this.cellCount;
}
for (final GridCell<P> otherCell : gridElement.consumeCells()) {
assert otherCell != cell;
otherCell.removeElement(element);
if (otherCell.isEmpty()) {
this.cells[otherCell.row()][otherCell.column()] = null;
--this.cellCount;
}
}
changed = true;
}
}
}
if (changed) {
--this.elementCount;
}
return changed;
} | [
"public",
"boolean",
"removeElement",
"(",
"P",
"element",
")",
"{",
"boolean",
"changed",
"=",
"false",
";",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"GridCellElement",
"<",
"P",
">",
"gridElement",
";",
"for",
"(",
"final",
"GridCell",
"<",
"P",
... | Remove the element at the specified location.
@param element the element.
@return <code>true</code> if the element was removed;
otherwise <code>false</code>. | [
"Remove",
"the",
"element",
"at",
"the",
"specified",
"location",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L225-L252 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.getColumnFor | @Pure
public int getColumnFor(double x) {
final double xx = x - this.bounds.getMinX();
if (xx >= 0.) {
final int idx = (int) (xx / getCellWidth());
assert idx >= 0;
if (idx < getColumnCount()) {
return idx;
}
return getColumnCount() - 1;
}
return 0;
} | java | @Pure
public int getColumnFor(double x) {
final double xx = x - this.bounds.getMinX();
if (xx >= 0.) {
final int idx = (int) (xx / getCellWidth());
assert idx >= 0;
if (idx < getColumnCount()) {
return idx;
}
return getColumnCount() - 1;
}
return 0;
} | [
"@",
"Pure",
"public",
"int",
"getColumnFor",
"(",
"double",
"x",
")",
"{",
"final",
"double",
"xx",
"=",
"x",
"-",
"this",
".",
"bounds",
".",
"getMinX",
"(",
")",
";",
"if",
"(",
"xx",
">=",
"0.",
")",
"{",
"final",
"int",
"idx",
"=",
"(",
"i... | Replies the column index for the specified position.
@param x the x coordinate.
@return the column index or {@code -1} if outside. | [
"Replies",
"the",
"column",
"index",
"for",
"the",
"specified",
"position",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L323-L335 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.getRowFor | @Pure
public int getRowFor(double y) {
final double yy = y - this.bounds.getMinY();
if (yy >= 0.) {
final int idx = (int) (yy / getCellHeight());
assert idx >= 0;
if (idx < getRowCount()) {
return idx;
}
return getRowCount() - 1;
}
return 0;
} | java | @Pure
public int getRowFor(double y) {
final double yy = y - this.bounds.getMinY();
if (yy >= 0.) {
final int idx = (int) (yy / getCellHeight());
assert idx >= 0;
if (idx < getRowCount()) {
return idx;
}
return getRowCount() - 1;
}
return 0;
} | [
"@",
"Pure",
"public",
"int",
"getRowFor",
"(",
"double",
"y",
")",
"{",
"final",
"double",
"yy",
"=",
"y",
"-",
"this",
".",
"bounds",
".",
"getMinY",
"(",
")",
";",
"if",
"(",
"yy",
">=",
"0.",
")",
"{",
"final",
"int",
"idx",
"=",
"(",
"int"... | Replies the row index for the specified position.
@param y y coordinate.
@return the row index or {@code -1} if outside. | [
"Replies",
"the",
"row",
"index",
"for",
"the",
"specified",
"position",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L342-L354 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.getGridCellsAround | @Pure
public AroundCellIterable<P> getGridCellsAround(Point2D<?, ?> position, double maximalDistance) {
final int column = getColumnFor(position.getX());
final int row = getRowFor(position.getY());
return new AroundIterable(row, column, position, maximalDistance);
} | java | @Pure
public AroundCellIterable<P> getGridCellsAround(Point2D<?, ?> position, double maximalDistance) {
final int column = getColumnFor(position.getX());
final int row = getRowFor(position.getY());
return new AroundIterable(row, column, position, maximalDistance);
} | [
"@",
"Pure",
"public",
"AroundCellIterable",
"<",
"P",
">",
"getGridCellsAround",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"position",
",",
"double",
"maximalDistance",
")",
"{",
"final",
"int",
"column",
"=",
"getColumnFor",
"(",
"position",
".",
"getX",
... | Replies the cells around the specified point.
The order of the replied cells follows cocentric circles
around the cell that contains the specified point.
@param position the position.
@param maximalDistance is the distance above which the cells are not replied.
@return the iterator on the cells. | [
"Replies",
"the",
"cells",
"around",
"the",
"specified",
"point",
".",
"The",
"order",
"of",
"the",
"replied",
"cells",
"follows",
"cocentric",
"circles",
"around",
"the",
"cell",
"that",
"contains",
"the",
"specified",
"point",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L364-L369 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.iterator | @Pure
public Iterator<P> iterator(Rectangle2afp<?, ?, ?, ?, ?, ?> bounds) {
if (this.bounds.intersects(bounds)) {
final int c1 = getColumnFor(bounds.getMinX());
final int r1 = getRowFor(bounds.getMinY());
final int c2 = getColumnFor(bounds.getMaxX());
final int r2 = getRowFor(bounds.getMaxY());
return new BoundedElementIterator(new CellIterator(r1, c1, r2, c2, false), -1, bounds);
}
return Collections.<P>emptyList().iterator();
} | java | @Pure
public Iterator<P> iterator(Rectangle2afp<?, ?, ?, ?, ?, ?> bounds) {
if (this.bounds.intersects(bounds)) {
final int c1 = getColumnFor(bounds.getMinX());
final int r1 = getRowFor(bounds.getMinY());
final int c2 = getColumnFor(bounds.getMaxX());
final int r2 = getRowFor(bounds.getMaxY());
return new BoundedElementIterator(new CellIterator(r1, c1, r2, c2, false), -1, bounds);
}
return Collections.<P>emptyList().iterator();
} | [
"@",
"Pure",
"public",
"Iterator",
"<",
"P",
">",
"iterator",
"(",
"Rectangle2afp",
"<",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
">",
"bounds",
")",
"{",
"if",
"(",
"this",
".",
"bounds",
".",
"intersects",
"(",
"bounds",
")",
")... | Replies the elements that are inside the cells intersecting the
specified bounds.
@param bounds the bounds.
@return the iterator on the elements. | [
"Replies",
"the",
"elements",
"that",
"are",
"inside",
"the",
"cells",
"intersecting",
"the",
"specified",
"bounds",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L383-L393 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.getElementAt | @Pure
public P getElementAt(int index) {
if (index >= 0) {
int idx = 0;
int eIdx;
for (final GridCell<P> cell : getGridCells()) {
eIdx = idx + cell.getReferenceElementCount();
if (index < eIdx) {
try {
return cell.getElementAt(index - idx);
} catch (IndexOutOfBoundsException exception) {
throw new IndexOutOfBoundsException(Integer.toString(index));
}
}
idx = eIdx;
}
}
throw new IndexOutOfBoundsException(Integer.toString(index));
} | java | @Pure
public P getElementAt(int index) {
if (index >= 0) {
int idx = 0;
int eIdx;
for (final GridCell<P> cell : getGridCells()) {
eIdx = idx + cell.getReferenceElementCount();
if (index < eIdx) {
try {
return cell.getElementAt(index - idx);
} catch (IndexOutOfBoundsException exception) {
throw new IndexOutOfBoundsException(Integer.toString(index));
}
}
idx = eIdx;
}
}
throw new IndexOutOfBoundsException(Integer.toString(index));
} | [
"@",
"Pure",
"public",
"P",
"getElementAt",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"int",
"eIdx",
";",
"for",
"(",
"final",
"GridCell",
"<",
"P",
">",
"cell",
":",
"getGridCells",
"(",... | Replies the element at the specified index.
@param index the index.
@return the element at the specified position. | [
"Replies",
"the",
"element",
"at",
"the",
"specified",
"index",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L438-L456 | train |
killme2008/hs4j | src/main/java/com/google/code/hs4j/network/nio/impl/NioTCPSession.java | NioTCPSession.blockingWrite | protected final Object blockingWrite(SelectableChannel channel,
WriteMessage message, IoBuffer writeBuffer) throws IOException,
ClosedChannelException {
SelectionKey tmpKey = null;
Selector writeSelector = null;
int attempts = 0;
int bytesProduced = 0;
try {
while (writeBuffer.hasRemaining()) {
long len = doRealWrite(channel, writeBuffer);
if (len > 0) {
attempts = 0;
bytesProduced += len;
statistics.statisticsWrite(len);
} else {
attempts++;
if (writeSelector == null) {
writeSelector = SelectorFactory.getSelector();
if (writeSelector == null) {
// Continue using the main one.
continue;
}
tmpKey = channel.register(writeSelector,
SelectionKey.OP_WRITE);
}
if (writeSelector.select(1000) == 0) {
if (attempts > 2) {
throw new IOException("Client disconnected");
}
}
}
}
if (!writeBuffer.hasRemaining() && message.getWriteFuture() != null) {
message.getWriteFuture().setResult(Boolean.TRUE);
}
} finally {
if (tmpKey != null) {
tmpKey.cancel();
tmpKey = null;
}
if (writeSelector != null) {
// Cancel the key.
writeSelector.selectNow();
SelectorFactory.returnSelector(writeSelector);
}
}
scheduleWritenBytes.addAndGet(0 - bytesProduced);
return message.getMessage();
} | java | protected final Object blockingWrite(SelectableChannel channel,
WriteMessage message, IoBuffer writeBuffer) throws IOException,
ClosedChannelException {
SelectionKey tmpKey = null;
Selector writeSelector = null;
int attempts = 0;
int bytesProduced = 0;
try {
while (writeBuffer.hasRemaining()) {
long len = doRealWrite(channel, writeBuffer);
if (len > 0) {
attempts = 0;
bytesProduced += len;
statistics.statisticsWrite(len);
} else {
attempts++;
if (writeSelector == null) {
writeSelector = SelectorFactory.getSelector();
if (writeSelector == null) {
// Continue using the main one.
continue;
}
tmpKey = channel.register(writeSelector,
SelectionKey.OP_WRITE);
}
if (writeSelector.select(1000) == 0) {
if (attempts > 2) {
throw new IOException("Client disconnected");
}
}
}
}
if (!writeBuffer.hasRemaining() && message.getWriteFuture() != null) {
message.getWriteFuture().setResult(Boolean.TRUE);
}
} finally {
if (tmpKey != null) {
tmpKey.cancel();
tmpKey = null;
}
if (writeSelector != null) {
// Cancel the key.
writeSelector.selectNow();
SelectorFactory.returnSelector(writeSelector);
}
}
scheduleWritenBytes.addAndGet(0 - bytesProduced);
return message.getMessage();
} | [
"protected",
"final",
"Object",
"blockingWrite",
"(",
"SelectableChannel",
"channel",
",",
"WriteMessage",
"message",
",",
"IoBuffer",
"writeBuffer",
")",
"throws",
"IOException",
",",
"ClosedChannelException",
"{",
"SelectionKey",
"tmpKey",
"=",
"null",
";",
"Selecto... | Blocking write using temp selector
@param channel
@param message
@param writeBuffer
@return
@throws IOException
@throws ClosedChannelException | [
"Blocking",
"write",
"using",
"temp",
"selector"
] | 805fe14bfe270d95009514c224d93c5fe3575f11 | https://github.com/killme2008/hs4j/blob/805fe14bfe270d95009514c224d93c5fe3575f11/src/main/java/com/google/code/hs4j/network/nio/impl/NioTCPSession.java#L122-L170 | train |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.setSecDataArr | private int setSecDataArr(HashMap m, ArrayList arr, boolean isEvent) {
int idx = setSecDataArr(m, arr);
if (idx != 0 && isEvent && getValueOr(m, "date", "").equals("")) {
return -1;
} else {
return idx;
}
} | java | private int setSecDataArr(HashMap m, ArrayList arr, boolean isEvent) {
int idx = setSecDataArr(m, arr);
if (idx != 0 && isEvent && getValueOr(m, "date", "").equals("")) {
return -1;
} else {
return idx;
}
} | [
"private",
"int",
"setSecDataArr",
"(",
"HashMap",
"m",
",",
"ArrayList",
"arr",
",",
"boolean",
"isEvent",
")",
"{",
"int",
"idx",
"=",
"setSecDataArr",
"(",
"m",
",",
"arr",
")",
";",
"if",
"(",
"idx",
"!=",
"0",
"&&",
"isEvent",
"&&",
"getValueOr",
... | Get index value of the record and set new id value in the array.
In addition, it will check if the event date is available. If not, then
return 0.
@param m sub data
@param arr array of sub data
@return current index value of the sub data | [
"Get",
"index",
"value",
"of",
"the",
"record",
"and",
"set",
"new",
"id",
"value",
"in",
"the",
"array",
".",
"In",
"addition",
"it",
"will",
"check",
"if",
"the",
"event",
"date",
"is",
"available",
".",
"If",
"not",
"then",
"return",
"0",
"."
] | 4be61d998f106eb7234ea8701b63c3746ae688f4 | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1436-L1445 | train |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.isPlotInfoExist | private boolean isPlotInfoExist(Map expData) {
String[] plotIds = {"plta", "pltr#", "pltln", "pldr", "pltsp", "pllay", "pltha", "plth#", "plthl", "plthm"};
for (String plotId : plotIds) {
if (!getValueOr(expData, plotId, "").equals("")) {
return true;
}
}
return false;
} | java | private boolean isPlotInfoExist(Map expData) {
String[] plotIds = {"plta", "pltr#", "pltln", "pldr", "pltsp", "pllay", "pltha", "plth#", "plthl", "plthm"};
for (String plotId : plotIds) {
if (!getValueOr(expData, plotId, "").equals("")) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isPlotInfoExist",
"(",
"Map",
"expData",
")",
"{",
"String",
"[",
"]",
"plotIds",
"=",
"{",
"\"plta\"",
",",
"\"pltr#\"",
",",
"\"pltln\"",
",",
"\"pldr\"",
",",
"\"pltsp\"",
",",
"\"pllay\"",
",",
"\"pltha\"",
",",
"\"plth#\"",
",",
... | To check if there is plot info data existed in the experiment
@param expData experiment data holder
@return the boolean value for if plot info exists | [
"To",
"check",
"if",
"there",
"is",
"plot",
"info",
"data",
"existed",
"in",
"the",
"experiment"
] | 4be61d998f106eb7234ea8701b63c3746ae688f4 | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1517-L1526 | train |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.isSoilAnalysisExist | private boolean isSoilAnalysisExist(ArrayList<HashMap> icSubArr) {
for (HashMap icSubData : icSubArr) {
if (!getValueOr(icSubData, "slsc", "").equals("")) {
return true;
}
}
return false;
} | java | private boolean isSoilAnalysisExist(ArrayList<HashMap> icSubArr) {
for (HashMap icSubData : icSubArr) {
if (!getValueOr(icSubData, "slsc", "").equals("")) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isSoilAnalysisExist",
"(",
"ArrayList",
"<",
"HashMap",
">",
"icSubArr",
")",
"{",
"for",
"(",
"HashMap",
"icSubData",
":",
"icSubArr",
")",
"{",
"if",
"(",
"!",
"getValueOr",
"(",
"icSubData",
",",
"\"slsc\"",
",",
"\"\"",
")",
".",... | To check if there is soil analysis info data existed in the experiment
@param expData initial condition layer data array
@return the boolean value for if soil analysis info exists | [
"To",
"check",
"if",
"there",
"is",
"soil",
"analysis",
"info",
"data",
"existed",
"in",
"the",
"experiment"
] | 4be61d998f106eb7234ea8701b63c3746ae688f4 | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1534-L1542 | train |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.getDataList | private ArrayList<HashMap> getDataList(Map expData, String blockName, String dataListName) {
HashMap dataBlock = getObjectOr(expData, blockName, new HashMap());
return getObjectOr(dataBlock, dataListName, new ArrayList<HashMap>());
} | java | private ArrayList<HashMap> getDataList(Map expData, String blockName, String dataListName) {
HashMap dataBlock = getObjectOr(expData, blockName, new HashMap());
return getObjectOr(dataBlock, dataListName, new ArrayList<HashMap>());
} | [
"private",
"ArrayList",
"<",
"HashMap",
">",
"getDataList",
"(",
"Map",
"expData",
",",
"String",
"blockName",
",",
"String",
"dataListName",
")",
"{",
"HashMap",
"dataBlock",
"=",
"getObjectOr",
"(",
"expData",
",",
"blockName",
",",
"new",
"HashMap",
"(",
... | Get sub data array from experiment data object
@param expData experiment data holder
@param blockName top level block name
@param dataListName sub array name
@return sub data array | [
"Get",
"sub",
"data",
"array",
"from",
"experiment",
"data",
"object"
] | 4be61d998f106eb7234ea8701b63c3746ae688f4 | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1552-L1555 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/evaluation/ProvenancedConfusionMatrix.java | ProvenancedConfusionMatrix.entries | public Set<CellFiller> entries() {
return FluentIterable.from(table.cellSet())
.transformAndConcat(CollectionUtils.<List<CellFiller>>TableCellValue())
.toSet();
} | java | public Set<CellFiller> entries() {
return FluentIterable.from(table.cellSet())
.transformAndConcat(CollectionUtils.<List<CellFiller>>TableCellValue())
.toSet();
} | [
"public",
"Set",
"<",
"CellFiller",
">",
"entries",
"(",
")",
"{",
"return",
"FluentIterable",
".",
"from",
"(",
"table",
".",
"cellSet",
"(",
")",
")",
".",
"transformAndConcat",
"(",
"CollectionUtils",
".",
"<",
"List",
"<",
"CellFiller",
">",
">",
"Ta... | Returns all provenance entries in this matrix, regardless of cell. | [
"Returns",
"all",
"provenance",
"entries",
"in",
"this",
"matrix",
"regardless",
"of",
"cell",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/evaluation/ProvenancedConfusionMatrix.java#L72-L76 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/evaluation/ProvenancedConfusionMatrix.java | ProvenancedConfusionMatrix.breakdown | public <SignatureType> BrokenDownProvenancedConfusionMatrix<SignatureType, CellFiller>
breakdown(Function<? super CellFiller, SignatureType> signatureFunction,
Ordering<SignatureType> keyOrdering) {
final Map<SignatureType, Builder<CellFiller>> ret = Maps.newHashMap();
// a more efficient implementation should be used if the confusion matrix is
// large and sparse, but this is unlikely. ~ rgabbard
for (final Symbol leftLabel : leftLabels()) {
for (final Symbol rightLabel : rightLabels()) {
for (final CellFiller provenance : cell(leftLabel, rightLabel)) {
final SignatureType signature = signatureFunction.apply(provenance);
checkNotNull(signature, "Provenance function may never return null");
if (!ret.containsKey(signature)) {
ret.put(signature, ProvenancedConfusionMatrix.<CellFiller>builder());
}
ret.get(signature).record(leftLabel, rightLabel, provenance);
}
}
}
final ImmutableMap.Builder<SignatureType, ProvenancedConfusionMatrix<CellFiller>> trueRet =
ImmutableMap.builder();
// to get consistent output, we make sure to sort by the keys
for (final Map.Entry<SignatureType, Builder<CellFiller>> entry :
MapUtils.<SignatureType, Builder<CellFiller>>byKeyOrdering(keyOrdering).sortedCopy(
ret.entrySet())) {
trueRet.put(entry.getKey(), entry.getValue().build());
}
return BrokenDownProvenancedConfusionMatrix.fromMap(trueRet.build());
} | java | public <SignatureType> BrokenDownProvenancedConfusionMatrix<SignatureType, CellFiller>
breakdown(Function<? super CellFiller, SignatureType> signatureFunction,
Ordering<SignatureType> keyOrdering) {
final Map<SignatureType, Builder<CellFiller>> ret = Maps.newHashMap();
// a more efficient implementation should be used if the confusion matrix is
// large and sparse, but this is unlikely. ~ rgabbard
for (final Symbol leftLabel : leftLabels()) {
for (final Symbol rightLabel : rightLabels()) {
for (final CellFiller provenance : cell(leftLabel, rightLabel)) {
final SignatureType signature = signatureFunction.apply(provenance);
checkNotNull(signature, "Provenance function may never return null");
if (!ret.containsKey(signature)) {
ret.put(signature, ProvenancedConfusionMatrix.<CellFiller>builder());
}
ret.get(signature).record(leftLabel, rightLabel, provenance);
}
}
}
final ImmutableMap.Builder<SignatureType, ProvenancedConfusionMatrix<CellFiller>> trueRet =
ImmutableMap.builder();
// to get consistent output, we make sure to sort by the keys
for (final Map.Entry<SignatureType, Builder<CellFiller>> entry :
MapUtils.<SignatureType, Builder<CellFiller>>byKeyOrdering(keyOrdering).sortedCopy(
ret.entrySet())) {
trueRet.put(entry.getKey(), entry.getValue().build());
}
return BrokenDownProvenancedConfusionMatrix.fromMap(trueRet.build());
} | [
"public",
"<",
"SignatureType",
">",
"BrokenDownProvenancedConfusionMatrix",
"<",
"SignatureType",
",",
"CellFiller",
">",
"breakdown",
"(",
"Function",
"<",
"?",
"super",
"CellFiller",
",",
"SignatureType",
">",
"signatureFunction",
",",
"Ordering",
"<",
"SignatureTy... | Allows generating "breakdowns" of a provenanced confusion matrix according to some criteria.
For example, a confusion matrix for an event detection task could be further broken down into
separate confusion matrices for each event type.
To do this, you specify a signature function mapping from each provenance to some signature
(e.g. to event types, to genres, etc.). The output will be an {@link
com.google.common.collect.ImmutableMap} from all observed signatures to {@link
ProvenancedConfusionMatrix}es consisting of only those provenances with
the corresponding signature under the provided function.
The signature function may never return a signature of {@code null}.
{@code keyOrder} is the order the keys should be in the iteration order of the resulting map. | [
"Allows",
"generating",
"breakdowns",
"of",
"a",
"provenanced",
"confusion",
"matrix",
"according",
"to",
"some",
"criteria",
".",
"For",
"example",
"a",
"confusion",
"matrix",
"for",
"an",
"event",
"detection",
"task",
"could",
"be",
"further",
"broken",
"down"... | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/evaluation/ProvenancedConfusionMatrix.java#L113-L142 | train |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java | FileType.getContentType | public static String getContentType(String filename) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.getContentType(filename);
} | java | public static String getContentType(String filename) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.getContentType(filename);
} | [
"public",
"static",
"String",
"getContentType",
"(",
"String",
"filename",
")",
"{",
"final",
"ContentFileTypeMap",
"map",
"=",
"ensureContentTypeManager",
"(",
")",
";",
"return",
"map",
".",
"getContentType",
"(",
"filename",
")",
";",
"}"
] | Replies the MIME type of the given file.
@param filename is the name of the file to test.
@return the MIME type of the given file. | [
"Replies",
"the",
"MIME",
"type",
"of",
"the",
"given",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java#L104-L107 | train |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java | FileType.getFormatVersion | public static String getFormatVersion(File filename) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.getFormatVersion(filename);
} | java | public static String getFormatVersion(File filename) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.getFormatVersion(filename);
} | [
"public",
"static",
"String",
"getFormatVersion",
"(",
"File",
"filename",
")",
"{",
"final",
"ContentFileTypeMap",
"map",
"=",
"ensureContentTypeManager",
"(",
")",
";",
"return",
"map",
".",
"getFormatVersion",
"(",
"filename",
")",
";",
"}"
] | Replies the version of the format of the given file.
@param filename is the name of the file to test.
@return the format version for the given file. | [
"Replies",
"the",
"version",
"of",
"the",
"format",
"of",
"the",
"given",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java#L124-L127 | train |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java | FileType.isImage | public static boolean isImage(String mime) {
try {
final MimeType type = new MimeType(mime);
return IMAGE.equalsIgnoreCase(type.getPrimaryType());
} catch (MimeTypeParseException e) {
//
}
return false;
} | java | public static boolean isImage(String mime) {
try {
final MimeType type = new MimeType(mime);
return IMAGE.equalsIgnoreCase(type.getPrimaryType());
} catch (MimeTypeParseException e) {
//
}
return false;
} | [
"public",
"static",
"boolean",
"isImage",
"(",
"String",
"mime",
")",
"{",
"try",
"{",
"final",
"MimeType",
"type",
"=",
"new",
"MimeType",
"(",
"mime",
")",
";",
"return",
"IMAGE",
".",
"equalsIgnoreCase",
"(",
"type",
".",
"getPrimaryType",
"(",
")",
"... | Replies if the specified MIME type corresponds to an image.
@param mime is the MIME type to test.
@return <code>true</code> if the given MIME type is corresponding to an image,
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"specified",
"MIME",
"type",
"corresponds",
"to",
"an",
"image",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java#L155-L163 | train |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java | FileType.isContentType | public static boolean isContentType(URL filename, String desiredMimeType) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.isContentType(filename, desiredMimeType);
} | java | public static boolean isContentType(URL filename, String desiredMimeType) {
final ContentFileTypeMap map = ensureContentTypeManager();
return map.isContentType(filename, desiredMimeType);
} | [
"public",
"static",
"boolean",
"isContentType",
"(",
"URL",
"filename",
",",
"String",
"desiredMimeType",
")",
"{",
"final",
"ContentFileTypeMap",
"map",
"=",
"ensureContentTypeManager",
"(",
")",
";",
"return",
"map",
".",
"isContentType",
"(",
"filename",
",",
... | Replies if the given file is compatible with the given MIME type.
@param filename is the name of the file to test.
@param desiredMimeType is the desired MIME type.
@return <code>true</code> if the given file has type equal to the given MIME type,
otherwise <code>false</code>. | [
"Replies",
"if",
"the",
"given",
"file",
"is",
"compatible",
"with",
"the",
"given",
"MIME",
"type",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/FileType.java#L196-L199 | train |
dbflute-session/tomcat-boot | src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java | BotmReflectionUtil.getPublicMethod | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
assertObjectNotNull("clazz", clazz);
assertStringNotNullAndNotTrimmedEmpty("methodName", methodName);
return findMethod(clazz, methodName, argTypes, VisibilityType.PUBLIC, false);
} | java | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
assertObjectNotNull("clazz", clazz);
assertStringNotNullAndNotTrimmedEmpty("methodName", methodName);
return findMethod(clazz, methodName, argTypes, VisibilityType.PUBLIC, false);
} | [
"public",
"static",
"Method",
"getPublicMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"{",
"assertObjectNotNull",
"(",
"\"clazz\"",
",",
"clazz",
")",
";",
"assertStringN... | Get the public method.
@param clazz The type of class that defines the method. (NotNull)
@param methodName The name of method. (NotNull)
@param argTypes The type of argument. (NotNull)
@return The instance of method. (NullAllowed: if null, not found) | [
"Get",
"the",
"public",
"method",
"."
] | fe941f88b6be083781873126f5b12d4c16bb9073 | https://github.com/dbflute-session/tomcat-boot/blob/fe941f88b6be083781873126f5b12d4c16bb9073/src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java#L368-L372 | train |
dbflute-session/tomcat-boot | src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java | BotmReflectionUtil.invoke | public static Object invoke(Method method, Object target, Object[] args) {
assertObjectNotNull("method", method);
try {
return method.invoke(target, args);
} catch (InvocationTargetException e) {
Throwable t = e.getCause();
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
if (t instanceof Error) {
throw (Error) t;
}
String msg = "The InvocationTargetException occurred: ";
msg = msg + " method=" + method + " target=" + target;
msg = msg + " args=" + (args != null ? Arrays.asList(args) : "");
throw new ReflectionFailureException(msg, t);
} catch (IllegalArgumentException e) {
String msg = "Illegal argument for the method:";
msg = msg + " method=" + method + " target=" + target;
msg = msg + " args=" + (args != null ? Arrays.asList(args) : "");
throw new ReflectionFailureException(msg, e);
} catch (IllegalAccessException e) {
String msg = "Illegal access to the method:";
msg = msg + " method=" + method + " target=" + target;
msg = msg + " args=" + (args != null ? Arrays.asList(args) : "");
throw new ReflectionFailureException(msg, e);
}
} | java | public static Object invoke(Method method, Object target, Object[] args) {
assertObjectNotNull("method", method);
try {
return method.invoke(target, args);
} catch (InvocationTargetException e) {
Throwable t = e.getCause();
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
if (t instanceof Error) {
throw (Error) t;
}
String msg = "The InvocationTargetException occurred: ";
msg = msg + " method=" + method + " target=" + target;
msg = msg + " args=" + (args != null ? Arrays.asList(args) : "");
throw new ReflectionFailureException(msg, t);
} catch (IllegalArgumentException e) {
String msg = "Illegal argument for the method:";
msg = msg + " method=" + method + " target=" + target;
msg = msg + " args=" + (args != null ? Arrays.asList(args) : "");
throw new ReflectionFailureException(msg, e);
} catch (IllegalAccessException e) {
String msg = "Illegal access to the method:";
msg = msg + " method=" + method + " target=" + target;
msg = msg + " args=" + (args != null ? Arrays.asList(args) : "");
throw new ReflectionFailureException(msg, e);
}
} | [
"public",
"static",
"Object",
"invoke",
"(",
"Method",
"method",
",",
"Object",
"target",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"assertObjectNotNull",
"(",
"\"method\"",
",",
"method",
")",
";",
"try",
"{",
"return",
"method",
".",
"invoke",
"(",
"t... | Invoke the method by reflection.
@param method The instance of method. (NotNull)
@param target The invocation target instance. (NullAllowed: if null, it means static method)
@param args The array of arguments. (NullAllowed)
@return The return value of the method. (NullAllowed)
@throws ReflectionFailureException When invocation failure and illegal access | [
"Invoke",
"the",
"method",
"by",
"reflection",
"."
] | fe941f88b6be083781873126f5b12d4c16bb9073 | https://github.com/dbflute-session/tomcat-boot/blob/fe941f88b6be083781873126f5b12d4c16bb9073/src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java#L559-L586 | train |
dbflute-session/tomcat-boot | src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java | BotmReflectionUtil.assertStringNotNullAndNotTrimmedEmpty | public static void assertStringNotNullAndNotTrimmedEmpty(String variableName, String value) {
assertObjectNotNull("variableName", variableName);
assertObjectNotNull("value", value);
if (value.trim().length() == 0) {
String msg = "The value should not be empty: variableName=" + variableName + " value=" + value;
throw new IllegalArgumentException(msg);
}
} | java | public static void assertStringNotNullAndNotTrimmedEmpty(String variableName, String value) {
assertObjectNotNull("variableName", variableName);
assertObjectNotNull("value", value);
if (value.trim().length() == 0) {
String msg = "The value should not be empty: variableName=" + variableName + " value=" + value;
throw new IllegalArgumentException(msg);
}
} | [
"public",
"static",
"void",
"assertStringNotNullAndNotTrimmedEmpty",
"(",
"String",
"variableName",
",",
"String",
"value",
")",
"{",
"assertObjectNotNull",
"(",
"\"variableName\"",
",",
"variableName",
")",
";",
"assertObjectNotNull",
"(",
"\"value\"",
",",
"value",
... | Assert that the entity is not null and not trimmed empty.
@param variableName The check name of variable for message. (NotNull)
@param value The checked value. (NotNull) | [
"Assert",
"that",
"the",
"entity",
"is",
"not",
"null",
"and",
"not",
"trimmed",
"empty",
"."
] | fe941f88b6be083781873126f5b12d4c16bb9073 | https://github.com/dbflute-session/tomcat-boot/blob/fe941f88b6be083781873126f5b12d4c16bb9073/src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java#L859-L866 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/xml/XMLUtils.java | XMLUtils.nextSibling | public static Optional<Element> nextSibling(final Element element, final String name) {
for (Node childNode = element.getNextSibling(); childNode != null;
childNode = childNode.getNextSibling()) {
if (childNode instanceof Element && ((Element) childNode).getTagName()
.equalsIgnoreCase(name)) {
return Optional.of((Element) childNode);
}
}
return Optional.absent();
} | java | public static Optional<Element> nextSibling(final Element element, final String name) {
for (Node childNode = element.getNextSibling(); childNode != null;
childNode = childNode.getNextSibling()) {
if (childNode instanceof Element && ((Element) childNode).getTagName()
.equalsIgnoreCase(name)) {
return Optional.of((Element) childNode);
}
}
return Optional.absent();
} | [
"public",
"static",
"Optional",
"<",
"Element",
">",
"nextSibling",
"(",
"final",
"Element",
"element",
",",
"final",
"String",
"name",
")",
"{",
"for",
"(",
"Node",
"childNode",
"=",
"element",
".",
"getNextSibling",
"(",
")",
";",
"childNode",
"!=",
"nul... | Returns the element's next sibling with a tag matching the given name.
@param element the element
@param name the tag of the desired sibling
@return a sibling matching the tag, or {@link Optional#absent()} if there is none | [
"Returns",
"the",
"element",
"s",
"next",
"sibling",
"with",
"a",
"tag",
"matching",
"the",
"given",
"name",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/xml/XMLUtils.java#L76-L85 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/xml/XMLUtils.java | XMLUtils.prettyPrintElementLocally | public static String prettyPrintElementLocally(Element e) {
final ImmutableMap.Builder<String, String> ret = ImmutableMap.builder();
final NamedNodeMap attributes = e.getAttributes();
for (int i = 0; i < attributes.getLength(); ++i) {
final Node attr = attributes.item(i);
ret.put(attr.getNodeName(), "\"" + attr.getNodeValue() + "\"");
}
return "<" + e.getNodeName() + " " + Joiner.on(" ").withKeyValueSeparator("=").join(ret.build())
+ "/>";
} | java | public static String prettyPrintElementLocally(Element e) {
final ImmutableMap.Builder<String, String> ret = ImmutableMap.builder();
final NamedNodeMap attributes = e.getAttributes();
for (int i = 0; i < attributes.getLength(); ++i) {
final Node attr = attributes.item(i);
ret.put(attr.getNodeName(), "\"" + attr.getNodeValue() + "\"");
}
return "<" + e.getNodeName() + " " + Joiner.on(" ").withKeyValueSeparator("=").join(ret.build())
+ "/>";
} | [
"public",
"static",
"String",
"prettyPrintElementLocally",
"(",
"Element",
"e",
")",
"{",
"final",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"String",
">",
"ret",
"=",
"ImmutableMap",
".",
"builder",
"(",
")",
";",
"final",
"NamedNodeMap",
"attribute... | A human-consumable string representation of an element with its attributes but without its
children. Do not depend on the particular form of this. | [
"A",
"human",
"-",
"consumable",
"string",
"representation",
"of",
"an",
"element",
"with",
"its",
"attributes",
"but",
"without",
"its",
"children",
".",
"Do",
"not",
"depend",
"on",
"the",
"particular",
"form",
"of",
"this",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/xml/XMLUtils.java#L545-L554 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/d/Point1d.java | Point1d.convert | public static Point1d convert(Tuple1d<?> tuple) {
if (tuple instanceof Point1d) {
return (Point1d) tuple;
}
return new Point1d(tuple.getSegment(), tuple.getX(), tuple.getY());
} | java | public static Point1d convert(Tuple1d<?> tuple) {
if (tuple instanceof Point1d) {
return (Point1d) tuple;
}
return new Point1d(tuple.getSegment(), tuple.getX(), tuple.getY());
} | [
"public",
"static",
"Point1d",
"convert",
"(",
"Tuple1d",
"<",
"?",
">",
"tuple",
")",
"{",
"if",
"(",
"tuple",
"instanceof",
"Point1d",
")",
"{",
"return",
"(",
"Point1d",
")",
"tuple",
";",
"}",
"return",
"new",
"Point1d",
"(",
"tuple",
".",
"getSegm... | Convert the given tuple to a real Point1d.
<p>If the given tuple is already a Point1d, it is replied.
@param tuple the tuple.
@return the Point1d.
@since 14.0 | [
"Convert",
"the",
"given",
"tuple",
"to",
"a",
"real",
"Point1d",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d1/d/Point1d.java#L142-L147 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.EL2_WSG84 | @Pure
public static GeodesicPosition EL2_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | @Pure
public static GeodesicPosition EL2_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | [
"@",
"Pure",
"public",
"static",
"GeodesicPosition",
"EL2_WSG84",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2E_N",
",",
"LAMBERT_2E_C",
",",
"LAMBERT_... | This function convert extended France Lambert II coordinate to geographic WSG84 Data.
@param x is the coordinate in extended France Lambert II
@param y is the coordinate in extended France Lambert II
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L165-L173 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.EL2_L2 | @Pure
public static Point2d EL2_L2(double x, double y) {
return new Point2d(x, y + (LAMBERT_2E_YS - LAMBERT_2_YS));
} | java | @Pure
public static Point2d EL2_L2(double x, double y) {
return new Point2d(x, y + (LAMBERT_2E_YS - LAMBERT_2_YS));
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"EL2_L2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"new",
"Point2d",
"(",
"x",
",",
"y",
"+",
"(",
"LAMBERT_2E_YS",
"-",
"LAMBERT_2_YS",
")",
")",
";",
"}"
] | This function convert extended France Lambert II coordinate to
France Lambert II coordinate.
@param x is the coordinate in extended France Lambert II
@param y is the coordinate in extended France Lambert II
@return the France Lambert II coordinate. | [
"This",
"function",
"convert",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"II",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L206-L209 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.EL2_L3 | @Pure
public static Point2d EL2_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | java | @Pure
public static Point2d EL2_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"EL2_L3",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2E_N",
",",
"LAMBERT_2E_C",
",",
"LAMBERT_2E_XS",
",... | This function convert extended France Lambert II coordinate to
France Lambert III coordinate.
@param x is the coordinate in extended France Lambert II
@param y is the coordinate in extended France Lambert II
@return the France Lambert III coordinate. | [
"This",
"function",
"convert",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"III",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L219-L232 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L1_WSG84 | @Pure
public static GeodesicPosition L1_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | @Pure
public static GeodesicPosition L1_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | [
"@",
"Pure",
"public",
"static",
"GeodesicPosition",
"L1_WSG84",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_1_N",
",",
"LAMBERT_1_C",
",",
"LAMBERT_1_X... | This function convert France Lambert I coordinate to geographic WSG84 Data.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"France",
"Lambert",
"I",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L287-L295 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L1_EL2 | @Pure
public static Point2d L1_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | java | @Pure
public static Point2d L1_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L1_EL2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_1_N",
",",
"LAMBERT_1_C",
",",
"LAMBERT_1_XS",
",",
... | This function convert France Lambert I coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return the extended France Lambert II coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"I",
"coordinate",
"to",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L305-L318 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L1_L3 | @Pure
public static Point2d L1_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | java | @Pure
public static Point2d L1_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L1_L3",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_1_N",
",",
"LAMBERT_1_C",
",",
"LAMBERT_1_XS",
",",
... | This function convert France Lambert I coordinate to
France Lambert III coordinate.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return the France Lambert III coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"I",
"coordinate",
"to",
"France",
"Lambert",
"III",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L351-L364 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L1_L4 | @Pure
public static Point2d L1_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | java | @Pure
public static Point2d L1_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L1_L4",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_1_N",
",",
"LAMBERT_1_C",
",",
"LAMBERT_1_XS",
",",
... | This function convert France Lambert I coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return the France Lambert IV coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"I",
"coordinate",
"to",
"France",
"Lambert",
"IV",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L374-L387 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_WSG84 | @Pure
public static GeodesicPosition L2_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | @Pure
public static GeodesicPosition L2_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | [
"@",
"Pure",
"public",
"static",
"GeodesicPosition",
"L2_WSG84",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2_N",
",",
"LAMBERT_2_C",
",",
"LAMBERT_2_X... | This function convert France Lambert II coordinate to geographic WSG84 Data.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L419-L427 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_EL2 | @Pure
public static Point2d L2_EL2(double x, double y) {
return new Point2d(x, y - (LAMBERT_2E_YS - LAMBERT_2_YS));
} | java | @Pure
public static Point2d L2_EL2(double x, double y) {
return new Point2d(x, y - (LAMBERT_2E_YS - LAMBERT_2_YS));
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_EL2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"new",
"Point2d",
"(",
"x",
",",
"y",
"-",
"(",
"LAMBERT_2E_YS",
"-",
"LAMBERT_2_YS",
")",
")",
";",
"}"
] | This function convert France Lambert II coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the extended France Lambert II coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L437-L440 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_L1 | @Pure
public static Point2d L2_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
} | java | @Pure
public static Point2d L2_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_L1",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2_N",
",",
"LAMBERT_2_C",
",",
"LAMBERT_2_XS",
",",
... | This function convert France Lambert II coordinate to
France Lambert I coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert I coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"I",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L450-L463 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_L3 | @Pure
public static Point2d L2_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | java | @Pure
public static Point2d L2_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_L3",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2_N",
",",
"LAMBERT_2_C",
",",
"LAMBERT_2_XS",
",",
... | This function convert France Lambert II coordinate to
France Lambert III coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert III coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"III",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L473-L486 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_L4 | @Pure
public static Point2d L2_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | java | @Pure
public static Point2d L2_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_L4",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2_N",
",",
"LAMBERT_2_C",
",",
"LAMBERT_2_XS",
",",
... | This function convert France Lambert II coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert IV coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"IV",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L496-L509 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_L93 | @Pure
public static Point2d L2_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
} | java | @Pure
public static Point2d L2_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_L93",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2_N",
",",
"LAMBERT_2_C",
",",
"LAMBERT_2_XS",
",",
... | This function convert France Lambert II coordinate to
France Lambert 93 coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert I coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"93",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L519-L532 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L3_WSG84 | @Pure
public static GeodesicPosition L3_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | @Pure
public static GeodesicPosition L3_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | [
"@",
"Pure",
"public",
"static",
"GeodesicPosition",
"L3_WSG84",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_3_N",
",",
"LAMBERT_3_C",
",",
"LAMBERT_3_X... | This function convert France Lambert III coordinate to geographic WSG84 Data.
@param x is the coordinate in France Lambert III
@param y is the coordinate in France Lambert III
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"France",
"Lambert",
"III",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L541-L549 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L3_L4 | @Pure
public static Point2d L3_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | java | @Pure
public static Point2d L3_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L3_L4",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_3_N",
",",
"LAMBERT_3_C",
",",
"LAMBERT_3_XS",
",",
... | This function convert France Lambert III coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert III
@param y is the coordinate in France Lambert III
@return the France Lambert IV coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"III",
"coordinate",
"to",
"France",
"Lambert",
"IV",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L628-L641 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L3_L93 | @Pure
public static Point2d L3_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
} | java | @Pure
public static Point2d L3_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L3_L93",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_3_N",
",",
"LAMBERT_3_C",
",",
"LAMBERT_3_XS",
",",
... | This function convert France Lambert III coordinate to
France Lambert 93 coordinate.
@param x is the coordinate in France Lambert III
@param y is the coordinate in France Lambert III
@return the France Lambert 93 coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"III",
"coordinate",
"to",
"France",
"Lambert",
"93",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L651-L664 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L4_WSG84 | @Pure
public static GeodesicPosition L4_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | @Pure
public static GeodesicPosition L4_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | [
"@",
"Pure",
"public",
"static",
"GeodesicPosition",
"L4_WSG84",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_4_N",
",",
"LAMBERT_4_C",
",",
"LAMBERT_4_X... | This function convert France Lambert IV coordinate to geographic WSG84 Data.
@param x is the coordinate in France Lambert IV
@param y is the coordinate in France Lambert IV
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"France",
"Lambert",
"IV",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L673-L681 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L4_EL2 | @Pure
public static Point2d L4_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | java | @Pure
public static Point2d L4_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L4_EL2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_4_N",
",",
"LAMBERT_4_C",
",",
"LAMBERT_4_XS",
",",
... | This function convert France Lambert IV coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert IV
@param y is the coordinate in France Lambert IV
@return the extended France Lambert II coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"IV",
"coordinate",
"to",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L691-L704 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L93_WSG84 | @Pure
public static GeodesicPosition L93_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | java | @Pure
public static GeodesicPosition L93_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | [
"@",
"Pure",
"public",
"static",
"GeodesicPosition",
"L93_WSG84",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_93_N",
",",
"LAMBERT_93_C",
",",
"LAMBERT_... | This function convert France Lambert 93 coordinate to geographic WSG84 Data.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"France",
"Lambert",
"93",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L805-L813 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L93_EL2 | @Pure
public static Point2d L93_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | java | @Pure
public static Point2d L93_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L93_EL2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_93_N",
",",
"LAMBERT_93_C",
",",
"LAMBERT_93_XS",
"... | This function convert France Lambert 93 coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return the extended France Lambert II coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"93",
"coordinate",
"to",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L823-L836 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L93_L1 | @Pure
public static Point2d L93_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
} | java | @Pure
public static Point2d L93_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L93_L1",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_93_N",
",",
"LAMBERT_93_C",
",",
"LAMBERT_93_XS",
",... | This function convert France Lambert 93 coordinate to
France Lambert I coordinate.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return the France Lambert I coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"93",
"coordinate",
"to",
"France",
"Lambert",
"I",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L846-L859 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L93_L4 | @Pure
public static Point2d L93_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | java | @Pure
public static Point2d L93_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L93_L4",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_93_N",
",",
"LAMBERT_93_C",
",",
"LAMBERT_93_XS",
",... | This function convert France Lambert 93 coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return the France Lambert IV coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"93",
"coordinate",
"to",
"France",
"Lambert",
"IV",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L915-L928 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.NTFLambert_NTFLambdaPhi | @SuppressWarnings({"checkstyle:parametername", "checkstyle:localfinalvariablename"})
private static Point2d NTFLambert_NTFLambdaPhi(double x, double y, double n, double c, double Xs, double Ys) {
// Several constants from the IGN specifications
//Longitude in radians of Paris (2°20'14.025" E) from Greenwich
final double lambda_0 = 0.;
// Extended Lambert II (x,y) -> graphical coordinate NTF (lambda_ntf,phi_ntf)
// ALG0004
final double R = Math.hypot(x - Xs, y - Ys);
final double g = Math.atan((x - Xs) / (Ys - y));
final double lamdda_ntf = lambda_0 + (g / n);
final double L = -(1 / n) * Math.log(Math.abs(R / c));
final double phi0 = 2 * Math.atan(Math.exp(L)) - (Math.PI / 2.0);
double phiprec = phi0;
double phii = compute1(phiprec, L);
while (Math.abs(phii - phiprec) >= EPSILON) {
phiprec = phii;
phii = compute1(phiprec, L);
}
final double phi_ntf = phii;
return new Point2d(lamdda_ntf, phi_ntf);
} | java | @SuppressWarnings({"checkstyle:parametername", "checkstyle:localfinalvariablename"})
private static Point2d NTFLambert_NTFLambdaPhi(double x, double y, double n, double c, double Xs, double Ys) {
// Several constants from the IGN specifications
//Longitude in radians of Paris (2°20'14.025" E) from Greenwich
final double lambda_0 = 0.;
// Extended Lambert II (x,y) -> graphical coordinate NTF (lambda_ntf,phi_ntf)
// ALG0004
final double R = Math.hypot(x - Xs, y - Ys);
final double g = Math.atan((x - Xs) / (Ys - y));
final double lamdda_ntf = lambda_0 + (g / n);
final double L = -(1 / n) * Math.log(Math.abs(R / c));
final double phi0 = 2 * Math.atan(Math.exp(L)) - (Math.PI / 2.0);
double phiprec = phi0;
double phii = compute1(phiprec, L);
while (Math.abs(phii - phiprec) >= EPSILON) {
phiprec = phii;
phii = compute1(phiprec, L);
}
final double phi_ntf = phii;
return new Point2d(lamdda_ntf, phi_ntf);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:parametername\"",
",",
"\"checkstyle:localfinalvariablename\"",
"}",
")",
"private",
"static",
"Point2d",
"NTFLambert_NTFLambdaPhi",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"n",
",",
"double",
"c",
",",... | This function convert extended France NTF Lambert coordinate to Angular NTF coordinate.
@param x is the coordinate in extended France NTF Lambert
@param y is the coordinate in extended France NTF Lambert
@param n is the exponential of the Lambert projection.
@param c is the constant of projection.
@param Xs is the x coordinate of the origine of the Lambert projection.
@param Ys is the y coordinate of the origine of the Lambert projection.
@return lambda and phi in NTF. | [
"This",
"function",
"convert",
"extended",
"France",
"NTF",
"Lambert",
"coordinate",
"to",
"Angular",
"NTF",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L941-L965 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.NTFLambdaPhi_WSG84 | @SuppressWarnings({"checkstyle:magicnumber", "checkstyle:localfinalvariablename", "checkstyle:localvariablename"})
private static GeodesicPosition NTFLambdaPhi_WSG84(double lambda_ntf, double phi_ntf) {
// Geographical coordinate NTF (lamda_ntf,phi_ntf)
// -> Cartesian coordinate NTF (x_ntf,y_ntf,z_ntf)
// ALG0009
double a = 6378249.2;
// 100 meters
final double h = 100;
final double N = a / Math.pow(1. - (NTF_E * NTF_E) * (Math.sin(phi_ntf) * Math.sin(phi_ntf)), .5);
final double x_ntf = (N + h) * Math.cos(phi_ntf) * Math.cos(lambda_ntf);
final double y_ntf = (N + h) * Math.cos(phi_ntf) * Math.sin(lambda_ntf);
final double z_ntf = ((N * (1. - (NTF_E * NTF_E))) + h) * Math.sin(phi_ntf);
// Cartesian coordinate NTF (x_ntf,y_ntf,z_ntf)
// -> Cartesian coordinate WGS84 (x_w,y_w,z_w)
// ALG0013
// This is a simple translation.
final double x_w = x_ntf - 168.;
final double y_w = y_ntf - 60.;
final double z_w = z_ntf + 320;
// Cartesian coordinate WGS84 (x_w,y_w,z_w)
// -> Geographic coordinate WGS84 (lamda_w,phi_w)
// ALG0012
// 0.04079234433 to use the Greenwich meridian, 0 else
final double l840 = 0.04079234433;
a = 6378137.0;
final double P = Math.hypot(x_w, y_w);
double lambda_w = l840 + Math.atan(y_w / x_w);
double phi0_w = Math.atan(z_w / (P * (1 - ((a * WSG84_E * WSG84_E))
/ Math.sqrt((x_w * x_w) + (y_w * y_w) + (z_w * z_w)))));
double phi_w = Math.atan((z_w / P) / (1 - ((a * WSG84_E * WSG84_E * Math.cos(phi0_w))
/ (P * Math.sqrt(1 - NTF_E * NTF_E * (Math.sin(phi0_w) * Math.sin(phi0_w)))))));
while (Math.abs(phi_w - phi0_w) >= EPSILON) {
phi0_w = phi_w;
phi_w = Math.atan((z_w / P) / (1 - ((a * WSG84_E * WSG84_E * Math.cos(phi0_w))
/ (P * Math.sqrt(1 - ((WSG84_E * WSG84_E) * (Math.sin(phi0_w) * Math.sin(phi0_w))))))));
}
// Convert radians to degrees.
lambda_w = Math.toDegrees(lambda_w);
phi_w = Math.toDegrees(phi_w);
return new GeodesicPosition(lambda_w, phi_w);
} | java | @SuppressWarnings({"checkstyle:magicnumber", "checkstyle:localfinalvariablename", "checkstyle:localvariablename"})
private static GeodesicPosition NTFLambdaPhi_WSG84(double lambda_ntf, double phi_ntf) {
// Geographical coordinate NTF (lamda_ntf,phi_ntf)
// -> Cartesian coordinate NTF (x_ntf,y_ntf,z_ntf)
// ALG0009
double a = 6378249.2;
// 100 meters
final double h = 100;
final double N = a / Math.pow(1. - (NTF_E * NTF_E) * (Math.sin(phi_ntf) * Math.sin(phi_ntf)), .5);
final double x_ntf = (N + h) * Math.cos(phi_ntf) * Math.cos(lambda_ntf);
final double y_ntf = (N + h) * Math.cos(phi_ntf) * Math.sin(lambda_ntf);
final double z_ntf = ((N * (1. - (NTF_E * NTF_E))) + h) * Math.sin(phi_ntf);
// Cartesian coordinate NTF (x_ntf,y_ntf,z_ntf)
// -> Cartesian coordinate WGS84 (x_w,y_w,z_w)
// ALG0013
// This is a simple translation.
final double x_w = x_ntf - 168.;
final double y_w = y_ntf - 60.;
final double z_w = z_ntf + 320;
// Cartesian coordinate WGS84 (x_w,y_w,z_w)
// -> Geographic coordinate WGS84 (lamda_w,phi_w)
// ALG0012
// 0.04079234433 to use the Greenwich meridian, 0 else
final double l840 = 0.04079234433;
a = 6378137.0;
final double P = Math.hypot(x_w, y_w);
double lambda_w = l840 + Math.atan(y_w / x_w);
double phi0_w = Math.atan(z_w / (P * (1 - ((a * WSG84_E * WSG84_E))
/ Math.sqrt((x_w * x_w) + (y_w * y_w) + (z_w * z_w)))));
double phi_w = Math.atan((z_w / P) / (1 - ((a * WSG84_E * WSG84_E * Math.cos(phi0_w))
/ (P * Math.sqrt(1 - NTF_E * NTF_E * (Math.sin(phi0_w) * Math.sin(phi0_w)))))));
while (Math.abs(phi_w - phi0_w) >= EPSILON) {
phi0_w = phi_w;
phi_w = Math.atan((z_w / P) / (1 - ((a * WSG84_E * WSG84_E * Math.cos(phi0_w))
/ (P * Math.sqrt(1 - ((WSG84_E * WSG84_E) * (Math.sin(phi0_w) * Math.sin(phi0_w))))))));
}
// Convert radians to degrees.
lambda_w = Math.toDegrees(lambda_w);
phi_w = Math.toDegrees(phi_w);
return new GeodesicPosition(lambda_w, phi_w);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:magicnumber\"",
",",
"\"checkstyle:localfinalvariablename\"",
",",
"\"checkstyle:localvariablename\"",
"}",
")",
"private",
"static",
"GeodesicPosition",
"NTFLambdaPhi_WSG84",
"(",
"double",
"lambda_ntf",
",",
"double",
"phi_nt... | This function convert extended France NTF Lambert coordinate to geographic WSG84 Data.
@param lambda_ntf is the lambda coordinate in NTF
@param lambda_ntf is the phi coordinate in NTF
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"extended",
"France",
"NTF",
"Lambert",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L982-L1034 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.WSG84_EL2 | @Pure
public static Point2d WSG84_EL2(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | java | @Pure
public static Point2d WSG84_EL2(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"WSG84_EL2",
"(",
"double",
"lambda",
",",
"double",
"phi",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"WSG84_NTFLamdaPhi",
"(",
"lambda",
",",
"phi",
")",
";",
"return",
"NTFLambdaPhi_NTFLambert",
"(",
"ntfL... | This function convert WSG84 GPS coordinate to extended France Lambert II coordinate.
@param lambda in degrees.
@param phi in degrees.
@return the extended France Lambert II coordinates. | [
"This",
"function",
"convert",
"WSG84",
"GPS",
"coordinate",
"to",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L1043-L1052 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.