id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
36,700 | iipc/webarchive-commons | src/main/java/org/archive/url/LaxURI.java | LaxURI.decode | protected static String decode(String component, String charset)
throws URIException {
if (component == null) {
throw new IllegalArgumentException(
"Component array of chars may not be null");
}
byte[] rawdata = null;
// try {
rawda... | java | protected static String decode(String component, String charset)
throws URIException {
if (component == null) {
throw new IllegalArgumentException(
"Component array of chars may not be null");
}
byte[] rawdata = null;
// try {
rawda... | [
"protected",
"static",
"String",
"decode",
"(",
"String",
"component",
",",
"String",
"charset",
")",
"throws",
"URIException",
"{",
"if",
"(",
"component",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Component array of chars may not ... | overridden to use IA's LaxURLCodec, which never throws DecoderException | [
"overridden",
"to",
"use",
"IA",
"s",
"LaxURLCodec",
"which",
"never",
"throws",
"DecoderException"
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/LaxURI.java#L117-L131 |
36,701 | iipc/webarchive-commons | src/main/java/org/archive/url/LaxURI.java | LaxURI.parseAuthority | protected void parseAuthority(String original, boolean escaped)
throws URIException {
super.parseAuthority(original, escaped);
if (_host != null && _authority != null
&& _host.length == _authority.length) {
_host = _authority;
}
} | java | protected void parseAuthority(String original, boolean escaped)
throws URIException {
super.parseAuthority(original, escaped);
if (_host != null && _authority != null
&& _host.length == _authority.length) {
_host = _authority;
}
} | [
"protected",
"void",
"parseAuthority",
"(",
"String",
"original",
",",
"boolean",
"escaped",
")",
"throws",
"URIException",
"{",
"super",
".",
"parseAuthority",
"(",
"original",
",",
"escaped",
")",
";",
"if",
"(",
"_host",
"!=",
"null",
"&&",
"_authority",
... | Coalesce the _host and _authority fields where
possible.
In the web crawl/http domain, most URIs have an
identical _host and _authority. (There is no port
or user info.) However, the superclass always
creates two separate char[] instances.
Notably, the lengths of these char[] fields are
equal if and only if their val... | [
"Coalesce",
"the",
"_host",
"and",
"_authority",
"fields",
"where",
"possible",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/LaxURI.java#L188-L195 |
36,702 | iipc/webarchive-commons | src/main/java/org/archive/url/LaxURI.java | LaxURI.setURI | protected void setURI() {
if (_scheme != null) {
if (_scheme.length == 4 && Arrays.equals(_scheme, HTTP_SCHEME)) {
_scheme = HTTP_SCHEME;
} else if (_scheme.length == 5
&& Arrays.equals(_scheme, HTTPS_SCHEME)) {
_scheme = HTTPS_SCHEME;
... | java | protected void setURI() {
if (_scheme != null) {
if (_scheme.length == 4 && Arrays.equals(_scheme, HTTP_SCHEME)) {
_scheme = HTTP_SCHEME;
} else if (_scheme.length == 5
&& Arrays.equals(_scheme, HTTPS_SCHEME)) {
_scheme = HTTPS_SCHEME;
... | [
"protected",
"void",
"setURI",
"(",
")",
"{",
"if",
"(",
"_scheme",
"!=",
"null",
")",
"{",
"if",
"(",
"_scheme",
".",
"length",
"==",
"4",
"&&",
"Arrays",
".",
"equals",
"(",
"_scheme",
",",
"HTTP_SCHEME",
")",
")",
"{",
"_scheme",
"=",
"HTTP_SCHEME... | Coalesce _scheme to existing instances, where appropriate.
In the web-crawl domain, most _schemes are 'http' or 'https',
but the superclass always creates a new char[] instance. For
these two cases, we replace the created instance with a
long-lived instance from a static field, saving 12-14 bytes
per instance.
@see o... | [
"Coalesce",
"_scheme",
"to",
"existing",
"instances",
"where",
"appropriate",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/LaxURI.java#L209-L219 |
36,703 | iipc/webarchive-commons | src/main/java/org/archive/io/WriterPoolMember.java | WriterPoolMember.generateNewBasename | protected void generateNewBasename() {
Properties localProps = new Properties();
localProps.setProperty("prefix", settings.getPrefix());
synchronized(this.getClass()) {
// ensure that serialNo and timestamp are minted together (never inverted sort order)
String paddedSer... | java | protected void generateNewBasename() {
Properties localProps = new Properties();
localProps.setProperty("prefix", settings.getPrefix());
synchronized(this.getClass()) {
// ensure that serialNo and timestamp are minted together (never inverted sort order)
String paddedSer... | [
"protected",
"void",
"generateNewBasename",
"(",
")",
"{",
"Properties",
"localProps",
"=",
"new",
"Properties",
"(",
")",
";",
"localProps",
".",
"setProperty",
"(",
"\"prefix\"",
",",
"settings",
".",
"getPrefix",
"(",
")",
")",
";",
"synchronized",
"(",
"... | Generate a new basename by interpolating values in the configured
template. Values come from local state, other configured values, and
global system properties. The recommended default template will
generate a unique basename under reasonable assumptions. | [
"Generate",
"a",
"new",
"basename",
"by",
"interpolating",
"values",
"in",
"the",
"configured",
"template",
".",
"Values",
"come",
"from",
"local",
"state",
"other",
"configured",
"values",
"and",
"global",
"system",
"properties",
".",
"The",
"recommended",
"def... | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/WriterPoolMember.java#L270-L285 |
36,704 | iipc/webarchive-commons | src/main/java/org/archive/io/WriterPoolMember.java | WriterPoolMember.getBaseFilename | protected String getBaseFilename() {
String name = this.f.getName();
if (settings.getCompress() && name.endsWith(DOT_COMPRESSED_FILE_EXTENSION)) {
return name.substring(0,name.length() - 3);
} else if(settings.getCompress() &&
name.endsWith(DOT_COMPRESSED_FILE_EXTENSI... | java | protected String getBaseFilename() {
String name = this.f.getName();
if (settings.getCompress() && name.endsWith(DOT_COMPRESSED_FILE_EXTENSION)) {
return name.substring(0,name.length() - 3);
} else if(settings.getCompress() &&
name.endsWith(DOT_COMPRESSED_FILE_EXTENSI... | [
"protected",
"String",
"getBaseFilename",
"(",
")",
"{",
"String",
"name",
"=",
"this",
".",
"f",
".",
"getName",
"(",
")",
";",
"if",
"(",
"settings",
".",
"getCompress",
"(",
")",
"&&",
"name",
".",
"endsWith",
"(",
"DOT_COMPRESSED_FILE_EXTENSION",
")",
... | Get the file name
@return the filename, as if uncompressed | [
"Get",
"the",
"file",
"name"
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/WriterPoolMember.java#L293-L305 |
36,705 | iipc/webarchive-commons | src/main/java/org/archive/io/WriterPoolMember.java | WriterPoolMember.preWriteRecordTasks | protected void preWriteRecordTasks()
throws IOException {
if (this.out == null) {
createFile();
}
if (settings.getCompress()) {
// Wrap stream in GZIP Writer.
// The below construction immediately writes the GZIP 'default'
// header out on the ... | java | protected void preWriteRecordTasks()
throws IOException {
if (this.out == null) {
createFile();
}
if (settings.getCompress()) {
// Wrap stream in GZIP Writer.
// The below construction immediately writes the GZIP 'default'
// header out on the ... | [
"protected",
"void",
"preWriteRecordTasks",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"out",
"==",
"null",
")",
"{",
"createFile",
"(",
")",
";",
"}",
"if",
"(",
"settings",
".",
"getCompress",
"(",
")",
")",
"{",
"// Wrap stream in... | Post write tasks.
Has side effects. Will open new file if we're at the upper bound.
If we're writing compressed files, it will wrap output stream with a
GZIP writer with side effect that GZIP header is written out on the
stream.
@exception IOException | [
"Post",
"write",
"tasks",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/WriterPoolMember.java#L329-L340 |
36,706 | iipc/webarchive-commons | src/main/java/org/archive/io/WriterPoolMember.java | WriterPoolMember.postWriteRecordTasks | protected void postWriteRecordTasks()
throws IOException {
if (settings.getCompress()) {
CompressedStream o = (CompressedStream)this.out;
o.finish();
o.flush();
o.end();
this.out = o.getWrappedStream();
}
} | java | protected void postWriteRecordTasks()
throws IOException {
if (settings.getCompress()) {
CompressedStream o = (CompressedStream)this.out;
o.finish();
o.flush();
o.end();
this.out = o.getWrappedStream();
}
} | [
"protected",
"void",
"postWriteRecordTasks",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"settings",
".",
"getCompress",
"(",
")",
")",
"{",
"CompressedStream",
"o",
"=",
"(",
"CompressedStream",
")",
"this",
".",
"out",
";",
"o",
".",
"finish",
"("... | Post file write tasks.
If compressed, finishes up compression and flushes stream so any
subsequent checks get good reading.
@exception IOException | [
"Post",
"file",
"write",
"tasks",
".",
"If",
"compressed",
"finishes",
"up",
"compression",
"and",
"flushes",
"stream",
"so",
"any",
"subsequent",
"checks",
"get",
"good",
"reading",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/WriterPoolMember.java#L349-L358 |
36,707 | iipc/webarchive-commons | src/main/java/org/archive/format/gzip/zipnum/ZipNumCluster.java | ZipNumCluster.computeTotalLines | public long computeTotalLines()
{
long numLines = 0;
try {
numLines = this.getNumLines(summary.getRange("", ""));
} catch (IOException e) {
LOGGER.warning(e.toString());
return 0;
}
long adjustment = getTotalAdjustment();
numLines -= (getNumBlocks() - 1);
numLines *= this.getCdxLinesPerB... | java | public long computeTotalLines()
{
long numLines = 0;
try {
numLines = this.getNumLines(summary.getRange("", ""));
} catch (IOException e) {
LOGGER.warning(e.toString());
return 0;
}
long adjustment = getTotalAdjustment();
numLines -= (getNumBlocks() - 1);
numLines *= this.getCdxLinesPerB... | [
"public",
"long",
"computeTotalLines",
"(",
")",
"{",
"long",
"numLines",
"=",
"0",
";",
"try",
"{",
"numLines",
"=",
"this",
".",
"getNumLines",
"(",
"summary",
".",
"getRange",
"(",
"\"\"",
",",
"\"\"",
")",
")",
";",
"}",
"catch",
"(",
"IOException"... | Adjust from shorter blocks, if loaded | [
"Adjust",
"from",
"shorter",
"blocks",
"if",
"loaded"
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/gzip/zipnum/ZipNumCluster.java#L493-L509 |
36,708 | iipc/webarchive-commons | src/main/java/org/archive/format/text/charset/CharsetDetector.java | CharsetDetector.getCharsetFromMeta | protected String getCharsetFromMeta(byte buffer[],int len) throws IOException {
String charsetName = null;
// convert to UTF-8 String -- which hopefully will not mess up the
// characters we're interested in...
String sample = new String(buffer,0,len,DEFAULT_CHARSET);
String metaContentType = findMetaContent... | java | protected String getCharsetFromMeta(byte buffer[],int len) throws IOException {
String charsetName = null;
// convert to UTF-8 String -- which hopefully will not mess up the
// characters we're interested in...
String sample = new String(buffer,0,len,DEFAULT_CHARSET);
String metaContentType = findMetaContent... | [
"protected",
"String",
"getCharsetFromMeta",
"(",
"byte",
"buffer",
"[",
"]",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"String",
"charsetName",
"=",
"null",
";",
"// convert to UTF-8 String -- which hopefully will not mess up the",
"// characters we're interest... | Attempt to find a META tag in the HTML that hints at the character set
used to write the document.
@param resource
@return String character set found from META tags in the HTML
@throws IOException | [
"Attempt",
"to",
"find",
"a",
"META",
"tag",
"in",
"the",
"HTML",
"that",
"hints",
"at",
"the",
"character",
"set",
"used",
"to",
"write",
"the",
"document",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/text/charset/CharsetDetector.java#L168-L179 |
36,709 | iipc/webarchive-commons | src/main/java/org/archive/format/text/charset/CharsetDetector.java | CharsetDetector.getCharsetFromBytes | protected String getCharsetFromBytes(byte buffer[], int len)
throws IOException {
String charsetName = null;
UniversalDetector detector = new UniversalDetector(null);
detector.handleData(buffer, 0, len);
detector.dataEnd();
charsetName = detector.getDetectedCharset();
detector.reset();
if(is... | java | protected String getCharsetFromBytes(byte buffer[], int len)
throws IOException {
String charsetName = null;
UniversalDetector detector = new UniversalDetector(null);
detector.handleData(buffer, 0, len);
detector.dataEnd();
charsetName = detector.getDetectedCharset();
detector.reset();
if(is... | [
"protected",
"String",
"getCharsetFromBytes",
"(",
"byte",
"buffer",
"[",
"]",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"String",
"charsetName",
"=",
"null",
";",
"UniversalDetector",
"detector",
"=",
"new",
"UniversalDetector",
"(",
"null",
")",
... | Attempts to figure out the character set of the document using
the excellent juniversalchardet library.
@param resource
@return String character encoding found, or null if nothing looked good.
@throws IOException | [
"Attempts",
"to",
"figure",
"out",
"the",
"character",
"set",
"of",
"the",
"document",
"using",
"the",
"excellent",
"juniversalchardet",
"library",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/text/charset/CharsetDetector.java#L231-L243 |
36,710 | iipc/webarchive-commons | src/main/java/org/archive/io/ReplayInputStream.java | ReplayInputStream.readContentTo | public void readContentTo(OutputStream os, long maxSize) throws IOException {
setToResponseBodyStart();
byte[] buf = new byte[4096];
int c = read(buf);
long tot = 0;
while (c != -1 && tot < maxSize) {
os.write(buf,0,c);
c = read(buf);
tot += c;... | java | public void readContentTo(OutputStream os, long maxSize) throws IOException {
setToResponseBodyStart();
byte[] buf = new byte[4096];
int c = read(buf);
long tot = 0;
while (c != -1 && tot < maxSize) {
os.write(buf,0,c);
c = read(buf);
tot += c;... | [
"public",
"void",
"readContentTo",
"(",
"OutputStream",
"os",
",",
"long",
"maxSize",
")",
"throws",
"IOException",
"{",
"setToResponseBodyStart",
"(",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"4096",
"]",
";",
"int",
"c",
"=",
"read",... | Convenience method to copy content out to target stream.
@param os stream to write content to
@param maxSize maximum count of bytes to copy
@throws IOException | [
"Convenience",
"method",
"to",
"copy",
"content",
"out",
"to",
"target",
"stream",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ReplayInputStream.java#L234-L244 |
36,711 | iipc/webarchive-commons | src/main/java/org/archive/io/ReplayInputStream.java | ReplayInputStream.position | public void position(long p) throws IOException {
if (p < 0) {
throw new IOException("Negative seek offset.");
}
if (p > size) {
throw new IOException("Desired position exceeds size.");
}
if (p < buffer.length) {
// Only seek file if necessary
... | java | public void position(long p) throws IOException {
if (p < 0) {
throw new IOException("Negative seek offset.");
}
if (p > size) {
throw new IOException("Desired position exceeds size.");
}
if (p < buffer.length) {
// Only seek file if necessary
... | [
"public",
"void",
"position",
"(",
"long",
"p",
")",
"throws",
"IOException",
"{",
"if",
"(",
"p",
"<",
"0",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Negative seek offset.\"",
")",
";",
"}",
"if",
"(",
"p",
">",
"size",
")",
"{",
"throw",
"ne... | Reposition the stream.
@param p the new position for this stream
@throws IOException if an IO error occurs | [
"Reposition",
"the",
"stream",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ReplayInputStream.java#L298-L314 |
36,712 | iipc/webarchive-commons | src/main/java/org/archive/io/ArchiveRecord.java | ArchiveRecord.close | public void close() throws IOException {
if (this.in != null) {
skip();
this.in = null;
if (this.digest != null) {
this.digestStr = Base32.encode(this.digest.digest());
}
}
} | java | public void close() throws IOException {
if (this.in != null) {
skip();
this.in = null;
if (this.digest != null) {
this.digestStr = Base32.encode(this.digest.digest());
}
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"in",
"!=",
"null",
")",
"{",
"skip",
"(",
")",
";",
"this",
".",
"in",
"=",
"null",
";",
"if",
"(",
"this",
".",
"digest",
"!=",
"null",
")",
"{",
"this... | Calling close on a record skips us past this record to the next record
in the stream.
It does not actually close the stream. The underlying steam is probably
being used by the next arc record.
@throws IOException | [
"Calling",
"close",
"on",
"a",
"record",
"skips",
"us",
"past",
"this",
"record",
"to",
"the",
"next",
"record",
"in",
"the",
"stream",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ArchiveRecord.java#L170-L178 |
36,713 | iipc/webarchive-commons | src/main/java/org/archive/io/ArchiveRecord.java | ArchiveRecord.available | public int available() {
long amount = getHeader().getLength() - getPosition();
return (amount > Integer.MAX_VALUE? Integer.MAX_VALUE: (int)amount);
} | java | public int available() {
long amount = getHeader().getLength() - getPosition();
return (amount > Integer.MAX_VALUE? Integer.MAX_VALUE: (int)amount);
} | [
"public",
"int",
"available",
"(",
")",
"{",
"long",
"amount",
"=",
"getHeader",
"(",
")",
".",
"getLength",
"(",
")",
"-",
"getPosition",
"(",
")",
";",
"return",
"(",
"amount",
">",
"Integer",
".",
"MAX_VALUE",
"?",
"Integer",
".",
"MAX_VALUE",
":",
... | This available is not the stream's available. Its an available based on
what the stated Archive record length is minus what we've read to date.
@return True if bytes remaining in record content. | [
"This",
"available",
"is",
"not",
"the",
"stream",
"s",
"available",
".",
"Its",
"an",
"available",
"based",
"on",
"what",
"the",
"stated",
"Archive",
"record",
"length",
"is",
"minus",
"what",
"we",
"ve",
"read",
"to",
"date",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ArchiveRecord.java#L228-L231 |
36,714 | iipc/webarchive-commons | src/main/java/org/archive/io/ArchiveRecord.java | ArchiveRecord.skip | protected void skip() throws IOException {
if (this.eor) {
return;
}
// Read to the end of the body of the record. Exhaust the stream.
// Can't skip direct to end because underlying stream may be compressed
// and we're calculating the digest for the record.
... | java | protected void skip() throws IOException {
if (this.eor) {
return;
}
// Read to the end of the body of the record. Exhaust the stream.
// Can't skip direct to end because underlying stream may be compressed
// and we're calculating the digest for the record.
... | [
"protected",
"void",
"skip",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"eor",
")",
"{",
"return",
";",
"}",
"// Read to the end of the body of the record. Exhaust the stream.",
"// Can't skip direct to end because underlying stream may be compressed",
"... | Skip over this records content.
@throws IOException | [
"Skip",
"over",
"this",
"records",
"content",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ArchiveRecord.java#L238-L251 |
36,715 | iipc/webarchive-commons | src/main/java/org/archive/io/GenerationFileHandler.java | GenerationFileHandler.rotate | public GenerationFileHandler rotate(String storeSuffix,
String activeSuffix)
throws IOException {
return rotate(storeSuffix, activeSuffix, false);
} | java | public GenerationFileHandler rotate(String storeSuffix,
String activeSuffix)
throws IOException {
return rotate(storeSuffix, activeSuffix, false);
} | [
"public",
"GenerationFileHandler",
"rotate",
"(",
"String",
"storeSuffix",
",",
"String",
"activeSuffix",
")",
"throws",
"IOException",
"{",
"return",
"rotate",
"(",
"storeSuffix",
",",
"activeSuffix",
",",
"false",
")",
";",
"}"
] | Move the current file to a new filename with the storeSuffix in place
of the activeSuffix; continuing logging to a new file under the
original filename.
@param storeSuffix Suffix to put in place of <code>activeSuffix</code>
@param activeSuffix Suffix to replace with <code>storeSuffix</code>.
@return GenerationFileHand... | [
"Move",
"the",
"current",
"file",
"to",
"a",
"new",
"filename",
"with",
"the",
"storeSuffix",
"in",
"place",
"of",
"the",
"activeSuffix",
";",
"continuing",
"logging",
"to",
"a",
"new",
"file",
"under",
"the",
"original",
"filename",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/GenerationFileHandler.java#L91-L95 |
36,716 | iipc/webarchive-commons | src/main/java/org/archive/io/GenerationFileHandler.java | GenerationFileHandler.makeNew | public static GenerationFileHandler makeNew(String filename, boolean append, boolean shouldManifest) throws SecurityException, IOException {
FileUtils.moveAsideIfExists(new File(filename));
return new GenerationFileHandler(filename, append, shouldManifest);
} | java | public static GenerationFileHandler makeNew(String filename, boolean append, boolean shouldManifest) throws SecurityException, IOException {
FileUtils.moveAsideIfExists(new File(filename));
return new GenerationFileHandler(filename, append, shouldManifest);
} | [
"public",
"static",
"GenerationFileHandler",
"makeNew",
"(",
"String",
"filename",
",",
"boolean",
"append",
",",
"boolean",
"shouldManifest",
")",
"throws",
"SecurityException",
",",
"IOException",
"{",
"FileUtils",
".",
"moveAsideIfExists",
"(",
"new",
"File",
"("... | Constructor-helper that rather than clobbering any existing
file, moves it aside with a timestamp suffix.
@param filename
@param append
@param shouldManifest
@return
@throws SecurityException
@throws IOException | [
"Constructor",
"-",
"helper",
"that",
"rather",
"than",
"clobbering",
"any",
"existing",
"file",
"moves",
"it",
"aside",
"with",
"a",
"timestamp",
"suffix",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/GenerationFileHandler.java#L156-L159 |
36,717 | iipc/webarchive-commons | src/main/java/org/archive/util/iterator/LookaheadIterator.java | LookaheadIterator.next | public T next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
// 'next' is guaranteed non-null by a hasNext() which returned true
T returnObj = this.next;
this.next = null;
return returnObj;
} | java | public T next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
// 'next' is guaranteed non-null by a hasNext() which returned true
T returnObj = this.next;
this.next = null;
return returnObj;
} | [
"public",
"T",
"next",
"(",
")",
"{",
"if",
"(",
"!",
"hasNext",
"(",
")",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
")",
";",
"}",
"// 'next' is guaranteed non-null by a hasNext() which returned true",
"T",
"returnObj",
"=",
"this",
".",
"next",
... | Return the next item.
@see java.util.Iterator#next() | [
"Return",
"the",
"next",
"item",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/iterator/LookaheadIterator.java#L57-L65 |
36,718 | iipc/webarchive-commons | src/main/java/org/archive/util/ByteOp.java | ByteOp.readToNull | public static byte[] readToNull(InputStream is, int maxSize)
throws IOException {
byte[] bytes = new byte[maxSize];
int i = 0;
while(i < maxSize) {
int b = is.read();
if(b == -1) {
throw new EOFException("NO NULL");
}
bytes[i] = (byte) (b & 0xff);
i++;
if(b == 0) {
return copy(bytes,0... | java | public static byte[] readToNull(InputStream is, int maxSize)
throws IOException {
byte[] bytes = new byte[maxSize];
int i = 0;
while(i < maxSize) {
int b = is.read();
if(b == -1) {
throw new EOFException("NO NULL");
}
bytes[i] = (byte) (b & 0xff);
i++;
if(b == 0) {
return copy(bytes,0... | [
"public",
"static",
"byte",
"[",
"]",
"readToNull",
"(",
"InputStream",
"is",
",",
"int",
"maxSize",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"maxSize",
"]",
";",
"int",
"i",
"=",
"0",
";",
"while",
"(",
... | Read, buffer, and return bytes from is until a null byte is encountered
@param is InputStream to read from
@param maxSize maximum number of bytes to search for the null
@return array of bytes read, INCLUDING TRAILING NULL
@throws IOException if the underlying stream throws on, OR if the
specified maximum buffer size is... | [
"Read",
"buffer",
"and",
"return",
"bytes",
"from",
"is",
"until",
"a",
"null",
"byte",
"is",
"encountered"
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/ByteOp.java#L196-L216 |
36,719 | iipc/webarchive-commons | src/main/java/org/archive/util/Base32.java | Base32.main | static public void main(String[] args) {
if (args.length == 0) {
System.out.println("Supply a Base32-encoded argument.");
return;
}
System.out.println(" Original: " + args[0]);
byte[] decoded = Base32.decode(args[0]);
System.out.print(" Hex: ");
... | java | static public void main(String[] args) {
if (args.length == 0) {
System.out.println("Supply a Base32-encoded argument.");
return;
}
System.out.println(" Original: " + args[0]);
byte[] decoded = Base32.decode(args[0]);
System.out.print(" Hex: ");
... | [
"static",
"public",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Supply a Base32-encoded argument.\"",
")",
";",
"return",
";",
"}",
"Sys... | For testing, take a command-line argument in Base32, decode, print in hex,
encode, print
@param args | [
"For",
"testing",
"take",
"a",
"command",
"-",
"line",
"argument",
"in",
"Base32",
"decode",
"print",
"in",
"hex",
"encode",
"print"
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/Base32.java#L141-L158 |
36,720 | iipc/webarchive-commons | src/main/java/org/archive/util/zip/GzipHeader.java | GzipHeader.readHeader | public void readHeader(InputStream in) throws IOException {
CRC32 crc = new CRC32();
crc.reset();
if (!testGzipMagic(in, crc)) {
throw new NoGzipMagicException();
}
this.length += 2;
if (readByte(in, crc) != Deflater.DEFLATED) {
throw new IOExcepti... | java | public void readHeader(InputStream in) throws IOException {
CRC32 crc = new CRC32();
crc.reset();
if (!testGzipMagic(in, crc)) {
throw new NoGzipMagicException();
}
this.length += 2;
if (readByte(in, crc) != Deflater.DEFLATED) {
throw new IOExcepti... | [
"public",
"void",
"readHeader",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"CRC32",
"crc",
"=",
"new",
"CRC32",
"(",
")",
";",
"crc",
".",
"reset",
"(",
")",
";",
"if",
"(",
"!",
"testGzipMagic",
"(",
"in",
",",
"crc",
")",
")",
"... | Read in gzip header.
Advances the stream past the gzip header.
@param in InputStream.
@throws IOException Throws if does not start with GZIP Header. | [
"Read",
"in",
"gzip",
"header",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/zip/GzipHeader.java#L112-L173 |
36,721 | iipc/webarchive-commons | src/main/java/org/archive/util/zip/GzipHeader.java | GzipHeader.readInt | private int readInt(InputStream in, CRC32 crc) throws IOException {
int s = readShort(in, crc);
return ((readShort(in, crc) << 16) & 0xffff0000) | s;
} | java | private int readInt(InputStream in, CRC32 crc) throws IOException {
int s = readShort(in, crc);
return ((readShort(in, crc) << 16) & 0xffff0000) | s;
} | [
"private",
"int",
"readInt",
"(",
"InputStream",
"in",
",",
"CRC32",
"crc",
")",
"throws",
"IOException",
"{",
"int",
"s",
"=",
"readShort",
"(",
"in",
",",
"crc",
")",
";",
"return",
"(",
"(",
"readShort",
"(",
"in",
",",
"crc",
")",
"<<",
"16",
"... | Read an int.
We do not expect to get a -1 reading. If we do, we throw exception.
Update the crc as we go.
@param in InputStream to read.
@param crc CRC to update.
@return int read.
@throws IOException | [
"Read",
"an",
"int",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/zip/GzipHeader.java#L213-L216 |
36,722 | iipc/webarchive-commons | src/main/java/org/archive/url/UsableURI.java | UsableURI.getHostBasename | public String getHostBasename() throws URIException {
// caching eliminated because this is rarely used
// (only benefits legacy DomainScope, which should
// be retired). Saves 4-byte object pointer in UURI
// instances.
return (this.getReferencedHost() == null)
? nu... | java | public String getHostBasename() throws URIException {
// caching eliminated because this is rarely used
// (only benefits legacy DomainScope, which should
// be retired). Saves 4-byte object pointer in UURI
// instances.
return (this.getReferencedHost() == null)
? nu... | [
"public",
"String",
"getHostBasename",
"(",
")",
"throws",
"URIException",
"{",
"// caching eliminated because this is rarely used",
"// (only benefits legacy DomainScope, which should",
"// be retired). Saves 4-byte object pointer in UURI",
"// instances.",
"return",
"(",
"this",
".",... | Strips www variants from the host.
Strips www[0-9]*\. from the host. If calling getHostBaseName becomes a
performance issue we should consider adding the hostBasename member that
is set on initialization.
@return Host's basename.
@throws URIException | [
"Strips",
"www",
"variants",
"from",
"the",
"host",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/UsableURI.java#L238-L247 |
36,723 | iipc/webarchive-commons | src/main/java/org/archive/url/UsableURI.java | UsableURI.coalesceUriStrings | protected void coalesceUriStrings() {
if (this.cachedString != null && this.cachedEscapedURI != null
&& this.cachedString.length() == this.cachedEscapedURI.length()) {
// lengths will only be identical if contents are identical
// (deescaping will always shrink length), s... | java | protected void coalesceUriStrings() {
if (this.cachedString != null && this.cachedEscapedURI != null
&& this.cachedString.length() == this.cachedEscapedURI.length()) {
// lengths will only be identical if contents are identical
// (deescaping will always shrink length), s... | [
"protected",
"void",
"coalesceUriStrings",
"(",
")",
"{",
"if",
"(",
"this",
".",
"cachedString",
"!=",
"null",
"&&",
"this",
".",
"cachedEscapedURI",
"!=",
"null",
"&&",
"this",
".",
"cachedString",
".",
"length",
"(",
")",
"==",
"this",
".",
"cachedEscap... | The two String fields cachedString and cachedEscapedURI are
usually identical; if so, coalesce into a single instance. | [
"The",
"two",
"String",
"fields",
"cachedString",
"and",
"cachedEscapedURI",
"are",
"usually",
"identical",
";",
"if",
"so",
"coalesce",
"into",
"a",
"single",
"instance",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/UsableURI.java#L336-L344 |
36,724 | iipc/webarchive-commons | src/main/java/org/archive/url/UsableURI.java | UsableURI.coalesceHostAuthorityStrings | protected void coalesceHostAuthorityStrings() {
if (this.cachedAuthorityMinusUserinfo != null
&& this.cachedHost != null
&& this.cachedHost.length() ==
this.cachedAuthorityMinusUserinfo.length()) {
// lengths can only be identical if contents
... | java | protected void coalesceHostAuthorityStrings() {
if (this.cachedAuthorityMinusUserinfo != null
&& this.cachedHost != null
&& this.cachedHost.length() ==
this.cachedAuthorityMinusUserinfo.length()) {
// lengths can only be identical if contents
... | [
"protected",
"void",
"coalesceHostAuthorityStrings",
"(",
")",
"{",
"if",
"(",
"this",
".",
"cachedAuthorityMinusUserinfo",
"!=",
"null",
"&&",
"this",
".",
"cachedHost",
"!=",
"null",
"&&",
"this",
".",
"cachedHost",
".",
"length",
"(",
")",
"==",
"this",
"... | The two String fields cachedHost and cachedAuthorityMinusUserInfo are
usually identical; if so, coalesce into a single instance. | [
"The",
"two",
"String",
"fields",
"cachedHost",
"and",
"cachedAuthorityMinusUserInfo",
"are",
"usually",
"identical",
";",
"if",
"so",
"coalesce",
"into",
"a",
"single",
"instance",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/UsableURI.java#L362-L371 |
36,725 | iipc/webarchive-commons | src/main/java/org/archive/url/UsableURI.java | UsableURI.getReferencedHost | public String getReferencedHost() throws URIException {
String referencedHost = this.getHost();
if(referencedHost==null && this.getScheme().equals("dns")) {
// extract target domain of DNS lookup
String possibleHost = this.getCurrentHierPath();
if(possibleHost != null... | java | public String getReferencedHost() throws URIException {
String referencedHost = this.getHost();
if(referencedHost==null && this.getScheme().equals("dns")) {
// extract target domain of DNS lookup
String possibleHost = this.getCurrentHierPath();
if(possibleHost != null... | [
"public",
"String",
"getReferencedHost",
"(",
")",
"throws",
"URIException",
"{",
"String",
"referencedHost",
"=",
"this",
".",
"getHost",
"(",
")",
";",
"if",
"(",
"referencedHost",
"==",
"null",
"&&",
"this",
".",
"getScheme",
"(",
")",
".",
"equals",
"(... | Return the referenced host in the UURI, if any, also extracting the
host of a DNS-lookup URI where necessary.
@return the target or topic host of the URI
@throws URIException | [
"Return",
"the",
"referenced",
"host",
"in",
"the",
"UURI",
"if",
"any",
"also",
"extracting",
"the",
"host",
"of",
"a",
"DNS",
"-",
"lookup",
"URI",
"where",
"necessary",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/UsableURI.java#L380-L390 |
36,726 | iipc/webarchive-commons | src/main/java/org/archive/url/UsableURI.java | UsableURI.hasScheme | public static boolean hasScheme(String possibleUrl) {
boolean result = false;
for (int i = 0; i < possibleUrl.length(); i++) {
char c = possibleUrl.charAt(i);
if (c == ':') {
if (i != 0) {
result = true;
}
break;... | java | public static boolean hasScheme(String possibleUrl) {
boolean result = false;
for (int i = 0; i < possibleUrl.length(); i++) {
char c = possibleUrl.charAt(i);
if (c == ':') {
if (i != 0) {
result = true;
}
break;... | [
"public",
"static",
"boolean",
"hasScheme",
"(",
"String",
"possibleUrl",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"possibleUrl",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"char",
"... | Test if passed String has likely URI scheme prefix.
@param possibleUrl URL string to examine.
@return True if passed string looks like it could be an URL. | [
"Test",
"if",
"passed",
"String",
"has",
"likely",
"URI",
"scheme",
"prefix",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/UsableURI.java#L461-L476 |
36,727 | iipc/webarchive-commons | src/main/java/org/archive/format/http/HttpHeaders.java | HttpHeaders.write | public void write(OutputStream out) throws IOException {
for(HttpHeader header: this) {
header.write(out);
}
out.write(CR);
out.write(LF);
} | java | public void write(OutputStream out) throws IOException {
for(HttpHeader header: this) {
header.write(out);
}
out.write(CR);
out.write(LF);
} | [
"public",
"void",
"write",
"(",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"for",
"(",
"HttpHeader",
"header",
":",
"this",
")",
"{",
"header",
".",
"write",
"(",
"out",
")",
";",
"}",
"out",
".",
"write",
"(",
"CR",
")",
";",
"out",
... | Write all Headers and a trailing CRLF, CRLF
@param out
@throws IOException | [
"Write",
"all",
"Headers",
"and",
"a",
"trailing",
"CRLF",
"CRLF"
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/http/HttpHeaders.java#L143-L149 |
36,728 | iipc/webarchive-commons | src/main/java/org/archive/httpclient/ThreadLocalHttpConnectionManager.java | ThreadLocalHttpConnectionManager.finishLastResponse | private static boolean finishLastResponse(final HttpConnection conn) {
InputStream lastResponse = conn.getLastResponseInputStream();
if(lastResponse != null) {
conn.setLastResponseInputStream(null);
try {
lastResponse.close();
return true;
... | java | private static boolean finishLastResponse(final HttpConnection conn) {
InputStream lastResponse = conn.getLastResponseInputStream();
if(lastResponse != null) {
conn.setLastResponseInputStream(null);
try {
lastResponse.close();
return true;
... | [
"private",
"static",
"boolean",
"finishLastResponse",
"(",
"final",
"HttpConnection",
"conn",
")",
"{",
"InputStream",
"lastResponse",
"=",
"conn",
".",
"getLastResponseInputStream",
"(",
")",
";",
"if",
"(",
"lastResponse",
"!=",
"null",
")",
"{",
"conn",
".",
... | Since the same connection is about to be reused, make sure the
previous request was completely processed, and if not
consume it now.
@param conn The connection
@return true, if the connection is reusable | [
"Since",
"the",
"same",
"connection",
"is",
"about",
"to",
"be",
"reused",
"make",
"sure",
"the",
"previous",
"request",
"was",
"completely",
"processed",
"and",
"if",
"not",
"consume",
"it",
"now",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/httpclient/ThreadLocalHttpConnectionManager.java#L78-L92 |
36,729 | iipc/webarchive-commons | src/main/java/org/archive/io/arc/ARCWriter.java | ARCWriter.generateARCFileMetaData | private byte [] generateARCFileMetaData(String date)
throws IOException {
if(date!=null && date.length()>14) {
date = date.substring(0,14);
}
int metadataBodyLength = getMetadataLength();
// If metadata body, then the minor part of the version is '1' rather
// tha... | java | private byte [] generateARCFileMetaData(String date)
throws IOException {
if(date!=null && date.length()>14) {
date = date.substring(0,14);
}
int metadataBodyLength = getMetadataLength();
// If metadata body, then the minor part of the version is '1' rather
// tha... | [
"private",
"byte",
"[",
"]",
"generateARCFileMetaData",
"(",
"String",
"date",
")",
"throws",
"IOException",
"{",
"if",
"(",
"date",
"!=",
"null",
"&&",
"date",
".",
"length",
"(",
")",
">",
"14",
")",
"{",
"date",
"=",
"date",
".",
"substring",
"(",
... | Write out the ARCMetaData.
<p>Generate ARC file meta data. Currently we only do version 1 of the
ARC file formats or version 1.1 when metadata has been supplied (We
write it into the body of the first record in the arc file).
<p>Version 1 metadata looks roughly like this:
<pre>filedesc://testWriteRecord-JunitIAH200... | [
"Write",
"out",
"the",
"ARCMetaData",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/arc/ARCWriter.java#L202-L266 |
36,730 | iipc/webarchive-commons | src/main/java/org/archive/io/arc/ARCWriter.java | ARCWriter.validateMetaLine | protected String validateMetaLine(String metaLineStr)
throws IOException {
if (metaLineStr.length() > MAX_METADATA_LINE_LENGTH) {
throw new IOException("Metadata line too long ("
+ metaLineStr.length() + ">" + MAX_METADATA_LINE_LENGTH
+ "): " + metaLineStr);
... | java | protected String validateMetaLine(String metaLineStr)
throws IOException {
if (metaLineStr.length() > MAX_METADATA_LINE_LENGTH) {
throw new IOException("Metadata line too long ("
+ metaLineStr.length() + ">" + MAX_METADATA_LINE_LENGTH
+ "): " + metaLineStr);
... | [
"protected",
"String",
"validateMetaLine",
"(",
"String",
"metaLineStr",
")",
"throws",
"IOException",
"{",
"if",
"(",
"metaLineStr",
".",
"length",
"(",
")",
">",
"MAX_METADATA_LINE_LENGTH",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Metadata line too long (\... | Test that the metadata line is valid before writing.
@param metaLineStr
@throws IOException
@return The passed in metaline. | [
"Test",
"that",
"the",
"metadata",
"line",
"is",
"valid",
"before",
"writing",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/arc/ARCWriter.java#L445-L458 |
36,731 | iipc/webarchive-commons | src/main/java/org/archive/format/warc/WARCRecordWriter.java | WARCRecordWriter.writeRecord | private void writeRecord( OutputStream out,
HttpHeaders headers,
byte[] contents) throws IOException
{
if ( contents == null )
{
headers.add(CONTENT_LENGTH, "0");
}
else
{
headers.add(CONTENT_LENGTH,String.valueOf(con... | java | private void writeRecord( OutputStream out,
HttpHeaders headers,
byte[] contents) throws IOException
{
if ( contents == null )
{
headers.add(CONTENT_LENGTH, "0");
}
else
{
headers.add(CONTENT_LENGTH,String.valueOf(con... | [
"private",
"void",
"writeRecord",
"(",
"OutputStream",
"out",
",",
"HttpHeaders",
"headers",
",",
"byte",
"[",
"]",
"contents",
")",
"throws",
"IOException",
"{",
"if",
"(",
"contents",
"==",
"null",
")",
"{",
"headers",
".",
"add",
"(",
"CONTENT_LENGTH",
... | Write the headers and contents as a WARC record to the given
output stream.
WARC record format:
<pre>warc-file = 1*warc-record
warc-record = header CRLF block CRLF CRLF
header = version warc-fields
version = "WARC/0.18" CRLF
warc-fields = *named-field CRLF
block = *OCTET</pre> | [
"Write",
"the",
"headers",
"and",
"contents",
"as",
"a",
"WARC",
"record",
"to",
"the",
"given",
"output",
"stream",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/warc/WARCRecordWriter.java#L29-L60 |
36,732 | iipc/webarchive-commons | src/main/java/org/archive/io/ArchiveReaderFactory.java | ArchiveReaderFactory.get | public static ArchiveReader get(final String arcFileOrUrl)
throws MalformedURLException, IOException {
return ArchiveReaderFactory.factory.getArchiveReader(arcFileOrUrl);
} | java | public static ArchiveReader get(final String arcFileOrUrl)
throws MalformedURLException, IOException {
return ArchiveReaderFactory.factory.getArchiveReader(arcFileOrUrl);
} | [
"public",
"static",
"ArchiveReader",
"get",
"(",
"final",
"String",
"arcFileOrUrl",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"return",
"ArchiveReaderFactory",
".",
"factory",
".",
"getArchiveReader",
"(",
"arcFileOrUrl",
")",
";",
"}"
] | Get an Archive file Reader on passed path or url.
Does primitive heuristic figuring if path or URL.
@param arcFileOrUrl File path or URL pointing at an Archive file.
@return An Archive file Reader.
@throws IOException
@throws MalformedURLException
@throws IOException | [
"Get",
"an",
"Archive",
"file",
"Reader",
"on",
"passed",
"path",
"or",
"url",
".",
"Does",
"primitive",
"heuristic",
"figuring",
"if",
"path",
"or",
"URL",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ArchiveReaderFactory.java#L74-L77 |
36,733 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneOption.java | SaneOption.getIntegerValue | public int getIntegerValue() throws IOException, SaneException {
// check for type agreement
Preconditions.checkState(getValueType() == OptionValueType.INT, "option is not an integer");
Preconditions.checkState(getValueCount() == 1, "option is an integer array, not integer");
// Send RCP corresponding ... | java | public int getIntegerValue() throws IOException, SaneException {
// check for type agreement
Preconditions.checkState(getValueType() == OptionValueType.INT, "option is not an integer");
Preconditions.checkState(getValueCount() == 1, "option is an integer array, not integer");
// Send RCP corresponding ... | [
"public",
"int",
"getIntegerValue",
"(",
")",
"throws",
"IOException",
",",
"SaneException",
"{",
"// check for type agreement",
"Preconditions",
".",
"checkState",
"(",
"getValueType",
"(",
")",
"==",
"OptionValueType",
".",
"INT",
",",
"\"option is not an integer\"",
... | Reads the current Integer value option. We do not cache value from previous get or set
operations so each get involves a round trip to the server.
TODO: consider caching the returned value for "fast read" later
@return the value of the option
@throws IOException if a problem occurred while talking to SANE | [
"Reads",
"the",
"current",
"Integer",
"value",
"option",
".",
"We",
"do",
"not",
"cache",
"value",
"from",
"previous",
"get",
"or",
"set",
"operations",
"so",
"each",
"get",
"involves",
"a",
"round",
"trip",
"to",
"the",
"server",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneOption.java#L343-L364 |
36,734 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneOption.java | SaneOption.setBooleanValue | public boolean setBooleanValue(boolean value) throws IOException, SaneException {
ControlOptionResult result = writeOption(SaneWord.forInt(value ? 1 : 0));
Preconditions.checkState(result.getType() == OptionValueType.BOOLEAN);
return SaneWord.fromBytes(result.getValue()).integerValue() != 0;
} | java | public boolean setBooleanValue(boolean value) throws IOException, SaneException {
ControlOptionResult result = writeOption(SaneWord.forInt(value ? 1 : 0));
Preconditions.checkState(result.getType() == OptionValueType.BOOLEAN);
return SaneWord.fromBytes(result.getValue()).integerValue() != 0;
} | [
"public",
"boolean",
"setBooleanValue",
"(",
"boolean",
"value",
")",
"throws",
"IOException",
",",
"SaneException",
"{",
"ControlOptionResult",
"result",
"=",
"writeOption",
"(",
"SaneWord",
".",
"forInt",
"(",
"value",
"?",
"1",
":",
"0",
")",
")",
";",
"P... | Sets the value of the current option to the supplied boolean value. Option value must be of
boolean type. SANE may ignore your preference, so if you need to ensure the value has been set
correctly, you should examine the return value of this method.
@return the value that the option now has according to SANE | [
"Sets",
"the",
"value",
"of",
"the",
"current",
"option",
"to",
"the",
"supplied",
"boolean",
"value",
".",
"Option",
"value",
"must",
"be",
"of",
"boolean",
"type",
".",
"SANE",
"may",
"ignore",
"your",
"preference",
"so",
"if",
"you",
"need",
"to",
"en... | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneOption.java#L473-L478 |
36,735 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneOption.java | SaneOption.setFixedValue | public double setFixedValue(double value) throws IOException, SaneException {
Preconditions.checkArgument(
value >= -32768 && value <= 32767.9999, "value " + value + " is out of range");
SaneWord wordValue = SaneWord.forFixedPrecision(value);
ControlOptionResult result = writeOption(wordValue);
... | java | public double setFixedValue(double value) throws IOException, SaneException {
Preconditions.checkArgument(
value >= -32768 && value <= 32767.9999, "value " + value + " is out of range");
SaneWord wordValue = SaneWord.forFixedPrecision(value);
ControlOptionResult result = writeOption(wordValue);
... | [
"public",
"double",
"setFixedValue",
"(",
"double",
"value",
")",
"throws",
"IOException",
",",
"SaneException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"value",
">=",
"-",
"32768",
"&&",
"value",
"<=",
"32767.9999",
",",
"\"value \"",
"+",
"value",
"... | Sets the value of the current option to the supplied fixed-precision value. Option value must
be of fixed-precision type. | [
"Sets",
"the",
"value",
"of",
"the",
"current",
"option",
"to",
"the",
"supplied",
"fixed",
"-",
"precision",
"value",
".",
"Option",
"value",
"must",
"be",
"of",
"fixed",
"-",
"precision",
"type",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneOption.java#L488-L498 |
36,736 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneOption.java | SaneOption.setIntegerValue | public int setIntegerValue(int newValue) throws IOException, SaneException {
Preconditions.checkState(getValueCount() == 1, "option is an array");
// check that this option is readable
Preconditions.checkState(isWriteable());
// Send RPC corresponding to:
//
// SANE_Status sane_control_option ... | java | public int setIntegerValue(int newValue) throws IOException, SaneException {
Preconditions.checkState(getValueCount() == 1, "option is an array");
// check that this option is readable
Preconditions.checkState(isWriteable());
// Send RPC corresponding to:
//
// SANE_Status sane_control_option ... | [
"public",
"int",
"setIntegerValue",
"(",
"int",
"newValue",
")",
"throws",
"IOException",
",",
"SaneException",
"{",
"Preconditions",
".",
"checkState",
"(",
"getValueCount",
"(",
")",
"==",
"1",
",",
"\"option is an array\"",
")",
";",
"// check that this option is... | Set the value of the current option to the supplied value. Option value must be of integer type
TODO: consider caching the returned value for "fast read" later
@param newValue for the option
@return the value actually set
@throws IOException | [
"Set",
"the",
"value",
"of",
"the",
"current",
"option",
"to",
"the",
"supplied",
"value",
".",
"Option",
"value",
"must",
"be",
"of",
"integer",
"type"
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneOption.java#L571-L588 |
36,737 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneDevice.java | SaneDevice.close | @Override
public void close() throws IOException {
if (!isOpen()) {
throw new IOException("device is already closed");
}
session.closeDevice(handle);
handle = null;
} | java | @Override
public void close() throws IOException {
if (!isOpen()) {
throw new IOException("device is already closed");
}
session.closeDevice(handle);
handle = null;
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"isOpen",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"device is already closed\"",
")",
";",
"}",
"session",
".",
"closeDevice",
"(",
"handle... | Closes the device.
@throws IOException if an error occurs talking to the SANE backend
@throws IllegalStateException if the device is already closed | [
"Closes",
"the",
"device",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneDevice.java#L130-L138 |
36,738 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneDevice.java | SaneDevice.listOptions | public List<SaneOption> listOptions() throws IOException {
if (optionTitleMap == null) {
groups.clear();
optionTitleMap =
Maps.uniqueIndex(
SaneOption.optionsFor(this),
new Function<SaneOption, String>() {
@Override
public String appl... | java | public List<SaneOption> listOptions() throws IOException {
if (optionTitleMap == null) {
groups.clear();
optionTitleMap =
Maps.uniqueIndex(
SaneOption.optionsFor(this),
new Function<SaneOption, String>() {
@Override
public String appl... | [
"public",
"List",
"<",
"SaneOption",
">",
"listOptions",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"optionTitleMap",
"==",
"null",
")",
"{",
"groups",
".",
"clear",
"(",
")",
";",
"optionTitleMap",
"=",
"Maps",
".",
"uniqueIndex",
"(",
"SaneOption... | Returns the list of options applicable to this device.
@return a list of {@link SaneOption} instances
@throws IOException if a problem occurred talking to the SANE backend | [
"Returns",
"the",
"list",
"of",
"options",
"applicable",
"to",
"this",
"device",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneDevice.java#L167-L183 |
36,739 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/OptionGroup.java | OptionGroup.addOption | void addOption(SaneOption option) {
Preconditions.checkState(option.getGroup() == this);
options.add(option);
} | java | void addOption(SaneOption option) {
Preconditions.checkState(option.getGroup() == this);
options.add(option);
} | [
"void",
"addOption",
"(",
"SaneOption",
"option",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"option",
".",
"getGroup",
"(",
")",
"==",
"this",
")",
";",
"options",
".",
"add",
"(",
"option",
")",
";",
"}"
] | Adds an option to the group. | [
"Adds",
"an",
"option",
"to",
"the",
"group",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/OptionGroup.java#L42-L45 |
36,740 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneSession.java | SaneSession.withRemoteSane | public static SaneSession withRemoteSane(InetAddress saneAddress, int port) throws IOException {
return withRemoteSane(saneAddress, port, 0, TimeUnit.MILLISECONDS, 0, TimeUnit.MILLISECONDS);
} | java | public static SaneSession withRemoteSane(InetAddress saneAddress, int port) throws IOException {
return withRemoteSane(saneAddress, port, 0, TimeUnit.MILLISECONDS, 0, TimeUnit.MILLISECONDS);
} | [
"public",
"static",
"SaneSession",
"withRemoteSane",
"(",
"InetAddress",
"saneAddress",
",",
"int",
"port",
")",
"throws",
"IOException",
"{",
"return",
"withRemoteSane",
"(",
"saneAddress",
",",
"port",
",",
"0",
",",
"TimeUnit",
".",
"MILLISECONDS",
",",
"0",
... | Establishes a connection to the SANE daemon running on the given host on the given port with no
connection timeout. | [
"Establishes",
"a",
"connection",
"to",
"the",
"SANE",
"daemon",
"running",
"on",
"the",
"given",
"host",
"on",
"the",
"given",
"port",
"with",
"no",
"connection",
"timeout",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L86-L88 |
36,741 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneSession.java | SaneSession.listDevices | public List<SaneDevice> listDevices() throws IOException, SaneException {
outputStream.write(SaneRpcCode.SANE_NET_GET_DEVICES);
outputStream.flush();
return inputStream.readDeviceList();
} | java | public List<SaneDevice> listDevices() throws IOException, SaneException {
outputStream.write(SaneRpcCode.SANE_NET_GET_DEVICES);
outputStream.flush();
return inputStream.readDeviceList();
} | [
"public",
"List",
"<",
"SaneDevice",
">",
"listDevices",
"(",
")",
"throws",
"IOException",
",",
"SaneException",
"{",
"outputStream",
".",
"write",
"(",
"SaneRpcCode",
".",
"SANE_NET_GET_DEVICES",
")",
";",
"outputStream",
".",
"flush",
"(",
")",
";",
"return... | Lists the devices known to the SANE daemon.
@return a list of devices that may be opened, see {@link SaneDevice#open}
@throws IOException if an error occurs while communicating with the SANE daemon
@throws SaneException if the SANE backend returns an error in response to this request | [
"Lists",
"the",
"devices",
"known",
"to",
"the",
"SANE",
"daemon",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L160-L164 |
36,742 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneSession.java | SaneSession.close | @Override
public void close() throws IOException {
try {
outputStream.write(SaneRpcCode.SANE_NET_EXIT);
outputStream.close();
} finally {
socket.close();
}
} | java | @Override
public void close() throws IOException {
try {
outputStream.write(SaneRpcCode.SANE_NET_EXIT);
outputStream.close();
} finally {
socket.close();
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"outputStream",
".",
"write",
"(",
"SaneRpcCode",
".",
"SANE_NET_EXIT",
")",
";",
"outputStream",
".",
"close",
"(",
")",
";",
"}",
"finally",
"{",
"socket",
... | Closes the connection to the SANE server. This is done immediately by closing the socket.
@throws IOException if an error occurred while closing the connection | [
"Closes",
"the",
"connection",
"to",
"the",
"SANE",
"server",
".",
"This",
"is",
"done",
"immediately",
"by",
"closing",
"the",
"socket",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L171-L179 |
36,743 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneSession.java | SaneSession.authorize | boolean authorize(String resource) throws IOException {
if (passwordProvider == null) {
throw new IOException(
"Authorization failed - no password provider present "
+ "(you must call setPasswordProvider)");
}
if (passwordProvider.canAuthenticate(resource)) {
// RPC code... | java | boolean authorize(String resource) throws IOException {
if (passwordProvider == null) {
throw new IOException(
"Authorization failed - no password provider present "
+ "(you must call setPasswordProvider)");
}
if (passwordProvider.canAuthenticate(resource)) {
// RPC code... | [
"boolean",
"authorize",
"(",
"String",
"resource",
")",
"throws",
"IOException",
"{",
"if",
"(",
"passwordProvider",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Authorization failed - no password provider present \"",
"+",
"\"(you must call setPasswordP... | Authorize the resource for access.
@throws IOException if an error occurs while communicating with the SANE daemon | [
"Authorize",
"the",
"resource",
"for",
"access",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L345-L366 |
36,744 | sjamesr/jfreesane | src/main/java/au/com/southsky/jfreesane/SaneSession.java | SaneSession.writePassword | private void writePassword(String resource, String password) throws IOException {
String[] resourceParts = resource.split("\\$MD5\\$");
if (resourceParts.length == 1) {
// Write in clean
outputStream.write(password);
} else {
outputStream.write("$MD5$" + SanePasswordEncoder.derivePassword(... | java | private void writePassword(String resource, String password) throws IOException {
String[] resourceParts = resource.split("\\$MD5\\$");
if (resourceParts.length == 1) {
// Write in clean
outputStream.write(password);
} else {
outputStream.write("$MD5$" + SanePasswordEncoder.derivePassword(... | [
"private",
"void",
"writePassword",
"(",
"String",
"resource",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"resourceParts",
"=",
"resource",
".",
"split",
"(",
"\"\\\\$MD5\\\\$\"",
")",
";",
"if",
"(",
"resourceParts",
"."... | Write password to outputstream depending on resource provided by saned.
@param resource as provided by sane in authorization request
@param password
@throws IOException | [
"Write",
"password",
"to",
"outputstream",
"depending",
"on",
"resource",
"provided",
"by",
"saned",
"."
] | 15ad0f73df0a8d0efec5167a2141cbd53afd862d | https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L375-L383 |
36,745 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlay.java | FeatureOverlay.ignoreTileDao | public void ignoreTileDao(TileDao tileDao) {
GeoPackageOverlay tileOverlay = new GeoPackageOverlay(tileDao);
linkedOverlays.add(tileOverlay);
} | java | public void ignoreTileDao(TileDao tileDao) {
GeoPackageOverlay tileOverlay = new GeoPackageOverlay(tileDao);
linkedOverlays.add(tileOverlay);
} | [
"public",
"void",
"ignoreTileDao",
"(",
"TileDao",
"tileDao",
")",
"{",
"GeoPackageOverlay",
"tileOverlay",
"=",
"new",
"GeoPackageOverlay",
"(",
"tileDao",
")",
";",
"linkedOverlays",
".",
"add",
"(",
"tileOverlay",
")",
";",
"}"
] | Ignore drawing tiles if they exist in the tile table represented by the tile dao
@param tileDao tile data access object
@since 1.2.6 | [
"Ignore",
"drawing",
"tiles",
"if",
"they",
"exist",
"in",
"the",
"tile",
"table",
"represented",
"by",
"the",
"tile",
"dao"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlay.java#L112-L116 |
36,746 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.simplifyPoints | private List<Point> simplifyPoints(List<Point> points) {
List<Point> simplifiedPoints = null;
if (simplifyTolerance != null) {
// Reproject to web mercator if not in meters
if (projection != null && !projection.isUnit(Units.METRES)) {
points = toWebMercator.tran... | java | private List<Point> simplifyPoints(List<Point> points) {
List<Point> simplifiedPoints = null;
if (simplifyTolerance != null) {
// Reproject to web mercator if not in meters
if (projection != null && !projection.isUnit(Units.METRES)) {
points = toWebMercator.tran... | [
"private",
"List",
"<",
"Point",
">",
"simplifyPoints",
"(",
"List",
"<",
"Point",
">",
"points",
")",
"{",
"List",
"<",
"Point",
">",
"simplifiedPoints",
"=",
"null",
";",
"if",
"(",
"simplifyTolerance",
"!=",
"null",
")",
"{",
"// Reproject to web mercator... | When the simplify tolerance is set, simplify the points to a similar
curve with fewer points.
@param points ordered points
@return simplified points | [
"When",
"the",
"simplify",
"tolerance",
"is",
"set",
"simplify",
"the",
"points",
"to",
"a",
"similar",
"curve",
"with",
"fewer",
"points",
"."
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L565-L588 |
36,747 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.getOrientation | public PolygonOrientation getOrientation(List<LatLng> points) {
return SphericalUtil.computeSignedArea(points) >= 0 ? PolygonOrientation.COUNTERCLOCKWISE : PolygonOrientation.CLOCKWISE;
} | java | public PolygonOrientation getOrientation(List<LatLng> points) {
return SphericalUtil.computeSignedArea(points) >= 0 ? PolygonOrientation.COUNTERCLOCKWISE : PolygonOrientation.CLOCKWISE;
} | [
"public",
"PolygonOrientation",
"getOrientation",
"(",
"List",
"<",
"LatLng",
">",
"points",
")",
"{",
"return",
"SphericalUtil",
".",
"computeSignedArea",
"(",
"points",
")",
">=",
"0",
"?",
"PolygonOrientation",
".",
"COUNTERCLOCKWISE",
":",
"PolygonOrientation",
... | Determine the closed points orientation
@param points closed points
@return orientation
@since 1.3.2 | [
"Determine",
"the",
"closed",
"points",
"orientation"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L728-L730 |
36,748 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addShapeToMap | public static GoogleMapShape addShapeToMap(GoogleMap map,
GoogleMapShape shape) {
GoogleMapShape addedShape = null;
switch (shape.getShapeType()) {
case LAT_LNG:
addedShape = new GoogleMapShape(shape.getGeometryType(),
... | java | public static GoogleMapShape addShapeToMap(GoogleMap map,
GoogleMapShape shape) {
GoogleMapShape addedShape = null;
switch (shape.getShapeType()) {
case LAT_LNG:
addedShape = new GoogleMapShape(shape.getGeometryType(),
... | [
"public",
"static",
"GoogleMapShape",
"addShapeToMap",
"(",
"GoogleMap",
"map",
",",
"GoogleMapShape",
"shape",
")",
"{",
"GoogleMapShape",
"addedShape",
"=",
"null",
";",
"switch",
"(",
"shape",
".",
"getShapeType",
"(",
")",
")",
"{",
"case",
"LAT_LNG",
":",... | Add a shape to the map
@param map google map
@param shape google map shape
@return google map shape | [
"Add",
"a",
"shape",
"to",
"the",
"map"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1464-L1524 |
36,749 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addPolygonsToMap | public static mil.nga.geopackage.map.geom.MultiPolygon addPolygonsToMap(
GoogleMap map, MultiPolygonOptions polygons) {
mil.nga.geopackage.map.geom.MultiPolygon multiPolygon = new mil.nga.geopackage.map.geom.MultiPolygon();
for (PolygonOptions polygonOption : polygons.getPolygonOptions()) {
... | java | public static mil.nga.geopackage.map.geom.MultiPolygon addPolygonsToMap(
GoogleMap map, MultiPolygonOptions polygons) {
mil.nga.geopackage.map.geom.MultiPolygon multiPolygon = new mil.nga.geopackage.map.geom.MultiPolygon();
for (PolygonOptions polygonOption : polygons.getPolygonOptions()) {
... | [
"public",
"static",
"mil",
".",
"nga",
".",
"geopackage",
".",
"map",
".",
"geom",
".",
"MultiPolygon",
"addPolygonsToMap",
"(",
"GoogleMap",
"map",
",",
"MultiPolygonOptions",
"polygons",
")",
"{",
"mil",
".",
"nga",
".",
"geopackage",
".",
"map",
".",
"g... | Add a list of Polygons to the map
@param map google map
@param polygons multi polygon options
@return multi polygon | [
"Add",
"a",
"list",
"of",
"Polygons",
"to",
"the",
"map"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1643-L1661 |
36,750 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addPointsToMapAsMarkers | public List<Marker> addPointsToMapAsMarkers(GoogleMap map,
List<LatLng> points, MarkerOptions customMarkerOptions,
boolean ignoreIdenticalEnds) {
List<Marker> markers = new ArrayList<Marker>();
for (int i = ... | java | public List<Marker> addPointsToMapAsMarkers(GoogleMap map,
List<LatLng> points, MarkerOptions customMarkerOptions,
boolean ignoreIdenticalEnds) {
List<Marker> markers = new ArrayList<Marker>();
for (int i = ... | [
"public",
"List",
"<",
"Marker",
">",
"addPointsToMapAsMarkers",
"(",
"GoogleMap",
"map",
",",
"List",
"<",
"LatLng",
">",
"points",
",",
"MarkerOptions",
"customMarkerOptions",
",",
"boolean",
"ignoreIdenticalEnds",
")",
"{",
"List",
"<",
"Marker",
">",
"marker... | Add the list of points as markers
@param map google map
@param points points
@param customMarkerOptions custom marker options
@param ignoreIdenticalEnds ignore identical ends flag
@return list of markers | [
"Add",
"the",
"list",
"of",
"points",
"as",
"markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1817-L1846 |
36,751 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addPolylineToMapAsMarkers | public PolylineMarkers addPolylineToMapAsMarkers(GoogleMap map,
PolylineOptions polylineOptions,
MarkerOptions polylineMarkerOptions,
PolylineOptions globalPolyl... | java | public PolylineMarkers addPolylineToMapAsMarkers(GoogleMap map,
PolylineOptions polylineOptions,
MarkerOptions polylineMarkerOptions,
PolylineOptions globalPolyl... | [
"public",
"PolylineMarkers",
"addPolylineToMapAsMarkers",
"(",
"GoogleMap",
"map",
",",
"PolylineOptions",
"polylineOptions",
",",
"MarkerOptions",
"polylineMarkerOptions",
",",
"PolylineOptions",
"globalPolylineOptions",
")",
"{",
"PolylineMarkers",
"polylineMarkers",
"=",
"... | Add a Polyline to the map as markers
@param map google map
@param polylineOptions polyline options
@param polylineMarkerOptions polyline marker options
@param globalPolylineOptions global polyline options
@return polyline markers | [
"Add",
"a",
"Polyline",
"to",
"the",
"map",
"as",
"markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1857-L1880 |
36,752 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addPolygonToMapAsMarkers | public PolygonMarkers addPolygonToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
PolygonOptions polygonOptions, MarkerOptions polygonMarkerOptions,
MarkerOptions polygonMarkerHoleOptions,
PolygonOptions globalPolygonOptions) {
PolygonMarkers pol... | java | public PolygonMarkers addPolygonToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
PolygonOptions polygonOptions, MarkerOptions polygonMarkerOptions,
MarkerOptions polygonMarkerHoleOptions,
PolygonOptions globalPolygonOptions) {
PolygonMarkers pol... | [
"public",
"PolygonMarkers",
"addPolygonToMapAsMarkers",
"(",
"GoogleMapShapeMarkers",
"shapeMarkers",
",",
"GoogleMap",
"map",
",",
"PolygonOptions",
"polygonOptions",
",",
"MarkerOptions",
"polygonMarkerOptions",
",",
"MarkerOptions",
"polygonMarkerHoleOptions",
",",
"PolygonO... | Add a Polygon to the map as markers
@param shapeMarkers google map shape markers
@param map google map
@param polygonOptions polygon options
@param polygonMarkerOptions polygon marker options
@param polygonMarkerHoleOptions polygon marker hole options
@param globalPolygon... | [
"Add",
"a",
"Polygon",
"to",
"the",
"map",
"as",
"markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1893-L1929 |
36,753 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addMultiPolylineToMapAsMarkers | public MultiPolylineMarkers addMultiPolylineToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
MultiPolylineOptions multiPolyline,
MarkerOptions polylineMarkerOptions,
PolylineOptions globalPolylineOptions) {
MultiPolylineMarkers polylines = new Mu... | java | public MultiPolylineMarkers addMultiPolylineToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
MultiPolylineOptions multiPolyline,
MarkerOptions polylineMarkerOptions,
PolylineOptions globalPolylineOptions) {
MultiPolylineMarkers polylines = new Mu... | [
"public",
"MultiPolylineMarkers",
"addMultiPolylineToMapAsMarkers",
"(",
"GoogleMapShapeMarkers",
"shapeMarkers",
",",
"GoogleMap",
"map",
",",
"MultiPolylineOptions",
"multiPolyline",
",",
"MarkerOptions",
"polylineMarkerOptions",
",",
"PolylineOptions",
"globalPolylineOptions",
... | Add a MultiPolylineOptions to the map as markers
@param shapeMarkers google map shape markers
@param map google map
@param multiPolyline multi polyline options
@param polylineMarkerOptions polyline marker options
@param globalPolylineOptions global polyline options
@return multi poly... | [
"Add",
"a",
"MultiPolylineOptions",
"to",
"the",
"map",
"as",
"markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1941-L1956 |
36,754 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.addMultiPolygonToMapAsMarkers | public MultiPolygonMarkers addMultiPolygonToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
MultiPolygonOptions multiPolygon,
MarkerOptions polygonMarkerOptions,
MarkerOptions polygonMarkerHoleOptions,
PolygonOptions globalPolygonOptions) {
... | java | public MultiPolygonMarkers addMultiPolygonToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
MultiPolygonOptions multiPolygon,
MarkerOptions polygonMarkerOptions,
MarkerOptions polygonMarkerHoleOptions,
PolygonOptions globalPolygonOptions) {
... | [
"public",
"MultiPolygonMarkers",
"addMultiPolygonToMapAsMarkers",
"(",
"GoogleMapShapeMarkers",
"shapeMarkers",
",",
"GoogleMap",
"map",
",",
"MultiPolygonOptions",
"multiPolygon",
",",
"MarkerOptions",
"polygonMarkerOptions",
",",
"MarkerOptions",
"polygonMarkerHoleOptions",
","... | Add a MultiPolygonOptions to the map as markers
@param shapeMarkers google map shape markers
@param map google map
@param multiPolygon multi polygon options
@param polygonMarkerOptions polygon marker options
@param polygonMarkerHoleOptions polygon marker hole options
@p... | [
"Add",
"a",
"MultiPolygonOptions",
"to",
"the",
"map",
"as",
"markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1969-L1984 |
36,755 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.getPointsFromMarkers | public List<LatLng> getPointsFromMarkers(List<Marker> markers) {
List<LatLng> points = new ArrayList<LatLng>();
for (Marker marker : markers) {
points.add(marker.getPosition());
}
return points;
} | java | public List<LatLng> getPointsFromMarkers(List<Marker> markers) {
List<LatLng> points = new ArrayList<LatLng>();
for (Marker marker : markers) {
points.add(marker.getPosition());
}
return points;
} | [
"public",
"List",
"<",
"LatLng",
">",
"getPointsFromMarkers",
"(",
"List",
"<",
"Marker",
">",
"markers",
")",
"{",
"List",
"<",
"LatLng",
">",
"points",
"=",
"new",
"ArrayList",
"<",
"LatLng",
">",
"(",
")",
";",
"for",
"(",
"Marker",
"marker",
":",
... | Get a list of points as LatLng from a list of Markers
@param markers list of markers
@return lat lngs | [
"Get",
"a",
"list",
"of",
"points",
"as",
"LatLng",
"from",
"a",
"list",
"of",
"Markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1992-L1998 |
36,756 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.boundingBoxToWebMercator | public BoundingBox boundingBoxToWebMercator(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(toWebMercator);
} | java | public BoundingBox boundingBoxToWebMercator(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(toWebMercator);
} | [
"public",
"BoundingBox",
"boundingBoxToWebMercator",
"(",
"BoundingBox",
"boundingBox",
")",
"{",
"if",
"(",
"projection",
"==",
"null",
")",
"{",
"throw",
"new",
"GeoPackageException",
"(",
"\"Shape Converter projection is null\"",
")",
";",
"}",
"return",
"boundingB... | Transform the bounding box in the feature projection to web mercator
@param boundingBox bounding box in feature projection
@return bounding box in web mercator | [
"Transform",
"the",
"bounding",
"box",
"in",
"the",
"feature",
"projection",
"to",
"web",
"mercator"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L2302-L2307 |
36,757 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.boundingBoxToWgs84 | public BoundingBox boundingBoxToWgs84(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(toWgs84);
} | java | public BoundingBox boundingBoxToWgs84(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(toWgs84);
} | [
"public",
"BoundingBox",
"boundingBoxToWgs84",
"(",
"BoundingBox",
"boundingBox",
")",
"{",
"if",
"(",
"projection",
"==",
"null",
")",
"{",
"throw",
"new",
"GeoPackageException",
"(",
"\"Shape Converter projection is null\"",
")",
";",
"}",
"return",
"boundingBox",
... | Transform the bounding box in the feature projection to WGS84
@param boundingBox bounding box in feature projection
@return bounding box in WGS84 | [
"Transform",
"the",
"bounding",
"box",
"in",
"the",
"feature",
"projection",
"to",
"WGS84"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L2315-L2320 |
36,758 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.boundingBoxFromWebMercator | public BoundingBox boundingBoxFromWebMercator(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(fromWebMercator);
} | java | public BoundingBox boundingBoxFromWebMercator(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(fromWebMercator);
} | [
"public",
"BoundingBox",
"boundingBoxFromWebMercator",
"(",
"BoundingBox",
"boundingBox",
")",
"{",
"if",
"(",
"projection",
"==",
"null",
")",
"{",
"throw",
"new",
"GeoPackageException",
"(",
"\"Shape Converter projection is null\"",
")",
";",
"}",
"return",
"boundin... | Transform the bounding box in web mercator to the feature projection
@param boundingBox bounding box in web mercator
@return bounding box in the feature projection | [
"Transform",
"the",
"bounding",
"box",
"in",
"web",
"mercator",
"to",
"the",
"feature",
"projection"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L2328-L2333 |
36,759 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.boundingBoxFromWgs84 | public BoundingBox boundingBoxFromWgs84(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(fromWgs84);
} | java | public BoundingBox boundingBoxFromWgs84(BoundingBox boundingBox) {
if (projection == null) {
throw new GeoPackageException("Shape Converter projection is null");
}
return boundingBox.transform(fromWgs84);
} | [
"public",
"BoundingBox",
"boundingBoxFromWgs84",
"(",
"BoundingBox",
"boundingBox",
")",
"{",
"if",
"(",
"projection",
"==",
"null",
")",
"{",
"throw",
"new",
"GeoPackageException",
"(",
"\"Shape Converter projection is null\"",
")",
";",
"}",
"return",
"boundingBox",... | Transform the bounding box in WGS84 to the feature projection
@param boundingBox bounding box in WGS84
@return bounding box in the feature projection | [
"Transform",
"the",
"bounding",
"box",
"in",
"WGS84",
"to",
"the",
"feature",
"projection"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L2341-L2346 |
36,760 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.setDateFormat | public void setDateFormat(java.text.DateFormat dateFormat, java.text.DateFormat numbersDateFormat) {
this.customDateFormat = dateFormat;
this.secondaryDateFormat = numbersDateFormat;
// update the spinner with the new date format:
// the only spinner item that will be affected is the mo... | java | public void setDateFormat(java.text.DateFormat dateFormat, java.text.DateFormat numbersDateFormat) {
this.customDateFormat = dateFormat;
this.secondaryDateFormat = numbersDateFormat;
// update the spinner with the new date format:
// the only spinner item that will be affected is the mo... | [
"public",
"void",
"setDateFormat",
"(",
"java",
".",
"text",
".",
"DateFormat",
"dateFormat",
",",
"java",
".",
"text",
".",
"DateFormat",
"numbersDateFormat",
")",
"{",
"this",
".",
"customDateFormat",
"=",
"dateFormat",
";",
"this",
".",
"secondaryDateFormat",... | Sets the custom date format to use for formatting Calendar objects to displayable strings.
@param dateFormat The new DateFormat, or null to use the default format.
@param numbersDateFormat The DateFormat for formatting the secondary date when both FLAG_NUMBERS
and FLAG_WEEKDAY_NAMES are set, or null to use the default ... | [
"Sets",
"the",
"custom",
"date",
"format",
"to",
"use",
"for",
"formatting",
"Calendar",
"objects",
"to",
"displayable",
"strings",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L333-L351 |
36,761 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.setShowPastItems | public void setShowPastItems(boolean enable) {
if(enable && !showPastItems) {
// first reset the minimum date if necessary:
if(getMinDate() != null && compareCalendarDates(getMinDate(), Calendar.getInstance()) == 0)
setMinDate(null);
// create the yesterday a... | java | public void setShowPastItems(boolean enable) {
if(enable && !showPastItems) {
// first reset the minimum date if necessary:
if(getMinDate() != null && compareCalendarDates(getMinDate(), Calendar.getInstance()) == 0)
setMinDate(null);
// create the yesterday a... | [
"public",
"void",
"setShowPastItems",
"(",
"boolean",
"enable",
")",
"{",
"if",
"(",
"enable",
"&&",
"!",
"showPastItems",
")",
"{",
"// first reset the minimum date if necessary:",
"if",
"(",
"getMinDate",
"(",
")",
"!=",
"null",
"&&",
"compareCalendarDates",
"("... | Toggles showing the past items. Past mode shows the yesterday and last weekday item.
@param enable True to enable, false to disable past mode. | [
"Toggles",
"showing",
"the",
"past",
"items",
".",
"Past",
"mode",
"shows",
"the",
"yesterday",
"and",
"last",
"weekday",
"item",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L488-L515 |
36,762 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.setShowMonthItem | public void setShowMonthItem(boolean enable) {
if(enable && !showMonthItem) {
// create the in 1 month item
final Calendar date = Calendar.getInstance();
date.add(Calendar.MONTH, 1);
addAdapterItem(new DateItem(formatDate(date), date, R.id.date_month));
}
... | java | public void setShowMonthItem(boolean enable) {
if(enable && !showMonthItem) {
// create the in 1 month item
final Calendar date = Calendar.getInstance();
date.add(Calendar.MONTH, 1);
addAdapterItem(new DateItem(formatDate(date), date, R.id.date_month));
}
... | [
"public",
"void",
"setShowMonthItem",
"(",
"boolean",
"enable",
")",
"{",
"if",
"(",
"enable",
"&&",
"!",
"showMonthItem",
")",
"{",
"// create the in 1 month item",
"final",
"Calendar",
"date",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"date",
".",
... | Toggles showing the month item. Month mode an item in exactly one month from now.
@param enable True to enable, false to disable month mode. | [
"Toggles",
"showing",
"the",
"month",
"item",
".",
"Month",
"mode",
"an",
"item",
"in",
"exactly",
"one",
"month",
"from",
"now",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L521-L532 |
36,763 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.setFlags | public void setFlags(int modeOrFlags) {
setShowPastItems((modeOrFlags & ReminderDatePicker.FLAG_PAST) != 0);
setShowMonthItem((modeOrFlags & ReminderDatePicker.FLAG_MONTH) != 0);
setShowWeekdayNames((modeOrFlags & ReminderDatePicker.FLAG_WEEKDAY_NAMES) != 0);
setShowNumbersInView((modeOr... | java | public void setFlags(int modeOrFlags) {
setShowPastItems((modeOrFlags & ReminderDatePicker.FLAG_PAST) != 0);
setShowMonthItem((modeOrFlags & ReminderDatePicker.FLAG_MONTH) != 0);
setShowWeekdayNames((modeOrFlags & ReminderDatePicker.FLAG_WEEKDAY_NAMES) != 0);
setShowNumbersInView((modeOr... | [
"public",
"void",
"setFlags",
"(",
"int",
"modeOrFlags",
")",
"{",
"setShowPastItems",
"(",
"(",
"modeOrFlags",
"&",
"ReminderDatePicker",
".",
"FLAG_PAST",
")",
"!=",
"0",
")",
";",
"setShowMonthItem",
"(",
"(",
"modeOrFlags",
"&",
"ReminderDatePicker",
".",
... | Set the flags to use for this date spinner.
@param modeOrFlags A mode of ReminderDatePicker.MODE_... or multiple ReminderDatePicker.FLAG_...
combined with the | operator. | [
"Set",
"the",
"flags",
"to",
"use",
"for",
"this",
"date",
"spinner",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L575-L580 |
36,764 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/PickerSpinnerAdapter.java | PickerSpinnerAdapter.brightness | private float brightness(int color) {
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
int V = Math.max(b, Math.max(r, g));
return (V / 255.f);
} | java | private float brightness(int color) {
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
int V = Math.max(b, Math.max(r, g));
return (V / 255.f);
} | [
"private",
"float",
"brightness",
"(",
"int",
"color",
")",
"{",
"int",
"r",
"=",
"(",
"color",
">>",
"16",
")",
"&",
"0xFF",
";",
"int",
"g",
"=",
"(",
"color",
">>",
"8",
")",
"&",
"0xFF",
";",
"int",
"b",
"=",
"color",
"&",
"0xFF",
";",
"i... | Returns the brightness component of a color int. Taken from android.graphics.Color.
@return A value between 0.0f and 1.0f | [
"Returns",
"the",
"brightness",
"component",
"of",
"a",
"color",
"int",
".",
"Taken",
"from",
"android",
".",
"graphics",
".",
"Color",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/PickerSpinnerAdapter.java#L313-L320 |
36,765 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java | ReminderDatePicker.getNextItemDate | private @Nullable Calendar getNextItemDate(Calendar searchDate) {
final int last = dateSpinner.getLastItemPosition();
for (int i=0; i<=last; i++) {
final Calendar date = ((DateItem) dateSpinner.getItemAtPosition(i)).getDate();
// use the DateSpinner's compare method so hours and ... | java | private @Nullable Calendar getNextItemDate(Calendar searchDate) {
final int last = dateSpinner.getLastItemPosition();
for (int i=0; i<=last; i++) {
final Calendar date = ((DateItem) dateSpinner.getItemAtPosition(i)).getDate();
// use the DateSpinner's compare method so hours and ... | [
"private",
"@",
"Nullable",
"Calendar",
"getNextItemDate",
"(",
"Calendar",
"searchDate",
")",
"{",
"final",
"int",
"last",
"=",
"dateSpinner",
".",
"getLastItemPosition",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<=",
"last",
";",
"i",... | Gets the next date item's date equal to or later than the given date in the DateSpinner.
Requires that the items are in ascending order.
@return A date from the next item in the DateSpinner, or no such date was found. | [
"Gets",
"the",
"next",
"date",
"item",
"s",
"date",
"equal",
"to",
"or",
"later",
"than",
"the",
"given",
"date",
"in",
"the",
"DateSpinner",
".",
"Requires",
"that",
"the",
"items",
"are",
"in",
"ascending",
"order",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java#L216-L226 |
36,766 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java | ReminderDatePicker.setSelectedDate | public void setSelectedDate(Calendar date) {
if(date!=null) {
dateSpinner.setSelectedDate(date);
timeSpinner.setSelectedTime(date.get(Calendar.HOUR_OF_DAY), date.get(Calendar.MINUTE));
// a custom selection has been set, don't select the default date:
shouldSelect... | java | public void setSelectedDate(Calendar date) {
if(date!=null) {
dateSpinner.setSelectedDate(date);
timeSpinner.setSelectedTime(date.get(Calendar.HOUR_OF_DAY), date.get(Calendar.MINUTE));
// a custom selection has been set, don't select the default date:
shouldSelect... | [
"public",
"void",
"setSelectedDate",
"(",
"Calendar",
"date",
")",
"{",
"if",
"(",
"date",
"!=",
"null",
")",
"{",
"dateSpinner",
".",
"setSelectedDate",
"(",
"date",
")",
";",
"timeSpinner",
".",
"setSelectedTime",
"(",
"date",
".",
"get",
"(",
"Calendar"... | Sets the Spinners' selection as date considering both time and day.
@param date The date to be selected. | [
"Sets",
"the",
"Spinners",
"selection",
"as",
"date",
"considering",
"both",
"time",
"and",
"day",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java#L247-L254 |
36,767 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java | ReminderDatePicker.setSelectedDate | public void setSelectedDate(int year, int month, int day) {
dateSpinner.setSelectedDate(new GregorianCalendar(year, month, day));
// a custom selection has been set, don't select the default date:
shouldSelectDefault = false;
} | java | public void setSelectedDate(int year, int month, int day) {
dateSpinner.setSelectedDate(new GregorianCalendar(year, month, day));
// a custom selection has been set, don't select the default date:
shouldSelectDefault = false;
} | [
"public",
"void",
"setSelectedDate",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"dateSpinner",
".",
"setSelectedDate",
"(",
"new",
"GregorianCalendar",
"(",
"year",
",",
"month",
",",
"day",
")",
")",
";",
"// a custom selection ha... | Sets the Spinners' date selection as integers considering only day. | [
"Sets",
"the",
"Spinners",
"date",
"selection",
"as",
"integers",
"considering",
"only",
"day",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java#L259-L263 |
36,768 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java | ReminderDatePicker.setHideTime | public void setHideTime(boolean enable, final boolean useDarkTheme) {
if(enable && !shouldHideTime) {
// hide the time spinner and show a button to show it instead
timeSpinner.setVisibility(GONE);
ImageButton timeButton = (ImageButton) LayoutInflater.from(getContext()).inflat... | java | public void setHideTime(boolean enable, final boolean useDarkTheme) {
if(enable && !shouldHideTime) {
// hide the time spinner and show a button to show it instead
timeSpinner.setVisibility(GONE);
ImageButton timeButton = (ImageButton) LayoutInflater.from(getContext()).inflat... | [
"public",
"void",
"setHideTime",
"(",
"boolean",
"enable",
",",
"final",
"boolean",
"useDarkTheme",
")",
"{",
"if",
"(",
"enable",
"&&",
"!",
"shouldHideTime",
")",
"{",
"// hide the time spinner and show a button to show it instead",
"timeSpinner",
".",
"setVisibility"... | Toggles hiding the Time Spinner and replaces it with a Button.
@param enable True to hide the Spinner, false to show it.
@param useDarkTheme True if a white icon shall be used, false for a dark one. | [
"Toggles",
"hiding",
"the",
"Time",
"Spinner",
"and",
"replaces",
"it",
"with",
"a",
"Button",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java#L330-L348 |
36,769 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java | ReminderDatePicker.setFlags | public void setFlags(int modeOrFlags) {
// check each flag and pass it on if needed:
setHideTime((modeOrFlags & FLAG_HIDE_TIME) != 0, isActivityUsingDarkTheme());
dateSpinner.setFlags(modeOrFlags);
timeSpinner.setFlags(modeOrFlags);
} | java | public void setFlags(int modeOrFlags) {
// check each flag and pass it on if needed:
setHideTime((modeOrFlags & FLAG_HIDE_TIME) != 0, isActivityUsingDarkTheme());
dateSpinner.setFlags(modeOrFlags);
timeSpinner.setFlags(modeOrFlags);
} | [
"public",
"void",
"setFlags",
"(",
"int",
"modeOrFlags",
")",
"{",
"// check each flag and pass it on if needed:",
"setHideTime",
"(",
"(",
"modeOrFlags",
"&",
"FLAG_HIDE_TIME",
")",
"!=",
"0",
",",
"isActivityUsingDarkTheme",
"(",
")",
")",
";",
"dateSpinner",
".",... | Set the flags to use for the picker.
@param modeOrFlags A mode of ReminderDatePicker.MODE_... or multiple ReminderDatePicker.FLAG_...
combined with the | operator. | [
"Set",
"the",
"flags",
"to",
"use",
"for",
"the",
"picker",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java#L448-L453 |
36,770 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java | TimeSpinner.setTimeFormat | public void setTimeFormat(java.text.DateFormat timeFormat) {
this.timeFormat = timeFormat;
// update our pre-built timePickerDialog with the new timeFormat:
initTimePickerDialog(getContext());
// save the flags and selection first:
final PickerSpinnerAdapter adapter = ((PickerSp... | java | public void setTimeFormat(java.text.DateFormat timeFormat) {
this.timeFormat = timeFormat;
// update our pre-built timePickerDialog with the new timeFormat:
initTimePickerDialog(getContext());
// save the flags and selection first:
final PickerSpinnerAdapter adapter = ((PickerSp... | [
"public",
"void",
"setTimeFormat",
"(",
"java",
".",
"text",
".",
"DateFormat",
"timeFormat",
")",
"{",
"this",
".",
"timeFormat",
"=",
"timeFormat",
";",
"// update our pre-built timePickerDialog with the new timeFormat:",
"initTimePickerDialog",
"(",
"getContext",
"(",
... | Sets the time format to use for formatting Calendar objects to displayable strings.
@param timeFormat The new time format (as java.text.DateFormat), or null to use the default format. | [
"Sets",
"the",
"time",
"format",
"to",
"use",
"for",
"formatting",
"Calendar",
"objects",
"to",
"displayable",
"strings",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java#L264-L292 |
36,771 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java | TimeSpinner.setShowMoreTimeItems | public void setShowMoreTimeItems(boolean enable) {
if(enable && !showMoreTimeItems) {
// create the noon and late night item:
final Resources res = getResources();
// switch the afternoon item to 2pm:
insertAdapterItem(new TimeItem(res.getString(R.string.time_afte... | java | public void setShowMoreTimeItems(boolean enable) {
if(enable && !showMoreTimeItems) {
// create the noon and late night item:
final Resources res = getResources();
// switch the afternoon item to 2pm:
insertAdapterItem(new TimeItem(res.getString(R.string.time_afte... | [
"public",
"void",
"setShowMoreTimeItems",
"(",
"boolean",
"enable",
")",
"{",
"if",
"(",
"enable",
"&&",
"!",
"showMoreTimeItems",
")",
"{",
"// create the noon and late night item:",
"final",
"Resources",
"res",
"=",
"getResources",
"(",
")",
";",
"// switch the af... | Toggles showing more time items. If enabled, a noon and a late night time item are shown.
@param enable True to enable, false to disable more time items. | [
"Toggles",
"showing",
"more",
"time",
"items",
".",
"If",
"enabled",
"a",
"noon",
"and",
"a",
"late",
"night",
"time",
"item",
"are",
"shown",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java#L333-L353 |
36,772 | SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java | TimeSpinner.setFlags | public void setFlags(int modeOrFlags) {
setShowMoreTimeItems((modeOrFlags & ReminderDatePicker.FLAG_MORE_TIME) != 0);
setShowNumbersInView((modeOrFlags & ReminderDatePicker.FLAG_NUMBERS) != 0);
} | java | public void setFlags(int modeOrFlags) {
setShowMoreTimeItems((modeOrFlags & ReminderDatePicker.FLAG_MORE_TIME) != 0);
setShowNumbersInView((modeOrFlags & ReminderDatePicker.FLAG_NUMBERS) != 0);
} | [
"public",
"void",
"setFlags",
"(",
"int",
"modeOrFlags",
")",
"{",
"setShowMoreTimeItems",
"(",
"(",
"modeOrFlags",
"&",
"ReminderDatePicker",
".",
"FLAG_MORE_TIME",
")",
"!=",
"0",
")",
";",
"setShowNumbersInView",
"(",
"(",
"modeOrFlags",
"&",
"ReminderDatePicke... | Set the flags to use for this time spinner.
@param modeOrFlags A mode of ReminderDatePicker.MODE_... or multiple ReminderDatePicker.FLAG_...
combined with the | operator. | [
"Set",
"the",
"flags",
"to",
"use",
"for",
"this",
"time",
"spinner",
"."
] | 7596fbac77a5d26f687fec11758935a2b7db156f | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java#L372-L375 |
36,773 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.getTables | public Map<String, Map<Long, FeatureShape>> getTables(String database) {
Map<String, Map<Long, FeatureShape>> tables = databases.get(database);
if (tables == null) {
tables = new HashMap<>();
databases.put(database, tables);
}
return tables;
} | java | public Map<String, Map<Long, FeatureShape>> getTables(String database) {
Map<String, Map<Long, FeatureShape>> tables = databases.get(database);
if (tables == null) {
tables = new HashMap<>();
databases.put(database, tables);
}
return tables;
} | [
"public",
"Map",
"<",
"String",
",",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
">",
"getTables",
"(",
"String",
"database",
")",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
">",
"tables",
"=",
"databases",
".",
"... | Get the mapping between tables and feature ids for the database
@param database GeoPackage database
@return tables to features ids mapping
@since 3.2.0 | [
"Get",
"the",
"mapping",
"between",
"tables",
"and",
"feature",
"ids",
"for",
"the",
"database"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L65-L73 |
36,774 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.getFeatureIds | public Map<Long, FeatureShape> getFeatureIds(String database, String table) {
Map<String, Map<Long, FeatureShape>> tables = getTables(database);
Map<Long, FeatureShape> featureIds = getFeatureIds(tables, table);
return featureIds;
} | java | public Map<Long, FeatureShape> getFeatureIds(String database, String table) {
Map<String, Map<Long, FeatureShape>> tables = getTables(database);
Map<Long, FeatureShape> featureIds = getFeatureIds(tables, table);
return featureIds;
} | [
"public",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"getFeatureIds",
"(",
"String",
"database",
",",
"String",
"table",
")",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
">",
"tables",
"=",
"getTables",
"(",
"database... | Get the mapping between feature ids and map shapes for the database and table
@param database GeoPackage database
@param table table name
@return feature ids to map shapes mapping
@since 3.2.0 | [
"Get",
"the",
"mapping",
"between",
"feature",
"ids",
"and",
"map",
"shapes",
"for",
"the",
"database",
"and",
"table"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L93-L97 |
36,775 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.getFeatureIds | private Map<Long, FeatureShape> getFeatureIds(Map<String, Map<Long, FeatureShape>> tables, String table) {
Map<Long, FeatureShape> featureIds = tables.get(table);
if (featureIds == null) {
featureIds = new HashMap<>();
tables.put(table, featureIds);
}
return feat... | java | private Map<Long, FeatureShape> getFeatureIds(Map<String, Map<Long, FeatureShape>> tables, String table) {
Map<Long, FeatureShape> featureIds = tables.get(table);
if (featureIds == null) {
featureIds = new HashMap<>();
tables.put(table, featureIds);
}
return feat... | [
"private",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"getFeatureIds",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
">",
"tables",
",",
"String",
"table",
")",
"{",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"feat... | Get the feature ids and map shapes for the tables and table
@param tables tables
@param table table name
@return feature ids to map shapes mapping | [
"Get",
"the",
"feature",
"ids",
"and",
"map",
"shapes",
"for",
"the",
"tables",
"and",
"table"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L117-L125 |
36,776 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.getFeatureShape | public FeatureShape getFeatureShape(String database, String table, long featureId) {
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
FeatureShape featureShape = getFeatureShape(featureIds, featureId);
return featureShape;
} | java | public FeatureShape getFeatureShape(String database, String table, long featureId) {
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
FeatureShape featureShape = getFeatureShape(featureIds, featureId);
return featureShape;
} | [
"public",
"FeatureShape",
"getFeatureShape",
"(",
"String",
"database",
",",
"String",
"table",
",",
"long",
"featureId",
")",
"{",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"featureIds",
"=",
"getFeatureIds",
"(",
"database",
",",
"table",
")",
";",
"Fe... | Get the feature shape for the database, table, and feature id
@param database GeoPackage database
@param table table name
@param featureId feature id
@return feature shape
@since 3.2.0 | [
"Get",
"the",
"feature",
"shape",
"for",
"the",
"database",
"table",
"and",
"feature",
"id"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L136-L140 |
36,777 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.getFeatureShapeCount | public int getFeatureShapeCount(String database, String table, long featureId) {
return getFeatureShape(database, table, featureId).count();
} | java | public int getFeatureShapeCount(String database, String table, long featureId) {
return getFeatureShape(database, table, featureId).count();
} | [
"public",
"int",
"getFeatureShapeCount",
"(",
"String",
"database",
",",
"String",
"table",
",",
"long",
"featureId",
")",
"{",
"return",
"getFeatureShape",
"(",
"database",
",",
"table",
",",
"featureId",
")",
".",
"count",
"(",
")",
";",
"}"
] | Get the feature shape count for the database, table, and feature id
@param database GeoPackage database
@param table table name
@param featureId feature id
@return map shapes count
@since 3.2.0 | [
"Get",
"the",
"feature",
"shape",
"count",
"for",
"the",
"database",
"table",
"and",
"feature",
"id"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L151-L153 |
36,778 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.getFeatureShape | private FeatureShape getFeatureShape(Map<Long, FeatureShape> featureIds, long featureId) {
FeatureShape featureShape = featureIds.get(featureId);
if (featureShape == null) {
featureShape = new FeatureShape(featureId);
featureIds.put(featureId, featureShape);
}
re... | java | private FeatureShape getFeatureShape(Map<Long, FeatureShape> featureIds, long featureId) {
FeatureShape featureShape = featureIds.get(featureId);
if (featureShape == null) {
featureShape = new FeatureShape(featureId);
featureIds.put(featureId, featureShape);
}
re... | [
"private",
"FeatureShape",
"getFeatureShape",
"(",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"featureIds",
",",
"long",
"featureId",
")",
"{",
"FeatureShape",
"featureShape",
"=",
"featureIds",
".",
"get",
"(",
"featureId",
")",
";",
"if",
"(",
"featureSha... | Get the map shapes for the feature ids and feature id
@param featureIds feature ids
@param featureId feature id
@return feature shape | [
"Get",
"the",
"map",
"shapes",
"for",
"the",
"feature",
"ids",
"and",
"feature",
"id"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L162-L170 |
36,779 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.addMapShape | public void addMapShape(GoogleMapShape mapShape, long featureId, String database, String table) {
FeatureShape featureShape = getFeatureShape(database, table, featureId);
featureShape.addShape(mapShape);
} | java | public void addMapShape(GoogleMapShape mapShape, long featureId, String database, String table) {
FeatureShape featureShape = getFeatureShape(database, table, featureId);
featureShape.addShape(mapShape);
} | [
"public",
"void",
"addMapShape",
"(",
"GoogleMapShape",
"mapShape",
",",
"long",
"featureId",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"FeatureShape",
"featureShape",
"=",
"getFeatureShape",
"(",
"database",
",",
"table",
",",
"featureId",
")... | Add a map shape with the feature id, database, and table
@param mapShape map shape
@param featureId feature id
@param database GeoPackage database
@param table table name | [
"Add",
"a",
"map",
"shape",
"with",
"the",
"feature",
"id",
"database",
"and",
"table"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L180-L183 |
36,780 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.addMapMetadataShape | public void addMapMetadataShape(GoogleMapShape mapShape, long featureId, String database, String table) {
FeatureShape featureShape = getFeatureShape(database, table, featureId);
featureShape.addMetadataShape(mapShape);
} | java | public void addMapMetadataShape(GoogleMapShape mapShape, long featureId, String database, String table) {
FeatureShape featureShape = getFeatureShape(database, table, featureId);
featureShape.addMetadataShape(mapShape);
} | [
"public",
"void",
"addMapMetadataShape",
"(",
"GoogleMapShape",
"mapShape",
",",
"long",
"featureId",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"FeatureShape",
"featureShape",
"=",
"getFeatureShape",
"(",
"database",
",",
"table",
",",
"featureI... | Add a map metadata shape with the feature id, database, and table
@param mapShape map metadata shape
@param featureId feature id
@param database GeoPackage database
@param table table name
@since 3.2.0 | [
"Add",
"a",
"map",
"metadata",
"shape",
"with",
"the",
"feature",
"id",
"database",
"and",
"table"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L194-L197 |
36,781 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.exists | public boolean exists(long featureId, String database, String table) {
boolean exists = false;
Map<String, Map<Long, FeatureShape>> tables = databases.get(database);
if (tables != null) {
Map<Long, FeatureShape> featureIds = tables.get(table);
if (featureIds != null) {
... | java | public boolean exists(long featureId, String database, String table) {
boolean exists = false;
Map<String, Map<Long, FeatureShape>> tables = databases.get(database);
if (tables != null) {
Map<Long, FeatureShape> featureIds = tables.get(table);
if (featureIds != null) {
... | [
"public",
"boolean",
"exists",
"(",
"long",
"featureId",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"boolean",
"exists",
"=",
"false",
";",
"Map",
"<",
"String",
",",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
">",
"tables",
"=",
"... | Check if map shapes exist for the feature id, database, and table
@param featureId feature id
@param database GeoPackage database
@param table table name
@return true if exists | [
"Check",
"if",
"map",
"shapes",
"exist",
"for",
"the",
"feature",
"id",
"database",
"and",
"table"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L207-L219 |
36,782 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.removeShapesWithExclusions | public int removeShapesWithExclusions(String database, Set<GoogleMapShapeType> excludedTypes) {
int count = 0;
Map<String, Map<Long, FeatureShape>> tables = getTables(database);
if (tables != null) {
Iterator<String> iterator = tables.keySet().iterator();
while (itera... | java | public int removeShapesWithExclusions(String database, Set<GoogleMapShapeType> excludedTypes) {
int count = 0;
Map<String, Map<Long, FeatureShape>> tables = getTables(database);
if (tables != null) {
Iterator<String> iterator = tables.keySet().iterator();
while (itera... | [
"public",
"int",
"removeShapesWithExclusions",
"(",
"String",
"database",
",",
"Set",
"<",
"GoogleMapShapeType",
">",
"excludedTypes",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Map",
"<",
"String",
",",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
">",
"t... | Remove all map shapes in the database from the map, excluding shapes with the excluded types
@param database GeoPackage database
@param excludedTypes Google Map Shape Types to exclude from map removal
@return count of removed features
@since 3.2.0 | [
"Remove",
"all",
"map",
"shapes",
"in",
"the",
"database",
"from",
"the",
"map",
"excluding",
"shapes",
"with",
"the",
"excluded",
"types"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L329-L351 |
36,783 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.removeShapesWithExclusion | public int removeShapesWithExclusion(String database, String table, GoogleMapShapeType excludedType) {
Set<GoogleMapShapeType> excludedTypes = new HashSet<>();
excludedTypes.add(excludedType);
return removeShapesWithExclusions(database, table, excludedTypes);
} | java | public int removeShapesWithExclusion(String database, String table, GoogleMapShapeType excludedType) {
Set<GoogleMapShapeType> excludedTypes = new HashSet<>();
excludedTypes.add(excludedType);
return removeShapesWithExclusions(database, table, excludedTypes);
} | [
"public",
"int",
"removeShapesWithExclusion",
"(",
"String",
"database",
",",
"String",
"table",
",",
"GoogleMapShapeType",
"excludedType",
")",
"{",
"Set",
"<",
"GoogleMapShapeType",
">",
"excludedTypes",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"excludedTypes... | Remove all map shapes in the database and table from the map, excluding shapes with the excluded type
@param database GeoPackage database
@param table table name
@param excludedType Google Map Shape Type to exclude from map removal
@return count of removed features
@since 3.2.0 | [
"Remove",
"all",
"map",
"shapes",
"in",
"the",
"database",
"and",
"table",
"from",
"the",
"map",
"excluding",
"shapes",
"with",
"the",
"excluded",
"type"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L373-L377 |
36,784 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.removeShapesWithExclusions | public int removeShapesWithExclusions(String database, String table, Set<GoogleMapShapeType> excludedTypes) {
int count = 0;
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
if (featureIds != null) {
Iterator<Long> iterator = featureIds.keySet().iterator();
... | java | public int removeShapesWithExclusions(String database, String table, Set<GoogleMapShapeType> excludedTypes) {
int count = 0;
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
if (featureIds != null) {
Iterator<Long> iterator = featureIds.keySet().iterator();
... | [
"public",
"int",
"removeShapesWithExclusions",
"(",
"String",
"database",
",",
"String",
"table",
",",
"Set",
"<",
"GoogleMapShapeType",
">",
"excludedTypes",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"featureIds",
... | Remove all map shapes in the database and table from the map, excluding shapes with the excluded types
@param database GeoPackage database
@param table table name
@param excludedTypes Google Map Shape Types to exclude from map removal
@return count of removed features
@since 3.2.0 | [
"Remove",
"all",
"map",
"shapes",
"in",
"the",
"database",
"and",
"table",
"from",
"the",
"map",
"excluding",
"shapes",
"with",
"the",
"excluded",
"types"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L405-L445 |
36,785 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.removeShapesNotWithinMap | public int removeShapesNotWithinMap(GoogleMap map) {
int count = 0;
BoundingBox boundingBox = MapUtils.getBoundingBox(map);
for (String database : databases.keySet()) {
count += removeShapesNotWithinMap(boundingBox, database);
}
return count;
} | java | public int removeShapesNotWithinMap(GoogleMap map) {
int count = 0;
BoundingBox boundingBox = MapUtils.getBoundingBox(map);
for (String database : databases.keySet()) {
count += removeShapesNotWithinMap(boundingBox, database);
}
return count;
} | [
"public",
"int",
"removeShapesNotWithinMap",
"(",
"GoogleMap",
"map",
")",
"{",
"int",
"count",
"=",
"0",
";",
"BoundingBox",
"boundingBox",
"=",
"MapUtils",
".",
"getBoundingBox",
"(",
"map",
")",
";",
"for",
"(",
"String",
"database",
":",
"databases",
"."... | Remove all map shapes that are not visible in the map
@param map map
@return count of removed features | [
"Remove",
"all",
"map",
"shapes",
"that",
"are",
"not",
"visible",
"in",
"the",
"map"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L453-L464 |
36,786 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.removeShapesNotWithinMap | public int removeShapesNotWithinMap(BoundingBox boundingBox, String database) {
int count = 0;
Map<String, Map<Long, FeatureShape>> tables = getTables(database);
if (tables != null) {
for (String table : tables.keySet()) {
count += removeShapesNotWithinMap(boundin... | java | public int removeShapesNotWithinMap(BoundingBox boundingBox, String database) {
int count = 0;
Map<String, Map<Long, FeatureShape>> tables = getTables(database);
if (tables != null) {
for (String table : tables.keySet()) {
count += removeShapesNotWithinMap(boundin... | [
"public",
"int",
"removeShapesNotWithinMap",
"(",
"BoundingBox",
"boundingBox",
",",
"String",
"database",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Map",
"<",
"String",
",",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
">",
"tables",
"=",
"getTables",
"(... | Remove all map shapes in the database that are not visible in the bounding box
@param boundingBox bounding box
@param database GeoPackage database
@return count of removed features
@since 3.2.0 | [
"Remove",
"all",
"map",
"shapes",
"in",
"the",
"database",
"that",
"are",
"not",
"visible",
"in",
"the",
"bounding",
"box"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L490-L504 |
36,787 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.removeShapesNotWithinMap | public int removeShapesNotWithinMap(BoundingBox boundingBox, String database, String table) {
int count = 0;
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
if (featureIds != null) {
List<Long> deleteFeatureIds = new ArrayList<>();
for (long feat... | java | public int removeShapesNotWithinMap(BoundingBox boundingBox, String database, String table) {
int count = 0;
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
if (featureIds != null) {
List<Long> deleteFeatureIds = new ArrayList<>();
for (long feat... | [
"public",
"int",
"removeShapesNotWithinMap",
"(",
"BoundingBox",
"boundingBox",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"featureIds",
"=",
"getFeatureIds",
"(",
... | Remove all map shapes in the database and table that are not visible in the bounding box
@param boundingBox bounding box
@param database GeoPackage database
@return count of removed features | [
"Remove",
"all",
"map",
"shapes",
"in",
"the",
"database",
"and",
"table",
"that",
"are",
"not",
"visible",
"in",
"the",
"bounding",
"box"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L530-L574 |
36,788 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.removeFeatureShape | public boolean removeFeatureShape(String database, String table, long featureId) {
boolean removed = false;
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
if (featureIds != null) {
FeatureShape featureShape = featureIds.remove(featureId);
if (featu... | java | public boolean removeFeatureShape(String database, String table, long featureId) {
boolean removed = false;
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
if (featureIds != null) {
FeatureShape featureShape = featureIds.remove(featureId);
if (featu... | [
"public",
"boolean",
"removeFeatureShape",
"(",
"String",
"database",
",",
"String",
"table",
",",
"long",
"featureId",
")",
"{",
"boolean",
"removed",
"=",
"false",
";",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"featureIds",
"=",
"getFeatureIds",
"(",
... | Remove the feature shape from the database and table
@param database GeoPackage database
@param table table name
@param featureId feature id
@return true if removed
@since 3.2.0 | [
"Remove",
"the",
"feature",
"shape",
"from",
"the",
"database",
"and",
"table"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L585-L599 |
36,789 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.remove | public void remove() {
switch (shapeType) {
case MARKER:
((Marker) shape).remove();
break;
case POLYGON:
((Polygon) shape).remove();
break;
case POLYLINE:
((Polyline) shape).remove();
... | java | public void remove() {
switch (shapeType) {
case MARKER:
((Marker) shape).remove();
break;
case POLYGON:
((Polygon) shape).remove();
break;
case POLYLINE:
((Polyline) shape).remove();
... | [
"public",
"void",
"remove",
"(",
")",
"{",
"switch",
"(",
"shapeType",
")",
"{",
"case",
"MARKER",
":",
"(",
"(",
"Marker",
")",
"shape",
")",
".",
"remove",
"(",
")",
";",
"break",
";",
"case",
"POLYGON",
":",
"(",
"(",
"Polygon",
")",
"shape",
... | Removes all objects added to the map | [
"Removes",
"all",
"objects",
"added",
"to",
"the",
"map"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L110-L154 |
36,790 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.setVisible | public void setVisible(boolean visible) {
switch (shapeType) {
case MARKER_OPTIONS:
((MarkerOptions) shape).visible(visible);
break;
case POLYLINE_OPTIONS:
((PolylineOptions) shape).visible(visible);
break;
cas... | java | public void setVisible(boolean visible) {
switch (shapeType) {
case MARKER_OPTIONS:
((MarkerOptions) shape).visible(visible);
break;
case POLYLINE_OPTIONS:
((PolylineOptions) shape).visible(visible);
break;
cas... | [
"public",
"void",
"setVisible",
"(",
"boolean",
"visible",
")",
"{",
"switch",
"(",
"shapeType",
")",
"{",
"case",
"MARKER_OPTIONS",
":",
"(",
"(",
"MarkerOptions",
")",
"shape",
")",
".",
"visible",
"(",
"visible",
")",
";",
"break",
";",
"case",
"POLYL... | Updates visibility of all objects
@param visible visible flag
@since 1.3.2 | [
"Updates",
"visibility",
"of",
"all",
"objects"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L162-L221 |
36,791 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.update | public void update() {
switch (shapeType) {
case POLYLINE_MARKERS:
((PolylineMarkers) shape).update();
break;
case POLYGON_MARKERS:
((PolygonMarkers) shape).update();
break;
case MULTI_POLYLINE_MARKERS:
... | java | public void update() {
switch (shapeType) {
case POLYLINE_MARKERS:
((PolylineMarkers) shape).update();
break;
case POLYGON_MARKERS:
((PolygonMarkers) shape).update();
break;
case MULTI_POLYLINE_MARKERS:
... | [
"public",
"void",
"update",
"(",
")",
"{",
"switch",
"(",
"shapeType",
")",
"{",
"case",
"POLYLINE_MARKERS",
":",
"(",
"(",
"PolylineMarkers",
")",
"shape",
")",
".",
"update",
"(",
")",
";",
"break",
";",
"case",
"POLYGON_MARKERS",
":",
"(",
"(",
"Pol... | Updates all objects that could have changed from moved markers | [
"Updates",
"all",
"objects",
"that",
"could",
"have",
"changed",
"from",
"moved",
"markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L293-L319 |
36,792 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.isValid | public boolean isValid() {
boolean valid = true;
switch (shapeType) {
case POLYLINE_MARKERS:
valid = ((PolylineMarkers) shape).isValid();
break;
case POLYGON_MARKERS:
valid = ((PolygonMarkers) shape).isValid();
br... | java | public boolean isValid() {
boolean valid = true;
switch (shapeType) {
case POLYLINE_MARKERS:
valid = ((PolylineMarkers) shape).isValid();
break;
case POLYGON_MARKERS:
valid = ((PolygonMarkers) shape).isValid();
br... | [
"public",
"boolean",
"isValid",
"(",
")",
"{",
"boolean",
"valid",
"=",
"true",
";",
"switch",
"(",
"shapeType",
")",
"{",
"case",
"POLYLINE_MARKERS",
":",
"valid",
"=",
"(",
"(",
"PolylineMarkers",
")",
"shape",
")",
".",
"isValid",
"(",
")",
";",
"br... | Determines if the shape is in a valid state | [
"Determines",
"if",
"the",
"shape",
"is",
"in",
"a",
"valid",
"state"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L324-L356 |
36,793 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.boundingBox | public BoundingBox boundingBox() {
BoundingBox boundingBox = new BoundingBox(Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
expandBoundingBox(boundingBox);
return boundingBox;
} | java | public BoundingBox boundingBox() {
BoundingBox boundingBox = new BoundingBox(Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
expandBoundingBox(boundingBox);
return boundingBox;
} | [
"public",
"BoundingBox",
"boundingBox",
"(",
")",
"{",
"BoundingBox",
"boundingBox",
"=",
"new",
"BoundingBox",
"(",
"Double",
".",
"MAX_VALUE",
",",
"Double",
".",
"MAX_VALUE",
",",
"-",
"Double",
".",
"MAX_VALUE",
",",
"-",
"Double",
".",
"MAX_VALUE",
")",... | Get a bounding box that includes the shape
@return bounding box | [
"Get",
"a",
"bounding",
"box",
"that",
"includes",
"the",
"shape"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L363-L367 |
36,794 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.expandBoundingBox | public void expandBoundingBox(BoundingBox boundingBox) {
switch (shapeType) {
case LAT_LNG:
expandBoundingBox(boundingBox, (LatLng) shape);
break;
case MARKER_OPTIONS:
expandBoundingBox(boundingBox,
((MarkerOptions... | java | public void expandBoundingBox(BoundingBox boundingBox) {
switch (shapeType) {
case LAT_LNG:
expandBoundingBox(boundingBox, (LatLng) shape);
break;
case MARKER_OPTIONS:
expandBoundingBox(boundingBox,
((MarkerOptions... | [
"public",
"void",
"expandBoundingBox",
"(",
"BoundingBox",
"boundingBox",
")",
"{",
"switch",
"(",
"shapeType",
")",
"{",
"case",
"LAT_LNG",
":",
"expandBoundingBox",
"(",
"boundingBox",
",",
"(",
"LatLng",
")",
"shape",
")",
";",
"break",
";",
"case",
"MARK... | Expand the bounding box to include the shape
@param boundingBox bounding box | [
"Expand",
"the",
"bounding",
"box",
"to",
"include",
"the",
"shape"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L374-L467 |
36,795 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.expandBoundingBox | private void expandBoundingBox(BoundingBox boundingBox, LatLng latLng) {
double latitude = latLng.latitude;
double longitude = latLng.longitude;
if (boundingBox.getMinLongitude() <= 3 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH && boundingBox.getMaxLongitude() >= 3 * -ProjectionConstants.... | java | private void expandBoundingBox(BoundingBox boundingBox, LatLng latLng) {
double latitude = latLng.latitude;
double longitude = latLng.longitude;
if (boundingBox.getMinLongitude() <= 3 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH && boundingBox.getMaxLongitude() >= 3 * -ProjectionConstants.... | [
"private",
"void",
"expandBoundingBox",
"(",
"BoundingBox",
"boundingBox",
",",
"LatLng",
"latLng",
")",
"{",
"double",
"latitude",
"=",
"latLng",
".",
"latitude",
";",
"double",
"longitude",
"=",
"latLng",
".",
"longitude",
";",
"if",
"(",
"boundingBox",
".",... | Expand the bounding box by the LatLng
@param boundingBox bounding box
@param latLng lat lng | [
"Expand",
"the",
"bounding",
"box",
"by",
"the",
"LatLng"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L475-L507 |
36,796 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.expandBoundingBox | private void expandBoundingBox(BoundingBox boundingBox, List<LatLng> latLngs) {
for (LatLng latLng : latLngs) {
expandBoundingBox(boundingBox, latLng);
}
} | java | private void expandBoundingBox(BoundingBox boundingBox, List<LatLng> latLngs) {
for (LatLng latLng : latLngs) {
expandBoundingBox(boundingBox, latLng);
}
} | [
"private",
"void",
"expandBoundingBox",
"(",
"BoundingBox",
"boundingBox",
",",
"List",
"<",
"LatLng",
">",
"latLngs",
")",
"{",
"for",
"(",
"LatLng",
"latLng",
":",
"latLngs",
")",
"{",
"expandBoundingBox",
"(",
"boundingBox",
",",
"latLng",
")",
";",
"}",
... | Expand the bounding box by the LatLngs
@param boundingBox bounding box
@param latLngs lat lngs | [
"Expand",
"the",
"bounding",
"box",
"by",
"the",
"LatLngs"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L515-L519 |
36,797 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.expandBoundingBoxMarkers | private void expandBoundingBoxMarkers(BoundingBox boundingBox,
List<Marker> markers) {
for (Marker marker : markers) {
expandBoundingBox(boundingBox, marker.getPosition());
}
} | java | private void expandBoundingBoxMarkers(BoundingBox boundingBox,
List<Marker> markers) {
for (Marker marker : markers) {
expandBoundingBox(boundingBox, marker.getPosition());
}
} | [
"private",
"void",
"expandBoundingBoxMarkers",
"(",
"BoundingBox",
"boundingBox",
",",
"List",
"<",
"Marker",
">",
"markers",
")",
"{",
"for",
"(",
"Marker",
"marker",
":",
"markers",
")",
"{",
"expandBoundingBox",
"(",
"boundingBox",
",",
"marker",
".",
"getP... | Expand the bounding box by the markers
@param boundingBox bounding box
@param markers list of markers | [
"Expand",
"the",
"bounding",
"box",
"by",
"the",
"markers"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L527-L532 |
36,798 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/BoundedOverlay.java | BoundedOverlay.setBoundingBox | public void setBoundingBox(BoundingBox boundingBox, Projection projection) {
ProjectionTransform projectionToWebMercator = projection
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
webMercatorBoundingBox = boundingBox
.transform(projectionToWebMercator);
} | java | public void setBoundingBox(BoundingBox boundingBox, Projection projection) {
ProjectionTransform projectionToWebMercator = projection
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
webMercatorBoundingBox = boundingBox
.transform(projectionToWebMercator);
} | [
"public",
"void",
"setBoundingBox",
"(",
"BoundingBox",
"boundingBox",
",",
"Projection",
"projection",
")",
"{",
"ProjectionTransform",
"projectionToWebMercator",
"=",
"projection",
".",
"getTransformation",
"(",
"ProjectionConstants",
".",
"EPSG_WEB_MERCATOR",
")",
";",... | Set the bounding box, provided as the indicated projection
@param boundingBox bounding box
@param projection projection | [
"Set",
"the",
"bounding",
"box",
"provided",
"as",
"the",
"indicated",
"projection"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/BoundedOverlay.java#L85-L90 |
36,799 | ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/BoundedOverlay.java | BoundedOverlay.getBoundingBox | public BoundingBox getBoundingBox(Projection projection) {
ProjectionTransform webMercatorToProjection = ProjectionFactory
.getProjection(ProjectionConstants.EPSG_WEB_MERCATOR)
.getTransformation(projection);
return webMercatorBoundingBox
.transform(webMer... | java | public BoundingBox getBoundingBox(Projection projection) {
ProjectionTransform webMercatorToProjection = ProjectionFactory
.getProjection(ProjectionConstants.EPSG_WEB_MERCATOR)
.getTransformation(projection);
return webMercatorBoundingBox
.transform(webMer... | [
"public",
"BoundingBox",
"getBoundingBox",
"(",
"Projection",
"projection",
")",
"{",
"ProjectionTransform",
"webMercatorToProjection",
"=",
"ProjectionFactory",
".",
"getProjection",
"(",
"ProjectionConstants",
".",
"EPSG_WEB_MERCATOR",
")",
".",
"getTransformation",
"(",
... | Get the bounding box as the provided projection
@param projection projection | [
"Get",
"the",
"bounding",
"box",
"as",
"the",
"provided",
"projection"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/BoundedOverlay.java#L106-L112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.