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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
hltcoe/annotated-nyt | src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java | NYTCorpusDocumentParser.parseNYTCorpusDocumentFromFile | public NYTCorpusDocument parseNYTCorpusDocumentFromFile(File file,
boolean validating) {
Document document = null;
if (validating) {
document = loadValidating(file);
} else {
document = loadNonValidating(file);
}
return parseNYTCorpusDocumentFromDOMDocument(file, document);
} | java | public NYTCorpusDocument parseNYTCorpusDocumentFromFile(File file,
boolean validating) {
Document document = null;
if (validating) {
document = loadValidating(file);
} else {
document = loadNonValidating(file);
}
return parseNYTCorpusDocumentFromDOMDocument(file, document);
} | [
"public",
"NYTCorpusDocument",
"parseNYTCorpusDocumentFromFile",
"(",
"File",
"file",
",",
"boolean",
"validating",
")",
"{",
"Document",
"document",
"=",
"null",
";",
"if",
"(",
"validating",
")",
"{",
"document",
"=",
"loadValidating",
"(",
"file",
")",
";",
"}",
"else",
"{",
"document",
"=",
"loadNonValidating",
"(",
"file",
")",
";",
"}",
"return",
"parseNYTCorpusDocumentFromDOMDocument",
"(",
"file",
",",
"document",
")",
";",
"}"
] | Parse an New York Times Document from a file.
@param file
The file from which to parse the document.
@param validating
True if the file is to be validated against the nitf DTD and
false if it is not. It is recommended that validation be
disabled, as all documents in the corpus have previously been
validated against the NITF DTD.
@return The parsed document, or null if an error occurs. | [
"Parse",
"an",
"New",
"York",
"Times",
"Document",
"from",
"a",
"file",
"."
] | 0a4daa97705591cefea9de61614770ae2665a48e | https://github.com/hltcoe/annotated-nyt/blob/0a4daa97705591cefea9de61614770ae2665a48e/src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java#L289-L299 | train |
hltcoe/annotated-nyt | src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java | NYTCorpusDocumentParser.loadNonValidating | private Document loadNonValidating(InputStream is) {
Document document;
StringBuffer sb = new StringBuffer();
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(is, "UTF8"));
String line = null;
while ((line = in.readLine()) != null) {
sb.append(line + "\n");
}
String xmlData = sb.toString();
xmlData = xmlData.replace("<!DOCTYPE nitf " + "SYSTEM \"http://www.nitf.org/" + "IPTC/NITF/3.3/specification/dtd/nitf-3-3.dtd\">", "");
document = parseStringToDOM(xmlData, "UTF-8");
return document;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
System.out.println("Error loading inputstream.");
} catch (FileNotFoundException e) {
e.printStackTrace();
System.out.println("Error loading file inputstream.");
} catch (IOException e) {
e.printStackTrace();
System.out.println("Error loading file inputstream.");
} finally {
if (in != null)
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
} | java | private Document loadNonValidating(InputStream is) {
Document document;
StringBuffer sb = new StringBuffer();
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(is, "UTF8"));
String line = null;
while ((line = in.readLine()) != null) {
sb.append(line + "\n");
}
String xmlData = sb.toString();
xmlData = xmlData.replace("<!DOCTYPE nitf " + "SYSTEM \"http://www.nitf.org/" + "IPTC/NITF/3.3/specification/dtd/nitf-3-3.dtd\">", "");
document = parseStringToDOM(xmlData, "UTF-8");
return document;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
System.out.println("Error loading inputstream.");
} catch (FileNotFoundException e) {
e.printStackTrace();
System.out.println("Error loading file inputstream.");
} catch (IOException e) {
e.printStackTrace();
System.out.println("Error loading file inputstream.");
} finally {
if (in != null)
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
} | [
"private",
"Document",
"loadNonValidating",
"(",
"InputStream",
"is",
")",
"{",
"Document",
"document",
";",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"BufferedReader",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"is",
",",
"\"UTF8\"",
")",
")",
";",
"String",
"line",
"=",
"null",
";",
"while",
"(",
"(",
"line",
"=",
"in",
".",
"readLine",
"(",
")",
")",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"line",
"+",
"\"\\n\"",
")",
";",
"}",
"String",
"xmlData",
"=",
"sb",
".",
"toString",
"(",
")",
";",
"xmlData",
"=",
"xmlData",
".",
"replace",
"(",
"\"<!DOCTYPE nitf \"",
"+",
"\"SYSTEM \\\"http://www.nitf.org/\"",
"+",
"\"IPTC/NITF/3.3/specification/dtd/nitf-3-3.dtd\\\">\"",
",",
"\"\"",
")",
";",
"document",
"=",
"parseStringToDOM",
"(",
"xmlData",
",",
"\"UTF-8\"",
")",
";",
"return",
"document",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Error loading inputstream.\"",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Error loading file inputstream.\"",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Error loading file inputstream.\"",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"in",
"!=",
"null",
")",
"try",
"{",
"in",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"}",
"return",
"null",
";",
"}"
] | Load a document without validating it. Since instructing the java.xml
libraries to do this does not actually disable validation, this method
disables validation by removing the doctype declaration from the XML
document before it is parsed.
@param file
The file to parse.
@return The parsed document or null if an error occurs. | [
"Load",
"a",
"document",
"without",
"validating",
"it",
".",
"Since",
"instructing",
"the",
"java",
".",
"xml",
"libraries",
"to",
"do",
"this",
"does",
"not",
"actually",
"disable",
"validation",
"this",
"method",
"disables",
"validation",
"by",
"removing",
"the",
"doctype",
"declaration",
"from",
"the",
"XML",
"document",
"before",
"it",
"is",
"parsed",
"."
] | 0a4daa97705591cefea9de61614770ae2665a48e | https://github.com/hltcoe/annotated-nyt/blob/0a4daa97705591cefea9de61614770ae2665a48e/src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java#L388-L420 | train |
hltcoe/annotated-nyt | src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java | NYTCorpusDocumentParser.parseStringToDOM | private Document parseStringToDOM(String s, String encoding) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setValidating(false);
InputStream is = new ByteArrayInputStream(s.getBytes(encoding));
Document doc = factory.newDocumentBuilder().parse(is);
return doc;
} catch (SAXException e) {
e.printStackTrace();
System.out.println("Exception processing string.");
} catch (ParserConfigurationException e) {
e.printStackTrace();
System.out.println("Exception processing string.");
} catch (IOException e) {
e.printStackTrace();
System.out.println("Exception processing string.");
}
return null;
} | java | private Document parseStringToDOM(String s, String encoding) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setValidating(false);
InputStream is = new ByteArrayInputStream(s.getBytes(encoding));
Document doc = factory.newDocumentBuilder().parse(is);
return doc;
} catch (SAXException e) {
e.printStackTrace();
System.out.println("Exception processing string.");
} catch (ParserConfigurationException e) {
e.printStackTrace();
System.out.println("Exception processing string.");
} catch (IOException e) {
e.printStackTrace();
System.out.println("Exception processing string.");
}
return null;
} | [
"private",
"Document",
"parseStringToDOM",
"(",
"String",
"s",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setValidating",
"(",
"false",
")",
";",
"InputStream",
"is",
"=",
"new",
"ByteArrayInputStream",
"(",
"s",
".",
"getBytes",
"(",
"encoding",
")",
")",
";",
"Document",
"doc",
"=",
"factory",
".",
"newDocumentBuilder",
"(",
")",
".",
"parse",
"(",
"is",
")",
";",
"return",
"doc",
";",
"}",
"catch",
"(",
"SAXException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Exception processing string.\"",
")",
";",
"}",
"catch",
"(",
"ParserConfigurationException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Exception processing string.\"",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Exception processing string.\"",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Parse a string to a DOM document.
@param s
A string containing an XML document.
@return The DOM document if it can be parsed, or null otherwise. | [
"Parse",
"a",
"string",
"to",
"a",
"DOM",
"document",
"."
] | 0a4daa97705591cefea9de61614770ae2665a48e | https://github.com/hltcoe/annotated-nyt/blob/0a4daa97705591cefea9de61614770ae2665a48e/src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java#L430-L449 | train |
hltcoe/annotated-nyt | src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java | NYTCorpusDocumentParser.getDOMObject | private Document getDOMObject(String filename, boolean validating)
throws SAXException, IOException, ParserConfigurationException {
// Create a builder factory
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
if (!validating) {
factory.setValidating(validating);
factory.setSchema(null);
factory.setNamespaceAware(false);
}
DocumentBuilder builder = factory.newDocumentBuilder();
// Create the builder and parse the file
Document doc = builder.parse(new File(filename));
return doc;
} | java | private Document getDOMObject(String filename, boolean validating)
throws SAXException, IOException, ParserConfigurationException {
// Create a builder factory
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
if (!validating) {
factory.setValidating(validating);
factory.setSchema(null);
factory.setNamespaceAware(false);
}
DocumentBuilder builder = factory.newDocumentBuilder();
// Create the builder and parse the file
Document doc = builder.parse(new File(filename));
return doc;
} | [
"private",
"Document",
"getDOMObject",
"(",
"String",
"filename",
",",
"boolean",
"validating",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"// Create a builder factory",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"if",
"(",
"!",
"validating",
")",
"{",
"factory",
".",
"setValidating",
"(",
"validating",
")",
";",
"factory",
".",
"setSchema",
"(",
"null",
")",
";",
"factory",
".",
"setNamespaceAware",
"(",
"false",
")",
";",
"}",
"DocumentBuilder",
"builder",
"=",
"factory",
".",
"newDocumentBuilder",
"(",
")",
";",
"// Create the builder and parse the file",
"Document",
"doc",
"=",
"builder",
".",
"parse",
"(",
"new",
"File",
"(",
"filename",
")",
")",
";",
"return",
"doc",
";",
"}"
] | Parse a file containing an XML document, into a DOM object.
@param filename
A path to a valid file.
@param validating
True iff validating should be turned on.
@return A DOM Object containing a parsed XML document or a null value if
there is an error in parsing.
@throws ParserConfigurationException
@throws IOException
@throws SAXException | [
"Parse",
"a",
"file",
"containing",
"an",
"XML",
"document",
"into",
"a",
"DOM",
"object",
"."
] | 0a4daa97705591cefea9de61614770ae2665a48e | https://github.com/hltcoe/annotated-nyt/blob/0a4daa97705591cefea9de61614770ae2665a48e/src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java#L942-L958 | train |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/util/MultiValue.java | MultiValue.getValueType | @Pure
@SuppressWarnings("unchecked")
public Class<? extends T> getValueType() {
if (this.object == null) {
return null;
}
return (Class<? extends T>) this.object.getClass();
} | java | @Pure
@SuppressWarnings("unchecked")
public Class<? extends T> getValueType() {
if (this.object == null) {
return null;
}
return (Class<? extends T>) this.object.getClass();
} | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Class",
"<",
"?",
"extends",
"T",
">",
"getValueType",
"(",
")",
"{",
"if",
"(",
"this",
".",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
")",
"this",
".",
"object",
".",
"getClass",
"(",
")",
";",
"}"
] | Replies the type of the value.
@return the type or <code>null</code> if there is no value. | [
"Replies",
"the",
"type",
"of",
"the",
"value",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/util/MultiValue.java#L107-L114 | train |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/util/MultiValue.java | MultiValue.add | public void add(T newValue) {
if (this.isSet) {
if (!this.isMultiple
&& newValue != this.object && (newValue == null || !newValue.equals(this.object))) {
this.isMultiple = true;
this.object = null;
}
} else {
this.object = newValue;
this.isSet = true;
this.isMultiple = false;
}
} | java | public void add(T newValue) {
if (this.isSet) {
if (!this.isMultiple
&& newValue != this.object && (newValue == null || !newValue.equals(this.object))) {
this.isMultiple = true;
this.object = null;
}
} else {
this.object = newValue;
this.isSet = true;
this.isMultiple = false;
}
} | [
"public",
"void",
"add",
"(",
"T",
"newValue",
")",
"{",
"if",
"(",
"this",
".",
"isSet",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isMultiple",
"&&",
"newValue",
"!=",
"this",
".",
"object",
"&&",
"(",
"newValue",
"==",
"null",
"||",
"!",
"newValue",
".",
"equals",
"(",
"this",
".",
"object",
")",
")",
")",
"{",
"this",
".",
"isMultiple",
"=",
"true",
";",
"this",
".",
"object",
"=",
"null",
";",
"}",
"}",
"else",
"{",
"this",
".",
"object",
"=",
"newValue",
";",
"this",
".",
"isSet",
"=",
"true",
";",
"this",
".",
"isMultiple",
"=",
"false",
";",
"}",
"}"
] | Add the given value to the styored value.
@param newValue the new value. | [
"Add",
"the",
"given",
"value",
"to",
"the",
"styored",
"value",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/util/MultiValue.java#L120-L132 | train |
BBN-E/bue-common-open | gnuplot-util/src/main/java/com/bbn/bue/gnuplot/PlotBundle.java | PlotBundle.commandsWritingDataTo | public String commandsWritingDataTo(File dataDirectory) throws IOException {
final Map<DatafileReference, File> refsToFiles = Maps.newHashMap();
for (final DatafileReference datafileReference : datafileReferences) {
final File randomFile = File.createTempFile("plotBundle", ".dat", dataDirectory);
randomFile.deleteOnExit();
refsToFiles.put(datafileReference, randomFile);
Files.asCharSink(randomFile, Charsets.UTF_8).write(datafileReference.data);
}
final StringBuilder ret = new StringBuilder();
for (final Object commandComponent : commandComponents) {
if (commandComponent instanceof String) {
ret.append(commandComponent);
} else if (commandComponent instanceof DatafileReference) {
final File file = refsToFiles.get(commandComponent);
if (file != null) {
ret.append(file.getAbsolutePath());
} else {
throw new RuntimeException("PlotBundle references an unknown data source");
}
} else {
throw new RuntimeException("Unknown command component " + commandComponent);
}
}
return ret.toString();
} | java | public String commandsWritingDataTo(File dataDirectory) throws IOException {
final Map<DatafileReference, File> refsToFiles = Maps.newHashMap();
for (final DatafileReference datafileReference : datafileReferences) {
final File randomFile = File.createTempFile("plotBundle", ".dat", dataDirectory);
randomFile.deleteOnExit();
refsToFiles.put(datafileReference, randomFile);
Files.asCharSink(randomFile, Charsets.UTF_8).write(datafileReference.data);
}
final StringBuilder ret = new StringBuilder();
for (final Object commandComponent : commandComponents) {
if (commandComponent instanceof String) {
ret.append(commandComponent);
} else if (commandComponent instanceof DatafileReference) {
final File file = refsToFiles.get(commandComponent);
if (file != null) {
ret.append(file.getAbsolutePath());
} else {
throw new RuntimeException("PlotBundle references an unknown data source");
}
} else {
throw new RuntimeException("Unknown command component " + commandComponent);
}
}
return ret.toString();
} | [
"public",
"String",
"commandsWritingDataTo",
"(",
"File",
"dataDirectory",
")",
"throws",
"IOException",
"{",
"final",
"Map",
"<",
"DatafileReference",
",",
"File",
">",
"refsToFiles",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"for",
"(",
"final",
"DatafileReference",
"datafileReference",
":",
"datafileReferences",
")",
"{",
"final",
"File",
"randomFile",
"=",
"File",
".",
"createTempFile",
"(",
"\"plotBundle\"",
",",
"\".dat\"",
",",
"dataDirectory",
")",
";",
"randomFile",
".",
"deleteOnExit",
"(",
")",
";",
"refsToFiles",
".",
"put",
"(",
"datafileReference",
",",
"randomFile",
")",
";",
"Files",
".",
"asCharSink",
"(",
"randomFile",
",",
"Charsets",
".",
"UTF_8",
")",
".",
"write",
"(",
"datafileReference",
".",
"data",
")",
";",
"}",
"final",
"StringBuilder",
"ret",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final",
"Object",
"commandComponent",
":",
"commandComponents",
")",
"{",
"if",
"(",
"commandComponent",
"instanceof",
"String",
")",
"{",
"ret",
".",
"append",
"(",
"commandComponent",
")",
";",
"}",
"else",
"if",
"(",
"commandComponent",
"instanceof",
"DatafileReference",
")",
"{",
"final",
"File",
"file",
"=",
"refsToFiles",
".",
"get",
"(",
"commandComponent",
")",
";",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"ret",
".",
"append",
"(",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"PlotBundle references an unknown data source\"",
")",
";",
"}",
"}",
"else",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Unknown command component \"",
"+",
"commandComponent",
")",
";",
"}",
"}",
"return",
"ret",
".",
"toString",
"(",
")",
";",
"}"
] | Writes the plot data to the indicated directory and returns the GnuPlot commands for the plot
as a string. These commands will reference the written data files. | [
"Writes",
"the",
"plot",
"data",
"to",
"the",
"indicated",
"directory",
"and",
"returns",
"the",
"GnuPlot",
"commands",
"for",
"the",
"plot",
"as",
"a",
"string",
".",
"These",
"commands",
"will",
"reference",
"the",
"written",
"data",
"files",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/gnuplot-util/src/main/java/com/bbn/bue/gnuplot/PlotBundle.java#L35-L60 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.setCodePage | public void setCodePage(DBaseCodePage code) {
if (this.columns != null) {
throw new IllegalStateException();
}
if (code != null) {
this.language = code;
}
} | java | public void setCodePage(DBaseCodePage code) {
if (this.columns != null) {
throw new IllegalStateException();
}
if (code != null) {
this.language = code;
}
} | [
"public",
"void",
"setCodePage",
"(",
"DBaseCodePage",
"code",
")",
"{",
"if",
"(",
"this",
".",
"columns",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"if",
"(",
"code",
"!=",
"null",
")",
"{",
"this",
".",
"language",
"=",
"code",
";",
"}",
"}"
] | Replies the output language to use in the dBASE file.
@param code the output language to use in the dBASE file.
@throws IllegalStateException if the header was already written. | [
"Replies",
"the",
"output",
"language",
"to",
"use",
"in",
"the",
"dBASE",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L164-L171 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.writeDBFDate | @SuppressWarnings("checkstyle:magicnumber")
private void writeDBFDate(Date date) throws IOException {
final SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
writeDBFString(format.format(date), 8, (byte) ' ');
} | java | @SuppressWarnings("checkstyle:magicnumber")
private void writeDBFDate(Date date) throws IOException {
final SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
writeDBFString(format.format(date), 8, (byte) ' ');
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"private",
"void",
"writeDBFDate",
"(",
"Date",
"date",
")",
"throws",
"IOException",
"{",
"final",
"SimpleDateFormat",
"format",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyyMMdd\"",
")",
";",
"//$NON-NLS-1$",
"writeDBFString",
"(",
"format",
".",
"format",
"(",
"date",
")",
",",
"8",
",",
"(",
"byte",
")",
"'",
"'",
")",
";",
"}"
] | Write a formated date according to the Dbase specifications.
@param date is the value to convert
@throws IOException in case of error. | [
"Write",
"a",
"formated",
"date",
"according",
"to",
"the",
"Dbase",
"specifications",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L302-L306 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.computeFieldSize | private static int computeFieldSize(AttributeValue value) throws DBaseFileException, AttributeException {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType());
return dbftype.getFieldSize(value.getString());
} | java | private static int computeFieldSize(AttributeValue value) throws DBaseFileException, AttributeException {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType());
return dbftype.getFieldSize(value.getString());
} | [
"private",
"static",
"int",
"computeFieldSize",
"(",
"AttributeValue",
"value",
")",
"throws",
"DBaseFileException",
",",
"AttributeException",
"{",
"final",
"DBaseFieldType",
"dbftype",
"=",
"DBaseFieldType",
".",
"fromAttributeType",
"(",
"value",
".",
"getType",
"(",
")",
")",
";",
"return",
"dbftype",
".",
"getFieldSize",
"(",
"value",
".",
"getString",
"(",
")",
")",
";",
"}"
] | Replies the size of the DBase field which must contains the
value of the given attribute value.
@return the size of the field in bytes
@throws DBaseFileException if the Dbase file cannot be read.
@throws AttributeException if an attribute is invalid. | [
"Replies",
"the",
"size",
"of",
"the",
"DBase",
"field",
"which",
"must",
"contains",
"the",
"value",
"of",
"the",
"given",
"attribute",
"value",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L342-L345 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.computeDecimalSize | private static int computeDecimalSize(AttributeValue value) throws DBaseFileException, AttributeException {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType());
return dbftype.getDecimalPointPosition(value.getString());
} | java | private static int computeDecimalSize(AttributeValue value) throws DBaseFileException, AttributeException {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType());
return dbftype.getDecimalPointPosition(value.getString());
} | [
"private",
"static",
"int",
"computeDecimalSize",
"(",
"AttributeValue",
"value",
")",
"throws",
"DBaseFileException",
",",
"AttributeException",
"{",
"final",
"DBaseFieldType",
"dbftype",
"=",
"DBaseFieldType",
".",
"fromAttributeType",
"(",
"value",
".",
"getType",
"(",
")",
")",
";",
"return",
"dbftype",
".",
"getDecimalPointPosition",
"(",
"value",
".",
"getString",
"(",
")",
")",
";",
"}"
] | Replies the decimal size of the DBase field which must contains the
value of the given attribute value.
@throws DBaseFileException if the Dbase file cannot be read.
@throws AttributeException if an attribute is invalid. | [
"Replies",
"the",
"decimal",
"size",
"of",
"the",
"DBase",
"field",
"which",
"must",
"contains",
"the",
"value",
"of",
"the",
"given",
"attribute",
"value",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L353-L356 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.isSupportedType | @Pure
public static boolean isSupportedType(DBaseFieldType type) {
return (type != DBaseFieldType.BINARY)
&& (type != DBaseFieldType.GENERAL)
&& (type != DBaseFieldType.MEMORY)
&& (type != DBaseFieldType.PICTURE)
&& (type != DBaseFieldType.VARIABLE);
} | java | @Pure
public static boolean isSupportedType(DBaseFieldType type) {
return (type != DBaseFieldType.BINARY)
&& (type != DBaseFieldType.GENERAL)
&& (type != DBaseFieldType.MEMORY)
&& (type != DBaseFieldType.PICTURE)
&& (type != DBaseFieldType.VARIABLE);
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isSupportedType",
"(",
"DBaseFieldType",
"type",
")",
"{",
"return",
"(",
"type",
"!=",
"DBaseFieldType",
".",
"BINARY",
")",
"&&",
"(",
"type",
"!=",
"DBaseFieldType",
".",
"GENERAL",
")",
"&&",
"(",
"type",
"!=",
"DBaseFieldType",
".",
"MEMORY",
")",
"&&",
"(",
"type",
"!=",
"DBaseFieldType",
".",
"PICTURE",
")",
"&&",
"(",
"type",
"!=",
"DBaseFieldType",
".",
"VARIABLE",
")",
";",
"}"
] | Replies if the given dBASE type is supported by this writer.
@param type the type of the field.
@return <code>true</code> if the given type is supported by the writer,
otherwise <code>false</code>.
@since 4.0 | [
"Replies",
"if",
"the",
"given",
"dBASE",
"type",
"is",
"supported",
"by",
"this",
"writer",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L365-L372 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.extractColumns | @SuppressWarnings("checkstyle:magicnumber")
private List<DBaseFileField> extractColumns(List<? extends AttributeProvider> providers)
throws DBaseFileException, AttributeException {
final Map<String, DBaseFileField> attributeColumns = new TreeMap<>();
DBaseFileField oldField;
String name;
String kname;
int fieldSize;
int decimalSize;
final Set<String> skippedColumns = new TreeSet<>();
for (final AttributeProvider provider : providers) {
for (final Attribute attr : provider.attributes()) {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(attr.getType());
// The following types are not yet supported
if (isSupportedType(dbftype)) {
name = attr.getName();
kname = name.toLowerCase();
oldField = attributeColumns.get(kname);
// compute the sizes
fieldSize = computeFieldSize(attr);
decimalSize = computeDecimalSize(attr);
if (oldField == null) {
oldField = new DBaseFileField(
name,
dbftype,
fieldSize,
decimalSize);
attributeColumns.put(kname, oldField);
} else {
oldField.updateSizes(fieldSize, decimalSize);
}
} else {
skippedColumns.add(attr.getName().toUpperCase());
}
}
// Be sure that the memory was not fully filled by the saving process
provider.freeMemory();
}
//Max of field allowed : 128
if (attributeColumns.size() > 128) {
throw new TooManyDBaseColumnException(attributeColumns.size(), 128);
}
final List<DBaseFileField> dbColumns = new ArrayList<>();
dbColumns.addAll(attributeColumns.values());
attributeColumns.clear();
for (int idx = 0; idx < dbColumns.size(); ++idx) {
dbColumns.get(idx).setColumnIndex(idx);
}
if (!skippedColumns.isEmpty()) {
columnsSkipped(skippedColumns);
}
return dbColumns;
} | java | @SuppressWarnings("checkstyle:magicnumber")
private List<DBaseFileField> extractColumns(List<? extends AttributeProvider> providers)
throws DBaseFileException, AttributeException {
final Map<String, DBaseFileField> attributeColumns = new TreeMap<>();
DBaseFileField oldField;
String name;
String kname;
int fieldSize;
int decimalSize;
final Set<String> skippedColumns = new TreeSet<>();
for (final AttributeProvider provider : providers) {
for (final Attribute attr : provider.attributes()) {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(attr.getType());
// The following types are not yet supported
if (isSupportedType(dbftype)) {
name = attr.getName();
kname = name.toLowerCase();
oldField = attributeColumns.get(kname);
// compute the sizes
fieldSize = computeFieldSize(attr);
decimalSize = computeDecimalSize(attr);
if (oldField == null) {
oldField = new DBaseFileField(
name,
dbftype,
fieldSize,
decimalSize);
attributeColumns.put(kname, oldField);
} else {
oldField.updateSizes(fieldSize, decimalSize);
}
} else {
skippedColumns.add(attr.getName().toUpperCase());
}
}
// Be sure that the memory was not fully filled by the saving process
provider.freeMemory();
}
//Max of field allowed : 128
if (attributeColumns.size() > 128) {
throw new TooManyDBaseColumnException(attributeColumns.size(), 128);
}
final List<DBaseFileField> dbColumns = new ArrayList<>();
dbColumns.addAll(attributeColumns.values());
attributeColumns.clear();
for (int idx = 0; idx < dbColumns.size(); ++idx) {
dbColumns.get(idx).setColumnIndex(idx);
}
if (!skippedColumns.isEmpty()) {
columnsSkipped(skippedColumns);
}
return dbColumns;
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"private",
"List",
"<",
"DBaseFileField",
">",
"extractColumns",
"(",
"List",
"<",
"?",
"extends",
"AttributeProvider",
">",
"providers",
")",
"throws",
"DBaseFileException",
",",
"AttributeException",
"{",
"final",
"Map",
"<",
"String",
",",
"DBaseFileField",
">",
"attributeColumns",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"DBaseFileField",
"oldField",
";",
"String",
"name",
";",
"String",
"kname",
";",
"int",
"fieldSize",
";",
"int",
"decimalSize",
";",
"final",
"Set",
"<",
"String",
">",
"skippedColumns",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"AttributeProvider",
"provider",
":",
"providers",
")",
"{",
"for",
"(",
"final",
"Attribute",
"attr",
":",
"provider",
".",
"attributes",
"(",
")",
")",
"{",
"final",
"DBaseFieldType",
"dbftype",
"=",
"DBaseFieldType",
".",
"fromAttributeType",
"(",
"attr",
".",
"getType",
"(",
")",
")",
";",
"// The following types are not yet supported",
"if",
"(",
"isSupportedType",
"(",
"dbftype",
")",
")",
"{",
"name",
"=",
"attr",
".",
"getName",
"(",
")",
";",
"kname",
"=",
"name",
".",
"toLowerCase",
"(",
")",
";",
"oldField",
"=",
"attributeColumns",
".",
"get",
"(",
"kname",
")",
";",
"// compute the sizes",
"fieldSize",
"=",
"computeFieldSize",
"(",
"attr",
")",
";",
"decimalSize",
"=",
"computeDecimalSize",
"(",
"attr",
")",
";",
"if",
"(",
"oldField",
"==",
"null",
")",
"{",
"oldField",
"=",
"new",
"DBaseFileField",
"(",
"name",
",",
"dbftype",
",",
"fieldSize",
",",
"decimalSize",
")",
";",
"attributeColumns",
".",
"put",
"(",
"kname",
",",
"oldField",
")",
";",
"}",
"else",
"{",
"oldField",
".",
"updateSizes",
"(",
"fieldSize",
",",
"decimalSize",
")",
";",
"}",
"}",
"else",
"{",
"skippedColumns",
".",
"add",
"(",
"attr",
".",
"getName",
"(",
")",
".",
"toUpperCase",
"(",
")",
")",
";",
"}",
"}",
"// Be sure that the memory was not fully filled by the saving process",
"provider",
".",
"freeMemory",
"(",
")",
";",
"}",
"//Max of field allowed : 128",
"if",
"(",
"attributeColumns",
".",
"size",
"(",
")",
">",
"128",
")",
"{",
"throw",
"new",
"TooManyDBaseColumnException",
"(",
"attributeColumns",
".",
"size",
"(",
")",
",",
"128",
")",
";",
"}",
"final",
"List",
"<",
"DBaseFileField",
">",
"dbColumns",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"dbColumns",
".",
"addAll",
"(",
"attributeColumns",
".",
"values",
"(",
")",
")",
";",
"attributeColumns",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"idx",
"=",
"0",
";",
"idx",
"<",
"dbColumns",
".",
"size",
"(",
")",
";",
"++",
"idx",
")",
"{",
"dbColumns",
".",
"get",
"(",
"idx",
")",
".",
"setColumnIndex",
"(",
"idx",
")",
";",
"}",
"if",
"(",
"!",
"skippedColumns",
".",
"isEmpty",
"(",
")",
")",
"{",
"columnsSkipped",
"(",
"skippedColumns",
")",
";",
"}",
"return",
"dbColumns",
";",
"}"
] | Extract the attribute's columns from the attributes providers.
@param providers is the list of attribute providers that will be used for the dbf writing.
@return an map in which each key is the attirbute's name and the corresponding
value is the size of the field.
@throws DBaseFileException if the Dbase file cannot be read.
@throws AttributeException if an attribute is invalid. | [
"Extract",
"the",
"attribute",
"s",
"columns",
"from",
"the",
"attributes",
"providers",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L383-L445 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.writeHeader | public void writeHeader(List<? extends AttributeProvider> providers) throws IOException, AttributeException {
if (this.columns == null) {
this.columns = extractColumns(providers);
writeDescriptionHeader(providers.size());
writeColumns();
}
} | java | public void writeHeader(List<? extends AttributeProvider> providers) throws IOException, AttributeException {
if (this.columns == null) {
this.columns = extractColumns(providers);
writeDescriptionHeader(providers.size());
writeColumns();
}
} | [
"public",
"void",
"writeHeader",
"(",
"List",
"<",
"?",
"extends",
"AttributeProvider",
">",
"providers",
")",
"throws",
"IOException",
",",
"AttributeException",
"{",
"if",
"(",
"this",
".",
"columns",
"==",
"null",
")",
"{",
"this",
".",
"columns",
"=",
"extractColumns",
"(",
"providers",
")",
";",
"writeDescriptionHeader",
"(",
"providers",
".",
"size",
"(",
")",
")",
";",
"writeColumns",
"(",
")",
";",
"}",
"}"
] | Write the header of the dbf file.
@param providers is the list of attribute providers that will be used for the dbf writing.
@throws AttributeException if an attribute cannot pre set.
@throws IOException in case of IO error. | [
"Write",
"the",
"header",
"of",
"the",
"dbf",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L679-L685 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.writeRecord | @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:magicnumber"})
public void writeRecord(AttributeProvider element) throws IOException, AttributeException {
if (this.columns == null) {
throw new MustCallWriteHeaderFunctionException();
}
//Field deleted flag (value : 2Ah (*) => Record is deleted, 20h (blank) => Record is valid)
this.stream.writeByte(0x20);
for (final DBaseFileField field : this.columns) {
// Get attribute
final DBaseFieldType dbftype = field.getType();
final String fieldName = field.getName();
AttributeValue attr = element != null ? element.getAttribute(fieldName) : null;
if (attr == null) {
attr = new AttributeValueImpl(dbftype.toAttributeType());
attr.setToDefault();
} else {
if (attr.isAssigned()) {
attr = new AttributeValueImpl(attr);
attr.cast(dbftype.toAttributeType());
} else {
attr = new AttributeValueImpl(attr);
attr.setToDefaultIfUninitialized();
}
}
// Write value
switch (dbftype) {
case BOOLEAN:
writeDBFBoolean(attr.getBoolean());
break;
case DATE:
writeDBFDate(attr.getDate());
break;
case STRING:
writeDBFString(attr.getString(), field.getLength(), (byte) ' ');
break;
case INTEGER_2BYTES:
writeDBFInteger((short) attr.getInteger());
break;
case INTEGER_4BYTES:
writeDBFLong((int) attr.getInteger());
break;
case DOUBLE:
writeDBFDouble(attr.getReal());
break;
case FLOATING_NUMBER:
case NUMBER:
if (attr.getType() == AttributeType.REAL) {
writeDBFNumber(attr.getReal(), field.getLength(), field.getDecimalPointPosition());
} else {
writeDBFNumber(attr.getInteger(), field.getLength(), field.getDecimalPointPosition());
}
break;
case BINARY:
case GENERAL:
case MEMORY:
case PICTURE:
case VARIABLE:
// not yet supported
writeDBFString((String) null, 10, (byte) 0);
break;
default:
throw new IllegalStateException();
}
}
// Be sure that the memory was not fully filled by the saving process
if (element != null) {
element.freeMemory();
}
} | java | @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:magicnumber"})
public void writeRecord(AttributeProvider element) throws IOException, AttributeException {
if (this.columns == null) {
throw new MustCallWriteHeaderFunctionException();
}
//Field deleted flag (value : 2Ah (*) => Record is deleted, 20h (blank) => Record is valid)
this.stream.writeByte(0x20);
for (final DBaseFileField field : this.columns) {
// Get attribute
final DBaseFieldType dbftype = field.getType();
final String fieldName = field.getName();
AttributeValue attr = element != null ? element.getAttribute(fieldName) : null;
if (attr == null) {
attr = new AttributeValueImpl(dbftype.toAttributeType());
attr.setToDefault();
} else {
if (attr.isAssigned()) {
attr = new AttributeValueImpl(attr);
attr.cast(dbftype.toAttributeType());
} else {
attr = new AttributeValueImpl(attr);
attr.setToDefaultIfUninitialized();
}
}
// Write value
switch (dbftype) {
case BOOLEAN:
writeDBFBoolean(attr.getBoolean());
break;
case DATE:
writeDBFDate(attr.getDate());
break;
case STRING:
writeDBFString(attr.getString(), field.getLength(), (byte) ' ');
break;
case INTEGER_2BYTES:
writeDBFInteger((short) attr.getInteger());
break;
case INTEGER_4BYTES:
writeDBFLong((int) attr.getInteger());
break;
case DOUBLE:
writeDBFDouble(attr.getReal());
break;
case FLOATING_NUMBER:
case NUMBER:
if (attr.getType() == AttributeType.REAL) {
writeDBFNumber(attr.getReal(), field.getLength(), field.getDecimalPointPosition());
} else {
writeDBFNumber(attr.getInteger(), field.getLength(), field.getDecimalPointPosition());
}
break;
case BINARY:
case GENERAL:
case MEMORY:
case PICTURE:
case VARIABLE:
// not yet supported
writeDBFString((String) null, 10, (byte) 0);
break;
default:
throw new IllegalStateException();
}
}
// Be sure that the memory was not fully filled by the saving process
if (element != null) {
element.freeMemory();
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:cyclomaticcomplexity\"",
",",
"\"checkstyle:magicnumber\"",
"}",
")",
"public",
"void",
"writeRecord",
"(",
"AttributeProvider",
"element",
")",
"throws",
"IOException",
",",
"AttributeException",
"{",
"if",
"(",
"this",
".",
"columns",
"==",
"null",
")",
"{",
"throw",
"new",
"MustCallWriteHeaderFunctionException",
"(",
")",
";",
"}",
"//Field deleted flag (value : 2Ah (*) => Record is deleted, 20h (blank) => Record is valid)",
"this",
".",
"stream",
".",
"writeByte",
"(",
"0x20",
")",
";",
"for",
"(",
"final",
"DBaseFileField",
"field",
":",
"this",
".",
"columns",
")",
"{",
"// Get attribute",
"final",
"DBaseFieldType",
"dbftype",
"=",
"field",
".",
"getType",
"(",
")",
";",
"final",
"String",
"fieldName",
"=",
"field",
".",
"getName",
"(",
")",
";",
"AttributeValue",
"attr",
"=",
"element",
"!=",
"null",
"?",
"element",
".",
"getAttribute",
"(",
"fieldName",
")",
":",
"null",
";",
"if",
"(",
"attr",
"==",
"null",
")",
"{",
"attr",
"=",
"new",
"AttributeValueImpl",
"(",
"dbftype",
".",
"toAttributeType",
"(",
")",
")",
";",
"attr",
".",
"setToDefault",
"(",
")",
";",
"}",
"else",
"{",
"if",
"(",
"attr",
".",
"isAssigned",
"(",
")",
")",
"{",
"attr",
"=",
"new",
"AttributeValueImpl",
"(",
"attr",
")",
";",
"attr",
".",
"cast",
"(",
"dbftype",
".",
"toAttributeType",
"(",
")",
")",
";",
"}",
"else",
"{",
"attr",
"=",
"new",
"AttributeValueImpl",
"(",
"attr",
")",
";",
"attr",
".",
"setToDefaultIfUninitialized",
"(",
")",
";",
"}",
"}",
"// Write value",
"switch",
"(",
"dbftype",
")",
"{",
"case",
"BOOLEAN",
":",
"writeDBFBoolean",
"(",
"attr",
".",
"getBoolean",
"(",
")",
")",
";",
"break",
";",
"case",
"DATE",
":",
"writeDBFDate",
"(",
"attr",
".",
"getDate",
"(",
")",
")",
";",
"break",
";",
"case",
"STRING",
":",
"writeDBFString",
"(",
"attr",
".",
"getString",
"(",
")",
",",
"field",
".",
"getLength",
"(",
")",
",",
"(",
"byte",
")",
"'",
"'",
")",
";",
"break",
";",
"case",
"INTEGER_2BYTES",
":",
"writeDBFInteger",
"(",
"(",
"short",
")",
"attr",
".",
"getInteger",
"(",
")",
")",
";",
"break",
";",
"case",
"INTEGER_4BYTES",
":",
"writeDBFLong",
"(",
"(",
"int",
")",
"attr",
".",
"getInteger",
"(",
")",
")",
";",
"break",
";",
"case",
"DOUBLE",
":",
"writeDBFDouble",
"(",
"attr",
".",
"getReal",
"(",
")",
")",
";",
"break",
";",
"case",
"FLOATING_NUMBER",
":",
"case",
"NUMBER",
":",
"if",
"(",
"attr",
".",
"getType",
"(",
")",
"==",
"AttributeType",
".",
"REAL",
")",
"{",
"writeDBFNumber",
"(",
"attr",
".",
"getReal",
"(",
")",
",",
"field",
".",
"getLength",
"(",
")",
",",
"field",
".",
"getDecimalPointPosition",
"(",
")",
")",
";",
"}",
"else",
"{",
"writeDBFNumber",
"(",
"attr",
".",
"getInteger",
"(",
")",
",",
"field",
".",
"getLength",
"(",
")",
",",
"field",
".",
"getDecimalPointPosition",
"(",
")",
")",
";",
"}",
"break",
";",
"case",
"BINARY",
":",
"case",
"GENERAL",
":",
"case",
"MEMORY",
":",
"case",
"PICTURE",
":",
"case",
"VARIABLE",
":",
"// not yet supported",
"writeDBFString",
"(",
"(",
"String",
")",
"null",
",",
"10",
",",
"(",
"byte",
")",
"0",
")",
";",
"break",
";",
"default",
":",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"}",
"// Be sure that the memory was not fully filled by the saving process",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"element",
".",
"freeMemory",
"(",
")",
";",
"}",
"}"
] | Write a record for attribute provider.
@param element is the element to write.
@throws AttributeException if an attribute cannot pre set.
@throws IOException in case of IO error. | [
"Write",
"a",
"record",
"for",
"attribute",
"provider",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L693-L768 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.write | public void write(AttributeProvider... providers) throws IOException, AttributeException {
writeHeader(providers);
for (final AttributeProvider provider : providers) {
writeRecord(provider);
}
close();
} | java | public void write(AttributeProvider... providers) throws IOException, AttributeException {
writeHeader(providers);
for (final AttributeProvider provider : providers) {
writeRecord(provider);
}
close();
} | [
"public",
"void",
"write",
"(",
"AttributeProvider",
"...",
"providers",
")",
"throws",
"IOException",
",",
"AttributeException",
"{",
"writeHeader",
"(",
"providers",
")",
";",
"for",
"(",
"final",
"AttributeProvider",
"provider",
":",
"providers",
")",
"{",
"writeRecord",
"(",
"provider",
")",
";",
"}",
"close",
"(",
")",
";",
"}"
] | Write the DBase file.
<p>A call to this method is equivalent to the sequence of calls:
<ul>
<li>{@link #writeHeader(AttributeProvider[])}</li>
<li>foreach(providers) {@link #writeRecord(AttributeProvider)}</li>
<li>{@link #close()}</li>
</ul>
@param providers are the attribute container that must be written inside the dBASE file.
@throws AttributeException if an attribute cannot pre set.
@throws IOException in case of IO error. | [
"Write",
"the",
"DBase",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L783-L791 | train |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java | DBaseFileWriter.close | @Override
@SuppressWarnings("checkstyle:magicnumber")
public void close() throws IOException {
if (this.stream != null) {
//End of file (1Ah)
this.stream.write(0x1A);
this.stream.close();
this.stream = null;
}
if (this.columns != null) {
this.columns.clear();
this.columns = null;
}
} | java | @Override
@SuppressWarnings("checkstyle:magicnumber")
public void close() throws IOException {
if (this.stream != null) {
//End of file (1Ah)
this.stream.write(0x1A);
this.stream.close();
this.stream = null;
}
if (this.columns != null) {
this.columns.clear();
this.columns = null;
}
} | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"stream",
"!=",
"null",
")",
"{",
"//End of file (1Ah)",
"this",
".",
"stream",
".",
"write",
"(",
"0x1A",
")",
";",
"this",
".",
"stream",
".",
"close",
"(",
")",
";",
"this",
".",
"stream",
"=",
"null",
";",
"}",
"if",
"(",
"this",
".",
"columns",
"!=",
"null",
")",
"{",
"this",
".",
"columns",
".",
"clear",
"(",
")",
";",
"this",
".",
"columns",
"=",
"null",
";",
"}",
"}"
] | Close the dBASE file.
<p>This function writes the end of file character (1Ah).
@throws IOException in case of IO error. | [
"Close",
"the",
"dBASE",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileWriter.java#L822-L836 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java | BinaryTreeNode.getChildAt | @Pure
public final N getChildAt(BinaryTreeZone index) {
switch (index) {
case LEFT:
return this.left;
case RIGHT:
return this.right;
default:
throw new IndexOutOfBoundsException();
}
} | java | @Pure
public final N getChildAt(BinaryTreeZone index) {
switch (index) {
case LEFT:
return this.left;
case RIGHT:
return this.right;
default:
throw new IndexOutOfBoundsException();
}
} | [
"@",
"Pure",
"public",
"final",
"N",
"getChildAt",
"(",
"BinaryTreeZone",
"index",
")",
"{",
"switch",
"(",
"index",
")",
"{",
"case",
"LEFT",
":",
"return",
"this",
".",
"left",
";",
"case",
"RIGHT",
":",
"return",
"this",
".",
"right",
";",
"default",
":",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"}"
] | Replies the child node at the specified position.
@param index is the position of the child to reply.
@return the child or <code>null</code> | [
"Replies",
"the",
"child",
"node",
"at",
"the",
"specified",
"position",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java#L194-L204 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java | BinaryTreeNode.setRightChild | public boolean setRightChild(N newChild) {
final N oldChild = this.right;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.right = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(1, newChild);
}
return true;
} | java | public boolean setRightChild(N newChild) {
final N oldChild = this.right;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.right = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(1, newChild);
}
return true;
} | [
"public",
"boolean",
"setRightChild",
"(",
"N",
"newChild",
")",
"{",
"final",
"N",
"oldChild",
"=",
"this",
".",
"right",
";",
"if",
"(",
"oldChild",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"oldChild",
"!=",
"null",
")",
"{",
"oldChild",
".",
"setParentNodeReference",
"(",
"null",
",",
"true",
")",
";",
"--",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildRemoved",
"(",
"1",
",",
"oldChild",
")",
";",
"}",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"final",
"N",
"oldParent",
"=",
"newChild",
".",
"getParentNode",
"(",
")",
";",
"if",
"(",
"oldParent",
"!=",
"this",
")",
"{",
"newChild",
".",
"removeFromParent",
"(",
")",
";",
"}",
"}",
"this",
".",
"right",
"=",
"newChild",
";",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"newChild",
".",
"setParentNodeReference",
"(",
"toN",
"(",
")",
",",
"true",
")",
";",
"++",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildAdded",
"(",
"1",
",",
"newChild",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Set the right child of this node.
@param newChild is the new left child
@return <code>true</code> on success, otherwise <code>false</code> | [
"Set",
"the",
"right",
"child",
"of",
"this",
"node",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java#L255-L283 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java | BinaryTreeNode.setChildAt | public final boolean setChildAt(BinaryTreeZone zone, N newChild) {
switch (zone) {
case LEFT:
return setLeftChild(newChild);
case RIGHT:
return setRightChild(newChild);
default:
throw new IndexOutOfBoundsException();
}
} | java | public final boolean setChildAt(BinaryTreeZone zone, N newChild) {
switch (zone) {
case LEFT:
return setLeftChild(newChild);
case RIGHT:
return setRightChild(newChild);
default:
throw new IndexOutOfBoundsException();
}
} | [
"public",
"final",
"boolean",
"setChildAt",
"(",
"BinaryTreeZone",
"zone",
",",
"N",
"newChild",
")",
"{",
"switch",
"(",
"zone",
")",
"{",
"case",
"LEFT",
":",
"return",
"setLeftChild",
"(",
"newChild",
")",
";",
"case",
"RIGHT",
":",
"return",
"setRightChild",
"(",
"newChild",
")",
";",
"default",
":",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"}"
] | Set the child for the specified zone.
@param zone is the zone to set
@param newChild is the child to insert
@return <code>true</code> if the child was added, otherwise <code>false</code> | [
"Set",
"the",
"child",
"for",
"the",
"specified",
"zone",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java#L318-L327 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/table/model/properties/PropertiesTableModel.java | PropertiesTableModel.add | public void add(final String key, final String value)
{
data.setProperty(key, value);
fireTableDataChanged();
} | java | public void add(final String key, final String value)
{
data.setProperty(key, value);
fireTableDataChanged();
} | [
"public",
"void",
"add",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"data",
".",
"setProperty",
"(",
"key",
",",
"value",
")",
";",
"fireTableDataChanged",
"(",
")",
";",
"}"
] | Adds the row from the given key and value.
@param key
the key
@param value
the value | [
"Adds",
"the",
"row",
"from",
"the",
"given",
"key",
"and",
"value",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/table/model/properties/PropertiesTableModel.java#L84-L88 | train |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatWeatherInput.java | DssatWeatherInput.readFile | @Override
protected HashMap readFile(HashMap brMap) throws IOException {
HashMap ret = new HashMap();
ArrayList<HashMap> files = readDailyData(brMap, new HashMap());
// compressData(files);
ret.put("weathers", files);
return ret;
} | java | @Override
protected HashMap readFile(HashMap brMap) throws IOException {
HashMap ret = new HashMap();
ArrayList<HashMap> files = readDailyData(brMap, new HashMap());
// compressData(files);
ret.put("weathers", files);
return ret;
} | [
"@",
"Override",
"protected",
"HashMap",
"readFile",
"(",
"HashMap",
"brMap",
")",
"throws",
"IOException",
"{",
"HashMap",
"ret",
"=",
"new",
"HashMap",
"(",
")",
";",
"ArrayList",
"<",
"HashMap",
">",
"files",
"=",
"readDailyData",
"(",
"brMap",
",",
"new",
"HashMap",
"(",
")",
")",
";",
"// compressData(files);",
"ret",
".",
"put",
"(",
"\"weathers\"",
",",
"files",
")",
";",
"return",
"ret",
";",
"}"
] | DSSAT Weather Data input method for only inputing weather file
@param brMap The holder for BufferReader objects for all files
@return result data holder object
@throws java.io.IOException | [
"DSSAT",
"Weather",
"Data",
"input",
"method",
"for",
"only",
"inputing",
"weather",
"file"
] | 4be61d998f106eb7234ea8701b63c3746ae688f4 | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatWeatherInput.java#L39-L47 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.getTranslationVector | @Pure
public void getTranslationVector(Tuple2D<?> translation) {
assert translation != null : AssertMessages.notNullParameter();
translation.set(this.m02, this.m12);
} | java | @Pure
public void getTranslationVector(Tuple2D<?> translation) {
assert translation != null : AssertMessages.notNullParameter();
translation.set(this.m02, this.m12);
} | [
"@",
"Pure",
"public",
"void",
"getTranslationVector",
"(",
"Tuple2D",
"<",
"?",
">",
"translation",
")",
"{",
"assert",
"translation",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
")",
";",
"translation",
".",
"set",
"(",
"this",
".",
"m02",
",",
"this",
".",
"m12",
")",
";",
"}"
] | Replies the translation.
@param translation the vector to set with the translation component. | [
"Replies",
"the",
"translation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L209-L213 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.getScaleRotate2x2 | @SuppressWarnings("checkstyle:magicnumber")
protected void getScaleRotate2x2(double[] scales, double[] rots) {
final double[] tmp = new double[9];
tmp[0] = this.m00;
tmp[1] = this.m01;
tmp[2] = 0;
tmp[3] = this.m10;
tmp[4] = this.m11;
tmp[5] = 0;
tmp[6] = 0;
tmp[7] = 0;
tmp[8] = 0;
computeSVD(tmp, scales, rots);
} | java | @SuppressWarnings("checkstyle:magicnumber")
protected void getScaleRotate2x2(double[] scales, double[] rots) {
final double[] tmp = new double[9];
tmp[0] = this.m00;
tmp[1] = this.m01;
tmp[2] = 0;
tmp[3] = this.m10;
tmp[4] = this.m11;
tmp[5] = 0;
tmp[6] = 0;
tmp[7] = 0;
tmp[8] = 0;
computeSVD(tmp, scales, rots);
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"protected",
"void",
"getScaleRotate2x2",
"(",
"double",
"[",
"]",
"scales",
",",
"double",
"[",
"]",
"rots",
")",
"{",
"final",
"double",
"[",
"]",
"tmp",
"=",
"new",
"double",
"[",
"9",
"]",
";",
"tmp",
"[",
"0",
"]",
"=",
"this",
".",
"m00",
";",
"tmp",
"[",
"1",
"]",
"=",
"this",
".",
"m01",
";",
"tmp",
"[",
"2",
"]",
"=",
"0",
";",
"tmp",
"[",
"3",
"]",
"=",
"this",
".",
"m10",
";",
"tmp",
"[",
"4",
"]",
"=",
"this",
".",
"m11",
";",
"tmp",
"[",
"5",
"]",
"=",
"0",
";",
"tmp",
"[",
"6",
"]",
"=",
"0",
";",
"tmp",
"[",
"7",
"]",
"=",
"0",
";",
"tmp",
"[",
"8",
"]",
"=",
"0",
";",
"computeSVD",
"(",
"tmp",
",",
"scales",
",",
"rots",
")",
";",
"}"
] | Perform SVD on the 2x2 matrix containing the rotation and scaling factors.
@param scales the scaling factors.
@param rots the rotation factors. | [
"Perform",
"SVD",
"on",
"the",
"2x2",
"matrix",
"containing",
"the",
"rotation",
"and",
"scaling",
"factors",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L287-L304 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.getRotation | @Pure
@SuppressWarnings("checkstyle:magicnumber")
public double getRotation() {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
if (Math.signum(tmpRot[0]) != Math.signum(tmpRot[4])) {
// Sinuses are on the top-left to bottom-right diagonal
// -s c 0
// c s 0
// 0 0 1
return Math.atan2(tmpRot[4], tmpRot[3]);
}
// Sinuses are on the top-right to bottom-left diagonal
// c -s 0
// s c 0
// 0 0 1
return Math.atan2(tmpRot[3], tmpRot[0]);
} | java | @Pure
@SuppressWarnings("checkstyle:magicnumber")
public double getRotation() {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
if (Math.signum(tmpRot[0]) != Math.signum(tmpRot[4])) {
// Sinuses are on the top-left to bottom-right diagonal
// -s c 0
// c s 0
// 0 0 1
return Math.atan2(tmpRot[4], tmpRot[3]);
}
// Sinuses are on the top-right to bottom-left diagonal
// c -s 0
// s c 0
// 0 0 1
return Math.atan2(tmpRot[3], tmpRot[0]);
} | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"public",
"double",
"getRotation",
"(",
")",
"{",
"final",
"double",
"[",
"]",
"tmpScale",
"=",
"new",
"double",
"[",
"3",
"]",
";",
"final",
"double",
"[",
"]",
"tmpRot",
"=",
"new",
"double",
"[",
"9",
"]",
";",
"getScaleRotate2x2",
"(",
"tmpScale",
",",
"tmpRot",
")",
";",
"if",
"(",
"Math",
".",
"signum",
"(",
"tmpRot",
"[",
"0",
"]",
")",
"!=",
"Math",
".",
"signum",
"(",
"tmpRot",
"[",
"4",
"]",
")",
")",
"{",
"// Sinuses are on the top-left to bottom-right diagonal",
"// -s c 0",
"// c s 0",
"// 0 0 1",
"return",
"Math",
".",
"atan2",
"(",
"tmpRot",
"[",
"4",
"]",
",",
"tmpRot",
"[",
"3",
"]",
")",
";",
"}",
"// Sinuses are on the top-right to bottom-left diagonal",
"// c -s 0",
"// s c 0",
"// 0 0 1",
"return",
"Math",
".",
"atan2",
"(",
"tmpRot",
"[",
"3",
"]",
",",
"tmpRot",
"[",
"0",
"]",
")",
";",
"}"
] | Performs an SVD normalization of this matrix to calculate and return the
rotation angle.
@return the rotation angle of this matrix. The value is in [-PI; PI] | [
"Performs",
"an",
"SVD",
"normalization",
"of",
"this",
"matrix",
"to",
"calculate",
"and",
"return",
"the",
"rotation",
"angle",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L312-L330 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.setRotation | @SuppressWarnings("checkstyle:magicnumber")
public void setRotation(double angle) {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
final double cos = Math.cos(angle);
final double sin = Math.sin(angle);
// R * S
this.m00 = tmpScale[0] * cos;
this.m01 = tmpScale[1] * -sin;
this.m10 = tmpScale[0] * sin;
this.m11 = tmpScale[1] * cos;
// S * R
// this.m00 = tmp_scale[0] * cos;
// this.m01 = tmp_scale[0] * -sin;
// this.m10 = tmp_scale[1] * sin;
// this.m11 = tmp_scale[1] * cos;
} | java | @SuppressWarnings("checkstyle:magicnumber")
public void setRotation(double angle) {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
final double cos = Math.cos(angle);
final double sin = Math.sin(angle);
// R * S
this.m00 = tmpScale[0] * cos;
this.m01 = tmpScale[1] * -sin;
this.m10 = tmpScale[0] * sin;
this.m11 = tmpScale[1] * cos;
// S * R
// this.m00 = tmp_scale[0] * cos;
// this.m01 = tmp_scale[0] * -sin;
// this.m10 = tmp_scale[1] * sin;
// this.m11 = tmp_scale[1] * cos;
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"public",
"void",
"setRotation",
"(",
"double",
"angle",
")",
"{",
"final",
"double",
"[",
"]",
"tmpScale",
"=",
"new",
"double",
"[",
"3",
"]",
";",
"final",
"double",
"[",
"]",
"tmpRot",
"=",
"new",
"double",
"[",
"9",
"]",
";",
"getScaleRotate2x2",
"(",
"tmpScale",
",",
"tmpRot",
")",
";",
"final",
"double",
"cos",
"=",
"Math",
".",
"cos",
"(",
"angle",
")",
";",
"final",
"double",
"sin",
"=",
"Math",
".",
"sin",
"(",
"angle",
")",
";",
"// R * S",
"this",
".",
"m00",
"=",
"tmpScale",
"[",
"0",
"]",
"*",
"cos",
";",
"this",
".",
"m01",
"=",
"tmpScale",
"[",
"1",
"]",
"*",
"-",
"sin",
";",
"this",
".",
"m10",
"=",
"tmpScale",
"[",
"0",
"]",
"*",
"sin",
";",
"this",
".",
"m11",
"=",
"tmpScale",
"[",
"1",
"]",
"*",
"cos",
";",
"// S * R",
"//\t\tthis.m00 = tmp_scale[0] * cos;",
"//\t\tthis.m01 = tmp_scale[0] * -sin;",
"//\t\tthis.m10 = tmp_scale[1] * sin;",
"//\t\tthis.m11 = tmp_scale[1] * cos;",
"}"
] | Change the rotation of this matrix.
Performs an SVD normalization of this matrix for determining and preserving the scaling.
@param angle the rotation angle. | [
"Change",
"the",
"rotation",
"of",
"this",
"matrix",
".",
"Performs",
"an",
"SVD",
"normalization",
"of",
"this",
"matrix",
"for",
"determining",
"and",
"preserving",
"the",
"scaling",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L337-L354 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.getScale | @Pure
@SuppressWarnings("checkstyle:magicnumber")
public double getScale() {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
return MathUtil.max(tmpScale);
} | java | @Pure
@SuppressWarnings("checkstyle:magicnumber")
public double getScale() {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
return MathUtil.max(tmpScale);
} | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"public",
"double",
"getScale",
"(",
")",
"{",
"final",
"double",
"[",
"]",
"tmpScale",
"=",
"new",
"double",
"[",
"3",
"]",
";",
"final",
"double",
"[",
"]",
"tmpRot",
"=",
"new",
"double",
"[",
"9",
"]",
";",
"getScaleRotate2x2",
"(",
"tmpScale",
",",
"tmpRot",
")",
";",
"return",
"MathUtil",
".",
"max",
"(",
"tmpScale",
")",
";",
"}"
] | Performs an SVD normalization of this matrix to calculate and return the
uniform scale factor. If the matrix has non-uniform scale factors, the
largest of the x, y scale factors will be returned.
@return the scale factor of this matrix. | [
"Performs",
"an",
"SVD",
"normalization",
"of",
"this",
"matrix",
"to",
"calculate",
"and",
"return",
"the",
"uniform",
"scale",
"factor",
".",
"If",
"the",
"matrix",
"has",
"non",
"-",
"uniform",
"scale",
"factors",
"the",
"largest",
"of",
"the",
"x",
"y",
"scale",
"factors",
"will",
"be",
"returned",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L416-L423 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.getScaleVector | @Pure
@SuppressWarnings("checkstyle:magicnumber")
public void getScaleVector(Tuple2D<?> scale) {
assert scale != null : AssertMessages.notNullParameter();
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
scale.set(tmpScale[0], tmpScale[1]);
} | java | @Pure
@SuppressWarnings("checkstyle:magicnumber")
public void getScaleVector(Tuple2D<?> scale) {
assert scale != null : AssertMessages.notNullParameter();
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
scale.set(tmpScale[0], tmpScale[1]);
} | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"public",
"void",
"getScaleVector",
"(",
"Tuple2D",
"<",
"?",
">",
"scale",
")",
"{",
"assert",
"scale",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
")",
";",
"final",
"double",
"[",
"]",
"tmpScale",
"=",
"new",
"double",
"[",
"3",
"]",
";",
"final",
"double",
"[",
"]",
"tmpRot",
"=",
"new",
"double",
"[",
"9",
"]",
";",
"getScaleRotate2x2",
"(",
"tmpScale",
",",
"tmpRot",
")",
";",
"scale",
".",
"set",
"(",
"tmpScale",
"[",
"0",
"]",
",",
"tmpScale",
"[",
"1",
"]",
")",
";",
"}"
] | Performs an SVD normalization of this matrix to calculate and return the
scale factors for X and Y axess.
@param scale the tuple to set. | [
"Performs",
"an",
"SVD",
"normalization",
"of",
"this",
"matrix",
"to",
"calculate",
"and",
"return",
"the",
"scale",
"factors",
"for",
"X",
"and",
"Y",
"axess",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L458-L466 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.setScale | @SuppressWarnings("checkstyle:magicnumber")
public void setScale(double scaleX, double scaleY) {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
this.m00 = tmpRot[0] * scaleX;
this.m01 = tmpRot[1] * scaleY;
this.m10 = tmpRot[3] * scaleX;
this.m11 = tmpRot[4] * scaleY;
} | java | @SuppressWarnings("checkstyle:magicnumber")
public void setScale(double scaleX, double scaleY) {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
this.m00 = tmpRot[0] * scaleX;
this.m01 = tmpRot[1] * scaleY;
this.m10 = tmpRot[3] * scaleX;
this.m11 = tmpRot[4] * scaleY;
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"public",
"void",
"setScale",
"(",
"double",
"scaleX",
",",
"double",
"scaleY",
")",
"{",
"final",
"double",
"[",
"]",
"tmpScale",
"=",
"new",
"double",
"[",
"3",
"]",
";",
"final",
"double",
"[",
"]",
"tmpRot",
"=",
"new",
"double",
"[",
"9",
"]",
";",
"getScaleRotate2x2",
"(",
"tmpScale",
",",
"tmpRot",
")",
";",
"this",
".",
"m00",
"=",
"tmpRot",
"[",
"0",
"]",
"*",
"scaleX",
";",
"this",
".",
"m01",
"=",
"tmpRot",
"[",
"1",
"]",
"*",
"scaleY",
";",
"this",
".",
"m10",
"=",
"tmpRot",
"[",
"3",
"]",
"*",
"scaleX",
";",
"this",
".",
"m11",
"=",
"tmpRot",
"[",
"4",
"]",
"*",
"scaleY",
";",
"}"
] | Change the scale of this matrix.
Performs an SVD normalization of this matrix for determining and preserving the rotation.
@param scaleX the scaling factor along x axis.
@param scaleY the scaling factor along y axis.
@see #makeScaleMatrix(double, double) | [
"Change",
"the",
"scale",
"of",
"this",
"matrix",
".",
"Performs",
"an",
"SVD",
"normalization",
"of",
"this",
"matrix",
"for",
"determining",
"and",
"preserving",
"the",
"rotation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L475-L484 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.setScale | public void setScale(Tuple2D<?> tuple) {
assert tuple != null : AssertMessages.notNullParameter();
setScale(tuple.getX(), tuple.getY());
} | java | public void setScale(Tuple2D<?> tuple) {
assert tuple != null : AssertMessages.notNullParameter();
setScale(tuple.getX(), tuple.getY());
} | [
"public",
"void",
"setScale",
"(",
"Tuple2D",
"<",
"?",
">",
"tuple",
")",
"{",
"assert",
"tuple",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
")",
";",
"setScale",
"(",
"tuple",
".",
"getX",
"(",
")",
",",
"tuple",
".",
"getY",
"(",
")",
")",
";",
"}"
] | Set the scale.
<p>This function changes only the elements of
the matrix related to the scaling (m00,
m11). The shearing and the translation are not changed.
The rotation is lost.
<p>After a call to this function, the matrix will
contains (? means any value):
<pre>
[ t.x ? ? ]
[ ? t.y ? ]
[ ? ? ? ]
</pre>
@param tuple the scaling factors.
@see #makeScaleMatrix(double, double) | [
"Set",
"the",
"scale",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L504-L507 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.makeRotationMatrix | public void makeRotationMatrix(double angle) {
final double sinAngle = Math.sin(angle);
final double cosAngle = Math.cos(angle);
this.m00 = cosAngle;
this.m01 = -sinAngle;
this.m02 = 0.;
this.m11 = cosAngle;
this.m10 = sinAngle;
this.m12 = 0.;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | java | public void makeRotationMatrix(double angle) {
final double sinAngle = Math.sin(angle);
final double cosAngle = Math.cos(angle);
this.m00 = cosAngle;
this.m01 = -sinAngle;
this.m02 = 0.;
this.m11 = cosAngle;
this.m10 = sinAngle;
this.m12 = 0.;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | [
"public",
"void",
"makeRotationMatrix",
"(",
"double",
"angle",
")",
"{",
"final",
"double",
"sinAngle",
"=",
"Math",
".",
"sin",
"(",
"angle",
")",
";",
"final",
"double",
"cosAngle",
"=",
"Math",
".",
"cos",
"(",
"angle",
")",
";",
"this",
".",
"m00",
"=",
"cosAngle",
";",
"this",
".",
"m01",
"=",
"-",
"sinAngle",
";",
"this",
".",
"m02",
"=",
"0.",
";",
"this",
".",
"m11",
"=",
"cosAngle",
";",
"this",
".",
"m10",
"=",
"sinAngle",
";",
"this",
".",
"m12",
"=",
"0.",
";",
"this",
".",
"m20",
"=",
"0.",
";",
"this",
".",
"m21",
"=",
"0.",
";",
"this",
".",
"m22",
"=",
"1.",
";",
"}"
] | Sets the value of this matrix to a counter clockwise rotation about the x
axis, and no translation
<p>This function changes all the elements of
the matrix, icluding the translation.
<p>After a call to this function, the matrix will
contains (? means any value):
<pre>
[ cos(theta) -sin(theta) 0 ]
[ sin(theta) cos(theta) 0 ]
[ 0 0 1 ]
</pre>
@param angle
the angle to rotate about the X axis in radians
@see #setRotation(double) | [
"Sets",
"the",
"value",
"of",
"this",
"matrix",
"to",
"a",
"counter",
"clockwise",
"rotation",
"about",
"the",
"x",
"axis",
"and",
"no",
"translation"
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L569-L584 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.makeTranslationMatrix | public void makeTranslationMatrix(double dx, double dy) {
this.m00 = 1.;
this.m01 = 0.;
this.m02 = dx;
this.m10 = 0.;
this.m11 = 1.;
this.m12 = dy;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | java | public void makeTranslationMatrix(double dx, double dy) {
this.m00 = 1.;
this.m01 = 0.;
this.m02 = dx;
this.m10 = 0.;
this.m11 = 1.;
this.m12 = dy;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | [
"public",
"void",
"makeTranslationMatrix",
"(",
"double",
"dx",
",",
"double",
"dy",
")",
"{",
"this",
".",
"m00",
"=",
"1.",
";",
"this",
".",
"m01",
"=",
"0.",
";",
"this",
".",
"m02",
"=",
"dx",
";",
"this",
".",
"m10",
"=",
"0.",
";",
"this",
".",
"m11",
"=",
"1.",
";",
"this",
".",
"m12",
"=",
"dy",
";",
"this",
".",
"m20",
"=",
"0.",
";",
"this",
".",
"m21",
"=",
"0.",
";",
"this",
".",
"m22",
"=",
"1.",
";",
"}"
] | Sets the value of this matrix to the given translation, without rotation.
<p>This function changes all the elements of
the matrix including the scaling and the shearing.
<p>After a call to this function, the matrix will
contains (? means any value):
<pre>
[ 1 0 x ]
[ 0 1 y ]
[ 0 0 1 ]
</pre>
@param dx is the translation along X.
@param dy is the translation along Y.
@see #setTranslation(double, double)
@see #setTranslation(Tuple2D) | [
"Sets",
"the",
"value",
"of",
"this",
"matrix",
"to",
"the",
"given",
"translation",
"without",
"rotation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L605-L617 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.makeScaleMatrix | public void makeScaleMatrix(double scaleX, double scaleY) {
this.m00 = scaleX;
this.m01 = 0.;
this.m02 = 0.;
this.m10 = 0.;
this.m11 = scaleY;
this.m12 = 0.;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | java | public void makeScaleMatrix(double scaleX, double scaleY) {
this.m00 = scaleX;
this.m01 = 0.;
this.m02 = 0.;
this.m10 = 0.;
this.m11 = scaleY;
this.m12 = 0.;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | [
"public",
"void",
"makeScaleMatrix",
"(",
"double",
"scaleX",
",",
"double",
"scaleY",
")",
"{",
"this",
".",
"m00",
"=",
"scaleX",
";",
"this",
".",
"m01",
"=",
"0.",
";",
"this",
".",
"m02",
"=",
"0.",
";",
"this",
".",
"m10",
"=",
"0.",
";",
"this",
".",
"m11",
"=",
"scaleY",
";",
"this",
".",
"m12",
"=",
"0.",
";",
"this",
".",
"m20",
"=",
"0.",
";",
"this",
".",
"m21",
"=",
"0.",
";",
"this",
".",
"m22",
"=",
"1.",
";",
"}"
] | Sets the value of this matrix to the given scaling, without rotation.
<p>This function changes all the elements of
the matrix, including the shearing and the
translation.
<p>After a call to this function, the matrix will
contains (? means any value):
<pre>
[ sx 0 0 ]
[ 0 sy 0 ]
[ 0 0 1 ]
</pre>
@param scaleX is the scaling along X.
@param scaleY is the scaling along Y.
@see #setScale(double, double)
@see #setScale(Tuple2D) | [
"Sets",
"the",
"value",
"of",
"this",
"matrix",
"to",
"the",
"given",
"scaling",
"without",
"rotation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L639-L651 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java | Transform2D.transform | public void transform(Tuple2D<?> tuple, Tuple2D<?> result) {
assert tuple != null : AssertMessages.notNullParameter(0);
assert result != null : AssertMessages.notNullParameter(1);
result.set(
this.m00 * tuple.getX() + this.m01 * tuple.getY() + this.m02,
this.m10 * tuple.getX() + this.m11 * tuple.getY() + this.m12);
} | java | public void transform(Tuple2D<?> tuple, Tuple2D<?> result) {
assert tuple != null : AssertMessages.notNullParameter(0);
assert result != null : AssertMessages.notNullParameter(1);
result.set(
this.m00 * tuple.getX() + this.m01 * tuple.getY() + this.m02,
this.m10 * tuple.getX() + this.m11 * tuple.getY() + this.m12);
} | [
"public",
"void",
"transform",
"(",
"Tuple2D",
"<",
"?",
">",
"tuple",
",",
"Tuple2D",
"<",
"?",
">",
"result",
")",
"{",
"assert",
"tuple",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")",
";",
"assert",
"result",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"1",
")",
";",
"result",
".",
"set",
"(",
"this",
".",
"m00",
"*",
"tuple",
".",
"getX",
"(",
")",
"+",
"this",
".",
"m01",
"*",
"tuple",
".",
"getY",
"(",
")",
"+",
"this",
".",
"m02",
",",
"this",
".",
"m10",
"*",
"tuple",
".",
"getX",
"(",
")",
"+",
"this",
".",
"m11",
"*",
"tuple",
".",
"getY",
"(",
")",
"+",
"this",
".",
"m12",
")",
";",
"}"
] | Multiply this matrix by the tuple t and and place the result into the
tuple "result".
<p>This function is equivalent to:
<pre>
result = this * [ t.x ]
[ t.y ]
[ 1 ]
</pre>
@param tuple
the tuple to be multiplied by this matrix
@param result
the tuple into which the product is placed | [
"Multiply",
"this",
"matrix",
"by",
"the",
"tuple",
"t",
"and",
"and",
"place",
"the",
"result",
"into",
"the",
"tuple",
"result",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L683-L689 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/panels/keypad/KeyPadPanel.java | KeyPadPanel.initializeButton | protected void initializeButton(final Button button, final Color foreground,
final Color background)
{
button.setForeground(foreground);
button.setBackground(background);
} | java | protected void initializeButton(final Button button, final Color foreground,
final Color background)
{
button.setForeground(foreground);
button.setBackground(background);
} | [
"protected",
"void",
"initializeButton",
"(",
"final",
"Button",
"button",
",",
"final",
"Color",
"foreground",
",",
"final",
"Color",
"background",
")",
"{",
"button",
".",
"setForeground",
"(",
"foreground",
")",
";",
"button",
".",
"setBackground",
"(",
"background",
")",
";",
"}"
] | Initialize a button.
@param button
the button
@param foreground
the foreground
@param background
the background | [
"Initialize",
"a",
"button",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/panels/keypad/KeyPadPanel.java#L109-L114 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/panels/keypad/KeyPadPanel.java | KeyPadPanel.initializeButtons | private void initializeButtons()
{
initializeButton(button1 = new Button("1"), Color.black, Color.lightGray);
initializeButton(button2 = new Button("2"), Color.black, Color.lightGray);
initializeButton(button3 = new Button("3"), Color.black, Color.lightGray);
initializeButton(button4 = new Button("4"), Color.black, Color.lightGray);
initializeButton(button5 = new Button("5"), Color.black, Color.lightGray);
initializeButton(button6 = new Button("6"), Color.black, Color.lightGray);
initializeButton(button7 = new Button("7"), Color.black, Color.lightGray);
initializeButton(button8 = new Button("8"), Color.black, Color.lightGray);
initializeButton(button9 = new Button("9"), Color.black, Color.lightGray);
initializeButton(button0 = new Button("0"), Color.black, Color.lightGray);
initializeButton(buttonCancel = new Button("A"), Color.black, Color.lightGray);
initializeButton(buttonTable = new Button("T"), Color.black, Color.lightGray);
initializeButton(buttonEnter = new Button("E"), Color.black, Color.lightGray);
initializeButton(buttonMinus = new Button("-"), Color.black, Color.lightGray);
initializeButton(buttonPlus = new Button("+"), Color.black, Color.lightGray);
initializeButton(buttonStorno = new Button("ST"), Color.black, Color.lightGray);
} | java | private void initializeButtons()
{
initializeButton(button1 = new Button("1"), Color.black, Color.lightGray);
initializeButton(button2 = new Button("2"), Color.black, Color.lightGray);
initializeButton(button3 = new Button("3"), Color.black, Color.lightGray);
initializeButton(button4 = new Button("4"), Color.black, Color.lightGray);
initializeButton(button5 = new Button("5"), Color.black, Color.lightGray);
initializeButton(button6 = new Button("6"), Color.black, Color.lightGray);
initializeButton(button7 = new Button("7"), Color.black, Color.lightGray);
initializeButton(button8 = new Button("8"), Color.black, Color.lightGray);
initializeButton(button9 = new Button("9"), Color.black, Color.lightGray);
initializeButton(button0 = new Button("0"), Color.black, Color.lightGray);
initializeButton(buttonCancel = new Button("A"), Color.black, Color.lightGray);
initializeButton(buttonTable = new Button("T"), Color.black, Color.lightGray);
initializeButton(buttonEnter = new Button("E"), Color.black, Color.lightGray);
initializeButton(buttonMinus = new Button("-"), Color.black, Color.lightGray);
initializeButton(buttonPlus = new Button("+"), Color.black, Color.lightGray);
initializeButton(buttonStorno = new Button("ST"), Color.black, Color.lightGray);
} | [
"private",
"void",
"initializeButtons",
"(",
")",
"{",
"initializeButton",
"(",
"button1",
"=",
"new",
"Button",
"(",
"\"1\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button2",
"=",
"new",
"Button",
"(",
"\"2\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button3",
"=",
"new",
"Button",
"(",
"\"3\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button4",
"=",
"new",
"Button",
"(",
"\"4\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button5",
"=",
"new",
"Button",
"(",
"\"5\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button6",
"=",
"new",
"Button",
"(",
"\"6\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button7",
"=",
"new",
"Button",
"(",
"\"7\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button8",
"=",
"new",
"Button",
"(",
"\"8\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button9",
"=",
"new",
"Button",
"(",
"\"9\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"button0",
"=",
"new",
"Button",
"(",
"\"0\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"buttonCancel",
"=",
"new",
"Button",
"(",
"\"A\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"buttonTable",
"=",
"new",
"Button",
"(",
"\"T\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"buttonEnter",
"=",
"new",
"Button",
"(",
"\"E\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"buttonMinus",
"=",
"new",
"Button",
"(",
"\"-\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"buttonPlus",
"=",
"new",
"Button",
"(",
"\"+\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"initializeButton",
"(",
"buttonStorno",
"=",
"new",
"Button",
"(",
"\"ST\"",
")",
",",
"Color",
".",
"black",
",",
"Color",
".",
"lightGray",
")",
";",
"}"
] | Initialize the buttons. | [
"Initialize",
"the",
"buttons",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/panels/keypad/KeyPadPanel.java#L119-L137 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.connectBeginToBegin | public void connectBeginToBegin(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setBegin(point);
segment.setBegin(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);
} | java | public void connectBeginToBegin(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setBegin(point);
segment.setBegin(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);
} | [
"public",
"void",
"connectBeginToBegin",
"(",
"SGraphSegment",
"segment",
")",
"{",
"if",
"(",
"segment",
".",
"getGraph",
"(",
")",
"!=",
"getGraph",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"final",
"SGraphPoint",
"point",
"=",
"new",
"SGraphPoint",
"(",
"getGraph",
"(",
")",
")",
";",
"setBegin",
"(",
"point",
")",
";",
"segment",
".",
"setBegin",
"(",
"point",
")",
";",
"final",
"SGraph",
"g",
"=",
"getGraph",
"(",
")",
";",
"assert",
"g",
"!=",
"null",
";",
"g",
".",
"updatePointCount",
"(",
"-",
"1",
")",
";",
"}"
] | Connect the begin point of this segment to the
begin point of the given segment.
This function change the connection points of the two segments.
@param segment the segment.
@throws IllegalArgumentException if the given segment is not in the same graph. | [
"Connect",
"the",
"begin",
"point",
"of",
"this",
"segment",
"to",
"the",
"begin",
"point",
"of",
"the",
"given",
"segment",
".",
"This",
"function",
"change",
"the",
"connection",
"points",
"of",
"the",
"two",
"segments",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L107-L118 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.connectBeginToEnd | public void connectBeginToEnd(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setBegin(point);
segment.setEnd(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);
} | java | public void connectBeginToEnd(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setBegin(point);
segment.setEnd(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);
} | [
"public",
"void",
"connectBeginToEnd",
"(",
"SGraphSegment",
"segment",
")",
"{",
"if",
"(",
"segment",
".",
"getGraph",
"(",
")",
"!=",
"getGraph",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"final",
"SGraphPoint",
"point",
"=",
"new",
"SGraphPoint",
"(",
"getGraph",
"(",
")",
")",
";",
"setBegin",
"(",
"point",
")",
";",
"segment",
".",
"setEnd",
"(",
"point",
")",
";",
"final",
"SGraph",
"g",
"=",
"getGraph",
"(",
")",
";",
"assert",
"g",
"!=",
"null",
";",
"g",
".",
"updatePointCount",
"(",
"-",
"1",
")",
";",
"}"
] | Connect the begin point of this segment to the
end point of the given segment.
This function change the connection points of the two segments.
@param segment the segment.
@throws IllegalArgumentException if the given segment is not in the same graph. | [
"Connect",
"the",
"begin",
"point",
"of",
"this",
"segment",
"to",
"the",
"end",
"point",
"of",
"the",
"given",
"segment",
".",
"This",
"function",
"change",
"the",
"connection",
"points",
"of",
"the",
"two",
"segments",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L127-L138 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.connectEndToEnd | public void connectEndToEnd(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setEnd(point);
segment.setEnd(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);
} | java | public void connectEndToEnd(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setEnd(point);
segment.setEnd(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);
} | [
"public",
"void",
"connectEndToEnd",
"(",
"SGraphSegment",
"segment",
")",
"{",
"if",
"(",
"segment",
".",
"getGraph",
"(",
")",
"!=",
"getGraph",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"final",
"SGraphPoint",
"point",
"=",
"new",
"SGraphPoint",
"(",
"getGraph",
"(",
")",
")",
";",
"setEnd",
"(",
"point",
")",
";",
"segment",
".",
"setEnd",
"(",
"point",
")",
";",
"final",
"SGraph",
"g",
"=",
"getGraph",
"(",
")",
";",
"assert",
"g",
"!=",
"null",
";",
"g",
".",
"updatePointCount",
"(",
"-",
"1",
")",
";",
"}"
] | Connect the end point of this segment to the
end point of the given segment.
This function change the connection points of the two segments.
@param segment the segment.
@throws IllegalArgumentException if the given segment is not in the samegraph. | [
"Connect",
"the",
"end",
"point",
"of",
"this",
"segment",
"to",
"the",
"end",
"point",
"of",
"the",
"given",
"segment",
".",
"This",
"function",
"change",
"the",
"connection",
"points",
"of",
"the",
"two",
"segments",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L167-L178 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.disconnectBegin | public void disconnectBegin() {
if (this.startPoint != null) {
this.startPoint.remove(this);
}
this.startPoint = new SGraphPoint(getGraph());
this.startPoint.add(this);
} | java | public void disconnectBegin() {
if (this.startPoint != null) {
this.startPoint.remove(this);
}
this.startPoint = new SGraphPoint(getGraph());
this.startPoint.add(this);
} | [
"public",
"void",
"disconnectBegin",
"(",
")",
"{",
"if",
"(",
"this",
".",
"startPoint",
"!=",
"null",
")",
"{",
"this",
".",
"startPoint",
".",
"remove",
"(",
"this",
")",
";",
"}",
"this",
".",
"startPoint",
"=",
"new",
"SGraphPoint",
"(",
"getGraph",
"(",
")",
")",
";",
"this",
".",
"startPoint",
".",
"add",
"(",
"this",
")",
";",
"}"
] | Disconnect the begin point of this segment. | [
"Disconnect",
"the",
"begin",
"point",
"of",
"this",
"segment",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L182-L188 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.disconnectEnd | public void disconnectEnd() {
if (this.endPoint != null) {
this.endPoint.remove(this);
}
this.endPoint = new SGraphPoint(getGraph());
this.endPoint.add(this);
} | java | public void disconnectEnd() {
if (this.endPoint != null) {
this.endPoint.remove(this);
}
this.endPoint = new SGraphPoint(getGraph());
this.endPoint.add(this);
} | [
"public",
"void",
"disconnectEnd",
"(",
")",
"{",
"if",
"(",
"this",
".",
"endPoint",
"!=",
"null",
")",
"{",
"this",
".",
"endPoint",
".",
"remove",
"(",
"this",
")",
";",
"}",
"this",
".",
"endPoint",
"=",
"new",
"SGraphPoint",
"(",
"getGraph",
"(",
")",
")",
";",
"this",
".",
"endPoint",
".",
"add",
"(",
"this",
")",
";",
"}"
] | Disconnect the end point of this segment. | [
"Disconnect",
"the",
"end",
"point",
"of",
"this",
"segment",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L192-L198 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.addUserData | public boolean addUserData(Object userData) {
if (this.userData == null) {
this.userData = new ArrayList<>();
}
return this.userData.add(userData);
} | java | public boolean addUserData(Object userData) {
if (this.userData == null) {
this.userData = new ArrayList<>();
}
return this.userData.add(userData);
} | [
"public",
"boolean",
"addUserData",
"(",
"Object",
"userData",
")",
"{",
"if",
"(",
"this",
".",
"userData",
"==",
"null",
")",
"{",
"this",
".",
"userData",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"return",
"this",
".",
"userData",
".",
"add",
"(",
"userData",
")",
";",
"}"
] | Add a user data in the data associated to this point.
@param userData the user data to add.
@return <code>true</code> if the data was added; otherwise <code>false</code>. | [
"Add",
"a",
"user",
"data",
"in",
"the",
"data",
"associated",
"to",
"this",
"point",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L245-L250 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.getUserDataAt | @Pure
public Object getUserDataAt(int index) {
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
return this.userData.get(index);
} | java | @Pure
public Object getUserDataAt(int index) {
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
return this.userData.get(index);
} | [
"@",
"Pure",
"public",
"Object",
"getUserDataAt",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"this",
".",
"userData",
"==",
"null",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"return",
"this",
".",
"userData",
".",
"get",
"(",
"index",
")",
";",
"}"
] | Replies the user data at the given index.
@param index is the index of the data.
@return the data | [
"Replies",
"the",
"user",
"data",
"at",
"the",
"given",
"index",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L275-L281 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.setUserDataAt | public void setUserDataAt(int index, Object data) {
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
this.userData.set(index, data);
} | java | public void setUserDataAt(int index, Object data) {
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
this.userData.set(index, data);
} | [
"public",
"void",
"setUserDataAt",
"(",
"int",
"index",
",",
"Object",
"data",
")",
"{",
"if",
"(",
"this",
".",
"userData",
"==",
"null",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"this",
".",
"userData",
".",
"set",
"(",
"index",
",",
"data",
")",
";",
"}"
] | Set the user data at the given index.
@param index is the index of the data.
@param data is the data | [
"Set",
"the",
"user",
"data",
"at",
"the",
"given",
"index",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L288-L293 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java | SGraphSegment.getAllUserData | @Pure
public Collection<Object> getAllUserData() {
if (this.userData == null) {
return Collections.emptyList();
}
return Collections.unmodifiableCollection(this.userData);
} | java | @Pure
public Collection<Object> getAllUserData() {
if (this.userData == null) {
return Collections.emptyList();
}
return Collections.unmodifiableCollection(this.userData);
} | [
"@",
"Pure",
"public",
"Collection",
"<",
"Object",
">",
"getAllUserData",
"(",
")",
"{",
"if",
"(",
"this",
".",
"userData",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"return",
"Collections",
".",
"unmodifiableCollection",
"(",
"this",
".",
"userData",
")",
";",
"}"
] | Replies all the user data.
@return an unmodifiable collection of user data. | [
"Replies",
"all",
"the",
"user",
"data",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/simple/SGraphSegment.java#L299-L305 | train |
italiangrid/voms-clients | src/main/java/org/italiangrid/voms/clients/util/UsageProvider.java | UsageProvider.displayUsage | public static void displayUsage(String cmdLineSyntax, Options options) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp(cmdLineSyntax, options);
} | java | public static void displayUsage(String cmdLineSyntax, Options options) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp(cmdLineSyntax, options);
} | [
"public",
"static",
"void",
"displayUsage",
"(",
"String",
"cmdLineSyntax",
",",
"Options",
"options",
")",
"{",
"HelpFormatter",
"helpFormatter",
"=",
"new",
"HelpFormatter",
"(",
")",
";",
"helpFormatter",
".",
"printHelp",
"(",
"cmdLineSyntax",
",",
"options",
")",
";",
"}"
] | Displays usage.
@param cmdLineSyntax
the string that will be displayed on top of the usage message
@param options
the command options | [
"Displays",
"usage",
"."
] | 069cbe324c85286fa454bd78c3f76c23e97e5768 | https://github.com/italiangrid/voms-clients/blob/069cbe324c85286fa454bd78c3f76c23e97e5768/src/main/java/org/italiangrid/voms/clients/util/UsageProvider.java#L38-L42 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/DrawMessage.java | DrawMessage.initGraphics2D | private Graphics2D initGraphics2D(final Graphics g)
{
Graphics2D g2;
g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setColor(this.color);
return g2;
} | java | private Graphics2D initGraphics2D(final Graphics g)
{
Graphics2D g2;
g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setColor(this.color);
return g2;
} | [
"private",
"Graphics2D",
"initGraphics2D",
"(",
"final",
"Graphics",
"g",
")",
"{",
"Graphics2D",
"g2",
";",
"g2",
"=",
"(",
"Graphics2D",
")",
"g",
";",
"g2",
".",
"setRenderingHint",
"(",
"RenderingHints",
".",
"KEY_ANTIALIASING",
",",
"RenderingHints",
".",
"VALUE_ANTIALIAS_ON",
")",
";",
"g2",
".",
"setRenderingHint",
"(",
"RenderingHints",
".",
"KEY_RENDERING",
",",
"RenderingHints",
".",
"VALUE_RENDER_QUALITY",
")",
";",
"g2",
".",
"setColor",
"(",
"this",
".",
"color",
")",
";",
"return",
"g2",
";",
"}"
] | Inits the graphics2D object.
@param g
the Graphics object.
@return the graphics2 d | [
"Inits",
"the",
"graphics2D",
"object",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/DrawMessage.java#L124-L132 | train |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/converters/StringToEnum.java | StringToEnum.decode | @Override
public T decode(final String s) {
checkNotNull(s);
try {
return Enum.valueOf(type, s);
} catch (final IllegalArgumentException ignored) {
}
try {
return Enum.valueOf(type, s.toUpperCase());
} catch (final IllegalArgumentException ignored) {
}
try {
return Enum.valueOf(type, s.toLowerCase());
} catch (final IllegalArgumentException ignored) {
}
throw new ConversionException(
"Unable to instantiate a " + type + " from value " + s + ". Valid values: " + Joiner
.on(", ").join(EnumSet.allOf(type)));
} | java | @Override
public T decode(final String s) {
checkNotNull(s);
try {
return Enum.valueOf(type, s);
} catch (final IllegalArgumentException ignored) {
}
try {
return Enum.valueOf(type, s.toUpperCase());
} catch (final IllegalArgumentException ignored) {
}
try {
return Enum.valueOf(type, s.toLowerCase());
} catch (final IllegalArgumentException ignored) {
}
throw new ConversionException(
"Unable to instantiate a " + type + " from value " + s + ". Valid values: " + Joiner
.on(", ").join(EnumSet.allOf(type)));
} | [
"@",
"Override",
"public",
"T",
"decode",
"(",
"final",
"String",
"s",
")",
"{",
"checkNotNull",
"(",
"s",
")",
";",
"try",
"{",
"return",
"Enum",
".",
"valueOf",
"(",
"type",
",",
"s",
")",
";",
"}",
"catch",
"(",
"final",
"IllegalArgumentException",
"ignored",
")",
"{",
"}",
"try",
"{",
"return",
"Enum",
".",
"valueOf",
"(",
"type",
",",
"s",
".",
"toUpperCase",
"(",
")",
")",
";",
"}",
"catch",
"(",
"final",
"IllegalArgumentException",
"ignored",
")",
"{",
"}",
"try",
"{",
"return",
"Enum",
".",
"valueOf",
"(",
"type",
",",
"s",
".",
"toLowerCase",
"(",
")",
")",
";",
"}",
"catch",
"(",
"final",
"IllegalArgumentException",
"ignored",
")",
"{",
"}",
"throw",
"new",
"ConversionException",
"(",
"\"Unable to instantiate a \"",
"+",
"type",
"+",
"\" from value \"",
"+",
"s",
"+",
"\". Valid values: \"",
"+",
"Joiner",
".",
"on",
"(",
"\", \"",
")",
".",
"join",
"(",
"EnumSet",
".",
"allOf",
"(",
"type",
")",
")",
")",
";",
"}"
] | Converts a string to a value of the enum type. If the string cannot be converted to an enum
value as-is, conversion is attempted on the string in uppercase and then in lowercase as a
fallback.
@param s the string to convert
@return an enum value
@throws NullPointerException if {@code s} is null
@throws ConversionException if {@code s} cannot be converted to an enum value after attempting
fallback transformations | [
"Converts",
"a",
"string",
"to",
"a",
"value",
"of",
"the",
"enum",
"type",
".",
"If",
"the",
"string",
"cannot",
"be",
"converted",
"to",
"an",
"enum",
"value",
"as",
"-",
"is",
"conversion",
"is",
"attempted",
"on",
"the",
"string",
"in",
"uppercase",
"and",
"then",
"in",
"lowercase",
"as",
"a",
"fallback",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/converters/StringToEnum.java#L42-L61 | train |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphIterationElementComparator.java | GraphIterationElementComparator.compareConnections | @Pure
protected int compareConnections(PT p1, PT p2) {
assert p1 != null && p2 != null;
return p1.hashCode() - p2.hashCode();
} | java | @Pure
protected int compareConnections(PT p1, PT p2) {
assert p1 != null && p2 != null;
return p1.hashCode() - p2.hashCode();
} | [
"@",
"Pure",
"protected",
"int",
"compareConnections",
"(",
"PT",
"p1",
",",
"PT",
"p2",
")",
"{",
"assert",
"p1",
"!=",
"null",
"&&",
"p2",
"!=",
"null",
";",
"return",
"p1",
".",
"hashCode",
"(",
")",
"-",
"p2",
".",
"hashCode",
"(",
")",
";",
"}"
] | Compare the two given entry points.
@param p1 the first connection.
@param p2 the second connection.
@return <code>-1</code> if {@code p1} is lower than {@code p2},
<code>1</code> if {@code p1} is greater than {@code p2},
otherwise <code>0</code>. | [
"Compare",
"the",
"two",
"given",
"entry",
"points",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphIterationElementComparator.java#L90-L94 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/x/GenericShuffleJXTable.java | GenericShuffleJXTable.addAllLeftRowsToRightTable | public void addAllLeftRowsToRightTable()
{
rightTable.getGenericTableModel().addList(leftTable.getGenericTableModel().getData());
leftTable.getGenericTableModel().clear();
} | java | public void addAllLeftRowsToRightTable()
{
rightTable.getGenericTableModel().addList(leftTable.getGenericTableModel().getData());
leftTable.getGenericTableModel().clear();
} | [
"public",
"void",
"addAllLeftRowsToRightTable",
"(",
")",
"{",
"rightTable",
".",
"getGenericTableModel",
"(",
")",
".",
"addList",
"(",
"leftTable",
".",
"getGenericTableModel",
"(",
")",
".",
"getData",
"(",
")",
")",
";",
"leftTable",
".",
"getGenericTableModel",
"(",
")",
".",
"clear",
"(",
")",
";",
"}"
] | Adds the all left rows to right table. | [
"Adds",
"the",
"all",
"left",
"rows",
"to",
"right",
"table",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/x/GenericShuffleJXTable.java#L61-L65 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/x/GenericShuffleJXTable.java | GenericShuffleJXTable.addAllRightRowsToLeftTable | public void addAllRightRowsToLeftTable()
{
leftTable.getGenericTableModel().addList(rightTable.getGenericTableModel().getData());
rightTable.getGenericTableModel().clear();
} | java | public void addAllRightRowsToLeftTable()
{
leftTable.getGenericTableModel().addList(rightTable.getGenericTableModel().getData());
rightTable.getGenericTableModel().clear();
} | [
"public",
"void",
"addAllRightRowsToLeftTable",
"(",
")",
"{",
"leftTable",
".",
"getGenericTableModel",
"(",
")",
".",
"addList",
"(",
"rightTable",
".",
"getGenericTableModel",
"(",
")",
".",
"getData",
"(",
")",
")",
";",
"rightTable",
".",
"getGenericTableModel",
"(",
")",
".",
"clear",
"(",
")",
";",
"}"
] | Adds the all right rows to left table. | [
"Adds",
"the",
"all",
"right",
"rows",
"to",
"left",
"table",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/x/GenericShuffleJXTable.java#L70-L74 | train |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/x/GenericShuffleJXTable.java | GenericShuffleJXTable.shuffleSelectedLeftRowsToRightTable | public void shuffleSelectedLeftRowsToRightTable()
{
final int[] selectedRows = leftTable.getSelectedRows();
final int lastIndex = selectedRows.length - 1;
for (int i = lastIndex; -1 < i; i--)
{
final int selectedRow = selectedRows[i];
final T row = leftTable.getGenericTableModel().removeAt(selectedRow);
rightTable.getGenericTableModel().add(row);
}
} | java | public void shuffleSelectedLeftRowsToRightTable()
{
final int[] selectedRows = leftTable.getSelectedRows();
final int lastIndex = selectedRows.length - 1;
for (int i = lastIndex; -1 < i; i--)
{
final int selectedRow = selectedRows[i];
final T row = leftTable.getGenericTableModel().removeAt(selectedRow);
rightTable.getGenericTableModel().add(row);
}
} | [
"public",
"void",
"shuffleSelectedLeftRowsToRightTable",
"(",
")",
"{",
"final",
"int",
"[",
"]",
"selectedRows",
"=",
"leftTable",
".",
"getSelectedRows",
"(",
")",
";",
"final",
"int",
"lastIndex",
"=",
"selectedRows",
".",
"length",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"lastIndex",
";",
"-",
"1",
"<",
"i",
";",
"i",
"--",
")",
"{",
"final",
"int",
"selectedRow",
"=",
"selectedRows",
"[",
"i",
"]",
";",
"final",
"T",
"row",
"=",
"leftTable",
".",
"getGenericTableModel",
"(",
")",
".",
"removeAt",
"(",
"selectedRow",
")",
";",
"rightTable",
".",
"getGenericTableModel",
"(",
")",
".",
"add",
"(",
"row",
")",
";",
"}",
"}"
] | Shuffle selected left rows to right table. | [
"Shuffle",
"selected",
"left",
"rows",
"to",
"right",
"table",
"."
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/x/GenericShuffleJXTable.java#L79-L89 | train |
italiangrid/voms-clients | src/main/java/org/italiangrid/voms/clients/util/OptionsFileLoader.java | OptionsFileLoader.loadOptions | public static List<String> loadOptions(String optionFileName) {
List<String> args = new ArrayList<String>();
File optionFile = new File(optionFileName);
StringWriter stringWriter = new StringWriter();
try {
InputStream inputStream = new FileInputStream(optionFile);
IOUtils.copy(inputStream, stringWriter);
} catch (FileNotFoundException e) {
System.err.println("Error reading options file: " + e.getMessage());
System.exit(1);
} catch (IOException e) {
System.err.println("Error reading options file: " + e.getMessage());
System.exit(1);
}
String string = stringWriter.toString();
StringTokenizer stringTokenizer = new StringTokenizer(string);
while (stringTokenizer.hasMoreTokens()) {
args.add(stringTokenizer.nextToken());
}
return args;
} | java | public static List<String> loadOptions(String optionFileName) {
List<String> args = new ArrayList<String>();
File optionFile = new File(optionFileName);
StringWriter stringWriter = new StringWriter();
try {
InputStream inputStream = new FileInputStream(optionFile);
IOUtils.copy(inputStream, stringWriter);
} catch (FileNotFoundException e) {
System.err.println("Error reading options file: " + e.getMessage());
System.exit(1);
} catch (IOException e) {
System.err.println("Error reading options file: " + e.getMessage());
System.exit(1);
}
String string = stringWriter.toString();
StringTokenizer stringTokenizer = new StringTokenizer(string);
while (stringTokenizer.hasMoreTokens()) {
args.add(stringTokenizer.nextToken());
}
return args;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"loadOptions",
"(",
"String",
"optionFileName",
")",
"{",
"List",
"<",
"String",
">",
"args",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"File",
"optionFile",
"=",
"new",
"File",
"(",
"optionFileName",
")",
";",
"StringWriter",
"stringWriter",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"InputStream",
"inputStream",
"=",
"new",
"FileInputStream",
"(",
"optionFile",
")",
";",
"IOUtils",
".",
"copy",
"(",
"inputStream",
",",
"stringWriter",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Error reading options file: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"System",
".",
"exit",
"(",
"1",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Error reading options file: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"System",
".",
"exit",
"(",
"1",
")",
";",
"}",
"String",
"string",
"=",
"stringWriter",
".",
"toString",
"(",
")",
";",
"StringTokenizer",
"stringTokenizer",
"=",
"new",
"StringTokenizer",
"(",
"string",
")",
";",
"while",
"(",
"stringTokenizer",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"args",
".",
"add",
"(",
"stringTokenizer",
".",
"nextToken",
"(",
")",
")",
";",
"}",
"return",
"args",
";",
"}"
] | Load options from a file
@param optionFileName
the file containing the options
@return a list of options | [
"Load",
"options",
"from",
"a",
"file"
] | 069cbe324c85286fa454bd78c3f76c23e97e5768 | https://github.com/italiangrid/voms-clients/blob/069cbe324c85286fa454bd78c3f76c23e97e5768/src/main/java/org/italiangrid/voms/clients/util/OptionsFileLoader.java#L45-L80 | train |
gallandarakhneorg/afc | advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/ShapeFileFilter.java | ShapeFileFilter.isShapeFile | @Pure
public static boolean isShapeFile(URL file) {
return FileType.isContentType(
file,
MimeName.MIME_SHAPE_FILE.getMimeConstant());
} | java | @Pure
public static boolean isShapeFile(URL file) {
return FileType.isContentType(
file,
MimeName.MIME_SHAPE_FILE.getMimeConstant());
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isShapeFile",
"(",
"URL",
"file",
")",
"{",
"return",
"FileType",
".",
"isContentType",
"(",
"file",
",",
"MimeName",
".",
"MIME_SHAPE_FILE",
".",
"getMimeConstant",
"(",
")",
")",
";",
"}"
] | Replies if the specified file content is a ESRI shape file.
@param file is the file to test
@return <code>true</code> if the given file contains dBase data,
otherwise <code>false</code>. | [
"Replies",
"if",
"the",
"specified",
"file",
"content",
"is",
"a",
"ESRI",
"shape",
"file",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/ShapeFileFilter.java#L99-L104 | train |
gallandarakhneorg/afc | advanced/bootique/bootique-synopsishelp/src/main/java/org/arakhne/afc/bootique/synopsishelp/modules/SynopsisHelpGeneratorModule.java | SynopsisHelpGeneratorModule.provideHelpGenerator | @SuppressWarnings("static-method")
@Provides
@Singleton
public HelpGenerator provideHelpGenerator(
ApplicationMetadata metadata, Injector injector, Terminal terminal) {
int maxColumns = terminal.getColumns();
if (maxColumns < TTY_MIN_COLUMNS) {
maxColumns = TTY_DEFAULT_COLUMNS;
}
String argumentSynopsis;
try {
argumentSynopsis = injector.getInstance(Key.get(String.class, ApplicationArgumentSynopsis.class));
} catch (Exception exception) {
argumentSynopsis = null;
}
String detailedDescription;
try {
detailedDescription = injector.getInstance(Key.get(String.class, ApplicationDetailedDescription.class));
} catch (Exception exception) {
detailedDescription = null;
}
return new SynopsisHelpGenerator(metadata, argumentSynopsis, detailedDescription, maxColumns);
} | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public HelpGenerator provideHelpGenerator(
ApplicationMetadata metadata, Injector injector, Terminal terminal) {
int maxColumns = terminal.getColumns();
if (maxColumns < TTY_MIN_COLUMNS) {
maxColumns = TTY_DEFAULT_COLUMNS;
}
String argumentSynopsis;
try {
argumentSynopsis = injector.getInstance(Key.get(String.class, ApplicationArgumentSynopsis.class));
} catch (Exception exception) {
argumentSynopsis = null;
}
String detailedDescription;
try {
detailedDescription = injector.getInstance(Key.get(String.class, ApplicationDetailedDescription.class));
} catch (Exception exception) {
detailedDescription = null;
}
return new SynopsisHelpGenerator(metadata, argumentSynopsis, detailedDescription, maxColumns);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"HelpGenerator",
"provideHelpGenerator",
"(",
"ApplicationMetadata",
"metadata",
",",
"Injector",
"injector",
",",
"Terminal",
"terminal",
")",
"{",
"int",
"maxColumns",
"=",
"terminal",
".",
"getColumns",
"(",
")",
";",
"if",
"(",
"maxColumns",
"<",
"TTY_MIN_COLUMNS",
")",
"{",
"maxColumns",
"=",
"TTY_DEFAULT_COLUMNS",
";",
"}",
"String",
"argumentSynopsis",
";",
"try",
"{",
"argumentSynopsis",
"=",
"injector",
".",
"getInstance",
"(",
"Key",
".",
"get",
"(",
"String",
".",
"class",
",",
"ApplicationArgumentSynopsis",
".",
"class",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"exception",
")",
"{",
"argumentSynopsis",
"=",
"null",
";",
"}",
"String",
"detailedDescription",
";",
"try",
"{",
"detailedDescription",
"=",
"injector",
".",
"getInstance",
"(",
"Key",
".",
"get",
"(",
"String",
".",
"class",
",",
"ApplicationDetailedDescription",
".",
"class",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"exception",
")",
"{",
"detailedDescription",
"=",
"null",
";",
"}",
"return",
"new",
"SynopsisHelpGenerator",
"(",
"metadata",
",",
"argumentSynopsis",
",",
"detailedDescription",
",",
"maxColumns",
")",
";",
"}"
] | Provide the help generator with synopsis.
@param metadata the application metadata.
@param injector the injector.
@param terminal the terminal description.
@return the help generator. | [
"Provide",
"the",
"help",
"generator",
"with",
"synopsis",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-synopsishelp/src/main/java/org/arakhne/afc/bootique/synopsishelp/modules/SynopsisHelpGeneratorModule.java#L62-L84 | train |
gallandarakhneorg/afc | advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableCanvas.java | ZoomableCanvas.getDocumentGraphicsContext2D | public ZoomableGraphicsContext getDocumentGraphicsContext2D() {
if (this.documentGraphicsContext == null) {
final CenteringTransform transform = new CenteringTransform(
invertedAxisXProperty(),
invertedAxisYProperty(),
viewportBoundsProperty());
this.documentGraphicsContext = new ZoomableGraphicsContext(
getGraphicsContext2D(),
scaleValueProperty(),
documentBoundsProperty(),
viewportBoundsProperty(),
widthProperty(),
heightProperty(),
drawableElementBudgetProperty(),
transform);
}
return this.documentGraphicsContext;
} | java | public ZoomableGraphicsContext getDocumentGraphicsContext2D() {
if (this.documentGraphicsContext == null) {
final CenteringTransform transform = new CenteringTransform(
invertedAxisXProperty(),
invertedAxisYProperty(),
viewportBoundsProperty());
this.documentGraphicsContext = new ZoomableGraphicsContext(
getGraphicsContext2D(),
scaleValueProperty(),
documentBoundsProperty(),
viewportBoundsProperty(),
widthProperty(),
heightProperty(),
drawableElementBudgetProperty(),
transform);
}
return this.documentGraphicsContext;
} | [
"public",
"ZoomableGraphicsContext",
"getDocumentGraphicsContext2D",
"(",
")",
"{",
"if",
"(",
"this",
".",
"documentGraphicsContext",
"==",
"null",
")",
"{",
"final",
"CenteringTransform",
"transform",
"=",
"new",
"CenteringTransform",
"(",
"invertedAxisXProperty",
"(",
")",
",",
"invertedAxisYProperty",
"(",
")",
",",
"viewportBoundsProperty",
"(",
")",
")",
";",
"this",
".",
"documentGraphicsContext",
"=",
"new",
"ZoomableGraphicsContext",
"(",
"getGraphicsContext2D",
"(",
")",
",",
"scaleValueProperty",
"(",
")",
",",
"documentBoundsProperty",
"(",
")",
",",
"viewportBoundsProperty",
"(",
")",
",",
"widthProperty",
"(",
")",
",",
"heightProperty",
"(",
")",
",",
"drawableElementBudgetProperty",
"(",
")",
",",
"transform",
")",
";",
"}",
"return",
"this",
".",
"documentGraphicsContext",
";",
"}"
] | Replies the document graphics context.
@return the graphics context. | [
"Replies",
"the",
"document",
"graphics",
"context",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableCanvas.java#L209-L226 | train |
gallandarakhneorg/afc | advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableCanvas.java | ZoomableCanvas.fireDrawingStart | protected void fireDrawingStart() {
final ListenerCollection<EventListener> list = this.listeners;
if (list != null) {
for (final DrawingListener listener : list.getListeners(DrawingListener.class)) {
listener.onDrawingStart();
}
}
} | java | protected void fireDrawingStart() {
final ListenerCollection<EventListener> list = this.listeners;
if (list != null) {
for (final DrawingListener listener : list.getListeners(DrawingListener.class)) {
listener.onDrawingStart();
}
}
} | [
"protected",
"void",
"fireDrawingStart",
"(",
")",
"{",
"final",
"ListenerCollection",
"<",
"EventListener",
">",
"list",
"=",
"this",
".",
"listeners",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"DrawingListener",
"listener",
":",
"list",
".",
"getListeners",
"(",
"DrawingListener",
".",
"class",
")",
")",
"{",
"listener",
".",
"onDrawingStart",
"(",
")",
";",
"}",
"}",
"}"
] | Notifies listeners on drawing start. | [
"Notifies",
"listeners",
"on",
"drawing",
"start",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableCanvas.java#L755-L762 | train |
gallandarakhneorg/afc | advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableCanvas.java | ZoomableCanvas.fireDrawingEnd | protected void fireDrawingEnd() {
final ListenerCollection<EventListener> list = this.listeners;
if (list != null) {
for (final DrawingListener listener : list.getListeners(DrawingListener.class)) {
listener.onDrawingEnd();
}
}
} | java | protected void fireDrawingEnd() {
final ListenerCollection<EventListener> list = this.listeners;
if (list != null) {
for (final DrawingListener listener : list.getListeners(DrawingListener.class)) {
listener.onDrawingEnd();
}
}
} | [
"protected",
"void",
"fireDrawingEnd",
"(",
")",
"{",
"final",
"ListenerCollection",
"<",
"EventListener",
">",
"list",
"=",
"this",
".",
"listeners",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"DrawingListener",
"listener",
":",
"list",
".",
"getListeners",
"(",
"DrawingListener",
".",
"class",
")",
")",
"{",
"listener",
".",
"onDrawingEnd",
"(",
")",
";",
"}",
"}",
"}"
] | Notifies listeners on drawing finishing. | [
"Notifies",
"listeners",
"on",
"drawing",
"finishing",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableCanvas.java#L766-L773 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.getPreferredLineDrawAlgorithm | @Pure
public static BusLayerDrawerType getPreferredLineDrawAlgorithm() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
final String algo = prefs.get("DRAWING_ALGORITHM", null); //$NON-NLS-1$
if (algo != null && algo.length() > 0) {
try {
return BusLayerDrawerType.valueOf(algo);
} catch (Throwable exception) {
//
}
}
}
return BusLayerDrawerType.OVERLAP;
} | java | @Pure
public static BusLayerDrawerType getPreferredLineDrawAlgorithm() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
final String algo = prefs.get("DRAWING_ALGORITHM", null); //$NON-NLS-1$
if (algo != null && algo.length() > 0) {
try {
return BusLayerDrawerType.valueOf(algo);
} catch (Throwable exception) {
//
}
}
}
return BusLayerDrawerType.OVERLAP;
} | [
"@",
"Pure",
"public",
"static",
"BusLayerDrawerType",
"getPreferredLineDrawAlgorithm",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"final",
"String",
"algo",
"=",
"prefs",
".",
"get",
"(",
"\"DRAWING_ALGORITHM\"",
",",
"null",
")",
";",
"//$NON-NLS-1$",
"if",
"(",
"algo",
"!=",
"null",
"&&",
"algo",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"try",
"{",
"return",
"BusLayerDrawerType",
".",
"valueOf",
"(",
"algo",
")",
";",
"}",
"catch",
"(",
"Throwable",
"exception",
")",
"{",
"//",
"}",
"}",
"}",
"return",
"BusLayerDrawerType",
".",
"OVERLAP",
";",
"}"
] | Replies if the bus network should be drawn with the
algorithm.
@return <code>true</code> if the algorithm may be used,
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"bus",
"network",
"should",
"be",
"drawn",
"with",
"the",
"algorithm",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L78-L92 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.setPreferredLineDrawingAlgorithm | public static void setPreferredLineDrawingAlgorithm(BusLayerDrawerType algorithm) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (algorithm == null) {
prefs.remove("DRAWING_ALGORITHM"); //$NON-NLS-1$
} else {
prefs.put("DRAWING_ALGORITHM", algorithm.name()); //$NON-NLS-1$
}
}
} | java | public static void setPreferredLineDrawingAlgorithm(BusLayerDrawerType algorithm) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (algorithm == null) {
prefs.remove("DRAWING_ALGORITHM"); //$NON-NLS-1$
} else {
prefs.put("DRAWING_ALGORITHM", algorithm.name()); //$NON-NLS-1$
}
}
} | [
"public",
"static",
"void",
"setPreferredLineDrawingAlgorithm",
"(",
"BusLayerDrawerType",
"algorithm",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"if",
"(",
"algorithm",
"==",
"null",
")",
"{",
"prefs",
".",
"remove",
"(",
"\"DRAWING_ALGORITHM\"",
")",
";",
"//$NON-NLS-1$",
"}",
"else",
"{",
"prefs",
".",
"put",
"(",
"\"DRAWING_ALGORITHM\"",
",",
"algorithm",
".",
"name",
"(",
")",
")",
";",
"//$NON-NLS-1$",
"}",
"}",
"}"
] | Set if the bus network should be drawn with the
algorithm.
@param algorithm indicates if the drawing algorithm. | [
"Set",
"if",
"the",
"bus",
"network",
"should",
"be",
"drawn",
"with",
"the",
"algorithm",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L99-L108 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.getSelectionColor | @Pure
public static int getSelectionColor() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
final String str = prefs.get("SELECTION_COLOR", null); //$NON-NLS-1$
if (str != null) {
try {
return Integer.valueOf(str);
} catch (Throwable exception) {
//
}
}
}
return DEFAULT_SELECTION_COLOR;
} | java | @Pure
public static int getSelectionColor() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
final String str = prefs.get("SELECTION_COLOR", null); //$NON-NLS-1$
if (str != null) {
try {
return Integer.valueOf(str);
} catch (Throwable exception) {
//
}
}
}
return DEFAULT_SELECTION_COLOR;
} | [
"@",
"Pure",
"public",
"static",
"int",
"getSelectionColor",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"final",
"String",
"str",
"=",
"prefs",
".",
"get",
"(",
"\"SELECTION_COLOR\"",
",",
"null",
")",
";",
"//$NON-NLS-1$",
"if",
"(",
"str",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"str",
")",
";",
"}",
"catch",
"(",
"Throwable",
"exception",
")",
"{",
"//",
"}",
"}",
"}",
"return",
"DEFAULT_SELECTION_COLOR",
";",
"}"
] | Replies if the preferred color for bus stops selection.
@return Color for selection | [
"Replies",
"if",
"the",
"preferred",
"color",
"for",
"bus",
"stops",
"selection",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L137-L151 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.setSelectionColor | public static void setSelectionColor(Integer color) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (color == null || color == DEFAULT_SELECTION_COLOR) {
prefs.remove("SELECTION_COLOR"); //$NON-NLS-1$
} else {
prefs.put("SELECTION_COLOR", color.toString()); //$NON-NLS-1$
}
try {
prefs.flush();
} catch (BackingStoreException exception) {
//
}
}
} | java | public static void setSelectionColor(Integer color) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (color == null || color == DEFAULT_SELECTION_COLOR) {
prefs.remove("SELECTION_COLOR"); //$NON-NLS-1$
} else {
prefs.put("SELECTION_COLOR", color.toString()); //$NON-NLS-1$
}
try {
prefs.flush();
} catch (BackingStoreException exception) {
//
}
}
} | [
"public",
"static",
"void",
"setSelectionColor",
"(",
"Integer",
"color",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"if",
"(",
"color",
"==",
"null",
"||",
"color",
"==",
"DEFAULT_SELECTION_COLOR",
")",
"{",
"prefs",
".",
"remove",
"(",
"\"SELECTION_COLOR\"",
")",
";",
"//$NON-NLS-1$",
"}",
"else",
"{",
"prefs",
".",
"put",
"(",
"\"SELECTION_COLOR\"",
",",
"color",
".",
"toString",
"(",
")",
")",
";",
"//$NON-NLS-1$",
"}",
"try",
"{",
"prefs",
".",
"flush",
"(",
")",
";",
"}",
"catch",
"(",
"BackingStoreException",
"exception",
")",
"{",
"//",
"}",
"}",
"}"
] | Set the default color selection.
@param color is the default color for selection. | [
"Set",
"the",
"default",
"color",
"selection",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L157-L171 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.isBusStopDrawable | @Pure
public static boolean isBusStopDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_BUS_STOPS", DEFAULT_BUS_STOP_DRAWING); //$NON-NLS-1$
}
return DEFAULT_BUS_STOP_DRAWING;
} | java | @Pure
public static boolean isBusStopDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_BUS_STOPS", DEFAULT_BUS_STOP_DRAWING); //$NON-NLS-1$
}
return DEFAULT_BUS_STOP_DRAWING;
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isBusStopDrawable",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"return",
"prefs",
".",
"getBoolean",
"(",
"\"DRAW_BUS_STOPS\"",
",",
"DEFAULT_BUS_STOP_DRAWING",
")",
";",
"//$NON-NLS-1$",
"}",
"return",
"DEFAULT_BUS_STOP_DRAWING",
";",
"}"
] | Replies if the bus stops should be drawn or not.
@return <code>true</code> if the bus stops are drawable;
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"bus",
"stops",
"should",
"be",
"drawn",
"or",
"not",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L179-L186 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.isBusStopNamesDrawable | @Pure
public static boolean isBusStopNamesDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_BUS_STOPS_NAMES", DEFAULT_BUS_STOP_NAMES_DRAWING); //$NON-NLS-1$
}
return DEFAULT_BUS_STOP_NAMES_DRAWING;
} | java | @Pure
public static boolean isBusStopNamesDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_BUS_STOPS_NAMES", DEFAULT_BUS_STOP_NAMES_DRAWING); //$NON-NLS-1$
}
return DEFAULT_BUS_STOP_NAMES_DRAWING;
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isBusStopNamesDrawable",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"return",
"prefs",
".",
"getBoolean",
"(",
"\"DRAW_BUS_STOPS_NAMES\"",
",",
"DEFAULT_BUS_STOP_NAMES_DRAWING",
")",
";",
"//$NON-NLS-1$",
"}",
"return",
"DEFAULT_BUS_STOP_NAMES_DRAWING",
";",
"}"
] | Replies if the bus stops names should be drawn or not.
@return <code>true</code> if the bus stops are drawable;
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"bus",
"stops",
"names",
"should",
"be",
"drawn",
"or",
"not",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L215-L222 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.setBusStopNamesDrawable | public static void setBusStopNamesDrawable(Boolean isNamesDrawable) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isNamesDrawable == null) {
prefs.remove("DRAW_BUS_STOPS_NAMES"); //$NON-NLS-1$
} else {
prefs.putBoolean("DRAW_BUS_STOPS_NAMES", isNamesDrawable.booleanValue()); //$NON-NLS-1$
}
try {
prefs.sync();
} catch (BackingStoreException exception) {
//
}
}
} | java | public static void setBusStopNamesDrawable(Boolean isNamesDrawable) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isNamesDrawable == null) {
prefs.remove("DRAW_BUS_STOPS_NAMES"); //$NON-NLS-1$
} else {
prefs.putBoolean("DRAW_BUS_STOPS_NAMES", isNamesDrawable.booleanValue()); //$NON-NLS-1$
}
try {
prefs.sync();
} catch (BackingStoreException exception) {
//
}
}
} | [
"public",
"static",
"void",
"setBusStopNamesDrawable",
"(",
"Boolean",
"isNamesDrawable",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"if",
"(",
"isNamesDrawable",
"==",
"null",
")",
"{",
"prefs",
".",
"remove",
"(",
"\"DRAW_BUS_STOPS_NAMES\"",
")",
";",
"//$NON-NLS-1$",
"}",
"else",
"{",
"prefs",
".",
"putBoolean",
"(",
"\"DRAW_BUS_STOPS_NAMES\"",
",",
"isNamesDrawable",
".",
"booleanValue",
"(",
")",
")",
";",
"//$NON-NLS-1$",
"}",
"try",
"{",
"prefs",
".",
"sync",
"(",
")",
";",
"}",
"catch",
"(",
"BackingStoreException",
"exception",
")",
"{",
"//",
"}",
"}",
"}"
] | Set if the bus stops should be drawn or not.
@param isNamesDrawable is <code>true</code> if the bus stops names are drawable;
<code>false</code> if the bus stops names are not drawable; or <code>null</code>
if the default value must be restored. | [
"Set",
"if",
"the",
"bus",
"stops",
"should",
"be",
"drawn",
"or",
"not",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L230-L244 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.isBusStopNoHaltBindingDrawable | @Pure
public static boolean isBusStopNoHaltBindingDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_NO_BUS_HALT_BIND", DEFAULT_NO_BUS_HALT_BIND); //$NON-NLS-1$
}
return DEFAULT_NO_BUS_HALT_BIND;
} | java | @Pure
public static boolean isBusStopNoHaltBindingDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_NO_BUS_HALT_BIND", DEFAULT_NO_BUS_HALT_BIND); //$NON-NLS-1$
}
return DEFAULT_NO_BUS_HALT_BIND;
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isBusStopNoHaltBindingDrawable",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"return",
"prefs",
".",
"getBoolean",
"(",
"\"DRAW_NO_BUS_HALT_BIND\"",
",",
"DEFAULT_NO_BUS_HALT_BIND",
")",
";",
"//$NON-NLS-1$",
"}",
"return",
"DEFAULT_NO_BUS_HALT_BIND",
";",
"}"
] | Replies if the bus stops with no binding to bus halt
should be drawn or not.
@return <code>true</code> if the bus stops name with no binding are drawable;
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"bus",
"stops",
"with",
"no",
"binding",
"to",
"bus",
"halt",
"should",
"be",
"drawn",
"or",
"not",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L252-L259 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.setBusStopNoHaltBindingDrawable | public static void setBusStopNoHaltBindingDrawable(Boolean isDrawable) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isDrawable == null) {
prefs.remove("DRAW_NO_BUS_HALT_BIND"); //$NON-NLS-1$
} else {
prefs.putBoolean("DRAW_NO_BUS_HALT_BIND", isDrawable.booleanValue()); //$NON-NLS-1$
}
try {
prefs.sync();
} catch (BackingStoreException exception) {
//
}
}
} | java | public static void setBusStopNoHaltBindingDrawable(Boolean isDrawable) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isDrawable == null) {
prefs.remove("DRAW_NO_BUS_HALT_BIND"); //$NON-NLS-1$
} else {
prefs.putBoolean("DRAW_NO_BUS_HALT_BIND", isDrawable.booleanValue()); //$NON-NLS-1$
}
try {
prefs.sync();
} catch (BackingStoreException exception) {
//
}
}
} | [
"public",
"static",
"void",
"setBusStopNoHaltBindingDrawable",
"(",
"Boolean",
"isDrawable",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"if",
"(",
"isDrawable",
"==",
"null",
")",
"{",
"prefs",
".",
"remove",
"(",
"\"DRAW_NO_BUS_HALT_BIND\"",
")",
";",
"//$NON-NLS-1$",
"}",
"else",
"{",
"prefs",
".",
"putBoolean",
"(",
"\"DRAW_NO_BUS_HALT_BIND\"",
",",
"isDrawable",
".",
"booleanValue",
"(",
")",
")",
";",
"//$NON-NLS-1$",
"}",
"try",
"{",
"prefs",
".",
"sync",
"(",
")",
";",
"}",
"catch",
"(",
"BackingStoreException",
"exception",
")",
"{",
"//",
"}",
"}",
"}"
] | Set if the bus stops stops with no binding to bus halt
should be drawn or not.
@param isDrawable is <code>true</code> if the bus stops name with no binding are drawable;
<code>false</code> if the bus stops name with no binding are not drawable; or <code>null</code>
if the default value must be restored. | [
"Set",
"if",
"the",
"bus",
"stops",
"stops",
"with",
"no",
"binding",
"to",
"bus",
"halt",
"should",
"be",
"drawn",
"or",
"not",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L268-L282 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.isBusStopNoHaltBindingNamesDrawable | @Pure
public static boolean isBusStopNoHaltBindingNamesDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_NO_BUS_HALT_BIND_NAMES", DEFAULT_NO_BUS_HALT_BIND_NAMES); //$NON-NLS-1$
}
return DEFAULT_NO_BUS_HALT_BIND_NAMES;
} | java | @Pure
public static boolean isBusStopNoHaltBindingNamesDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_NO_BUS_HALT_BIND_NAMES", DEFAULT_NO_BUS_HALT_BIND_NAMES); //$NON-NLS-1$
}
return DEFAULT_NO_BUS_HALT_BIND_NAMES;
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isBusStopNoHaltBindingNamesDrawable",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"return",
"prefs",
".",
"getBoolean",
"(",
"\"DRAW_NO_BUS_HALT_BIND_NAMES\"",
",",
"DEFAULT_NO_BUS_HALT_BIND_NAMES",
")",
";",
"//$NON-NLS-1$",
"}",
"return",
"DEFAULT_NO_BUS_HALT_BIND_NAMES",
";",
"}"
] | Replies if the bus stops with no binding to bus halt
should have their names drawn or not.
@return <code>true</code> if the bus stops name with no binding are drawable;
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"bus",
"stops",
"with",
"no",
"binding",
"to",
"bus",
"halt",
"should",
"have",
"their",
"names",
"drawn",
"or",
"not",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L290-L297 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.isAttributeExhibitable | @Pure
public static boolean isAttributeExhibitable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("EXHIBIT_ATTRIBUTES", DEFAULT_ATTRIBUTE_EXHIBITION); //$NON-NLS-1$
}
return DEFAULT_ATTRIBUTE_EXHIBITION;
} | java | @Pure
public static boolean isAttributeExhibitable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("EXHIBIT_ATTRIBUTES", DEFAULT_ATTRIBUTE_EXHIBITION); //$NON-NLS-1$
}
return DEFAULT_ATTRIBUTE_EXHIBITION;
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"isAttributeExhibitable",
"(",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"return",
"prefs",
".",
"getBoolean",
"(",
"\"EXHIBIT_ATTRIBUTES\"",
",",
"DEFAULT_ATTRIBUTE_EXHIBITION",
")",
";",
"//$NON-NLS-1$",
"}",
"return",
"DEFAULT_ATTRIBUTE_EXHIBITION",
";",
"}"
] | Replies if the attributes of the bus network elements
should be exhibited by the layers that are displaying
them.
For example, a BusLineLayer may exhibit the BusLine
attributes.
@return <code>true</code> if the bus stops are drawable;
otherwise <code>false</code> | [
"Replies",
"if",
"the",
"attributes",
"of",
"the",
"bus",
"network",
"elements",
"should",
"be",
"exhibited",
"by",
"the",
"layers",
"that",
"are",
"displaying",
"them",
".",
"For",
"example",
"a",
"BusLineLayer",
"may",
"exhibit",
"the",
"BusLine",
"attributes",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L331-L338 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java | BusLayerConstants.setAttributeExhibitable | public static void setAttributeExhibitable(Boolean isExhibit) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isExhibit == null) {
prefs.remove("EXHIBIT_ATTRIBUTES"); //$NON-NLS-1$
} else {
prefs.putBoolean("EXHIBIT_ATTRIBUTES", isExhibit.booleanValue()); //$NON-NLS-1$
}
try {
prefs.sync();
} catch (BackingStoreException exception) {
//
}
}
} | java | public static void setAttributeExhibitable(Boolean isExhibit) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isExhibit == null) {
prefs.remove("EXHIBIT_ATTRIBUTES"); //$NON-NLS-1$
} else {
prefs.putBoolean("EXHIBIT_ATTRIBUTES", isExhibit.booleanValue()); //$NON-NLS-1$
}
try {
prefs.sync();
} catch (BackingStoreException exception) {
//
}
}
} | [
"public",
"static",
"void",
"setAttributeExhibitable",
"(",
"Boolean",
"isExhibit",
")",
"{",
"final",
"Preferences",
"prefs",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"BusLayerConstants",
".",
"class",
")",
";",
"if",
"(",
"prefs",
"!=",
"null",
")",
"{",
"if",
"(",
"isExhibit",
"==",
"null",
")",
"{",
"prefs",
".",
"remove",
"(",
"\"EXHIBIT_ATTRIBUTES\"",
")",
";",
"//$NON-NLS-1$",
"}",
"else",
"{",
"prefs",
".",
"putBoolean",
"(",
"\"EXHIBIT_ATTRIBUTES\"",
",",
"isExhibit",
".",
"booleanValue",
"(",
")",
")",
";",
"//$NON-NLS-1$",
"}",
"try",
"{",
"prefs",
".",
"sync",
"(",
")",
";",
"}",
"catch",
"(",
"BackingStoreException",
"exception",
")",
"{",
"//",
"}",
"}",
"}"
] | Set if the attributes of the bus network elements
should be exhibited by the layers that are displaying
them.
For example, a BusLineLayer may exhibit the BusLine
attributes.
@param isExhibit is <code>true</code> if the attributes are exhibited by the layers;
<code>false</code> if the attributes are not exhibited; or <code>null</code>
if the default value must be restored. | [
"Set",
"if",
"the",
"attributes",
"of",
"the",
"bus",
"network",
"elements",
"should",
"be",
"exhibited",
"by",
"the",
"layers",
"that",
"are",
"displaying",
"them",
".",
"For",
"example",
"a",
"BusLineLayer",
"may",
"exhibit",
"the",
"BusLine",
"attributes",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLayerConstants.java#L350-L364 | train |
kbss-cvut/jb4jsonld-jackson | src/main/java/cz/cvut/kbss/jsonld/jackson/JsonLdModule.java | JsonLdModule.configure | public JsonLdModule configure(ConfigParam param, String value) {
Objects.requireNonNull(param);
configuration.set(param, value);
return this;
} | java | public JsonLdModule configure(ConfigParam param, String value) {
Objects.requireNonNull(param);
configuration.set(param, value);
return this;
} | [
"public",
"JsonLdModule",
"configure",
"(",
"ConfigParam",
"param",
",",
"String",
"value",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"param",
")",
";",
"configuration",
".",
"set",
"(",
"param",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Configure this module with additional parameters.
@param param Parameter to set
@param value New value of the parameter
@return This instance | [
"Configure",
"this",
"module",
"with",
"additional",
"parameters",
"."
] | 89ec8bd23250003300c484fdf676e3c5178d1486 | https://github.com/kbss-cvut/jb4jsonld-jackson/blob/89ec8bd23250003300c484fdf676e3c5178d1486/src/main/java/cz/cvut/kbss/jsonld/jackson/JsonLdModule.java#L48-L52 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java | QuadTreeNode.setFirstChild | public boolean setFirstChild(N newChild) {
final N oldChild = this.nNorthWest;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nNorthWest = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(0, newChild);
}
return true;
} | java | public boolean setFirstChild(N newChild) {
final N oldChild = this.nNorthWest;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nNorthWest = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(0, newChild);
}
return true;
} | [
"public",
"boolean",
"setFirstChild",
"(",
"N",
"newChild",
")",
"{",
"final",
"N",
"oldChild",
"=",
"this",
".",
"nNorthWest",
";",
"if",
"(",
"oldChild",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"oldChild",
"!=",
"null",
")",
"{",
"oldChild",
".",
"setParentNodeReference",
"(",
"null",
",",
"true",
")",
";",
"--",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildRemoved",
"(",
"0",
",",
"oldChild",
")",
";",
"}",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"final",
"N",
"oldParent",
"=",
"newChild",
".",
"getParentNode",
"(",
")",
";",
"if",
"(",
"oldParent",
"!=",
"this",
")",
"{",
"newChild",
".",
"removeFromParent",
"(",
")",
";",
"}",
"}",
"this",
".",
"nNorthWest",
"=",
"newChild",
";",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"newChild",
".",
"setParentNodeReference",
"(",
"toN",
"(",
")",
",",
"true",
")",
";",
"++",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildAdded",
"(",
"0",
",",
"newChild",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Set the first child of this node.
@param newChild is the new child for the first zone
@return <code>true</code> on success, otherwhise <code>false</code> | [
"Set",
"the",
"first",
"child",
"of",
"this",
"node",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java#L245-L273 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java | QuadTreeNode.setSecondChild | public boolean setSecondChild(N newChild) {
final N oldChild = this.nNorthEast;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nNorthEast = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(1, newChild);
}
return true;
} | java | public boolean setSecondChild(N newChild) {
final N oldChild = this.nNorthEast;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nNorthEast = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(1, newChild);
}
return true;
} | [
"public",
"boolean",
"setSecondChild",
"(",
"N",
"newChild",
")",
"{",
"final",
"N",
"oldChild",
"=",
"this",
".",
"nNorthEast",
";",
"if",
"(",
"oldChild",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"oldChild",
"!=",
"null",
")",
"{",
"oldChild",
".",
"setParentNodeReference",
"(",
"null",
",",
"true",
")",
";",
"--",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildRemoved",
"(",
"1",
",",
"oldChild",
")",
";",
"}",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"final",
"N",
"oldParent",
"=",
"newChild",
".",
"getParentNode",
"(",
")",
";",
"if",
"(",
"oldParent",
"!=",
"this",
")",
"{",
"newChild",
".",
"removeFromParent",
"(",
")",
";",
"}",
"}",
"this",
".",
"nNorthEast",
"=",
"newChild",
";",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"newChild",
".",
"setParentNodeReference",
"(",
"toN",
"(",
")",
",",
"true",
")",
";",
"++",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildAdded",
"(",
"1",
",",
"newChild",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Set the second child of this node.
@param newChild is the new child for the second zone
@return <code>true</code> on success, otherwhise <code>false</code> | [
"Set",
"the",
"second",
"child",
"of",
"this",
"node",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java#L289-L317 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java | QuadTreeNode.setThirdChild | public boolean setThirdChild(N newChild) {
final N oldChild = this.nSouthWest;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(2, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nSouthWest = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(2, newChild);
}
return true;
} | java | public boolean setThirdChild(N newChild) {
final N oldChild = this.nSouthWest;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(2, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nSouthWest = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(2, newChild);
}
return true;
} | [
"public",
"boolean",
"setThirdChild",
"(",
"N",
"newChild",
")",
"{",
"final",
"N",
"oldChild",
"=",
"this",
".",
"nSouthWest",
";",
"if",
"(",
"oldChild",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"oldChild",
"!=",
"null",
")",
"{",
"oldChild",
".",
"setParentNodeReference",
"(",
"null",
",",
"true",
")",
";",
"--",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildRemoved",
"(",
"2",
",",
"oldChild",
")",
";",
"}",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"final",
"N",
"oldParent",
"=",
"newChild",
".",
"getParentNode",
"(",
")",
";",
"if",
"(",
"oldParent",
"!=",
"this",
")",
"{",
"newChild",
".",
"removeFromParent",
"(",
")",
";",
"}",
"}",
"this",
".",
"nSouthWest",
"=",
"newChild",
";",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"newChild",
".",
"setParentNodeReference",
"(",
"toN",
"(",
")",
",",
"true",
")",
";",
"++",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildAdded",
"(",
"2",
",",
"newChild",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Set the third child of this node.
@param newChild is the new child for the third zone
@return <code>true</code> on success, otherwhise <code>false</code> | [
"Set",
"the",
"third",
"child",
"of",
"this",
"node",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java#L333-L361 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java | QuadTreeNode.setFourthChild | public boolean setFourthChild(N newChild) {
final N oldChild = this.nSouthEast;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(3, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nSouthEast = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(3, newChild);
}
return true;
} | java | public boolean setFourthChild(N newChild) {
final N oldChild = this.nSouthEast;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(3, oldChild);
}
if (newChild != null) {
final N oldParent = newChild.getParentNode();
if (oldParent != this) {
newChild.removeFromParent();
}
}
this.nSouthEast = newChild;
if (newChild != null) {
newChild.setParentNodeReference(toN(), true);
++this.notNullChildCount;
firePropertyChildAdded(3, newChild);
}
return true;
} | [
"public",
"boolean",
"setFourthChild",
"(",
"N",
"newChild",
")",
"{",
"final",
"N",
"oldChild",
"=",
"this",
".",
"nSouthEast",
";",
"if",
"(",
"oldChild",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"oldChild",
"!=",
"null",
")",
"{",
"oldChild",
".",
"setParentNodeReference",
"(",
"null",
",",
"true",
")",
";",
"--",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildRemoved",
"(",
"3",
",",
"oldChild",
")",
";",
"}",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"final",
"N",
"oldParent",
"=",
"newChild",
".",
"getParentNode",
"(",
")",
";",
"if",
"(",
"oldParent",
"!=",
"this",
")",
"{",
"newChild",
".",
"removeFromParent",
"(",
")",
";",
"}",
"}",
"this",
".",
"nSouthEast",
"=",
"newChild",
";",
"if",
"(",
"newChild",
"!=",
"null",
")",
"{",
"newChild",
".",
"setParentNodeReference",
"(",
"toN",
"(",
")",
",",
"true",
")",
";",
"++",
"this",
".",
"notNullChildCount",
";",
"firePropertyChildAdded",
"(",
"3",
",",
"newChild",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Set the Fourth child of this node.
@param newChild is the new child for the fourth zone
@return <code>true</code> on success, otherwhise <code>false</code> | [
"Set",
"the",
"Fourth",
"child",
"of",
"this",
"node",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java#L377-L405 | train |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java | QuadTreeNode.setChildAt | public boolean setChildAt(QuadTreeZone zone, N newChild) {
switch (zone) {
case NORTH_WEST:
return setFirstChild(newChild);
case NORTH_EAST:
return setSecondChild(newChild);
case SOUTH_WEST:
return setThirdChild(newChild);
case SOUTH_EAST:
return setFourthChild(newChild);
default:
}
return false;
} | java | public boolean setChildAt(QuadTreeZone zone, N newChild) {
switch (zone) {
case NORTH_WEST:
return setFirstChild(newChild);
case NORTH_EAST:
return setSecondChild(newChild);
case SOUTH_WEST:
return setThirdChild(newChild);
case SOUTH_EAST:
return setFourthChild(newChild);
default:
}
return false;
} | [
"public",
"boolean",
"setChildAt",
"(",
"QuadTreeZone",
"zone",
",",
"N",
"newChild",
")",
"{",
"switch",
"(",
"zone",
")",
"{",
"case",
"NORTH_WEST",
":",
"return",
"setFirstChild",
"(",
"newChild",
")",
";",
"case",
"NORTH_EAST",
":",
"return",
"setSecondChild",
"(",
"newChild",
")",
";",
"case",
"SOUTH_WEST",
":",
"return",
"setThirdChild",
"(",
"newChild",
")",
";",
"case",
"SOUTH_EAST",
":",
"return",
"setFourthChild",
"(",
"newChild",
")",
";",
"default",
":",
"}",
"return",
"false",
";",
"}"
] | Set the child at the specified zone.
@param zone is the zone to set
@param newChild is the new node for the given zone
@return <code>true</code> on success, <code>false</code> otherwise | [
"Set",
"the",
"child",
"at",
"the",
"specified",
"zone",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java#L457-L470 | train |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/Path3dfx.java | Path3dfx.remove | @SuppressWarnings({"checkstyle:magicnumber", "checkstyle:cyclomaticcomplexity"})
public boolean remove(Point3D<?, ?> point) {
if (this.types != null && !this.types.isEmpty() && this.coords != null && !this.coords.isEmpty()) {
for (int i = 0, j = 0; i < this.coords.size() && j < this.types.size(); j++) {
final Point3dfx currentPoint = this.coords.get(i);
switch (this.types.get(j)) {
case MOVE_TO:
//$FALL-THROUGH$
case LINE_TO:
if (point.equals(currentPoint)) {
this.coords.remove(i);
this.types.remove(j);
return true;
}
i++;
break;
case CURVE_TO:
final Point3dfx p2 = this.coords.get(i + 1);
final Point3dfx p3 = this.coords.get(i + 2);
if ((point.equals(currentPoint))
|| (point.equals(p2))
|| (point.equals(p3))) {
this.coords.remove(i, i + 3);
this.types.remove(j);
return true;
}
i += 3;
break;
case QUAD_TO:
final Point3dfx pt = this.coords.get(i + 1);
if ((point.equals(currentPoint))
|| (point.equals(pt))) {
this.coords.remove(i, i + 2);
this.types.remove(j);
return true;
}
i += 2;
break;
case ARC_TO:
throw new IllegalStateException();
//$CASES-OMITTED$
default:
break;
}
}
}
return false;
} | java | @SuppressWarnings({"checkstyle:magicnumber", "checkstyle:cyclomaticcomplexity"})
public boolean remove(Point3D<?, ?> point) {
if (this.types != null && !this.types.isEmpty() && this.coords != null && !this.coords.isEmpty()) {
for (int i = 0, j = 0; i < this.coords.size() && j < this.types.size(); j++) {
final Point3dfx currentPoint = this.coords.get(i);
switch (this.types.get(j)) {
case MOVE_TO:
//$FALL-THROUGH$
case LINE_TO:
if (point.equals(currentPoint)) {
this.coords.remove(i);
this.types.remove(j);
return true;
}
i++;
break;
case CURVE_TO:
final Point3dfx p2 = this.coords.get(i + 1);
final Point3dfx p3 = this.coords.get(i + 2);
if ((point.equals(currentPoint))
|| (point.equals(p2))
|| (point.equals(p3))) {
this.coords.remove(i, i + 3);
this.types.remove(j);
return true;
}
i += 3;
break;
case QUAD_TO:
final Point3dfx pt = this.coords.get(i + 1);
if ((point.equals(currentPoint))
|| (point.equals(pt))) {
this.coords.remove(i, i + 2);
this.types.remove(j);
return true;
}
i += 2;
break;
case ARC_TO:
throw new IllegalStateException();
//$CASES-OMITTED$
default:
break;
}
}
}
return false;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"checkstyle:magicnumber\"",
",",
"\"checkstyle:cyclomaticcomplexity\"",
"}",
")",
"public",
"boolean",
"remove",
"(",
"Point3D",
"<",
"?",
",",
"?",
">",
"point",
")",
"{",
"if",
"(",
"this",
".",
"types",
"!=",
"null",
"&&",
"!",
"this",
".",
"types",
".",
"isEmpty",
"(",
")",
"&&",
"this",
".",
"coords",
"!=",
"null",
"&&",
"!",
"this",
".",
"coords",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"j",
"=",
"0",
";",
"i",
"<",
"this",
".",
"coords",
".",
"size",
"(",
")",
"&&",
"j",
"<",
"this",
".",
"types",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"{",
"final",
"Point3dfx",
"currentPoint",
"=",
"this",
".",
"coords",
".",
"get",
"(",
"i",
")",
";",
"switch",
"(",
"this",
".",
"types",
".",
"get",
"(",
"j",
")",
")",
"{",
"case",
"MOVE_TO",
":",
"//$FALL-THROUGH$",
"case",
"LINE_TO",
":",
"if",
"(",
"point",
".",
"equals",
"(",
"currentPoint",
")",
")",
"{",
"this",
".",
"coords",
".",
"remove",
"(",
"i",
")",
";",
"this",
".",
"types",
".",
"remove",
"(",
"j",
")",
";",
"return",
"true",
";",
"}",
"i",
"++",
";",
"break",
";",
"case",
"CURVE_TO",
":",
"final",
"Point3dfx",
"p2",
"=",
"this",
".",
"coords",
".",
"get",
"(",
"i",
"+",
"1",
")",
";",
"final",
"Point3dfx",
"p3",
"=",
"this",
".",
"coords",
".",
"get",
"(",
"i",
"+",
"2",
")",
";",
"if",
"(",
"(",
"point",
".",
"equals",
"(",
"currentPoint",
")",
")",
"||",
"(",
"point",
".",
"equals",
"(",
"p2",
")",
")",
"||",
"(",
"point",
".",
"equals",
"(",
"p3",
")",
")",
")",
"{",
"this",
".",
"coords",
".",
"remove",
"(",
"i",
",",
"i",
"+",
"3",
")",
";",
"this",
".",
"types",
".",
"remove",
"(",
"j",
")",
";",
"return",
"true",
";",
"}",
"i",
"+=",
"3",
";",
"break",
";",
"case",
"QUAD_TO",
":",
"final",
"Point3dfx",
"pt",
"=",
"this",
".",
"coords",
".",
"get",
"(",
"i",
"+",
"1",
")",
";",
"if",
"(",
"(",
"point",
".",
"equals",
"(",
"currentPoint",
")",
")",
"||",
"(",
"point",
".",
"equals",
"(",
"pt",
")",
")",
")",
"{",
"this",
".",
"coords",
".",
"remove",
"(",
"i",
",",
"i",
"+",
"2",
")",
";",
"this",
".",
"types",
".",
"remove",
"(",
"j",
")",
";",
"return",
"true",
";",
"}",
"i",
"+=",
"2",
";",
"break",
";",
"case",
"ARC_TO",
":",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"//$CASES-OMITTED$",
"default",
":",
"break",
";",
"}",
"}",
"}",
"return",
"false",
";",
"}"
] | Remove the point from this path.
<p>If the given point do not match exactly a point in the path, nothing is removed.
@param point the point to remove.
@return <code>true</code> if the point was removed; <code>false</code> otherwise. | [
"Remove",
"the",
"point",
"from",
"this",
"path",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/Path3dfx.java#L807-L854 | train |
BBN-E/bue-common-open | nlp-core-open/src/main/java/com/bbn/nlp/edl/EDLLoader.java | EDLLoader.loadEDLMentionsByDocFrom | public ImmutableListMultimap<Symbol, EDLMention> loadEDLMentionsByDocFrom(CharSource source) throws IOException {
final ImmutableList<EDLMention> edlMentions = loadEDLMentionsFrom(source);
final ImmutableListMultimap.Builder<Symbol, EDLMention> byDocs =
ImmutableListMultimap.<Symbol, EDLMention>builder()
.orderKeysBy(SymbolUtils.byStringOrdering());
for (final EDLMention edlMention : edlMentions) {
byDocs.put(edlMention.documentID(), edlMention);
}
return byDocs.build();
} | java | public ImmutableListMultimap<Symbol, EDLMention> loadEDLMentionsByDocFrom(CharSource source) throws IOException {
final ImmutableList<EDLMention> edlMentions = loadEDLMentionsFrom(source);
final ImmutableListMultimap.Builder<Symbol, EDLMention> byDocs =
ImmutableListMultimap.<Symbol, EDLMention>builder()
.orderKeysBy(SymbolUtils.byStringOrdering());
for (final EDLMention edlMention : edlMentions) {
byDocs.put(edlMention.documentID(), edlMention);
}
return byDocs.build();
} | [
"public",
"ImmutableListMultimap",
"<",
"Symbol",
",",
"EDLMention",
">",
"loadEDLMentionsByDocFrom",
"(",
"CharSource",
"source",
")",
"throws",
"IOException",
"{",
"final",
"ImmutableList",
"<",
"EDLMention",
">",
"edlMentions",
"=",
"loadEDLMentionsFrom",
"(",
"source",
")",
";",
"final",
"ImmutableListMultimap",
".",
"Builder",
"<",
"Symbol",
",",
"EDLMention",
">",
"byDocs",
"=",
"ImmutableListMultimap",
".",
"<",
"Symbol",
",",
"EDLMention",
">",
"builder",
"(",
")",
".",
"orderKeysBy",
"(",
"SymbolUtils",
".",
"byStringOrdering",
"(",
")",
")",
";",
"for",
"(",
"final",
"EDLMention",
"edlMention",
":",
"edlMentions",
")",
"{",
"byDocs",
".",
"put",
"(",
"edlMention",
".",
"documentID",
"(",
")",
",",
"edlMention",
")",
";",
"}",
"return",
"byDocs",
".",
"build",
"(",
")",
";",
"}"
] | Loads EDL mentions, grouped by document. Multimap keys are in alphabetical order
by document ID. | [
"Loads",
"EDL",
"mentions",
"grouped",
"by",
"document",
".",
"Multimap",
"keys",
"are",
"in",
"alphabetical",
"order",
"by",
"document",
"ID",
"."
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/nlp-core-open/src/main/java/com/bbn/nlp/edl/EDLLoader.java#L48-L57 | train |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatControllerOutput.java | DssatControllerOutput.writeSingleExp | private void writeSingleExp(String arg0, Map result, DssatCommonOutput output, String file) {
futFiles.put(file, executor.submit(new DssatTranslateRunner(output, result, arg0)));
} | java | private void writeSingleExp(String arg0, Map result, DssatCommonOutput output, String file) {
futFiles.put(file, executor.submit(new DssatTranslateRunner(output, result, arg0)));
} | [
"private",
"void",
"writeSingleExp",
"(",
"String",
"arg0",
",",
"Map",
"result",
",",
"DssatCommonOutput",
"output",
",",
"String",
"file",
")",
"{",
"futFiles",
".",
"put",
"(",
"file",
",",
"executor",
".",
"submit",
"(",
"new",
"DssatTranslateRunner",
"(",
"output",
",",
"result",
",",
"arg0",
")",
")",
")",
";",
"}"
] | Write files and add file objects in the array
@param arg0 file output path
@param result data holder object
@param output DSSAT translator object
@param file Generated DSSAT file identifier | [
"Write",
"files",
"and",
"add",
"file",
"objects",
"in",
"the",
"array"
] | 4be61d998f106eb7234ea8701b63c3746ae688f4 | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatControllerOutput.java#L274-L276 | train |
gallandarakhneorg/afc | core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d3/i/Vector3i.java | Vector3i.convert | public static Vector3i convert(Tuple3D<?> tuple) {
if (tuple instanceof Vector3i) {
return (Vector3i) tuple;
}
return new Vector3i(tuple.getX(), tuple.getY(), tuple.getZ());
} | java | public static Vector3i convert(Tuple3D<?> tuple) {
if (tuple instanceof Vector3i) {
return (Vector3i) tuple;
}
return new Vector3i(tuple.getX(), tuple.getY(), tuple.getZ());
} | [
"public",
"static",
"Vector3i",
"convert",
"(",
"Tuple3D",
"<",
"?",
">",
"tuple",
")",
"{",
"if",
"(",
"tuple",
"instanceof",
"Vector3i",
")",
"{",
"return",
"(",
"Vector3i",
")",
"tuple",
";",
"}",
"return",
"new",
"Vector3i",
"(",
"tuple",
".",
"getX",
"(",
")",
",",
"tuple",
".",
"getY",
"(",
")",
",",
"tuple",
".",
"getZ",
"(",
")",
")",
";",
"}"
] | Convert the given tuple to a real Vector3i.
<p>If the given tuple is already a Vector3i, it is replied.
@param tuple the tuple.
@return the Vector3i.
@since 14.0 | [
"Convert",
"the",
"given",
"tuple",
"to",
"a",
"real",
"Vector3i",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d3/i/Vector3i.java#L116-L121 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.getFirstFreeBusHubName | @Pure
public static String getFirstFreeBusHubName(BusNetwork busnetwork) {
int nb = busnetwork.getBusHubCount();
String name;
do {
++nb;
name = Locale.getString(
"NAME_TEMPLATE", //$NON-NLS-1$
Integer.toString(nb));
}
while (busnetwork.getBusHub(name) != null);
return name;
} | java | @Pure
public static String getFirstFreeBusHubName(BusNetwork busnetwork) {
int nb = busnetwork.getBusHubCount();
String name;
do {
++nb;
name = Locale.getString(
"NAME_TEMPLATE", //$NON-NLS-1$
Integer.toString(nb));
}
while (busnetwork.getBusHub(name) != null);
return name;
} | [
"@",
"Pure",
"public",
"static",
"String",
"getFirstFreeBusHubName",
"(",
"BusNetwork",
"busnetwork",
")",
"{",
"int",
"nb",
"=",
"busnetwork",
".",
"getBusHubCount",
"(",
")",
";",
"String",
"name",
";",
"do",
"{",
"++",
"nb",
";",
"name",
"=",
"Locale",
".",
"getString",
"(",
"\"NAME_TEMPLATE\"",
",",
"//$NON-NLS-1$",
"Integer",
".",
"toString",
"(",
"nb",
")",
")",
";",
"}",
"while",
"(",
"busnetwork",
".",
"getBusHub",
"(",
"name",
")",
"!=",
"null",
")",
";",
"return",
"name",
";",
"}"
] | Replies a bus hub name that was not exist in the specified
bus network.
@param busnetwork is the bus network from which a free bus hub name may be computed.
@return a name suitable for a bus hub. | [
"Replies",
"a",
"bus",
"hub",
"name",
"that",
"was",
"not",
"exist",
"in",
"the",
"specified",
"bus",
"network",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L108-L120 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.getGeoLocation | @Override
@Pure
public GeoLocation getGeoLocation() {
final Rectangle2d b = getBoundingBox();
if (b == null) {
return new GeoLocationNowhere(getUUID());
}
return new GeoLocationPoint(b.getCenterX(), b.getCenterY());
} | java | @Override
@Pure
public GeoLocation getGeoLocation() {
final Rectangle2d b = getBoundingBox();
if (b == null) {
return new GeoLocationNowhere(getUUID());
}
return new GeoLocationPoint(b.getCenterX(), b.getCenterY());
} | [
"@",
"Override",
"@",
"Pure",
"public",
"GeoLocation",
"getGeoLocation",
"(",
")",
"{",
"final",
"Rectangle2d",
"b",
"=",
"getBoundingBox",
"(",
")",
";",
"if",
"(",
"b",
"==",
"null",
")",
"{",
"return",
"new",
"GeoLocationNowhere",
"(",
"getUUID",
"(",
")",
")",
";",
"}",
"return",
"new",
"GeoLocationPoint",
"(",
"b",
".",
"getCenterX",
"(",
")",
",",
"b",
".",
"getCenterY",
"(",
")",
")",
";",
"}"
] | Replies the geo-location of this hub.
@return the geo-location of the hub, never <code>null</code>. | [
"Replies",
"the",
"geo",
"-",
"location",
"of",
"this",
"hub",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L175-L183 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.distance | @Pure
public double distance(double x, double y) {
double dist = Double.POSITIVE_INFINITY;
if (isValidPrimitive()) {
for (final BusStop stop : this.busStops) {
final double d = stop.distance(x, y);
if (!Double.isNaN(d) && d < dist) {
dist = d;
}
}
}
return Double.isInfinite(dist) ? Double.NaN : dist;
} | java | @Pure
public double distance(double x, double y) {
double dist = Double.POSITIVE_INFINITY;
if (isValidPrimitive()) {
for (final BusStop stop : this.busStops) {
final double d = stop.distance(x, y);
if (!Double.isNaN(d) && d < dist) {
dist = d;
}
}
}
return Double.isInfinite(dist) ? Double.NaN : dist;
} | [
"@",
"Pure",
"public",
"double",
"distance",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"double",
"dist",
"=",
"Double",
".",
"POSITIVE_INFINITY",
";",
"if",
"(",
"isValidPrimitive",
"(",
")",
")",
"{",
"for",
"(",
"final",
"BusStop",
"stop",
":",
"this",
".",
"busStops",
")",
"{",
"final",
"double",
"d",
"=",
"stop",
".",
"distance",
"(",
"x",
",",
"y",
")",
";",
"if",
"(",
"!",
"Double",
".",
"isNaN",
"(",
"d",
")",
"&&",
"d",
"<",
"dist",
")",
"{",
"dist",
"=",
"d",
";",
"}",
"}",
"}",
"return",
"Double",
".",
"isInfinite",
"(",
"dist",
")",
"?",
"Double",
".",
"NaN",
":",
"dist",
";",
"}"
] | Replies the distance between the given point and this bus hub.
<p>The distance to the hub is the distance to the nearest bus stop
located in the hub.
@param x x coordinate.
@param y y coordinate.
@return the distance to this bus hub | [
"Replies",
"the",
"distance",
"between",
"the",
"given",
"point",
"and",
"this",
"bus",
"hub",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L316-L328 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.addBusStop | boolean addBusStop(BusStop busStop, boolean fireEvents) {
if (busStop == null) {
return false;
}
if (this.busStops.indexOf(busStop) != -1) {
return false;
}
if (!this.busStops.add(busStop)) {
return false;
}
busStop.addBusHub(this);
resetBoundingBox();
if (fireEvents) {
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.STOP_ADDED,
busStop,
this.busStops.size() - 1,
null,
null,
null));
checkPrimitiveValidity();
}
return true;
} | java | boolean addBusStop(BusStop busStop, boolean fireEvents) {
if (busStop == null) {
return false;
}
if (this.busStops.indexOf(busStop) != -1) {
return false;
}
if (!this.busStops.add(busStop)) {
return false;
}
busStop.addBusHub(this);
resetBoundingBox();
if (fireEvents) {
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.STOP_ADDED,
busStop,
this.busStops.size() - 1,
null,
null,
null));
checkPrimitiveValidity();
}
return true;
} | [
"boolean",
"addBusStop",
"(",
"BusStop",
"busStop",
",",
"boolean",
"fireEvents",
")",
"{",
"if",
"(",
"busStop",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"busStops",
".",
"indexOf",
"(",
"busStop",
")",
"!=",
"-",
"1",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"this",
".",
"busStops",
".",
"add",
"(",
"busStop",
")",
")",
"{",
"return",
"false",
";",
"}",
"busStop",
".",
"addBusHub",
"(",
"this",
")",
";",
"resetBoundingBox",
"(",
")",
";",
"if",
"(",
"fireEvents",
")",
"{",
"firePrimitiveChanged",
"(",
"new",
"BusChangeEvent",
"(",
"this",
",",
"BusChangeEventType",
".",
"STOP_ADDED",
",",
"busStop",
",",
"this",
".",
"busStops",
".",
"size",
"(",
")",
"-",
"1",
",",
"null",
",",
"null",
",",
"null",
")",
")",
";",
"checkPrimitiveValidity",
"(",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Add a bus stop inside the bus hub.
@param busStop is the bus stop to insert.
@param fireEvents indicates if the events should be fired and the validity checked.
@return <code>true</code> if the bus stop was added, otherwise <code>false</code> | [
"Add",
"a",
"bus",
"stop",
"inside",
"the",
"bus",
"hub",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L377-L400 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.removeAllBusStops | public void removeAllBusStops() {
for (final BusStop busStop : this.busStops) {
busStop.removeBusHub(this);
}
this.busStops.clear();
resetBoundingBox();
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.ALL_STOPS_REMOVED,
null,
-1,
null,
null,
null));
checkPrimitiveValidity();
} | java | public void removeAllBusStops() {
for (final BusStop busStop : this.busStops) {
busStop.removeBusHub(this);
}
this.busStops.clear();
resetBoundingBox();
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.ALL_STOPS_REMOVED,
null,
-1,
null,
null,
null));
checkPrimitiveValidity();
} | [
"public",
"void",
"removeAllBusStops",
"(",
")",
"{",
"for",
"(",
"final",
"BusStop",
"busStop",
":",
"this",
".",
"busStops",
")",
"{",
"busStop",
".",
"removeBusHub",
"(",
"this",
")",
";",
"}",
"this",
".",
"busStops",
".",
"clear",
"(",
")",
";",
"resetBoundingBox",
"(",
")",
";",
"firePrimitiveChanged",
"(",
"new",
"BusChangeEvent",
"(",
"this",
",",
"BusChangeEventType",
".",
"ALL_STOPS_REMOVED",
",",
"null",
",",
"-",
"1",
",",
"null",
",",
"null",
",",
"null",
")",
")",
";",
"checkPrimitiveValidity",
"(",
")",
";",
"}"
] | Remove all the bus stops from the current hub. | [
"Remove",
"all",
"the",
"bus",
"stops",
"from",
"the",
"current",
"hub",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L405-L419 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.removeBusStop | public boolean removeBusStop(BusStop busStop) {
final int index = this.busStops.indexOf(busStop);
if (index >= 0) {
this.busStops.remove(index);
busStop.removeBusHub(this);
resetBoundingBox();
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.STOP_REMOVED,
busStop,
index,
null,
null,
null));
checkPrimitiveValidity();
return true;
}
return false;
} | java | public boolean removeBusStop(BusStop busStop) {
final int index = this.busStops.indexOf(busStop);
if (index >= 0) {
this.busStops.remove(index);
busStop.removeBusHub(this);
resetBoundingBox();
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.STOP_REMOVED,
busStop,
index,
null,
null,
null));
checkPrimitiveValidity();
return true;
}
return false;
} | [
"public",
"boolean",
"removeBusStop",
"(",
"BusStop",
"busStop",
")",
"{",
"final",
"int",
"index",
"=",
"this",
".",
"busStops",
".",
"indexOf",
"(",
"busStop",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"this",
".",
"busStops",
".",
"remove",
"(",
"index",
")",
";",
"busStop",
".",
"removeBusHub",
"(",
"this",
")",
";",
"resetBoundingBox",
"(",
")",
";",
"firePrimitiveChanged",
"(",
"new",
"BusChangeEvent",
"(",
"this",
",",
"BusChangeEventType",
".",
"STOP_REMOVED",
",",
"busStop",
",",
"index",
",",
"null",
",",
"null",
",",
"null",
")",
")",
";",
"checkPrimitiveValidity",
"(",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Remove a bus stop from this hub.
@param busStop is the bus stop to remove.
@return <code>true</code> if the bus stop was successfully removed, otherwise <code>false</code> | [
"Remove",
"a",
"bus",
"stop",
"from",
"this",
"hub",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L427-L444 | train |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.busStopsArray | @Pure
public BusStop[] busStopsArray() {
return Collections.unmodifiableList(this.busStops).toArray(new BusStop[this.busStops.size()]);
} | java | @Pure
public BusStop[] busStopsArray() {
return Collections.unmodifiableList(this.busStops).toArray(new BusStop[this.busStops.size()]);
} | [
"@",
"Pure",
"public",
"BusStop",
"[",
"]",
"busStopsArray",
"(",
")",
"{",
"return",
"Collections",
".",
"unmodifiableList",
"(",
"this",
".",
"busStops",
")",
".",
"toArray",
"(",
"new",
"BusStop",
"[",
"this",
".",
"busStops",
".",
"size",
"(",
")",
"]",
")",
";",
"}"
] | Replies the array of the bus stops.
This function copies the bus stops in an array.
@return the array of bus stops. | [
"Replies",
"the",
"array",
"of",
"the",
"bus",
"stops",
".",
"This",
"function",
"copies",
"the",
"bus",
"stops",
"in",
"an",
"array",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L539-L542 | train |
gallandarakhneorg/afc | advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapPointDrawer.java | AbstractMapPointDrawer.defineSmallRectangle | protected void defineSmallRectangle(ZoomableGraphicsContext gc, T element) {
final double ptsSize = element.getPointSize() / 2.;
final double x = element.getX() - ptsSize;
final double y = element.getY() - ptsSize;
final double mx = element.getX() + ptsSize;
final double my = element.getY() + ptsSize;
gc.moveTo(x, y);
gc.lineTo(mx, y);
gc.lineTo(mx, my);
gc.lineTo(x, my);
gc.closePath();
} | java | protected void defineSmallRectangle(ZoomableGraphicsContext gc, T element) {
final double ptsSize = element.getPointSize() / 2.;
final double x = element.getX() - ptsSize;
final double y = element.getY() - ptsSize;
final double mx = element.getX() + ptsSize;
final double my = element.getY() + ptsSize;
gc.moveTo(x, y);
gc.lineTo(mx, y);
gc.lineTo(mx, my);
gc.lineTo(x, my);
gc.closePath();
} | [
"protected",
"void",
"defineSmallRectangle",
"(",
"ZoomableGraphicsContext",
"gc",
",",
"T",
"element",
")",
"{",
"final",
"double",
"ptsSize",
"=",
"element",
".",
"getPointSize",
"(",
")",
"/",
"2.",
";",
"final",
"double",
"x",
"=",
"element",
".",
"getX",
"(",
")",
"-",
"ptsSize",
";",
"final",
"double",
"y",
"=",
"element",
".",
"getY",
"(",
")",
"-",
"ptsSize",
";",
"final",
"double",
"mx",
"=",
"element",
".",
"getX",
"(",
")",
"+",
"ptsSize",
";",
"final",
"double",
"my",
"=",
"element",
".",
"getY",
"(",
")",
"+",
"ptsSize",
";",
"gc",
".",
"moveTo",
"(",
"x",
",",
"y",
")",
";",
"gc",
".",
"lineTo",
"(",
"mx",
",",
"y",
")",
";",
"gc",
".",
"lineTo",
"(",
"mx",
",",
"my",
")",
";",
"gc",
".",
"lineTo",
"(",
"x",
",",
"my",
")",
";",
"gc",
".",
"closePath",
"(",
")",
";",
"}"
] | Define a path that corresponds to the small rectangle around a point.
@param gc the graphics context that must be used for drawing.
@param element the map element. | [
"Define",
"a",
"path",
"that",
"corresponds",
"to",
"the",
"small",
"rectangle",
"around",
"a",
"point",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapPointDrawer.java#L42-L53 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.setUUID | @Override
public final void setUUID(UUID id) {
final UUID oldId = getUUID();
if ((oldId != null && !oldId.equals(id)) || (oldId == null && id != null)) {
super.setUUID(oldId);
fireElementChanged();
}
} | java | @Override
public final void setUUID(UUID id) {
final UUID oldId = getUUID();
if ((oldId != null && !oldId.equals(id)) || (oldId == null && id != null)) {
super.setUUID(oldId);
fireElementChanged();
}
} | [
"@",
"Override",
"public",
"final",
"void",
"setUUID",
"(",
"UUID",
"id",
")",
"{",
"final",
"UUID",
"oldId",
"=",
"getUUID",
"(",
")",
";",
"if",
"(",
"(",
"oldId",
"!=",
"null",
"&&",
"!",
"oldId",
".",
"equals",
"(",
"id",
")",
")",
"||",
"(",
"oldId",
"==",
"null",
"&&",
"id",
"!=",
"null",
")",
")",
"{",
"super",
".",
"setUUID",
"(",
"oldId",
")",
";",
"fireElementChanged",
"(",
")",
";",
"}",
"}"
] | Set the unique identifier for element.
<p>A Unique IDentifier (UID) must be unique for all the object instances.
@param id is the new identifier
@since 4.0 | [
"Set",
"the",
"unique",
"identifier",
"for",
"element",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L152-L159 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.addLayerListener | public final void addLayerListener(MapLayerListener listener) {
if (this.listeners == null) {
this.listeners = new ListenerCollection<>();
}
this.listeners.add(MapLayerListener.class, listener);
} | java | public final void addLayerListener(MapLayerListener listener) {
if (this.listeners == null) {
this.listeners = new ListenerCollection<>();
}
this.listeners.add(MapLayerListener.class, listener);
} | [
"public",
"final",
"void",
"addLayerListener",
"(",
"MapLayerListener",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"listeners",
"==",
"null",
")",
"{",
"this",
".",
"listeners",
"=",
"new",
"ListenerCollection",
"<>",
"(",
")",
";",
"}",
"this",
".",
"listeners",
".",
"add",
"(",
"MapLayerListener",
".",
"class",
",",
"listener",
")",
";",
"}"
] | Add a listener on the layer's events.
@param listener the listener. | [
"Add",
"a",
"listener",
"on",
"the",
"layer",
"s",
"events",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L165-L170 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.removeLayerListener | public final void removeLayerListener(MapLayerListener listener) {
if (this.listeners != null) {
this.listeners.remove(MapLayerListener.class, listener);
if (this.listeners.isEmpty()) {
this.listeners = null;
}
}
} | java | public final void removeLayerListener(MapLayerListener listener) {
if (this.listeners != null) {
this.listeners.remove(MapLayerListener.class, listener);
if (this.listeners.isEmpty()) {
this.listeners = null;
}
}
} | [
"public",
"final",
"void",
"removeLayerListener",
"(",
"MapLayerListener",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"listeners",
"!=",
"null",
")",
"{",
"this",
".",
"listeners",
".",
"remove",
"(",
"MapLayerListener",
".",
"class",
",",
"listener",
")",
";",
"if",
"(",
"this",
".",
"listeners",
".",
"isEmpty",
"(",
")",
")",
"{",
"this",
".",
"listeners",
"=",
"null",
";",
"}",
"}",
"}"
] | Remove a listener on the layer's events.
@param listener the listener. | [
"Remove",
"a",
"listener",
"on",
"the",
"layer",
"s",
"events",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L176-L183 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.onAttributeChangeEvent | @Override
public void onAttributeChangeEvent(AttributeChangeEvent event) {
super.onAttributeChangeEvent(event);
fireLayerAttributeChangedEvent(new MapLayerAttributeChangeEvent(this, event));
fireElementChanged();
if (ATTR_VISIBLE.equals(event.getName())) {
final AttributeValue nValue = event.getValue();
boolean cvalue;
try {
cvalue = nValue.getBoolean();
} catch (Exception exception) {
cvalue = isVisible();
}
if (cvalue) {
final GISLayerContainer<?> container = getContainer();
if (container instanceof GISBrowsable) {
((GISBrowsable) container).setVisible(cvalue, false);
}
}
}
} | java | @Override
public void onAttributeChangeEvent(AttributeChangeEvent event) {
super.onAttributeChangeEvent(event);
fireLayerAttributeChangedEvent(new MapLayerAttributeChangeEvent(this, event));
fireElementChanged();
if (ATTR_VISIBLE.equals(event.getName())) {
final AttributeValue nValue = event.getValue();
boolean cvalue;
try {
cvalue = nValue.getBoolean();
} catch (Exception exception) {
cvalue = isVisible();
}
if (cvalue) {
final GISLayerContainer<?> container = getContainer();
if (container instanceof GISBrowsable) {
((GISBrowsable) container).setVisible(cvalue, false);
}
}
}
} | [
"@",
"Override",
"public",
"void",
"onAttributeChangeEvent",
"(",
"AttributeChangeEvent",
"event",
")",
"{",
"super",
".",
"onAttributeChangeEvent",
"(",
"event",
")",
";",
"fireLayerAttributeChangedEvent",
"(",
"new",
"MapLayerAttributeChangeEvent",
"(",
"this",
",",
"event",
")",
")",
";",
"fireElementChanged",
"(",
")",
";",
"if",
"(",
"ATTR_VISIBLE",
".",
"equals",
"(",
"event",
".",
"getName",
"(",
")",
")",
")",
"{",
"final",
"AttributeValue",
"nValue",
"=",
"event",
".",
"getValue",
"(",
")",
";",
"boolean",
"cvalue",
";",
"try",
"{",
"cvalue",
"=",
"nValue",
".",
"getBoolean",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"exception",
")",
"{",
"cvalue",
"=",
"isVisible",
"(",
")",
";",
"}",
"if",
"(",
"cvalue",
")",
"{",
"final",
"GISLayerContainer",
"<",
"?",
">",
"container",
"=",
"getContainer",
"(",
")",
";",
"if",
"(",
"container",
"instanceof",
"GISBrowsable",
")",
"{",
"(",
"(",
"GISBrowsable",
")",
"container",
")",
".",
"setVisible",
"(",
"cvalue",
",",
"false",
")",
";",
"}",
"}",
"}",
"}"
] | Invoked when the attribute's value changed. | [
"Invoked",
"when",
"the",
"attribute",
"s",
"value",
"changed",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L289-L309 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.isClickable | @Pure
public boolean isClickable() {
final AttributeValue val = getAttributeProvider().getAttribute(ATTR_CLICKABLE);
if (val != null) {
try {
return val.getBoolean();
} catch (AttributeException e) {
//
}
}
return true;
} | java | @Pure
public boolean isClickable() {
final AttributeValue val = getAttributeProvider().getAttribute(ATTR_CLICKABLE);
if (val != null) {
try {
return val.getBoolean();
} catch (AttributeException e) {
//
}
}
return true;
} | [
"@",
"Pure",
"public",
"boolean",
"isClickable",
"(",
")",
"{",
"final",
"AttributeValue",
"val",
"=",
"getAttributeProvider",
"(",
")",
".",
"getAttribute",
"(",
"ATTR_CLICKABLE",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"val",
".",
"getBoolean",
"(",
")",
";",
"}",
"catch",
"(",
"AttributeException",
"e",
")",
"{",
"//",
"}",
"}",
"return",
"true",
";",
"}"
] | Replies if this layer accepts the user clicks.
@return <code>true</code> if this layer allows mouse click events, otherwise <code>false</code> | [
"Replies",
"if",
"this",
"layer",
"accepts",
"the",
"user",
"clicks",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L594-L605 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.isTemporaryLayer | @Pure
public final boolean isTemporaryLayer() {
MapLayer layer = this;
GISLayerContainer<?> container;
while (layer != null) {
if (layer.isTemp) {
return true;
}
container = layer.getContainer();
layer = container instanceof MapLayer ? (MapLayer) container : null;
}
return false;
} | java | @Pure
public final boolean isTemporaryLayer() {
MapLayer layer = this;
GISLayerContainer<?> container;
while (layer != null) {
if (layer.isTemp) {
return true;
}
container = layer.getContainer();
layer = container instanceof MapLayer ? (MapLayer) container : null;
}
return false;
} | [
"@",
"Pure",
"public",
"final",
"boolean",
"isTemporaryLayer",
"(",
")",
"{",
"MapLayer",
"layer",
"=",
"this",
";",
"GISLayerContainer",
"<",
"?",
">",
"container",
";",
"while",
"(",
"layer",
"!=",
"null",
")",
"{",
"if",
"(",
"layer",
".",
"isTemp",
")",
"{",
"return",
"true",
";",
"}",
"container",
"=",
"layer",
".",
"getContainer",
"(",
")",
";",
"layer",
"=",
"container",
"instanceof",
"MapLayer",
"?",
"(",
"MapLayer",
")",
"container",
":",
"null",
";",
"}",
"return",
"false",
";",
"}"
] | Replies if this layer was mark as temporary lyer.
<p>A temporary layer means that any things inside this layer is
assumed to be lost when the layer will be destroyed.
@return <code>true</code> if this layer is temporary, otherwise <code>false</code> | [
"Replies",
"if",
"this",
"layer",
"was",
"mark",
"as",
"temporary",
"lyer",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L635-L647 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java | MapLayer.isRemovable | @Pure
public boolean isRemovable() {
final AttributeValue val = getAttributeProvider().getAttribute(ATTR_REMOVABLE);
if (val != null) {
try {
return val.getBoolean();
} catch (AttributeException e) {
//
}
}
return true;
} | java | @Pure
public boolean isRemovable() {
final AttributeValue val = getAttributeProvider().getAttribute(ATTR_REMOVABLE);
if (val != null) {
try {
return val.getBoolean();
} catch (AttributeException e) {
//
}
}
return true;
} | [
"@",
"Pure",
"public",
"boolean",
"isRemovable",
"(",
")",
"{",
"final",
"AttributeValue",
"val",
"=",
"getAttributeProvider",
"(",
")",
".",
"getAttribute",
"(",
"ATTR_REMOVABLE",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"val",
".",
"getBoolean",
"(",
")",
";",
"}",
"catch",
"(",
"AttributeException",
"e",
")",
"{",
"//",
"}",
"}",
"return",
"true",
";",
"}"
] | Replies if this layer is removable from this container.
This removal value permits to the container to be
informed about the desired removal state from
its component. The usage of this state by
the container depends only of its implementation.
@return <code>true</code> if this layer is removable from its container,
otherwise <code>false</code> | [
"Replies",
"if",
"this",
"layer",
"is",
"removable",
"from",
"this",
"container",
".",
"This",
"removal",
"value",
"permits",
"to",
"the",
"container",
"to",
"be",
"informed",
"about",
"the",
"desired",
"removal",
"state",
"from",
"its",
"component",
".",
"The",
"usage",
"of",
"this",
"state",
"by",
"the",
"container",
"depends",
"only",
"of",
"its",
"implementation",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MapLayer.java#L710-L721 | train |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java | Sphere3d.setProperties | public void setProperties(Point3d center, DoubleProperty radius1) {
setProperties(center.xProperty,center.yProperty,center.zProperty, radius1);
} | java | public void setProperties(Point3d center, DoubleProperty radius1) {
setProperties(center.xProperty,center.yProperty,center.zProperty, radius1);
} | [
"public",
"void",
"setProperties",
"(",
"Point3d",
"center",
",",
"DoubleProperty",
"radius1",
")",
"{",
"setProperties",
"(",
"center",
".",
"xProperty",
",",
"center",
".",
"yProperty",
",",
"center",
".",
"zProperty",
",",
"radius1",
")",
";",
"}"
] | Bind the frame of the sphere with center and radisu properties.
@param center
@param radius1 | [
"Bind",
"the",
"frame",
"of",
"the",
"sphere",
"with",
"center",
"and",
"radisu",
"properties",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java#L145-L147 | train |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java | Sphere3d.getCenterWithoutProperties | @Pure
public Point3f getCenterWithoutProperties() {
return new Point3f(this.cxProperty.doubleValue(), this.cyProperty.doubleValue(), this.czProperty.doubleValue());
} | java | @Pure
public Point3f getCenterWithoutProperties() {
return new Point3f(this.cxProperty.doubleValue(), this.cyProperty.doubleValue(), this.czProperty.doubleValue());
} | [
"@",
"Pure",
"public",
"Point3f",
"getCenterWithoutProperties",
"(",
")",
"{",
"return",
"new",
"Point3f",
"(",
"this",
".",
"cxProperty",
".",
"doubleValue",
"(",
")",
",",
"this",
".",
"cyProperty",
".",
"doubleValue",
"(",
")",
",",
"this",
".",
"czProperty",
".",
"doubleValue",
"(",
")",
")",
";",
"}"
] | Replies the center.
@return a copy of the center. | [
"Replies",
"the",
"center",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java#L193-L196 | train |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java | Sphere3d.setCenterProperties | public void setCenterProperties(Point3d center) {
this.cxProperty = center.xProperty;
this.cyProperty = center.yProperty;
this.czProperty = center.zProperty;
} | java | public void setCenterProperties(Point3d center) {
this.cxProperty = center.xProperty;
this.cyProperty = center.yProperty;
this.czProperty = center.zProperty;
} | [
"public",
"void",
"setCenterProperties",
"(",
"Point3d",
"center",
")",
"{",
"this",
".",
"cxProperty",
"=",
"center",
".",
"xProperty",
";",
"this",
".",
"cyProperty",
"=",
"center",
".",
"yProperty",
";",
"this",
".",
"czProperty",
"=",
"center",
".",
"zProperty",
";",
"}"
] | Set the center properties with the properties of the Point3d in parameter.
@param center | [
"Set",
"the",
"center",
"properties",
"with",
"the",
"properties",
"of",
"the",
"Point3d",
"in",
"parameter",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java#L213-L217 | train |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java | Sphere3d.setCenterProperties | public void setCenterProperties(DoubleProperty x, DoubleProperty y, DoubleProperty z) {
this.cxProperty = x;
this.cyProperty = y;
this.czProperty = z;
} | java | public void setCenterProperties(DoubleProperty x, DoubleProperty y, DoubleProperty z) {
this.cxProperty = x;
this.cyProperty = y;
this.czProperty = z;
} | [
"public",
"void",
"setCenterProperties",
"(",
"DoubleProperty",
"x",
",",
"DoubleProperty",
"y",
",",
"DoubleProperty",
"z",
")",
"{",
"this",
".",
"cxProperty",
"=",
"x",
";",
"this",
".",
"cyProperty",
"=",
"y",
";",
"this",
".",
"czProperty",
"=",
"z",
";",
"}"
] | Set the center properties with the properties in parameter.
@param x
@param y
@param z | [
"Set",
"the",
"center",
"properties",
"with",
"the",
"properties",
"in",
"parameter",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java#L238-L242 | train |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java | Sphere3d.setRadiusProperty | public void setRadiusProperty(DoubleProperty radius1) {
this.radiusProperty = radius1;
this.radiusProperty.set(Math.abs(this.radiusProperty.get()));
} | java | public void setRadiusProperty(DoubleProperty radius1) {
this.radiusProperty = radius1;
this.radiusProperty.set(Math.abs(this.radiusProperty.get()));
} | [
"public",
"void",
"setRadiusProperty",
"(",
"DoubleProperty",
"radius1",
")",
"{",
"this",
".",
"radiusProperty",
"=",
"radius1",
";",
"this",
".",
"radiusProperty",
".",
"set",
"(",
"Math",
".",
"abs",
"(",
"this",
".",
"radiusProperty",
".",
"get",
"(",
")",
")",
")",
";",
"}"
] | Set the radius property with the property in parameter.
@param radius1 is the radius. | [
"Set",
"the",
"radius",
"property",
"with",
"the",
"property",
"in",
"parameter",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java#L267-L270 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.