repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java | SqsManager.validate | private void validate() {
LibraryUtils.checkArgumentNotNull(config, "configuration is null");
LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
LibraryUtils.checkArgumentNotNul... | java | private void validate() {
LibraryUtils.checkArgumentNotNull(config, "configuration is null");
LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
LibraryUtils.checkArgumentNotNul... | [
"private",
"void",
"validate",
"(",
")",
"{",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"config",
",",
"\"configuration is null\"",
")",
";",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"exceptionHandler",
",",
"\"exceptionHandler is null\"",
")",
";",
"... | Convenient function to validate input. | [
"Convenient",
"function",
"to",
"validate",
"input",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java#L247-L253 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java | PropertiesFileConfiguration.loadProperty | private Properties loadProperty(String propertiesFile) {
Properties prop = new Properties();
try {
InputStream in = getClass().getResourceAsStream(propertiesFile);
prop.load(in);
in.close();
} catch (IOException e) {
throw new IllegalStateException... | java | private Properties loadProperty(String propertiesFile) {
Properties prop = new Properties();
try {
InputStream in = getClass().getResourceAsStream(propertiesFile);
prop.load(in);
in.close();
} catch (IOException e) {
throw new IllegalStateException... | [
"private",
"Properties",
"loadProperty",
"(",
"String",
"propertiesFile",
")",
"{",
"Properties",
"prop",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",
"InputStream",
"in",
"=",
"getClass",
"(",
")",
".",
"getResourceAsStream",
"(",
"propertiesFile",
")... | Load properties from a classpath property file.
@param propertiesFile the classpath properties file to read.
@return a <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html">Properties</a> object
containing the properties set in the file. | [
"Load",
"properties",
"from",
"a",
"classpath",
"property",
"file",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java#L261-L271 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java | PropertiesFileConfiguration.getIntProperty | private int getIntProperty(Properties prop, String name) {
String propertyValue = prop.getProperty(name);
return Integer.parseInt(propertyValue);
} | java | private int getIntProperty(Properties prop, String name) {
String propertyValue = prop.getProperty(name);
return Integer.parseInt(propertyValue);
} | [
"private",
"int",
"getIntProperty",
"(",
"Properties",
"prop",
",",
"String",
"name",
")",
"{",
"String",
"propertyValue",
"=",
"prop",
".",
"getProperty",
"(",
"name",
")",
";",
"return",
"Integer",
".",
"parseInt",
"(",
"propertyValue",
")",
";",
"}"
] | Convert a string representation of a property to an integer type.
@param prop the {@link Properties} needs conversion.
@param name a name to evaluate in the property file.
@return an integer representation of the value associated with the property name. | [
"Convert",
"a",
"string",
"representation",
"of",
"a",
"property",
"to",
"an",
"integer",
"type",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java#L280-L283 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java | PropertiesFileConfiguration.getBooleanProperty | private Boolean getBooleanProperty(Properties prop, String name) {
String propertyValue = prop.getProperty(name);
return Boolean.parseBoolean(propertyValue);
} | java | private Boolean getBooleanProperty(Properties prop, String name) {
String propertyValue = prop.getProperty(name);
return Boolean.parseBoolean(propertyValue);
} | [
"private",
"Boolean",
"getBooleanProperty",
"(",
"Properties",
"prop",
",",
"String",
"name",
")",
"{",
"String",
"propertyValue",
"=",
"prop",
".",
"getProperty",
"(",
"name",
")",
";",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"propertyValue",
")",
";",... | Convert a string representation of a property to a boolean type.
@param prop the {@link Properties} needs conversion.
@param name a name to evaluate in the property file.
@return a boolean representation of the value associated with the property name. | [
"Convert",
"a",
"string",
"representation",
"of",
"a",
"property",
"to",
"a",
"boolean",
"type",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java#L292-L295 | train |
aws/aws-cloudtrail-processing-library | src/sample/SampleEventsProcessor.java | SampleEventsProcessor.validateEvent | private void validateEvent(CloudTrailEvent event) {
if (event.getEventData().getAccountId() == null) {
logger.error(String.format("Event %s doesn't have account ID.", event.getEventData()));
}
// more validation here...
} | java | private void validateEvent(CloudTrailEvent event) {
if (event.getEventData().getAccountId() == null) {
logger.error(String.format("Event %s doesn't have account ID.", event.getEventData()));
}
// more validation here...
} | [
"private",
"void",
"validateEvent",
"(",
"CloudTrailEvent",
"event",
")",
"{",
"if",
"(",
"event",
".",
"getEventData",
"(",
")",
".",
"getAccountId",
"(",
")",
"==",
"null",
")",
"{",
"logger",
".",
"error",
"(",
"String",
".",
"format",
"(",
"\"Event %... | Do simple validation before processing.
@param event to validate | [
"Do",
"simple",
"validation",
"before",
"processing",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/sample/SampleEventsProcessor.java#L42-L48 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java | EventReader.getSources | public List<CloudTrailSource> getSources() {
List<Message> sqsMessages = sqsManager.pollQueue();
return sqsManager.parseMessage(sqsMessages);
} | java | public List<CloudTrailSource> getSources() {
List<Message> sqsMessages = sqsManager.pollQueue();
return sqsManager.parseMessage(sqsMessages);
} | [
"public",
"List",
"<",
"CloudTrailSource",
">",
"getSources",
"(",
")",
"{",
"List",
"<",
"Message",
">",
"sqsMessages",
"=",
"sqsManager",
".",
"pollQueue",
"(",
")",
";",
"return",
"sqsManager",
".",
"parseMessage",
"(",
"sqsMessages",
")",
";",
"}"
] | Poll messages from SQS queue and convert messages to CloudTrailSource.
@return a list of {@link CloudTrailSource}. | [
"Poll",
"messages",
"from",
"SQS",
"queue",
"and",
"convert",
"messages",
"to",
"CloudTrailSource",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java#L111-L114 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java | EventReader.processSource | public void processSource (CloudTrailSource source) {
boolean filterSourceOut = false;
boolean downloadLogSuccess = true;
boolean processSourceSuccess = false;
ProgressStatus processSourceStatus = new ProgressStatus(ProgressState.processSource, new BasicProcessSourceInfo(source, process... | java | public void processSource (CloudTrailSource source) {
boolean filterSourceOut = false;
boolean downloadLogSuccess = true;
boolean processSourceSuccess = false;
ProgressStatus processSourceStatus = new ProgressStatus(ProgressState.processSource, new BasicProcessSourceInfo(source, process... | [
"public",
"void",
"processSource",
"(",
"CloudTrailSource",
"source",
")",
"{",
"boolean",
"filterSourceOut",
"=",
"false",
";",
"boolean",
"downloadLogSuccess",
"=",
"true",
";",
"boolean",
"processSourceSuccess",
"=",
"false",
";",
"ProgressStatus",
"processSourceSt... | Retrieve S3 object URL from source then downloads the object processes each event through
call back functions.
@param source {@link CloudTrailSource} to process. | [
"Retrieve",
"S3",
"object",
"URL",
"from",
"source",
"then",
"downloads",
"the",
"object",
"processes",
"each",
"event",
"through",
"call",
"back",
"functions",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java#L122-L186 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java | EventReader.deleteMessageAfterProcessSource | private void deleteMessageAfterProcessSource(ProgressState progressState, CloudTrailSource source) {
ProgressStatus deleteMessageStatus = new ProgressStatus(progressState, new BasicProcessSourceInfo(source, false));
sqsManager.deleteMessageFromQueue(((SQSBasedSource)source).getSqsMessage(), deleteMessag... | java | private void deleteMessageAfterProcessSource(ProgressState progressState, CloudTrailSource source) {
ProgressStatus deleteMessageStatus = new ProgressStatus(progressState, new BasicProcessSourceInfo(source, false));
sqsManager.deleteMessageFromQueue(((SQSBasedSource)source).getSqsMessage(), deleteMessag... | [
"private",
"void",
"deleteMessageAfterProcessSource",
"(",
"ProgressState",
"progressState",
",",
"CloudTrailSource",
"source",
")",
"{",
"ProgressStatus",
"deleteMessageStatus",
"=",
"new",
"ProgressStatus",
"(",
"progressState",
",",
"new",
"BasicProcessSourceInfo",
"(",
... | Delete SQS message after processing source.
@param progressState {@link ProgressState} either {@link ProgressState#deleteMessage}, or {@link ProgressState#deleteFilteredMessage}
@param source {@link CloudTrailSource} that contains the SQS message that will be deleted. | [
"Delete",
"SQS",
"message",
"after",
"processing",
"source",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java#L194-L197 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/AWSCloudTrailProcessingExecutor.java | AWSCloudTrailProcessingExecutor.start | public void start() {
logger.info("Started AWSCloudTrailProcessingLibrary.");
validateBeforeStart();
scheduledThreadPool.scheduleAtFixedRate(new ScheduledJob(readerFactory), 0L, EXECUTION_DELAY, TimeUnit.MICROSECONDS);
} | java | public void start() {
logger.info("Started AWSCloudTrailProcessingLibrary.");
validateBeforeStart();
scheduledThreadPool.scheduleAtFixedRate(new ScheduledJob(readerFactory), 0L, EXECUTION_DELAY, TimeUnit.MICROSECONDS);
} | [
"public",
"void",
"start",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Started AWSCloudTrailProcessingLibrary.\"",
")",
";",
"validateBeforeStart",
"(",
")",
";",
"scheduledThreadPool",
".",
"scheduleAtFixedRate",
"(",
"new",
"ScheduledJob",
"(",
"readerFactory",
... | Start processing AWS CloudTrail logs. | [
"Start",
"processing",
"AWS",
"CloudTrail",
"logs",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/AWSCloudTrailProcessingExecutor.java#L110-L114 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/AWSCloudTrailProcessingExecutor.java | AWSCloudTrailProcessingExecutor.validateBeforeStart | private void validateBeforeStart() {
LibraryUtils.checkArgumentNotNull(config, "Configuration is null.");
config.validate();
LibraryUtils.checkArgumentNotNull(sourceFilter, "sourceFilter is null.");
LibraryUtils.checkArgumentNotNull(eventFilter, "eventFilter is null.");
LibraryU... | java | private void validateBeforeStart() {
LibraryUtils.checkArgumentNotNull(config, "Configuration is null.");
config.validate();
LibraryUtils.checkArgumentNotNull(sourceFilter, "sourceFilter is null.");
LibraryUtils.checkArgumentNotNull(eventFilter, "eventFilter is null.");
LibraryU... | [
"private",
"void",
"validateBeforeStart",
"(",
")",
"{",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"config",
",",
"\"Configuration is null.\"",
")",
";",
"config",
".",
"validate",
"(",
")",
";",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"sourceFilte... | Validate the user's input before processing logs. | [
"Validate",
"the",
"user",
"s",
"input",
"before",
"processing",
"logs",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/AWSCloudTrailProcessingExecutor.java#L195-L208 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/RawLogDeliveryEventSerializer.java | RawLogDeliveryEventSerializer.getMetadata | @Override
public CloudTrailEventMetadata getMetadata(int charStart, int charEnd) {
// Use Jackson getTokenLocation API only return the , (Comma) position, we need to advance to first open curly brace.
String rawEvent = logFile.substring(charStart, charEnd+1);
int offset = rawEvent.indexOf("{... | java | @Override
public CloudTrailEventMetadata getMetadata(int charStart, int charEnd) {
// Use Jackson getTokenLocation API only return the , (Comma) position, we need to advance to first open curly brace.
String rawEvent = logFile.substring(charStart, charEnd+1);
int offset = rawEvent.indexOf("{... | [
"@",
"Override",
"public",
"CloudTrailEventMetadata",
"getMetadata",
"(",
"int",
"charStart",
",",
"int",
"charEnd",
")",
"{",
"// Use Jackson getTokenLocation API only return the , (Comma) position, we need to advance to first open curly brace.",
"String",
"rawEvent",
"=",
"logFil... | Find the raw event in string format from logFileContent based on character start index and end index. | [
"Find",
"the",
"raw",
"event",
"in",
"string",
"format",
"from",
"logFileContent",
"based",
"on",
"character",
"start",
"index",
"and",
"end",
"index",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/RawLogDeliveryEventSerializer.java#L42-L50 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.readArrayHeader | protected void readArrayHeader() throws IOException {
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Json object", jsonParser.getCurrentLocation());
}
jsonParser.nextToken();
if (!jsonParser.getText().equals(RECORDS)) {
... | java | protected void readArrayHeader() throws IOException {
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Json object", jsonParser.getCurrentLocation());
}
jsonParser.nextToken();
if (!jsonParser.getText().equals(RECORDS)) {
... | [
"protected",
"void",
"readArrayHeader",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"jsonParser",
".",
"nextToken",
"(",
")",
"!=",
"JsonToken",
".",
"START_OBJECT",
")",
"{",
"throw",
"new",
"JsonParseException",
"(",
"\"Not a Json object\"",
",",
"jsonP... | Read the header of an AWS CloudTrail log.
@throws JsonParseException if the log could not be parsed.
@throws IOException if the log could not be opened or accessed. | [
"Read",
"the",
"header",
"of",
"an",
"AWS",
"CloudTrail",
"log",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L76-L89 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.hasNextEvent | public boolean hasNextEvent() throws IOException {
/* In Fasterxml parser, hasNextEvent will consume next token. So do not call it multiple times. */
JsonToken nextToken = jsonParser.nextToken();
return nextToken == JsonToken.START_OBJECT || nextToken == JsonToken.START_ARRAY;
} | java | public boolean hasNextEvent() throws IOException {
/* In Fasterxml parser, hasNextEvent will consume next token. So do not call it multiple times. */
JsonToken nextToken = jsonParser.nextToken();
return nextToken == JsonToken.START_OBJECT || nextToken == JsonToken.START_ARRAY;
} | [
"public",
"boolean",
"hasNextEvent",
"(",
")",
"throws",
"IOException",
"{",
"/* In Fasterxml parser, hasNextEvent will consume next token. So do not call it multiple times. */",
"JsonToken",
"nextToken",
"=",
"jsonParser",
".",
"nextToken",
"(",
")",
";",
"return",
"nextToken"... | Indicates whether the CloudTrail log has more events to read.
@return <code>true</code> if the log contains more events; <code>false</code> otherwise.
@throws IOException if the log could not be opened or accessed. | [
"Indicates",
"whether",
"the",
"CloudTrail",
"log",
"has",
"more",
"events",
"to",
"read",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L97-L101 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.getNextEvent | public CloudTrailEvent getNextEvent() throws IOException {
CloudTrailEventData eventData = new CloudTrailEventData();
String key;
/* Get next CloudTrailEvent event from log file. When failed to parse a event,
* IOException will be thrown. In this case, the charEnd index the place we
... | java | public CloudTrailEvent getNextEvent() throws IOException {
CloudTrailEventData eventData = new CloudTrailEventData();
String key;
/* Get next CloudTrailEvent event from log file. When failed to parse a event,
* IOException will be thrown. In this case, the charEnd index the place we
... | [
"public",
"CloudTrailEvent",
"getNextEvent",
"(",
")",
"throws",
"IOException",
"{",
"CloudTrailEventData",
"eventData",
"=",
"new",
"CloudTrailEventData",
"(",
")",
";",
"String",
"key",
";",
"/* Get next CloudTrailEvent event from log file. When failed to parse a event,\n ... | Get the next event from the CloudTrail log and parse it.
@return a {@link CloudTrailEvent} that represents the
parsed event.
@throws IOException if the event could not be parsed. | [
"Get",
"the",
"next",
"event",
"from",
"the",
"CloudTrail",
"log",
"and",
"parse",
"it",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L119-L173 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.setAccountId | private void setAccountId(CloudTrailEventData eventData) {
if (eventData.getRecipientAccountId() != null) {
eventData.add("accountId", eventData.getRecipientAccountId());
return;
}
if (eventData.getUserIdentity() != null &&
eventData.getUserIdentity().getAcco... | java | private void setAccountId(CloudTrailEventData eventData) {
if (eventData.getRecipientAccountId() != null) {
eventData.add("accountId", eventData.getRecipientAccountId());
return;
}
if (eventData.getUserIdentity() != null &&
eventData.getUserIdentity().getAcco... | [
"private",
"void",
"setAccountId",
"(",
"CloudTrailEventData",
"eventData",
")",
"{",
"if",
"(",
"eventData",
".",
"getRecipientAccountId",
"(",
")",
"!=",
"null",
")",
"{",
"eventData",
".",
"add",
"(",
"\"accountId\"",
",",
"eventData",
".",
"getRecipientAccou... | Set AccountId in CloudTrailEventData top level from either recipientAccountID or from UserIdentity.
If recipientAccountID exists then recipientAccountID is set to accountID; otherwise, accountID is retrieved
from UserIdentity.
There are 2 places accountID would appear in UserIdentity: first is the UserIdentity top lev... | [
"Set",
"AccountId",
"in",
"CloudTrailEventData",
"top",
"level",
"from",
"either",
"recipientAccountID",
"or",
"from",
"UserIdentity",
".",
"If",
"recipientAccountID",
"exists",
"then",
"recipientAccountID",
"is",
"set",
"to",
"accountID",
";",
"otherwise",
"accountID... | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L188-L207 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseReadOnly | private void parseReadOnly(CloudTrailEventData eventData) throws IOException {
jsonParser.nextToken();
Boolean readOnly = null;
if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
readOnly = jsonParser.getBooleanValue();
}
eventData.add(CloudTrailEventField.re... | java | private void parseReadOnly(CloudTrailEventData eventData) throws IOException {
jsonParser.nextToken();
Boolean readOnly = null;
if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
readOnly = jsonParser.getBooleanValue();
}
eventData.add(CloudTrailEventField.re... | [
"private",
"void",
"parseReadOnly",
"(",
"CloudTrailEventData",
"eventData",
")",
"throws",
"IOException",
"{",
"jsonParser",
".",
"nextToken",
"(",
")",
";",
"Boolean",
"readOnly",
"=",
"null",
";",
"if",
"(",
"jsonParser",
".",
"getCurrentToken",
"(",
")",
"... | Parses the event readOnly attribute.
@param eventData
@throws JsonParseException
@throws IOException | [
"Parses",
"the",
"event",
"readOnly",
"attribute",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L390-L397 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseManagementEvent | private void parseManagementEvent(CloudTrailEventData eventData) throws IOException {
jsonParser.nextToken();
Boolean managementEvent = null;
if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
managementEvent = jsonParser.getBooleanValue();
}
eventData.add(Cl... | java | private void parseManagementEvent(CloudTrailEventData eventData) throws IOException {
jsonParser.nextToken();
Boolean managementEvent = null;
if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
managementEvent = jsonParser.getBooleanValue();
}
eventData.add(Cl... | [
"private",
"void",
"parseManagementEvent",
"(",
"CloudTrailEventData",
"eventData",
")",
"throws",
"IOException",
"{",
"jsonParser",
".",
"nextToken",
"(",
")",
";",
"Boolean",
"managementEvent",
"=",
"null",
";",
"if",
"(",
"jsonParser",
".",
"getCurrentToken",
"... | Parses the event managementEvent attribute.
@param eventData the interesting {@link CloudTrailEventData}
@throws IOException | [
"Parses",
"the",
"event",
"managementEvent",
"attribute",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L404-L411 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseResources | private void parseResources(CloudTrailEventData eventData) throws IOException {
JsonToken nextToken = jsonParser.nextToken();
if (nextToken == JsonToken.VALUE_NULL) {
eventData.add(CloudTrailEventField.resources.name(), null);
return;
}
if (nextToken != JsonToken... | java | private void parseResources(CloudTrailEventData eventData) throws IOException {
JsonToken nextToken = jsonParser.nextToken();
if (nextToken == JsonToken.VALUE_NULL) {
eventData.add(CloudTrailEventField.resources.name(), null);
return;
}
if (nextToken != JsonToken... | [
"private",
"void",
"parseResources",
"(",
"CloudTrailEventData",
"eventData",
")",
"throws",
"IOException",
"{",
"JsonToken",
"nextToken",
"=",
"jsonParser",
".",
"nextToken",
"(",
")",
";",
"if",
"(",
"nextToken",
"==",
"JsonToken",
".",
"VALUE_NULL",
")",
"{",... | Parses a list of Resource.
@param eventData the resources belong to
@throws IOException | [
"Parses",
"a",
"list",
"of",
"Resource",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L419-L437 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseResource | private Resource parseResource() throws IOException {
//current token is ready consumed by parseResources
if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Resource object", jsonParser.getCurrentLocation());
}
Resource resource... | java | private Resource parseResource() throws IOException {
//current token is ready consumed by parseResources
if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Resource object", jsonParser.getCurrentLocation());
}
Resource resource... | [
"private",
"Resource",
"parseResource",
"(",
")",
"throws",
"IOException",
"{",
"//current token is ready consumed by parseResources",
"if",
"(",
"jsonParser",
".",
"getCurrentToken",
"(",
")",
"!=",
"JsonToken",
".",
"START_OBJECT",
")",
"{",
"throw",
"new",
"JsonPar... | Parses a single Resource.
@return a single resource
@throws IOException | [
"Parses",
"a",
"single",
"Resource",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L445-L464 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseDefaultValue | private String parseDefaultValue(String key) throws IOException {
jsonParser.nextToken();
String value = null;
JsonToken currentToken = jsonParser.getCurrentToken();
if (currentToken != JsonToken.VALUE_NULL) {
if (currentToken == JsonToken.START_ARRAY || currentToken == JsonT... | java | private String parseDefaultValue(String key) throws IOException {
jsonParser.nextToken();
String value = null;
JsonToken currentToken = jsonParser.getCurrentToken();
if (currentToken != JsonToken.VALUE_NULL) {
if (currentToken == JsonToken.START_ARRAY || currentToken == JsonT... | [
"private",
"String",
"parseDefaultValue",
"(",
"String",
"key",
")",
"throws",
"IOException",
"{",
"jsonParser",
".",
"nextToken",
"(",
")",
";",
"String",
"value",
"=",
"null",
";",
"JsonToken",
"currentToken",
"=",
"jsonParser",
".",
"getCurrentToken",
"(",
... | Parses the event with key as default value.
If the value is JSON null, then we will return null.
If the value is JSON object (of starting with START_ARRAY or START_OBject) , then we will convert the object to String.
If the value is JSON scalar value (non-structured object), then we will return simply return it as Str... | [
"Parses",
"the",
"event",
"with",
"key",
"as",
"default",
"value",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L476-L489 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseAttributes | private Map<String, String> parseAttributes() throws IOException {
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Attributes object", jsonParser.getCurrentLocation());
}
Map<String, String> attributes = new HashMap<>();
while (js... | java | private Map<String, String> parseAttributes() throws IOException {
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Attributes object", jsonParser.getCurrentLocation());
}
Map<String, String> attributes = new HashMap<>();
while (js... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"parseAttributes",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"jsonParser",
".",
"nextToken",
"(",
")",
"!=",
"JsonToken",
".",
"START_OBJECT",
")",
"{",
"throw",
"new",
"JsonParseException",
"(",
... | Parses attributes as a Map, used in both parseWebIdentitySessionContext and parseSessionContext
@return attributes for either session context or web identity session context
@throws IOException | [
"Parses",
"attributes",
"as",
"a",
"Map",
"used",
"in",
"both",
"parseWebIdentitySessionContext",
"and",
"parseSessionContext"
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L497-L511 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.convertToDate | private Date convertToDate(String dateInString) throws IOException {
Date date = null;
if (dateInString != null) {
try {
date = LibraryUtils.getUtcSdf().parse(dateInString);
} catch (ParseException e) {
throw new IOException("Cannot parse " + dateI... | java | private Date convertToDate(String dateInString) throws IOException {
Date date = null;
if (dateInString != null) {
try {
date = LibraryUtils.getUtcSdf().parse(dateInString);
} catch (ParseException e) {
throw new IOException("Cannot parse " + dateI... | [
"private",
"Date",
"convertToDate",
"(",
"String",
"dateInString",
")",
"throws",
"IOException",
"{",
"Date",
"date",
"=",
"null",
";",
"if",
"(",
"dateInString",
"!=",
"null",
")",
"{",
"try",
"{",
"date",
"=",
"LibraryUtils",
".",
"getUtcSdf",
"(",
")",
... | This method convert a String to Date type. When parse error happened return current date.
@param dateInString the String to convert to Date
@return Date the date and time in coordinated universal time
@throws IOException | [
"This",
"method",
"convert",
"a",
"String",
"to",
"Date",
"type",
".",
"When",
"parse",
"error",
"happened",
"return",
"current",
"date",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L530-L540 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/utils/LibraryUtils.java | LibraryUtils.endToProcess | public static void endToProcess(ProgressReporter progressReporter, boolean processSuccess, ProgressStatus progressStatus, Object reportObject) {
progressStatus.getProgressInfo().setIsSuccess(processSuccess);
progressReporter.reportEnd(progressStatus, reportObject);
} | java | public static void endToProcess(ProgressReporter progressReporter, boolean processSuccess, ProgressStatus progressStatus, Object reportObject) {
progressStatus.getProgressInfo().setIsSuccess(processSuccess);
progressReporter.reportEnd(progressStatus, reportObject);
} | [
"public",
"static",
"void",
"endToProcess",
"(",
"ProgressReporter",
"progressReporter",
",",
"boolean",
"processSuccess",
",",
"ProgressStatus",
"progressStatus",
",",
"Object",
"reportObject",
")",
"{",
"progressStatus",
".",
"getProgressInfo",
"(",
")",
".",
"setIs... | A wrapper function of reporting the result of the processing.
@param progressReporter the {@link ProgressReporter} to report the end of process.
@param processSuccess the result of process.
@param progressStatus the current progress status {@link ProgressStatus}.
@param reportObject the object to send, usually the obje... | [
"A",
"wrapper",
"function",
"of",
"reporting",
"the",
"result",
"of",
"the",
"processing",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/utils/LibraryUtils.java#L192-L195 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/EventReaderFactory.java | EventReaderFactory.validate | private void validate() {
LibraryUtils.checkArgumentNotNull(config, "Configuration is null.");
LibraryUtils.checkArgumentNotNull(eventsProcessor, "Events Processor is null.");
LibraryUtils.checkArgumentNotNull(sourceFilter, "Source Filter is null.");
LibraryUtils.checkArgumentNotNull(eve... | java | private void validate() {
LibraryUtils.checkArgumentNotNull(config, "Configuration is null.");
LibraryUtils.checkArgumentNotNull(eventsProcessor, "Events Processor is null.");
LibraryUtils.checkArgumentNotNull(sourceFilter, "Source Filter is null.");
LibraryUtils.checkArgumentNotNull(eve... | [
"private",
"void",
"validate",
"(",
")",
"{",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"config",
",",
"\"Configuration is null.\"",
")",
";",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"eventsProcessor",
",",
"\"Events Processor is null.\"",
")",
";",
... | Validate input parameters. | [
"Validate",
"input",
"parameters",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/EventReaderFactory.java#L137-L146 | train |
aws/aws-cloudtrail-processing-library | src/sample/SampleExceptionHandler.java | SampleExceptionHandler.handleException | @Override
public void handleException(ProcessingLibraryException exception) {
ProgressStatus status = exception.getStatus();
ProgressState state = status.getProgressState();
ProgressInfo info = status.getProgressInfo();
logger.error(String.format("Exception. Progress State: %s. Progr... | java | @Override
public void handleException(ProcessingLibraryException exception) {
ProgressStatus status = exception.getStatus();
ProgressState state = status.getProgressState();
ProgressInfo info = status.getProgressInfo();
logger.error(String.format("Exception. Progress State: %s. Progr... | [
"@",
"Override",
"public",
"void",
"handleException",
"(",
"ProcessingLibraryException",
"exception",
")",
"{",
"ProgressStatus",
"status",
"=",
"exception",
".",
"getStatus",
"(",
")",
";",
"ProgressState",
"state",
"=",
"status",
".",
"getProgressState",
"(",
")... | Exception handler that simply log progress state and progress information. | [
"Exception",
"handler",
"that",
"simply",
"log",
"progress",
"state",
"and",
"progress",
"information",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/sample/SampleExceptionHandler.java#L33-L39 | train |
aws/aws-cloudtrail-processing-library | src/sample/SampleEventFilter.java | SampleEventFilter.filterEvent | @Override
public boolean filterEvent(CloudTrailEvent event) throws CallbackException {
CloudTrailEventData eventData = event.getEventData();
String eventSource = eventData.getEventSource();
String eventName = eventData.getEventName();
return eventSource.equals(EC2_EVENTS) && eventN... | java | @Override
public boolean filterEvent(CloudTrailEvent event) throws CallbackException {
CloudTrailEventData eventData = event.getEventData();
String eventSource = eventData.getEventSource();
String eventName = eventData.getEventName();
return eventSource.equals(EC2_EVENTS) && eventN... | [
"@",
"Override",
"public",
"boolean",
"filterEvent",
"(",
"CloudTrailEvent",
"event",
")",
"throws",
"CallbackException",
"{",
"CloudTrailEventData",
"eventData",
"=",
"event",
".",
"getEventData",
"(",
")",
";",
"String",
"eventSource",
"=",
"eventData",
".",
"ge... | Event filter that only keep EC2 deletion API calls. | [
"Event",
"filter",
"that",
"only",
"keep",
"EC2",
"deletion",
"API",
"calls",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/sample/SampleEventFilter.java#L30-L38 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/model/CloudTrailEventData.java | CloudTrailEventData.getResources | @SuppressWarnings("unchecked")
public List<Resource> getResources() {
return (List<Resource>) get(CloudTrailEventField.resources.name());
} | java | @SuppressWarnings("unchecked")
public List<Resource> getResources() {
return (List<Resource>) get(CloudTrailEventField.resources.name());
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"List",
"<",
"Resource",
">",
"getResources",
"(",
")",
"{",
"return",
"(",
"List",
"<",
"Resource",
">",
")",
"get",
"(",
"CloudTrailEventField",
".",
"resources",
".",
"name",
"(",
")",
")",
... | Get the resources used in the operation.
@return A list of resources used in this operation. | [
"Get",
"the",
"resources",
"used",
"in",
"the",
"operation",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/model/CloudTrailEventData.java#L229-L232 | train |
aws/aws-cloudtrail-processing-library | src/sample/SampleSourceFilter.java | SampleSourceFilter.filterSource | @Override
public boolean filterSource(CloudTrailSource source) throws CallbackException {
source = (SQSBasedSource) source;
Map<String, String> sourceAttributes = source.getSourceAttributes();
String accountId = sourceAttributes.get(SourceAttributeKeys.ACCOUNT_ID.getAttributeKey());
... | java | @Override
public boolean filterSource(CloudTrailSource source) throws CallbackException {
source = (SQSBasedSource) source;
Map<String, String> sourceAttributes = source.getSourceAttributes();
String accountId = sourceAttributes.get(SourceAttributeKeys.ACCOUNT_ID.getAttributeKey());
... | [
"@",
"Override",
"public",
"boolean",
"filterSource",
"(",
"CloudTrailSource",
"source",
")",
"throws",
"CallbackException",
"{",
"source",
"=",
"(",
"SQSBasedSource",
")",
"source",
";",
"Map",
"<",
"String",
",",
"String",
">",
"sourceAttributes",
"=",
"source... | This Sample Source Filter filter out messages that have been received more than 3 times and
accountIDs in a certain range.
It is useful when you only want to retry on failed message up to certain times. | [
"This",
"Sample",
"Source",
"Filter",
"filter",
"out",
"messages",
"that",
"have",
"been",
"received",
"more",
"than",
"3",
"times",
"and",
"accountIDs",
"in",
"a",
"certain",
"range",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/sample/SampleSourceFilter.java#L50-L60 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/model/internal/WebIdentitySessionContext.java | WebIdentitySessionContext.getAttributes | @SuppressWarnings({ "unchecked", "rawtypes" })
public Map<String, String> getAttributes() {
return (Map) this.get(CloudTrailEventField.attributes.name());
} | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public Map<String, String> getAttributes() {
return (Map) this.get(CloudTrailEventField.attributes.name());
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getAttributes",
"(",
")",
"{",
"return",
"(",
"Map",
")",
"this",
".",
"get",
"(",
"CloudTrailEventField",
".",
"attribu... | Get attributes.
@return additional web identity session contest attributes. | [
"Get",
"attributes",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/model/internal/WebIdentitySessionContext.java#L38-L41 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java | S3Manager.downloadLog | public byte[] downloadLog(CloudTrailLog ctLog, CloudTrailSource source) {
boolean success = false;
ProgressStatus downloadLogStatus = new ProgressStatus(ProgressState.downloadLog, new BasicProcessLogInfo(source, ctLog, success));
final Object downloadSourceReportObject = progressReporter.reportS... | java | public byte[] downloadLog(CloudTrailLog ctLog, CloudTrailSource source) {
boolean success = false;
ProgressStatus downloadLogStatus = new ProgressStatus(ProgressState.downloadLog, new BasicProcessLogInfo(source, ctLog, success));
final Object downloadSourceReportObject = progressReporter.reportS... | [
"public",
"byte",
"[",
"]",
"downloadLog",
"(",
"CloudTrailLog",
"ctLog",
",",
"CloudTrailSource",
"source",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"ProgressStatus",
"downloadLogStatus",
"=",
"new",
"ProgressStatus",
"(",
"ProgressState",
".",
"downloa... | Downloads an AWS CloudTrail log from the specified source.
@param ctLog The {@link CloudTrailLog} to download
@param source The {@link CloudTrailSource} to download the log from.
@return A byte array containing the log data. | [
"Downloads",
"an",
"AWS",
"CloudTrail",
"log",
"from",
"the",
"specified",
"source",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java#L74-L100 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java | S3Manager.getObject | public S3Object getObject(String bucketName, String objectKey) {
try {
return s3Client.getObject(bucketName, objectKey);
} catch (AmazonServiceException e) {
logger.error("Failed to get object " + objectKey + " from s3 bucket " + bucketName);
throw e;
}
} | java | public S3Object getObject(String bucketName, String objectKey) {
try {
return s3Client.getObject(bucketName, objectKey);
} catch (AmazonServiceException e) {
logger.error("Failed to get object " + objectKey + " from s3 bucket " + bucketName);
throw e;
}
} | [
"public",
"S3Object",
"getObject",
"(",
"String",
"bucketName",
",",
"String",
"objectKey",
")",
"{",
"try",
"{",
"return",
"s3Client",
".",
"getObject",
"(",
"bucketName",
",",
"objectKey",
")",
";",
"}",
"catch",
"(",
"AmazonServiceException",
"e",
")",
"{... | Download an S3 object.
@param bucketName The S3 bucket name from which to download the object.
@param objectKey The S3 key name of the object to download.
@return The downloaded
<a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/S3Object.html">S3Object</a>. | [
"Download",
"an",
"S3",
"object",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java#L110-L117 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java | S3Manager.validate | private void validate() {
LibraryUtils.checkArgumentNotNull(config, "configuration is null");
LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
LibraryUtils.checkArgumentNotNul... | java | private void validate() {
LibraryUtils.checkArgumentNotNull(config, "configuration is null");
LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
LibraryUtils.checkArgumentNotNul... | [
"private",
"void",
"validate",
"(",
")",
"{",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"config",
",",
"\"configuration is null\"",
")",
";",
"LibraryUtils",
".",
"checkArgumentNotNull",
"(",
"exceptionHandler",
",",
"\"exceptionHandler is null\"",
")",
";",
"... | Validates input parameters. | [
"Validates",
"input",
"parameters",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java#L122-L127 | train |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/utils/SourceIdentifier.java | SourceIdentifier.identifyWithEventName | public SourceType identifyWithEventName(String source, String eventName) {
if (eventName.startsWith(CREATE_EVENT_PREFIX)) {
return getCloudTrailSourceType(source);
}
return SourceType.Other;
} | java | public SourceType identifyWithEventName(String source, String eventName) {
if (eventName.startsWith(CREATE_EVENT_PREFIX)) {
return getCloudTrailSourceType(source);
}
return SourceType.Other;
} | [
"public",
"SourceType",
"identifyWithEventName",
"(",
"String",
"source",
",",
"String",
"eventName",
")",
"{",
"if",
"(",
"eventName",
".",
"startsWith",
"(",
"CREATE_EVENT_PREFIX",
")",
")",
"{",
"return",
"getCloudTrailSourceType",
"(",
"source",
")",
";",
"}... | Identify the source type with event action.
@param source the S3 object name
@param eventName the event name defined by Amazon S3.
@return {@link SourceType} | [
"Identify",
"the",
"source",
"type",
"with",
"event",
"action",
"."
] | 411315808d8d3dc6b45e4182212e3e04d82e3782 | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/utils/SourceIdentifier.java#L38-L43 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/db/ResultSetResult.java | ResultSetResult.resultSetTypeToSqlLite | public static int resultSetTypeToSqlLite(int columnType) {
int type;
switch (columnType) {
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
case Types.TINYINT:
case Types.BOOLEAN:
type = ResultUtils.FIELD_TYPE_INTEGER;
break;
case Types.VARCHAR:
case Types.DATE:
type = ResultUtil... | java | public static int resultSetTypeToSqlLite(int columnType) {
int type;
switch (columnType) {
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
case Types.TINYINT:
case Types.BOOLEAN:
type = ResultUtils.FIELD_TYPE_INTEGER;
break;
case Types.VARCHAR:
case Types.DATE:
type = ResultUtil... | [
"public",
"static",
"int",
"resultSetTypeToSqlLite",
"(",
"int",
"columnType",
")",
"{",
"int",
"type",
";",
"switch",
"(",
"columnType",
")",
"{",
"case",
"Types",
".",
"INTEGER",
":",
"case",
"Types",
".",
"BIGINT",
":",
"case",
"Types",
".",
"SMALLINT",... | Get the SQLite type from the ResultSetMetaData column type
@param columnType
column type
@return SQLite type | [
"Get",
"the",
"SQLite",
"type",
"from",
"the",
"ResultSetMetaData",
"column",
"type"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/ResultSetResult.java#L341-L374 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/manager/GeoPackageManager.java | GeoPackageManager.create | public static boolean create(File file) {
boolean created = false;
// Validate or add the file extension
if (GeoPackageIOUtils.hasFileExtension(file)) {
GeoPackageValidate.validateGeoPackageExtension(file);
} else {
file = GeoPackageIOUtils.addFileExtension(file,
GeoPackageConstants.GEOPACKAGE_EXTE... | java | public static boolean create(File file) {
boolean created = false;
// Validate or add the file extension
if (GeoPackageIOUtils.hasFileExtension(file)) {
GeoPackageValidate.validateGeoPackageExtension(file);
} else {
file = GeoPackageIOUtils.addFileExtension(file,
GeoPackageConstants.GEOPACKAGE_EXTE... | [
"public",
"static",
"boolean",
"create",
"(",
"File",
"file",
")",
"{",
"boolean",
"created",
"=",
"false",
";",
"// Validate or add the file extension",
"if",
"(",
"GeoPackageIOUtils",
".",
"hasFileExtension",
"(",
"file",
")",
")",
"{",
"GeoPackageValidate",
"."... | Create a GeoPackage
@param file
file
@return true if created | [
"Create",
"a",
"GeoPackage"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/manager/GeoPackageManager.java#L39-L72 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/manager/GeoPackageManager.java | GeoPackageManager.open | public static GeoPackage open(String name, File file) {
// Validate or add the file extension
if (GeoPackageIOUtils.hasFileExtension(file)) {
GeoPackageValidate.validateGeoPackageExtension(file);
} else {
file = GeoPackageIOUtils.addFileExtension(file,
GeoPackageConstants.GEOPACKAGE_EXTENSION);
}
... | java | public static GeoPackage open(String name, File file) {
// Validate or add the file extension
if (GeoPackageIOUtils.hasFileExtension(file)) {
GeoPackageValidate.validateGeoPackageExtension(file);
} else {
file = GeoPackageIOUtils.addFileExtension(file,
GeoPackageConstants.GEOPACKAGE_EXTENSION);
}
... | [
"public",
"static",
"GeoPackage",
"open",
"(",
"String",
"name",
",",
"File",
"file",
")",
"{",
"// Validate or add the file extension",
"if",
"(",
"GeoPackageIOUtils",
".",
"hasFileExtension",
"(",
"file",
")",
")",
"{",
"GeoPackageValidate",
".",
"validateGeoPacka... | Open a GeoPackage
@param name
GeoPackage name
@param file
GeoPackage file
@return GeoPackage
@since 3.0.2 | [
"Open",
"a",
"GeoPackage"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/manager/GeoPackageManager.java#L95-L123 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/manager/GeoPackageManager.java | GeoPackageManager.connect | private static GeoPackageConnection connect(File file) {
String databaseUrl = "jdbc:sqlite:" + file.getPath();
// load the sqlite-JDBC driver using the current class loader
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
throw new GeoPackageException(
"Failed to load th... | java | private static GeoPackageConnection connect(File file) {
String databaseUrl = "jdbc:sqlite:" + file.getPath();
// load the sqlite-JDBC driver using the current class loader
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
throw new GeoPackageException(
"Failed to load th... | [
"private",
"static",
"GeoPackageConnection",
"connect",
"(",
"File",
"file",
")",
"{",
"String",
"databaseUrl",
"=",
"\"jdbc:sqlite:\"",
"+",
"file",
".",
"getPath",
"(",
")",
";",
"// load the sqlite-JDBC driver using the current class loader",
"try",
"{",
"Class",
"... | Connect to a GeoPackage file
@param file
@return | [
"Connect",
"to",
"a",
"GeoPackage",
"file"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/manager/GeoPackageManager.java#L131-L167 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/user/TileRow.java | TileRow.setTileData | public void setTileData(BufferedImage image, String imageFormat)
throws IOException {
byte[] bytes = ImageUtils.writeImageToBytes(image, imageFormat);
setTileData(bytes);
} | java | public void setTileData(BufferedImage image, String imageFormat)
throws IOException {
byte[] bytes = ImageUtils.writeImageToBytes(image, imageFormat);
setTileData(bytes);
} | [
"public",
"void",
"setTileData",
"(",
"BufferedImage",
"image",
",",
"String",
"imageFormat",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"ImageUtils",
".",
"writeImageToBytes",
"(",
"image",
",",
"imageFormat",
")",
";",
"setTileData",
... | Set the tile data from an image
@param image
image
@param imageFormat
image format
@throws IOException
upon failure | [
"Set",
"the",
"tile",
"data",
"from",
"an",
"image"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/user/TileRow.java#L217-L221 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/db/GeoPackageConnection.java | GeoPackageConnection.query | public ResultSet query(String sql, String[] args) {
return SQLUtils.query(connection, sql, args);
} | java | public ResultSet query(String sql, String[] args) {
return SQLUtils.query(connection, sql, args);
} | [
"public",
"ResultSet",
"query",
"(",
"String",
"sql",
",",
"String",
"[",
"]",
"args",
")",
"{",
"return",
"SQLUtils",
".",
"query",
"(",
"connection",
",",
"sql",
",",
"args",
")",
";",
"}"
] | Perform a database query
@param sql
sql statement
@param args
arguments
@return result set
@since 1.1.2 | [
"Perform",
"a",
"database",
"query"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/GeoPackageConnection.java#L203-L205 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/TileCreator.java | TileCreator.hasTile | public boolean hasTile(BoundingBox requestBoundingBox) {
boolean hasTile = false;
// Transform to the projection of the tiles
ProjectionTransform transformRequestToTiles = requestProjection
.getTransformation(tilesProjection);
BoundingBox tilesBoundingBox = requestBoundingBox
.transform(transformReque... | java | public boolean hasTile(BoundingBox requestBoundingBox) {
boolean hasTile = false;
// Transform to the projection of the tiles
ProjectionTransform transformRequestToTiles = requestProjection
.getTransformation(tilesProjection);
BoundingBox tilesBoundingBox = requestBoundingBox
.transform(transformReque... | [
"public",
"boolean",
"hasTile",
"(",
"BoundingBox",
"requestBoundingBox",
")",
"{",
"boolean",
"hasTile",
"=",
"false",
";",
"// Transform to the projection of the tiles",
"ProjectionTransform",
"transformRequestToTiles",
"=",
"requestProjection",
".",
"getTransformation",
"(... | Check if the tile table contains a tile for the request bounding box
@param requestBoundingBox
request bounding box in the request projection
@return true if a tile exists | [
"Check",
"if",
"the",
"tile",
"table",
"contains",
"a",
"tile",
"for",
"the",
"request",
"bounding",
"box"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileCreator.java#L270-L299 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/TileCreator.java | TileCreator.getTile | public GeoPackageTile getTile(BoundingBox requestBoundingBox) {
GeoPackageTile tile = null;
// Transform to the projection of the tiles
ProjectionTransform transformRequestToTiles = requestProjection
.getTransformation(tilesProjection);
BoundingBox tilesBoundingBox = requestBoundingBox
.transform(tran... | java | public GeoPackageTile getTile(BoundingBox requestBoundingBox) {
GeoPackageTile tile = null;
// Transform to the projection of the tiles
ProjectionTransform transformRequestToTiles = requestProjection
.getTransformation(tilesProjection);
BoundingBox tilesBoundingBox = requestBoundingBox
.transform(tran... | [
"public",
"GeoPackageTile",
"getTile",
"(",
"BoundingBox",
"requestBoundingBox",
")",
"{",
"GeoPackageTile",
"tile",
"=",
"null",
";",
"// Transform to the projection of the tiles",
"ProjectionTransform",
"transformRequestToTiles",
"=",
"requestProjection",
".",
"getTransformat... | Get the tile from the request bounding box in the request projection
@param requestBoundingBox
request bounding box in the request projection
@return image | [
"Get",
"the",
"tile",
"from",
"the",
"request",
"bounding",
"box",
"in",
"the",
"request",
"projection"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileCreator.java#L308-L392 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/TileCreator.java | TileCreator.drawTile | private GeoPackageTile drawTile(TileMatrix tileMatrix,
TileResultSet tileResults, BoundingBox requestProjectedBoundingBox,
int tileWidth, int tileHeight) {
// Draw the resulting bitmap with the matching tiles
GeoPackageTile geoPackageTile = null;
Graphics graphics = null;
while (tileResults.moveToNext())... | java | private GeoPackageTile drawTile(TileMatrix tileMatrix,
TileResultSet tileResults, BoundingBox requestProjectedBoundingBox,
int tileWidth, int tileHeight) {
// Draw the resulting bitmap with the matching tiles
GeoPackageTile geoPackageTile = null;
Graphics graphics = null;
while (tileResults.moveToNext())... | [
"private",
"GeoPackageTile",
"drawTile",
"(",
"TileMatrix",
"tileMatrix",
",",
"TileResultSet",
"tileResults",
",",
"BoundingBox",
"requestProjectedBoundingBox",
",",
"int",
"tileWidth",
",",
"int",
"tileHeight",
")",
"{",
"// Draw the resulting bitmap with the matching tiles... | Draw the tile from the tile results
@param tileMatrix
@param tileResults
@param requestProjectedBoundingBox
@param tileWidth
@param tileHeight
@return tile bitmap | [
"Draw",
"the",
"tile",
"from",
"the",
"tile",
"results"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileCreator.java#L404-L489 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/TileCreator.java | TileCreator.reprojectTile | private BufferedImage reprojectTile(BufferedImage tile,
int requestedTileWidth, int requestedTileHeight,
BoundingBox requestBoundingBox,
ProjectionTransform transformRequestToTiles,
BoundingBox tilesBoundingBox) {
final double requestedWidthUnitsPerPixel = (requestBoundingBox
.getMaxLongitude() - req... | java | private BufferedImage reprojectTile(BufferedImage tile,
int requestedTileWidth, int requestedTileHeight,
BoundingBox requestBoundingBox,
ProjectionTransform transformRequestToTiles,
BoundingBox tilesBoundingBox) {
final double requestedWidthUnitsPerPixel = (requestBoundingBox
.getMaxLongitude() - req... | [
"private",
"BufferedImage",
"reprojectTile",
"(",
"BufferedImage",
"tile",
",",
"int",
"requestedTileWidth",
",",
"int",
"requestedTileHeight",
",",
"BoundingBox",
"requestBoundingBox",
",",
"ProjectionTransform",
"transformRequestToTiles",
",",
"BoundingBox",
"tilesBoundingB... | Reproject the tile to the requested projection
@param tile
tile in the tile matrix projection
@param requestedTileWidth
requested tile width
@param requestedTileHeight
requested tile height
@param requestBoundingBox
request bounding box in the request projection
@param transformRequestToTiles
transformation from reque... | [
"Reproject",
"the",
"tile",
"to",
"the",
"requested",
"projection"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileCreator.java#L508-L578 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/features/user/ManualFeatureQuery.java | ManualFeatureQuery.getBoundingBox | public BoundingBox getBoundingBox() {
GeometryEnvelope envelope = null;
long offset = 0;
boolean hasResults = true;
while (hasResults) {
hasResults = false;
FeatureResultSet resultSet = featureDao.queryForChunk(chunkLimit,
offset);
try {
while (resultSet.moveToNext()) {
hasResults = ... | java | public BoundingBox getBoundingBox() {
GeometryEnvelope envelope = null;
long offset = 0;
boolean hasResults = true;
while (hasResults) {
hasResults = false;
FeatureResultSet resultSet = featureDao.queryForChunk(chunkLimit,
offset);
try {
while (resultSet.moveToNext()) {
hasResults = ... | [
"public",
"BoundingBox",
"getBoundingBox",
"(",
")",
"{",
"GeometryEnvelope",
"envelope",
"=",
"null",
";",
"long",
"offset",
"=",
"0",
";",
"boolean",
"hasResults",
"=",
"true",
";",
"while",
"(",
"hasResults",
")",
"{",
"hasResults",
"=",
"false",
";",
"... | Manually build the bounds of the feature table
@return bounding box | [
"Manually",
"build",
"the",
"bounds",
"of",
"the",
"feature",
"table"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/user/ManualFeatureQuery.java#L117-L160 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/RTreeIndexExtension.java | RTreeIndexExtension.createFunction | private void createFunction(String name, GeometryFunction function) {
try {
Function.create(getGeoPackage().getConnection().getConnection(),
name, function);
} catch (SQLException e) {
log.log(Level.SEVERE, "Failed to create function: " + name, e);
}
} | java | private void createFunction(String name, GeometryFunction function) {
try {
Function.create(getGeoPackage().getConnection().getConnection(),
name, function);
} catch (SQLException e) {
log.log(Level.SEVERE, "Failed to create function: " + name, e);
}
} | [
"private",
"void",
"createFunction",
"(",
"String",
"name",
",",
"GeometryFunction",
"function",
")",
"{",
"try",
"{",
"Function",
".",
"create",
"(",
"getGeoPackage",
"(",
")",
".",
"getConnection",
"(",
")",
".",
"getConnection",
"(",
")",
",",
"name",
"... | Create the function for the connection
@param name
function name
@param function
geometry function | [
"Create",
"the",
"function",
"for",
"the",
"connection"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/RTreeIndexExtension.java#L175-L182 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/custom/NumberFeaturesTile.java | NumberFeaturesTile.drawTile | private BufferedImage drawTile(int tileWidth, int tileHeight, String text) {
// Create the image and graphics
BufferedImage image = new BufferedImage(tileWidth, tileHeight,
BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,... | java | private BufferedImage drawTile(int tileWidth, int tileHeight, String text) {
// Create the image and graphics
BufferedImage image = new BufferedImage(tileWidth, tileHeight,
BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,... | [
"private",
"BufferedImage",
"drawTile",
"(",
"int",
"tileWidth",
",",
"int",
"tileHeight",
",",
"String",
"text",
")",
"{",
"// Create the image and graphics",
"BufferedImage",
"image",
"=",
"new",
"BufferedImage",
"(",
"tileWidth",
",",
"tileHeight",
",",
"Buffered... | Draw a tile with the provided text label in the middle
@param tileWidth
@param tileHeight
@param text
@return | [
"Draw",
"a",
"tile",
"with",
"the",
"provided",
"text",
"label",
"in",
"the",
"middle"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/custom/NumberFeaturesTile.java#L394-L461 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.createBufferedImage | public static BufferedImage createBufferedImage(int width, int height,
String imageFormat) {
int imageType;
switch (imageFormat.toLowerCase()) {
case IMAGE_FORMAT_JPG:
case IMAGE_FORMAT_JPEG:
imageType = BufferedImage.TYPE_INT_RGB;
break;
default:
imageType = BufferedImage.TYPE_INT_ARGB;
}
... | java | public static BufferedImage createBufferedImage(int width, int height,
String imageFormat) {
int imageType;
switch (imageFormat.toLowerCase()) {
case IMAGE_FORMAT_JPG:
case IMAGE_FORMAT_JPEG:
imageType = BufferedImage.TYPE_INT_RGB;
break;
default:
imageType = BufferedImage.TYPE_INT_ARGB;
}
... | [
"public",
"static",
"BufferedImage",
"createBufferedImage",
"(",
"int",
"width",
",",
"int",
"height",
",",
"String",
"imageFormat",
")",
"{",
"int",
"imageType",
";",
"switch",
"(",
"imageFormat",
".",
"toLowerCase",
"(",
")",
")",
"{",
"case",
"IMAGE_FORMAT_... | Create a buffered image for the dimensions and image format
@param width
image width
@param height
image height
@param imageFormat
image format
@return image | [
"Create",
"a",
"buffered",
"image",
"for",
"the",
"dimensions",
"and",
"image",
"format"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L58-L75 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.isFullyTransparent | public static boolean isFullyTransparent(BufferedImage image) {
boolean transparent = true;
for (int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
transparent = isTransparent(image, x, y);
if (!transparent) {
break;
}
}
if (!transparent) {
break;
... | java | public static boolean isFullyTransparent(BufferedImage image) {
boolean transparent = true;
for (int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
transparent = isTransparent(image, x, y);
if (!transparent) {
break;
}
}
if (!transparent) {
break;
... | [
"public",
"static",
"boolean",
"isFullyTransparent",
"(",
"BufferedImage",
"image",
")",
"{",
"boolean",
"transparent",
"=",
"true",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"image",
".",
"getWidth",
"(",
")",
";",
"x",
"++",
")",
"{",
"... | Check if the image is fully transparent, meaning it contains only
transparent pixels as an empty image
@param image
image
@return true if fully transparent | [
"Check",
"if",
"the",
"image",
"is",
"fully",
"transparent",
"meaning",
"it",
"contains",
"only",
"transparent",
"pixels",
"as",
"an",
"empty",
"image"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L85-L99 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.isTransparent | public static boolean isTransparent(BufferedImage image, int x, int y) {
int pixel = image.getRGB(x, y);
boolean transparent = (pixel >> 24) == 0x00;
return transparent;
} | java | public static boolean isTransparent(BufferedImage image, int x, int y) {
int pixel = image.getRGB(x, y);
boolean transparent = (pixel >> 24) == 0x00;
return transparent;
} | [
"public",
"static",
"boolean",
"isTransparent",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"pixel",
"=",
"image",
".",
"getRGB",
"(",
"x",
",",
"y",
")",
";",
"boolean",
"transparent",
"=",
"(",
"pixel",
">>",
"... | Check if the pixel in the image at the x and y is transparent
@param image
image
@param x
x location
@param y
y location
@return true if transparent | [
"Check",
"if",
"the",
"pixel",
"in",
"the",
"image",
"at",
"the",
"x",
"and",
"y",
"is",
"transparent"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L112-L116 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.getImage | public static BufferedImage getImage(byte[] imageBytes) throws IOException {
BufferedImage image = null;
if (imageBytes != null) {
ByteArrayInputStream stream = new ByteArrayInputStream(imageBytes);
image = ImageIO.read(stream);
stream.close();
}
return image;
} | java | public static BufferedImage getImage(byte[] imageBytes) throws IOException {
BufferedImage image = null;
if (imageBytes != null) {
ByteArrayInputStream stream = new ByteArrayInputStream(imageBytes);
image = ImageIO.read(stream);
stream.close();
}
return image;
} | [
"public",
"static",
"BufferedImage",
"getImage",
"(",
"byte",
"[",
"]",
"imageBytes",
")",
"throws",
"IOException",
"{",
"BufferedImage",
"image",
"=",
"null",
";",
"if",
"(",
"imageBytes",
"!=",
"null",
")",
"{",
"ByteArrayInputStream",
"stream",
"=",
"new",
... | Get a buffered image of the image bytes
@param imageBytes
image bytes
@return buffered image or null
@throws IOException
upon failure
@since 1.1.2 | [
"Get",
"a",
"buffered",
"image",
"of",
"the",
"image",
"bytes"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L128-L139 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.writeImageToBytes | public static byte[] writeImageToBytes(BufferedImage image,
String formatName, Float quality) throws IOException {
byte[] bytes = null;
if (quality != null) {
bytes = compressAndWriteImageToBytes(image, formatName, quality);
} else {
bytes = writeImageToBytes(image, formatName);
}
return bytes;
} | java | public static byte[] writeImageToBytes(BufferedImage image,
String formatName, Float quality) throws IOException {
byte[] bytes = null;
if (quality != null) {
bytes = compressAndWriteImageToBytes(image, formatName, quality);
} else {
bytes = writeImageToBytes(image, formatName);
}
return bytes;
} | [
"public",
"static",
"byte",
"[",
"]",
"writeImageToBytes",
"(",
"BufferedImage",
"image",
",",
"String",
"formatName",
",",
"Float",
"quality",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"null",
";",
"if",
"(",
"quality",
"!=",
"nul... | Write the image to bytes in the provided format and optional quality
@param image
buffered image
@param formatName
image format name
@param quality
null or quality between 0.0 and 1.0
@return image bytes
@throws IOException
upon failure
@since 1.1.2 | [
"Write",
"the",
"image",
"to",
"bytes",
"in",
"the",
"provided",
"format",
"and",
"optional",
"quality"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L155-L164 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.writeImageToBytes | public static byte[] writeImageToBytes(BufferedImage image,
String formatName) throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
ImageIO.write(image, formatName, stream);
stream.flush();
byte[] bytes = stream.toByteArray();
stream.close();
return bytes;
} | java | public static byte[] writeImageToBytes(BufferedImage image,
String formatName) throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
ImageIO.write(image, formatName, stream);
stream.flush();
byte[] bytes = stream.toByteArray();
stream.close();
return bytes;
} | [
"public",
"static",
"byte",
"[",
"]",
"writeImageToBytes",
"(",
"BufferedImage",
"image",
",",
"String",
"formatName",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"stream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ImageIO",
".",
"write"... | Write the image to bytes in the provided format
@param image
buffered image
@param formatName
image format name
@return image bytes
@throws IOException
upon failure
@since 1.1.2 | [
"Write",
"the",
"image",
"to",
"bytes",
"in",
"the",
"provided",
"format"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L178-L186 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.compressAndWriteImageToBytes | public static byte[] compressAndWriteImageToBytes(BufferedImage image,
String formatName, float quality) {
byte[] bytes = null;
Iterator<ImageWriter> writers = ImageIO
.getImageWritersByFormatName(formatName);
if (writers == null || !writers.hasNext()) {
throw new GeoPackageException(
"No Image W... | java | public static byte[] compressAndWriteImageToBytes(BufferedImage image,
String formatName, float quality) {
byte[] bytes = null;
Iterator<ImageWriter> writers = ImageIO
.getImageWritersByFormatName(formatName);
if (writers == null || !writers.hasNext()) {
throw new GeoPackageException(
"No Image W... | [
"public",
"static",
"byte",
"[",
"]",
"compressAndWriteImageToBytes",
"(",
"BufferedImage",
"image",
",",
"String",
"formatName",
",",
"float",
"quality",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"null",
";",
"Iterator",
"<",
"ImageWriter",
">",
"writers",
... | Compress and write the image to bytes in the provided format and quality
@param image
buffered image
@param formatName
image format name
@param quality
quality between 0.0 and 1.0
@return compressed image bytes
@since 1.1.2 | [
"Compress",
"and",
"write",
"the",
"image",
"to",
"bytes",
"in",
"the",
"provided",
"format",
"and",
"quality"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L200-L236 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/style/IconDao.java | IconDao.queryForRow | public IconRow queryForRow(StyleMappingRow styleMappingRow) {
IconRow iconRow = null;
UserCustomRow userCustomRow = queryForIdRow(styleMappingRow
.getRelatedId());
if (userCustomRow != null) {
iconRow = getRow(userCustomRow);
}
return iconRow;
} | java | public IconRow queryForRow(StyleMappingRow styleMappingRow) {
IconRow iconRow = null;
UserCustomRow userCustomRow = queryForIdRow(styleMappingRow
.getRelatedId());
if (userCustomRow != null) {
iconRow = getRow(userCustomRow);
}
return iconRow;
} | [
"public",
"IconRow",
"queryForRow",
"(",
"StyleMappingRow",
"styleMappingRow",
")",
"{",
"IconRow",
"iconRow",
"=",
"null",
";",
"UserCustomRow",
"userCustomRow",
"=",
"queryForIdRow",
"(",
"styleMappingRow",
".",
"getRelatedId",
"(",
")",
")",
";",
"if",
"(",
"... | Query for the icon row from a style mapping row
@param styleMappingRow
style mapping row
@return icon row | [
"Query",
"for",
"the",
"icon",
"row",
"from",
"a",
"style",
"mapping",
"row"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/style/IconDao.java#L71-L81 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.setScale | public void setScale(float scale) {
this.scale = scale;
linePaint.setStrokeWidth(scale * lineStrokeWidth);
polygonPaint.setStrokeWidth(scale * polygonStrokeWidth);
featurePaintCache.clear();
} | java | public void setScale(float scale) {
this.scale = scale;
linePaint.setStrokeWidth(scale * lineStrokeWidth);
polygonPaint.setStrokeWidth(scale * polygonStrokeWidth);
featurePaintCache.clear();
} | [
"public",
"void",
"setScale",
"(",
"float",
"scale",
")",
"{",
"this",
".",
"scale",
"=",
"scale",
";",
"linePaint",
".",
"setStrokeWidth",
"(",
"scale",
"*",
"lineStrokeWidth",
")",
";",
"polygonPaint",
".",
"setStrokeWidth",
"(",
"scale",
"*",
"polygonStro... | Set the scale
@param scale
scale factor
@since 3.2.0 | [
"Set",
"the",
"scale"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L452-L457 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.drawTileBytes | public byte[] drawTileBytes(int x, int y, int zoom) {
BufferedImage image = drawTile(x, y, zoom);
byte[] tileData = null;
// Convert the image to bytes
if (image != null) {
try {
tileData = ImageUtils.writeImageToBytes(image, compressFormat);
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "... | java | public byte[] drawTileBytes(int x, int y, int zoom) {
BufferedImage image = drawTile(x, y, zoom);
byte[] tileData = null;
// Convert the image to bytes
if (image != null) {
try {
tileData = ImageUtils.writeImageToBytes(image, compressFormat);
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "... | [
"public",
"byte",
"[",
"]",
"drawTileBytes",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"BufferedImage",
"image",
"=",
"drawTile",
"(",
"x",
",",
"y",
",",
"zoom",
")",
";",
"byte",
"[",
"]",
"tileData",
"=",
"null",
";",
"//... | Draw the tile and get the bytes from the x, y, and zoom level
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return tile bytes, or null | [
"Draw",
"the",
"tile",
"and",
"get",
"the",
"bytes",
"from",
"the",
"x",
"y",
"and",
"zoom",
"level"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L895-L912 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.drawTile | public BufferedImage drawTile(int x, int y, int zoom) {
BufferedImage image;
if (isIndexQuery()) {
image = drawTileQueryIndex(x, y, zoom);
} else {
image = drawTileQueryAll(x, y, zoom);
}
return image;
} | java | public BufferedImage drawTile(int x, int y, int zoom) {
BufferedImage image;
if (isIndexQuery()) {
image = drawTileQueryIndex(x, y, zoom);
} else {
image = drawTileQueryAll(x, y, zoom);
}
return image;
} | [
"public",
"BufferedImage",
"drawTile",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"BufferedImage",
"image",
";",
"if",
"(",
"isIndexQuery",
"(",
")",
")",
"{",
"image",
"=",
"drawTileQueryIndex",
"(",
"x",
",",
"y",
",",
"zoom",
... | Draw a tile image from the x, y, and zoom level
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return tile image, or null | [
"Draw",
"a",
"tile",
"image",
"from",
"the",
"x",
"y",
"and",
"zoom",
"level"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L925-L933 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.drawTileQueryIndex | public BufferedImage drawTileQueryIndex(int x, int y, int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
BufferedImage image = null;
// Query for the geometry count matching the bounds in the index
long tile... | java | public BufferedImage drawTileQueryIndex(int x, int y, int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
BufferedImage image = null;
// Query for the geometry count matching the bounds in the index
long tile... | [
"public",
"BufferedImage",
"drawTileQueryIndex",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"// Get the web mercator bounding box",
"BoundingBox",
"webMercatorBoundingBox",
"=",
"TileBoundingBoxUtils",
".",
"getWebMercatorBoundingBox",
"(",
"x",
","... | Draw a tile image from the x, y, and zoom level by querying features in
the tile location
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return drawn image, or null | [
"Draw",
"a",
"tile",
"image",
"from",
"the",
"x",
"y",
"and",
"zoom",
"level",
"by",
"querying",
"features",
"in",
"the",
"tile",
"location"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L947-L990 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.queryIndexedFeaturesCount | public long queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox) {
// Create an expanded bounding box to handle features outside the tile
// that overlap
BoundingBox expandedQueryBoundingBox = expandBoundingBox(webMercatorBoundingBox);
// Query for the count of geometries matching the bounds in the i... | java | public long queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox) {
// Create an expanded bounding box to handle features outside the tile
// that overlap
BoundingBox expandedQueryBoundingBox = expandBoundingBox(webMercatorBoundingBox);
// Query for the count of geometries matching the bounds in the i... | [
"public",
"long",
"queryIndexedFeaturesCount",
"(",
"BoundingBox",
"webMercatorBoundingBox",
")",
"{",
"// Create an expanded bounding box to handle features outside the tile",
"// that overlap",
"BoundingBox",
"expandedQueryBoundingBox",
"=",
"expandBoundingBox",
"(",
"webMercatorBoun... | Query for feature result count in the bounding box
@param webMercatorBoundingBox
web mercator bounding box
@return count | [
"Query",
"for",
"feature",
"result",
"count",
"in",
"the",
"bounding",
"box"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1022-L1033 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.queryIndexedFeatures | public CloseableIterator<GeometryIndex> queryIndexedFeatures(int x, int y,
int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
// Query for the geometries matching the bounds in the index
return queryIndexedF... | java | public CloseableIterator<GeometryIndex> queryIndexedFeatures(int x, int y,
int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
// Query for the geometries matching the bounds in the index
return queryIndexedF... | [
"public",
"CloseableIterator",
"<",
"GeometryIndex",
">",
"queryIndexedFeatures",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"// Get the web mercator bounding box",
"BoundingBox",
"webMercatorBoundingBox",
"=",
"TileBoundingBoxUtils",
".",
"getWebMe... | Query for feature results in the x, y, and zoom
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return feature count
@since 3.2.0 | [
"Query",
"for",
"feature",
"results",
"in",
"the",
"x",
"y",
"and",
"zoom"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1047-L1056 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.queryIndexedFeatures | public CloseableIterator<GeometryIndex> queryIndexedFeatures(
BoundingBox webMercatorBoundingBox) {
// Create an expanded bounding box to handle features outside the tile
// that overlap
BoundingBox expandedQueryBoundingBox = expandBoundingBox(webMercatorBoundingBox);
// Query for geometries matching the b... | java | public CloseableIterator<GeometryIndex> queryIndexedFeatures(
BoundingBox webMercatorBoundingBox) {
// Create an expanded bounding box to handle features outside the tile
// that overlap
BoundingBox expandedQueryBoundingBox = expandBoundingBox(webMercatorBoundingBox);
// Query for geometries matching the b... | [
"public",
"CloseableIterator",
"<",
"GeometryIndex",
">",
"queryIndexedFeatures",
"(",
"BoundingBox",
"webMercatorBoundingBox",
")",
"{",
"// Create an expanded bounding box to handle features outside the tile",
"// that overlap",
"BoundingBox",
"expandedQueryBoundingBox",
"=",
"expa... | Query for feature results in the bounding box
@param webMercatorBoundingBox
web mercator bounding box
@return geometry index results | [
"Query",
"for",
"feature",
"results",
"in",
"the",
"bounding",
"box"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1065-L1077 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.drawTileQueryAll | public BufferedImage drawTileQueryAll(int x, int y, int zoom) {
BoundingBox boundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
BufferedImage image = null;
// Query for all features
FeatureResultSet resultSet = featureDao.queryForAll();
try {
int totalCount = resultSet.getCo... | java | public BufferedImage drawTileQueryAll(int x, int y, int zoom) {
BoundingBox boundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
BufferedImage image = null;
// Query for all features
FeatureResultSet resultSet = featureDao.queryForAll();
try {
int totalCount = resultSet.getCo... | [
"public",
"BufferedImage",
"drawTileQueryAll",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"BoundingBox",
"boundingBox",
"=",
"TileBoundingBoxUtils",
".",
"getWebMercatorBoundingBox",
"(",
"x",
",",
"y",
",",
"zoom",
")",
";",
"BufferedImag... | Draw a tile image from the x, y, and zoom level by querying all features.
This could be very slow if there are a lot of features
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return drawn image, or null | [
"Draw",
"a",
"tile",
"image",
"from",
"the",
"x",
"y",
"and",
"zoom",
"level",
"by",
"querying",
"all",
"features",
".",
"This",
"could",
"be",
"very",
"slow",
"if",
"there",
"are",
"a",
"lot",
"of",
"features"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1193-L1229 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.getGraphics | protected Graphics2D getGraphics(BufferedImage image) {
Graphics2D graphics = image.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
return graphics;
} | java | protected Graphics2D getGraphics(BufferedImage image) {
Graphics2D graphics = image.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
return graphics;
} | [
"protected",
"Graphics2D",
"getGraphics",
"(",
"BufferedImage",
"image",
")",
"{",
"Graphics2D",
"graphics",
"=",
"image",
".",
"createGraphics",
"(",
")",
";",
"graphics",
".",
"setRenderingHint",
"(",
"RenderingHints",
".",
"KEY_ANTIALIASING",
",",
"RenderingHints... | Get a graphics for the image
@param image
buffered image
@return graphics | [
"Get",
"a",
"graphics",
"for",
"the",
"image"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1248-L1253 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.getStylePaint | private Paint getStylePaint(StyleRow style, FeatureDrawType drawType) {
Paint paint = featurePaintCache.getPaint(style, drawType);
if (paint == null) {
mil.nga.geopackage.style.Color color = null;
Float strokeWidth = null;
switch (drawType) {
case CIRCLE:
color = style.getColorOrDefault();
b... | java | private Paint getStylePaint(StyleRow style, FeatureDrawType drawType) {
Paint paint = featurePaintCache.getPaint(style, drawType);
if (paint == null) {
mil.nga.geopackage.style.Color color = null;
Float strokeWidth = null;
switch (drawType) {
case CIRCLE:
color = style.getColorOrDefault();
b... | [
"private",
"Paint",
"getStylePaint",
"(",
"StyleRow",
"style",
",",
"FeatureDrawType",
"drawType",
")",
"{",
"Paint",
"paint",
"=",
"featurePaintCache",
".",
"getPaint",
"(",
"style",
",",
"drawType",
")",
";",
"if",
"(",
"paint",
"==",
"null",
")",
"{",
"... | Get the style paint from cache, or create and cache it
@param style
style row
@param drawType
draw type
@return paint | [
"Get",
"the",
"style",
"paint",
"from",
"cache",
"or",
"create",
"and",
"cache",
"it"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1480-L1525 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.isTransparent | protected boolean isTransparent(BufferedImage image) {
boolean transparent = false;
if (image != null) {
WritableRaster raster = image.getAlphaRaster();
if (raster != null) {
transparent = true;
done: for (int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
... | java | protected boolean isTransparent(BufferedImage image) {
boolean transparent = false;
if (image != null) {
WritableRaster raster = image.getAlphaRaster();
if (raster != null) {
transparent = true;
done: for (int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
... | [
"protected",
"boolean",
"isTransparent",
"(",
"BufferedImage",
"image",
")",
"{",
"boolean",
"transparent",
"=",
"false",
";",
"if",
"(",
"image",
"!=",
"null",
")",
"{",
"WritableRaster",
"raster",
"=",
"image",
".",
"getAlphaRaster",
"(",
")",
";",
"if",
... | Determine if the image is transparent
@param image
image
@return true if transparent | [
"Determine",
"if",
"the",
"image",
"is",
"transparent"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1534-L1551 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/user/UserRow.java | UserRow.toContentValues | public ContentValues toContentValues() {
ContentValues contentValues = new ContentValues();
for (TColumn column : table.getColumns()) {
if (!column.isPrimaryKey()) {
Object value = values[column.getIndex()];
String columnName = column.getName();
if (value == null) {
contentValues.putNull(col... | java | public ContentValues toContentValues() {
ContentValues contentValues = new ContentValues();
for (TColumn column : table.getColumns()) {
if (!column.isPrimaryKey()) {
Object value = values[column.getIndex()];
String columnName = column.getName();
if (value == null) {
contentValues.putNull(col... | [
"public",
"ContentValues",
"toContentValues",
"(",
")",
"{",
"ContentValues",
"contentValues",
"=",
"new",
"ContentValues",
"(",
")",
";",
"for",
"(",
"TColumn",
"column",
":",
"table",
".",
"getColumns",
"(",
")",
")",
"{",
"if",
"(",
"!",
"column",
".",
... | Convert the row to content values
@return content values | [
"Convert",
"the",
"row",
"to",
"content",
"values"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/user/UserRow.java#L60-L81 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/user/UserRow.java | UserRow.columnToContentValue | protected void columnToContentValue(ContentValues contentValues,
TColumn column, Object value) {
String columnName = column.getName();
if (value instanceof Number) {
if (value instanceof Byte) {
validateValue(column, value, Byte.class, Short.class,
Integer.class, Long.class);
contentValues.put... | java | protected void columnToContentValue(ContentValues contentValues,
TColumn column, Object value) {
String columnName = column.getName();
if (value instanceof Number) {
if (value instanceof Byte) {
validateValue(column, value, Byte.class, Short.class,
Integer.class, Long.class);
contentValues.put... | [
"protected",
"void",
"columnToContentValue",
"(",
"ContentValues",
"contentValues",
",",
"TColumn",
"column",
",",
"Object",
"value",
")",
"{",
"String",
"columnName",
"=",
"column",
".",
"getName",
"(",
")",
";",
"if",
"(",
"value",
"instanceof",
"Number",
")... | Map the column to the content values
@param contentValues
content values
@param column
column
@param value
value | [
"Map",
"the",
"column",
"to",
"the",
"content",
"values"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/user/UserRow.java#L93-L144 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/related/UserMappingDao.java | UserMappingDao.queryByIds | public UserCustomResultSet queryByIds(long baseId, long relatedId) {
return query(buildWhereIds(baseId, relatedId),
buildWhereIdsArgs(baseId, relatedId));
} | java | public UserCustomResultSet queryByIds(long baseId, long relatedId) {
return query(buildWhereIds(baseId, relatedId),
buildWhereIdsArgs(baseId, relatedId));
} | [
"public",
"UserCustomResultSet",
"queryByIds",
"(",
"long",
"baseId",
",",
"long",
"relatedId",
")",
"{",
"return",
"query",
"(",
"buildWhereIds",
"(",
"baseId",
",",
"relatedId",
")",
",",
"buildWhereIdsArgs",
"(",
"baseId",
",",
"relatedId",
")",
")",
";",
... | Query by both base id and related id
@param baseId
base id
@param relatedId
related id
@return result set | [
"Query",
"by",
"both",
"base",
"id",
"and",
"related",
"id"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/UserMappingDao.java#L188-L191 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java | FeatureIndexManager.isIndexed | public boolean isIndexed(FeatureIndexType type) {
boolean indexed = false;
if (type == null) {
indexed = isIndexed();
} else {
switch (type) {
case GEOPACKAGE:
indexed = featureTableIndex.isIndexed();
break;
case RTREE:
indexed = rTreeIndexTableDao.has();
break;
default:
throw n... | java | public boolean isIndexed(FeatureIndexType type) {
boolean indexed = false;
if (type == null) {
indexed = isIndexed();
} else {
switch (type) {
case GEOPACKAGE:
indexed = featureTableIndex.isIndexed();
break;
case RTREE:
indexed = rTreeIndexTableDao.has();
break;
default:
throw n... | [
"public",
"boolean",
"isIndexed",
"(",
"FeatureIndexType",
"type",
")",
"{",
"boolean",
"indexed",
"=",
"false",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"indexed",
"=",
"isIndexed",
"(",
")",
";",
"}",
"else",
"{",
"switch",
"(",
"type",
")",
... | Is the feature table indexed in the provided type location
@param type
index location type
@return true if indexed | [
"Is",
"the",
"feature",
"table",
"indexed",
"in",
"the",
"provided",
"type",
"location"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L624-L642 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java | FeatureIndexManager.query | public FeatureIndexResults query() {
FeatureIndexResults results = null;
switch (getIndexedType()) {
case GEOPACKAGE:
long count = featureTableIndex.count();
CloseableIterator<GeometryIndex> geometryIndices = featureTableIndex
.query();
results = new FeatureIndexGeoPackageResults(featureTableIndex,
... | java | public FeatureIndexResults query() {
FeatureIndexResults results = null;
switch (getIndexedType()) {
case GEOPACKAGE:
long count = featureTableIndex.count();
CloseableIterator<GeometryIndex> geometryIndices = featureTableIndex
.query();
results = new FeatureIndexGeoPackageResults(featureTableIndex,
... | [
"public",
"FeatureIndexResults",
"query",
"(",
")",
"{",
"FeatureIndexResults",
"results",
"=",
"null",
";",
"switch",
"(",
"getIndexedType",
"(",
")",
")",
"{",
"case",
"GEOPACKAGE",
":",
"long",
"count",
"=",
"featureTableIndex",
".",
"count",
"(",
")",
";... | Query for all feature index results
@return feature index results, close when done | [
"Query",
"for",
"all",
"feature",
"index",
"results"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L710-L730 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java | FeatureIndexManager.count | public long count(BoundingBox boundingBox) {
long count = 0;
switch (getIndexedType()) {
case GEOPACKAGE:
count = featureTableIndex.count(boundingBox);
break;
case RTREE:
count = rTreeIndexTableDao.count(boundingBox);
break;
default:
count = manualFeatureQuery.count(boundingBox);
}
return c... | java | public long count(BoundingBox boundingBox) {
long count = 0;
switch (getIndexedType()) {
case GEOPACKAGE:
count = featureTableIndex.count(boundingBox);
break;
case RTREE:
count = rTreeIndexTableDao.count(boundingBox);
break;
default:
count = manualFeatureQuery.count(boundingBox);
}
return c... | [
"public",
"long",
"count",
"(",
"BoundingBox",
"boundingBox",
")",
"{",
"long",
"count",
"=",
"0",
";",
"switch",
"(",
"getIndexedType",
"(",
")",
")",
"{",
"case",
"GEOPACKAGE",
":",
"count",
"=",
"featureTableIndex",
".",
"count",
"(",
"boundingBox",
")"... | Query for feature index count within the bounding box, projected
correctly
@param boundingBox
bounding box
@return count | [
"Query",
"for",
"feature",
"index",
"count",
"within",
"the",
"bounding",
"box",
"projected",
"correctly"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L832-L845 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java | FeatureIndexManager.query | public FeatureIndexResults query(GeometryEnvelope envelope) {
FeatureIndexResults results = null;
switch (getIndexedType()) {
case GEOPACKAGE:
long count = featureTableIndex.count(envelope);
CloseableIterator<GeometryIndex> geometryIndices = featureTableIndex
.query(envelope);
results = new FeatureI... | java | public FeatureIndexResults query(GeometryEnvelope envelope) {
FeatureIndexResults results = null;
switch (getIndexedType()) {
case GEOPACKAGE:
long count = featureTableIndex.count(envelope);
CloseableIterator<GeometryIndex> geometryIndices = featureTableIndex
.query(envelope);
results = new FeatureI... | [
"public",
"FeatureIndexResults",
"query",
"(",
"GeometryEnvelope",
"envelope",
")",
"{",
"FeatureIndexResults",
"results",
"=",
"null",
";",
"switch",
"(",
"getIndexedType",
"(",
")",
")",
"{",
"case",
"GEOPACKAGE",
":",
"long",
"count",
"=",
"featureTableIndex",
... | Query for feature index results within the Geometry Envelope
@param envelope
geometry envelope
@return feature index results, close when done | [
"Query",
"for",
"feature",
"index",
"results",
"within",
"the",
"Geometry",
"Envelope"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L854-L873 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java | FeatureIndexManager.count | public long count(GeometryEnvelope envelope) {
long count = 0;
switch (getIndexedType()) {
case GEOPACKAGE:
count = featureTableIndex.count(envelope);
break;
case RTREE:
count = rTreeIndexTableDao.count(envelope);
break;
default:
count = manualFeatureQuery.count(envelope);
}
return count;
... | java | public long count(GeometryEnvelope envelope) {
long count = 0;
switch (getIndexedType()) {
case GEOPACKAGE:
count = featureTableIndex.count(envelope);
break;
case RTREE:
count = rTreeIndexTableDao.count(envelope);
break;
default:
count = manualFeatureQuery.count(envelope);
}
return count;
... | [
"public",
"long",
"count",
"(",
"GeometryEnvelope",
"envelope",
")",
"{",
"long",
"count",
"=",
"0",
";",
"switch",
"(",
"getIndexedType",
"(",
")",
")",
"{",
"case",
"GEOPACKAGE",
":",
"count",
"=",
"featureTableIndex",
".",
"count",
"(",
"envelope",
")",... | Query for feature index count within the Geometry Envelope
@param envelope
geometry envelope
@return count | [
"Query",
"for",
"feature",
"index",
"count",
"within",
"the",
"Geometry",
"Envelope"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L882-L895 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/Progress.java | Progress.getZoomLevelMax | public Integer getZoomLevelMax(int zoomLevel) {
Integer zoomMax = zoomLevelMax.get(zoomLevel);
if (zoomMax == null) {
zoomMax = 0;
}
return zoomMax;
} | java | public Integer getZoomLevelMax(int zoomLevel) {
Integer zoomMax = zoomLevelMax.get(zoomLevel);
if (zoomMax == null) {
zoomMax = 0;
}
return zoomMax;
} | [
"public",
"Integer",
"getZoomLevelMax",
"(",
"int",
"zoomLevel",
")",
"{",
"Integer",
"zoomMax",
"=",
"zoomLevelMax",
".",
"get",
"(",
"zoomLevel",
")",
";",
"if",
"(",
"zoomMax",
"==",
"null",
")",
"{",
"zoomMax",
"=",
"0",
";",
"}",
"return",
"zoomMax"... | Get the max at the zoom level
@param zoomLevel
zoom level
@return max | [
"Get",
"the",
"max",
"at",
"the",
"zoom",
"level"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/Progress.java#L192-L198 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/Progress.java | Progress.getZoomLevelProgress | public int getZoomLevelProgress(int zoomLevel) {
Integer zoomProgress = zoomLevelProgress.get(zoomLevel);
if (zoomProgress == null) {
zoomProgress = 0;
}
return zoomProgress;
} | java | public int getZoomLevelProgress(int zoomLevel) {
Integer zoomProgress = zoomLevelProgress.get(zoomLevel);
if (zoomProgress == null) {
zoomProgress = 0;
}
return zoomProgress;
} | [
"public",
"int",
"getZoomLevelProgress",
"(",
"int",
"zoomLevel",
")",
"{",
"Integer",
"zoomProgress",
"=",
"zoomLevelProgress",
".",
"get",
"(",
"zoomLevel",
")",
";",
"if",
"(",
"zoomProgress",
"==",
"null",
")",
"{",
"zoomProgress",
"=",
"0",
";",
"}",
... | Get the total progress at the zoom level
@param zoomLevel
zoom level
@return progress | [
"Get",
"the",
"total",
"progress",
"at",
"the",
"zoom",
"level"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/Progress.java#L216-L222 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java | FeatureTileGraphics.createImage | public BufferedImage createImage() {
BufferedImage image = null;
Graphics2D graphics = null;
for (int layer = 0; layer < 4; layer++) {
BufferedImage layerImage = layeredImage[layer];
if (layerImage != null) {
if (image == null) {
image = layerImage;
graphics = layeredGraphics[layer];
... | java | public BufferedImage createImage() {
BufferedImage image = null;
Graphics2D graphics = null;
for (int layer = 0; layer < 4; layer++) {
BufferedImage layerImage = layeredImage[layer];
if (layerImage != null) {
if (image == null) {
image = layerImage;
graphics = layeredGraphics[layer];
... | [
"public",
"BufferedImage",
"createImage",
"(",
")",
"{",
"BufferedImage",
"image",
"=",
"null",
";",
"Graphics2D",
"graphics",
"=",
"null",
";",
"for",
"(",
"int",
"layer",
"=",
"0",
";",
"layer",
"<",
"4",
";",
"layer",
"++",
")",
"{",
"BufferedImage",
... | Create the final image from the layers, resets the layers
@return image | [
"Create",
"the",
"final",
"image",
"from",
"the",
"layers",
"resets",
"the",
"layers"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java#L146-L176 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java | FeatureTileGraphics.dispose | public void dispose() {
for (int layer = 0; layer < 4; layer++) {
Graphics2D graphics = layeredGraphics[layer];
if (graphics != null) {
graphics.dispose();
layeredGraphics[layer] = null;
}
BufferedImage image = layeredImage[layer];
if (image != null) {
image.flush();
layeredImage[layer]... | java | public void dispose() {
for (int layer = 0; layer < 4; layer++) {
Graphics2D graphics = layeredGraphics[layer];
if (graphics != null) {
graphics.dispose();
layeredGraphics[layer] = null;
}
BufferedImage image = layeredImage[layer];
if (image != null) {
image.flush();
layeredImage[layer]... | [
"public",
"void",
"dispose",
"(",
")",
"{",
"for",
"(",
"int",
"layer",
"=",
"0",
";",
"layer",
"<",
"4",
";",
"layer",
"++",
")",
"{",
"Graphics2D",
"graphics",
"=",
"layeredGraphics",
"[",
"layer",
"]",
";",
"if",
"(",
"graphics",
"!=",
"null",
"... | Dispose of the layered graphics and images | [
"Dispose",
"of",
"the",
"layered",
"graphics",
"and",
"images"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java#L181-L194 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java | FeatureTileGraphics.getImage | private BufferedImage getImage(int layer) {
BufferedImage image = layeredImage[layer];
if (image == null) {
createImageAndGraphics(layer);
image = layeredImage[layer];
}
return image;
} | java | private BufferedImage getImage(int layer) {
BufferedImage image = layeredImage[layer];
if (image == null) {
createImageAndGraphics(layer);
image = layeredImage[layer];
}
return image;
} | [
"private",
"BufferedImage",
"getImage",
"(",
"int",
"layer",
")",
"{",
"BufferedImage",
"image",
"=",
"layeredImage",
"[",
"layer",
"]",
";",
"if",
"(",
"image",
"==",
"null",
")",
"{",
"createImageAndGraphics",
"(",
"layer",
")",
";",
"image",
"=",
"layer... | Get the bitmap for the layer index
@param layer
layer index
@return bitmap | [
"Get",
"the",
"bitmap",
"for",
"the",
"layer",
"index"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java#L203-L210 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java | FeatureTileGraphics.getGraphics | private Graphics2D getGraphics(int layer) {
Graphics2D graphics = layeredGraphics[layer];
if (graphics == null) {
createImageAndGraphics(layer);
graphics = layeredGraphics[layer];
}
return graphics;
} | java | private Graphics2D getGraphics(int layer) {
Graphics2D graphics = layeredGraphics[layer];
if (graphics == null) {
createImageAndGraphics(layer);
graphics = layeredGraphics[layer];
}
return graphics;
} | [
"private",
"Graphics2D",
"getGraphics",
"(",
"int",
"layer",
")",
"{",
"Graphics2D",
"graphics",
"=",
"layeredGraphics",
"[",
"layer",
"]",
";",
"if",
"(",
"graphics",
"==",
"null",
")",
"{",
"createImageAndGraphics",
"(",
"layer",
")",
";",
"graphics",
"=",... | Get the graphics for the layer index
@param layer
layer index
@return graphics | [
"Get",
"the",
"graphics",
"for",
"the",
"layer",
"index"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java#L219-L226 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java | FeatureTileGraphics.createImageAndGraphics | private void createImageAndGraphics(int layer) {
layeredImage[layer] = new BufferedImage(tileWidth, tileHeight,
BufferedImage.TYPE_INT_ARGB);
layeredGraphics[layer] = layeredImage[layer].createGraphics();
layeredGraphics[layer].setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_AN... | java | private void createImageAndGraphics(int layer) {
layeredImage[layer] = new BufferedImage(tileWidth, tileHeight,
BufferedImage.TYPE_INT_ARGB);
layeredGraphics[layer] = layeredImage[layer].createGraphics();
layeredGraphics[layer].setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_AN... | [
"private",
"void",
"createImageAndGraphics",
"(",
"int",
"layer",
")",
"{",
"layeredImage",
"[",
"layer",
"]",
"=",
"new",
"BufferedImage",
"(",
"tileWidth",
",",
"tileHeight",
",",
"BufferedImage",
".",
"TYPE_INT_ARGB",
")",
";",
"layeredGraphics",
"[",
"layer"... | Create a new empty Image and Graphics
@param layer
layer index | [
"Create",
"a",
"new",
"empty",
"Image",
"and",
"Graphics"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/FeatureTileGraphics.java#L234-L241 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/features/user/FeatureCache.java | FeatureCache.resize | public void resize(int maxSize) {
this.maxSize = maxSize;
if (cache.size() > maxSize) {
int count = 0;
Iterator<Long> rowIds = cache.keySet().iterator();
while (rowIds.hasNext()) {
rowIds.next();
if (++count > maxSize) {
rowIds.remove();
}
}
}
} | java | public void resize(int maxSize) {
this.maxSize = maxSize;
if (cache.size() > maxSize) {
int count = 0;
Iterator<Long> rowIds = cache.keySet().iterator();
while (rowIds.hasNext()) {
rowIds.next();
if (++count > maxSize) {
rowIds.remove();
}
}
}
} | [
"public",
"void",
"resize",
"(",
"int",
"maxSize",
")",
"{",
"this",
".",
"maxSize",
"=",
"maxSize",
";",
"if",
"(",
"cache",
".",
"size",
"(",
")",
">",
"maxSize",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Iterator",
"<",
"Long",
">",
"rowIds",
... | Resize the cache
@param maxSize
max size | [
"Resize",
"the",
"cache"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/user/FeatureCache.java#L132-L144 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageData.java | CoverageData.getResults | private CoverageDataTileMatrixResults getResults(
BoundingBox requestProjectedBoundingBox, TileMatrix tileMatrix,
int overlappingPixels) {
CoverageDataTileMatrixResults results = null;
BoundingBox paddedBoundingBox = padBoundingBox(tileMatrix,
requestProjectedBoundingBox, overlappingPixels);
TileResultS... | java | private CoverageDataTileMatrixResults getResults(
BoundingBox requestProjectedBoundingBox, TileMatrix tileMatrix,
int overlappingPixels) {
CoverageDataTileMatrixResults results = null;
BoundingBox paddedBoundingBox = padBoundingBox(tileMatrix,
requestProjectedBoundingBox, overlappingPixels);
TileResultS... | [
"private",
"CoverageDataTileMatrixResults",
"getResults",
"(",
"BoundingBox",
"requestProjectedBoundingBox",
",",
"TileMatrix",
"tileMatrix",
",",
"int",
"overlappingPixels",
")",
"{",
"CoverageDataTileMatrixResults",
"results",
"=",
"null",
";",
"BoundingBox",
"paddedBoundin... | Get the coverage data tile results for a specified tile matrix
@param requestProjectedBoundingBox
request projected bounding box
@param tileMatrix
tile matrix
@param overlappingPixels
number of overlapping pixels used by the algorithm
@return tile matrix results | [
"Get",
"the",
"coverage",
"data",
"tile",
"results",
"for",
"a",
"specified",
"tile",
"matrix"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageData.java#L502-L519 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageData.java | CoverageData.retrieveSortedTileResults | private TileResultSet retrieveSortedTileResults(
BoundingBox projectedRequestBoundingBox, TileMatrix tileMatrix) {
TileResultSet tileResults = null;
if (tileMatrix != null) {
// Get the tile grid
TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
coverageBoundingBox, tileMatrix.getMatrixWidth(),... | java | private TileResultSet retrieveSortedTileResults(
BoundingBox projectedRequestBoundingBox, TileMatrix tileMatrix) {
TileResultSet tileResults = null;
if (tileMatrix != null) {
// Get the tile grid
TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
coverageBoundingBox, tileMatrix.getMatrixWidth(),... | [
"private",
"TileResultSet",
"retrieveSortedTileResults",
"(",
"BoundingBox",
"projectedRequestBoundingBox",
",",
"TileMatrix",
"tileMatrix",
")",
"{",
"TileResultSet",
"tileResults",
"=",
"null",
";",
"if",
"(",
"tileMatrix",
"!=",
"null",
")",
"{",
"// Get the tile gri... | Get the tile row results of coverage data tiles needed to create the
requested bounding box coverage data, sorted by row and then column
@param projectedRequestBoundingBox
bounding box projected to the coverage data
@param tileMatrix
tile matrix
@return tile results or null | [
"Get",
"the",
"tile",
"row",
"results",
"of",
"coverage",
"data",
"tiles",
"needed",
"to",
"create",
"the",
"requested",
"bounding",
"box",
"coverage",
"data",
"sorted",
"by",
"row",
"and",
"then",
"column"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageData.java#L1039-L1059 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/related/media/MediaDao.java | MediaDao.getRows | public List<MediaRow> getRows(List<Long> ids) {
List<MediaRow> mediaRows = new ArrayList<>();
for (long id : ids) {
UserCustomRow userCustomRow = queryForIdRow(id);
if (userCustomRow != null) {
mediaRows.add(getRow(userCustomRow));
}
}
return mediaRows;
} | java | public List<MediaRow> getRows(List<Long> ids) {
List<MediaRow> mediaRows = new ArrayList<>();
for (long id : ids) {
UserCustomRow userCustomRow = queryForIdRow(id);
if (userCustomRow != null) {
mediaRows.add(getRow(userCustomRow));
}
}
return mediaRows;
} | [
"public",
"List",
"<",
"MediaRow",
">",
"getRows",
"(",
"List",
"<",
"Long",
">",
"ids",
")",
"{",
"List",
"<",
"MediaRow",
">",
"mediaRows",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"long",
"id",
":",
"ids",
")",
"{",
"UserCustomR... | Get the media rows that exist with the provided ids
@param ids
list of ids
@return media rows | [
"Get",
"the",
"media",
"rows",
"that",
"exist",
"with",
"the",
"provided",
"ids"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/media/MediaDao.java#L85-L94 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/FeatureTileGen.java | FeatureTileGen.getColor | private static Color getColor(String colorString) {
Color color = null;
String[] colorParts = colorString.split(",");
try {
switch (colorParts.length) {
case 1:
Field field = Color.class.getField(colorString);
color = (Color) field.get(null);
break;
case 3:
color = new Color(Integer... | java | private static Color getColor(String colorString) {
Color color = null;
String[] colorParts = colorString.split(",");
try {
switch (colorParts.length) {
case 1:
Field field = Color.class.getField(colorString);
color = (Color) field.get(null);
break;
case 3:
color = new Color(Integer... | [
"private",
"static",
"Color",
"getColor",
"(",
"String",
"colorString",
")",
"{",
"Color",
"color",
"=",
"null",
";",
"String",
"[",
"]",
"colorParts",
"=",
"colorString",
".",
"split",
"(",
"\",\"",
")",
";",
"try",
"{",
"switch",
"(",
"colorParts",
"."... | Get the color from the string
@param colorString
@return | [
"Get",
"the",
"color",
"from",
"the",
"string"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/FeatureTileGen.java#L752-L791 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/FeatureTileGen.java | FeatureTileGen.colorString | private static String colorString(Color color) {
return color.getRed() + "," + color.getGreen() + "," + color.getBlue()
+ "," + color.getAlpha();
} | java | private static String colorString(Color color) {
return color.getRed() + "," + color.getGreen() + "," + color.getBlue()
+ "," + color.getAlpha();
} | [
"private",
"static",
"String",
"colorString",
"(",
"Color",
"color",
")",
"{",
"return",
"color",
".",
"getRed",
"(",
")",
"+",
"\",\"",
"+",
"color",
".",
"getGreen",
"(",
")",
"+",
"\",\"",
"+",
"color",
".",
"getBlue",
"(",
")",
"+",
"\",\"",
"+",... | Get a r,g,b,a color string from the color
@param color
@return color string | [
"Get",
"a",
"r",
"g",
"b",
"a",
"color",
"string",
"from",
"the",
"color"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/FeatureTileGen.java#L1308-L1311 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/TileProperties.java | TileProperties.getIntegerProperty | public Integer getIntegerProperty(String property, boolean required) {
Integer integerValue = null;
String value = getProperty(property, required);
if (value != null) {
try {
integerValue = Integer.valueOf(value);
} catch (NumberFormatException e) {
throw new GeoPackageException(GEOPACKAGE_PROPERTIE... | java | public Integer getIntegerProperty(String property, boolean required) {
Integer integerValue = null;
String value = getProperty(property, required);
if (value != null) {
try {
integerValue = Integer.valueOf(value);
} catch (NumberFormatException e) {
throw new GeoPackageException(GEOPACKAGE_PROPERTIE... | [
"public",
"Integer",
"getIntegerProperty",
"(",
"String",
"property",
",",
"boolean",
"required",
")",
"{",
"Integer",
"integerValue",
"=",
"null",
";",
"String",
"value",
"=",
"getProperty",
"(",
"property",
",",
"required",
")",
";",
"if",
"(",
"value",
"!... | Get the Integer property
@param property
property
@param required
required flag
@return integer property | [
"Get",
"the",
"Integer",
"property"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileProperties.java#L136-L149 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/TileProperties.java | TileProperties.getDoubleProperty | public Double getDoubleProperty(String property, boolean required) {
Double doubleValue = null;
String value = getProperty(property, required);
if (value != null) {
try {
doubleValue = Double.valueOf(value);
} catch (NumberFormatException e) {
throw new GeoPackageException(GEOPACKAGE_PROPERTIES_FILE... | java | public Double getDoubleProperty(String property, boolean required) {
Double doubleValue = null;
String value = getProperty(property, required);
if (value != null) {
try {
doubleValue = Double.valueOf(value);
} catch (NumberFormatException e) {
throw new GeoPackageException(GEOPACKAGE_PROPERTIES_FILE... | [
"public",
"Double",
"getDoubleProperty",
"(",
"String",
"property",
",",
"boolean",
"required",
")",
"{",
"Double",
"doubleValue",
"=",
"null",
";",
"String",
"value",
"=",
"getProperty",
"(",
"property",
",",
"required",
")",
";",
"if",
"(",
"value",
"!=",
... | Get the Double property
@param property
property
@param required
required flag
@return double property | [
"Get",
"the",
"Double",
"property"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileProperties.java#L160-L173 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/TileProperties.java | TileProperties.getProperty | public String getProperty(String property, boolean required) {
if (properties == null) {
throw new GeoPackageException(
"Properties must be loaded before reading");
}
String value = properties.getProperty(property);
if (value == null && required) {
throw new GeoPackageException(GEOPACKAGE_PROPERTIE... | java | public String getProperty(String property, boolean required) {
if (properties == null) {
throw new GeoPackageException(
"Properties must be loaded before reading");
}
String value = properties.getProperty(property);
if (value == null && required) {
throw new GeoPackageException(GEOPACKAGE_PROPERTIE... | [
"public",
"String",
"getProperty",
"(",
"String",
"property",
",",
"boolean",
"required",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"throw",
"new",
"GeoPackageException",
"(",
"\"Properties must be loaded before reading\"",
")",
";",
"}",
"String"... | Get the String property
@param property
property
@param required
required flag
@return string property | [
"Get",
"the",
"String",
"property"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileProperties.java#L184-L197 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/TileProperties.java | TileProperties.writeFile | public void writeFile(TileDao tileDao) {
try {
PrintWriter pw = new PrintWriter(propertiesFile);
TileMatrixSet tileMatrixSet = tileDao.getTileMatrixSet();
pw.println(GEOPACKAGE_PROPERTIES_EPSG + "="
+ tileMatrixSet.getSrs().getOrganizationCoordsysId());
pw.println(GEOPACKAGE_PROPERTIES_MIN_X + "="
... | java | public void writeFile(TileDao tileDao) {
try {
PrintWriter pw = new PrintWriter(propertiesFile);
TileMatrixSet tileMatrixSet = tileDao.getTileMatrixSet();
pw.println(GEOPACKAGE_PROPERTIES_EPSG + "="
+ tileMatrixSet.getSrs().getOrganizationCoordsysId());
pw.println(GEOPACKAGE_PROPERTIES_MIN_X + "="
... | [
"public",
"void",
"writeFile",
"(",
"TileDao",
"tileDao",
")",
"{",
"try",
"{",
"PrintWriter",
"pw",
"=",
"new",
"PrintWriter",
"(",
"propertiesFile",
")",
";",
"TileMatrixSet",
"tileMatrixSet",
"=",
"tileDao",
".",
"getTileMatrixSet",
"(",
")",
";",
"pw",
"... | Write the properties file using the tile dao
@param tileDao
tile dao | [
"Write",
"the",
"properties",
"file",
"using",
"the",
"tile",
"dao"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileProperties.java#L205-L236 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java | GeoPackageTextOutput.header | public String header() {
StringBuilder output = new StringBuilder();
output.append("GeoPackage File: " + geoPackage.getPath());
output.append("\nGeoPackage Name: " + geoPackage.getName());
return output.toString();
} | java | public String header() {
StringBuilder output = new StringBuilder();
output.append("GeoPackage File: " + geoPackage.getPath());
output.append("\nGeoPackage Name: " + geoPackage.getName());
return output.toString();
} | [
"public",
"String",
"header",
"(",
")",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"output",
".",
"append",
"(",
"\"GeoPackage File: \"",
"+",
"geoPackage",
".",
"getPath",
"(",
")",
")",
";",
"output",
".",
"append",
"(",
... | Get the GeoPackage file and name header text
@return text | [
"Get",
"the",
"GeoPackage",
"file",
"and",
"name",
"header",
"text"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java#L39-L44 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java | GeoPackageTextOutput.tileTable | public String tileTable(String table) {
StringBuilder output = new StringBuilder();
TileDao tileDao = geoPackage.getTileDao(table);
output.append("Table Name: " + tileDao.getTableName());
long minZoom = tileDao.getMinZoom();
long maxZoom = tileDao.getMaxZoom();
output.append("\nMin Zoom: " + minZoom);
ou... | java | public String tileTable(String table) {
StringBuilder output = new StringBuilder();
TileDao tileDao = geoPackage.getTileDao(table);
output.append("Table Name: " + tileDao.getTableName());
long minZoom = tileDao.getMinZoom();
long maxZoom = tileDao.getMaxZoom();
output.append("\nMin Zoom: " + minZoom);
ou... | [
"public",
"String",
"tileTable",
"(",
"String",
"table",
")",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"TileDao",
"tileDao",
"=",
"geoPackage",
".",
"getTileDao",
"(",
"table",
")",
";",
"output",
".",
"append",
"(",
"\"T... | Build text from a tile table
@param table
tile table
@return text | [
"Build",
"text",
"from",
"a",
"tile",
"table"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java#L53-L86 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java | GeoPackageTextOutput.textOutput | public String textOutput(SpatialReferenceSystem srs) {
StringBuilder output = new StringBuilder();
output.append("\tSRS " + SpatialReferenceSystem.COLUMN_ORGANIZATION
+ ": " + srs.getOrganization());
output.append("\n\tSRS "
+ SpatialReferenceSystem.COLUMN_ORGANIZATION_COORDSYS_ID + ": "
+ srs.getOrga... | java | public String textOutput(SpatialReferenceSystem srs) {
StringBuilder output = new StringBuilder();
output.append("\tSRS " + SpatialReferenceSystem.COLUMN_ORGANIZATION
+ ": " + srs.getOrganization());
output.append("\n\tSRS "
+ SpatialReferenceSystem.COLUMN_ORGANIZATION_COORDSYS_ID + ": "
+ srs.getOrga... | [
"public",
"String",
"textOutput",
"(",
"SpatialReferenceSystem",
"srs",
")",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"output",
".",
"append",
"(",
"\"\\tSRS \"",
"+",
"SpatialReferenceSystem",
".",
"COLUMN_ORGANIZATION",
"+",
"\... | Text output from a SRS
@param srs
spatial reference system
@return text | [
"Text",
"output",
"from",
"a",
"SRS"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java#L95-L105 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java | GeoPackageTextOutput.textOutput | public String textOutput(Contents contents) {
StringBuilder output = new StringBuilder();
output.append("\t" + Contents.COLUMN_TABLE_NAME + ": "
+ contents.getTableName());
output.append("\n\t" + Contents.COLUMN_DATA_TYPE + ": "
+ contents.getDataType());
output.append("\n\t" + Contents.COLUMN_IDENTIFIE... | java | public String textOutput(Contents contents) {
StringBuilder output = new StringBuilder();
output.append("\t" + Contents.COLUMN_TABLE_NAME + ": "
+ contents.getTableName());
output.append("\n\t" + Contents.COLUMN_DATA_TYPE + ": "
+ contents.getDataType());
output.append("\n\t" + Contents.COLUMN_IDENTIFIE... | [
"public",
"String",
"textOutput",
"(",
"Contents",
"contents",
")",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"output",
".",
"append",
"(",
"\"\\t\"",
"+",
"Contents",
".",
"COLUMN_TABLE_NAME",
"+",
"\": \"",
"+",
"contents",
... | Text output from a Contents
@param contents
contents
@return text | [
"Text",
"output",
"from",
"a",
"Contents"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java#L114-L136 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java | GeoPackageTextOutput.textOutput | public String textOutput(TileMatrixSet tileMatrixSet) {
StringBuilder output = new StringBuilder();
output.append("\t" + TileMatrixSet.COLUMN_TABLE_NAME + ": "
+ tileMatrixSet.getTableName());
output.append("\n" + textOutput(tileMatrixSet.getSrs()));
output.append("\n\t" + TileMatrixSet.COLUMN_MIN_X + ": "
... | java | public String textOutput(TileMatrixSet tileMatrixSet) {
StringBuilder output = new StringBuilder();
output.append("\t" + TileMatrixSet.COLUMN_TABLE_NAME + ": "
+ tileMatrixSet.getTableName());
output.append("\n" + textOutput(tileMatrixSet.getSrs()));
output.append("\n\t" + TileMatrixSet.COLUMN_MIN_X + ": "
... | [
"public",
"String",
"textOutput",
"(",
"TileMatrixSet",
"tileMatrixSet",
")",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"output",
".",
"append",
"(",
"\"\\t\"",
"+",
"TileMatrixSet",
".",
"COLUMN_TABLE_NAME",
"+",
"\": \"",
"+",... | Text output from a TileMatrixSet
@param tileMatrixSet
tile matrix set
@return text | [
"Text",
"output",
"from",
"a",
"TileMatrixSet"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java#L145-L159 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java | GeoPackageTextOutput.textOutput | public String textOutput(TileMatrix tileMatrix) {
StringBuilder output = new StringBuilder();
output.append("\t" + TileMatrix.COLUMN_TABLE_NAME + ": "
+ tileMatrix.getTableName());
output.append("\n\t" + TileMatrix.COLUMN_ZOOM_LEVEL + ": "
+ tileMatrix.getZoomLevel());
output.append("\n\t" + TileMatrix.... | java | public String textOutput(TileMatrix tileMatrix) {
StringBuilder output = new StringBuilder();
output.append("\t" + TileMatrix.COLUMN_TABLE_NAME + ": "
+ tileMatrix.getTableName());
output.append("\n\t" + TileMatrix.COLUMN_ZOOM_LEVEL + ": "
+ tileMatrix.getZoomLevel());
output.append("\n\t" + TileMatrix.... | [
"public",
"String",
"textOutput",
"(",
"TileMatrix",
"tileMatrix",
")",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"output",
".",
"append",
"(",
"\"\\t\"",
"+",
"TileMatrix",
".",
"COLUMN_TABLE_NAME",
"+",
"\": \"",
"+",
"tileM... | Text output from a Tile Matrix
@param tileMatrix
tile matrix
@return text | [
"Text",
"output",
"from",
"a",
"Tile",
"Matrix"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java#L168-L187 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java | GeoPackageTextOutput.textOutput | public String textOutput(BoundingBox boundingBox) {
StringBuilder output = new StringBuilder();
output.append("\tMin Longitude: " + boundingBox.getMinLongitude());
output.append("\n\tMin Latitude: " + boundingBox.getMinLatitude());
output.append("\n\tMax Longitude: " + boundingBox.getMaxLongitude());
output.a... | java | public String textOutput(BoundingBox boundingBox) {
StringBuilder output = new StringBuilder();
output.append("\tMin Longitude: " + boundingBox.getMinLongitude());
output.append("\n\tMin Latitude: " + boundingBox.getMinLatitude());
output.append("\n\tMax Longitude: " + boundingBox.getMaxLongitude());
output.a... | [
"public",
"String",
"textOutput",
"(",
"BoundingBox",
"boundingBox",
")",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"output",
".",
"append",
"(",
"\"\\tMin Longitude: \"",
"+",
"boundingBox",
".",
"getMinLongitude",
"(",
")",
")... | Text output from a bounding box
@param boundingBox
bounding box
@return text | [
"Text",
"output",
"from",
"a",
"bounding",
"box"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/GeoPackageTextOutput.java#L196-L203 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiffImage.java | CoverageDataTiffImage.writeTiff | public void writeTiff() {
if (directory.getWriteRasters() != null) {
TIFFImage tiffImage = new TIFFImage();
tiffImage.add(directory);
try {
imageBytes = TiffWriter.writeTiffToBytes(tiffImage);
} catch (IOException e) {
throw new GeoPackageException("Failed to write TIFF image", e);
}
}
} | java | public void writeTiff() {
if (directory.getWriteRasters() != null) {
TIFFImage tiffImage = new TIFFImage();
tiffImage.add(directory);
try {
imageBytes = TiffWriter.writeTiffToBytes(tiffImage);
} catch (IOException e) {
throw new GeoPackageException("Failed to write TIFF image", e);
}
}
} | [
"public",
"void",
"writeTiff",
"(",
")",
"{",
"if",
"(",
"directory",
".",
"getWriteRasters",
"(",
")",
"!=",
"null",
")",
"{",
"TIFFImage",
"tiffImage",
"=",
"new",
"TIFFImage",
"(",
")",
";",
"tiffImage",
".",
"add",
"(",
"directory",
")",
";",
"try"... | Write the TIFF file to the image bytes | [
"Write",
"the",
"TIFF",
"file",
"to",
"the",
"image",
"bytes"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiffImage.java#L126-L136 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiffImage.java | CoverageDataTiffImage.getPixel | public float getPixel(int x, int y) {
float pixel = -1;
if (rasters == null) {
readPixels();
}
if (rasters != null) {
pixel = rasters.getFirstPixelSample(x, y).floatValue();
} else {
throw new GeoPackageException("Could not retrieve pixel value");
}
return pixel;
} | java | public float getPixel(int x, int y) {
float pixel = -1;
if (rasters == null) {
readPixels();
}
if (rasters != null) {
pixel = rasters.getFirstPixelSample(x, y).floatValue();
} else {
throw new GeoPackageException("Could not retrieve pixel value");
}
return pixel;
} | [
"public",
"float",
"getPixel",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"float",
"pixel",
"=",
"-",
"1",
";",
"if",
"(",
"rasters",
"==",
"null",
")",
"{",
"readPixels",
"(",
")",
";",
"}",
"if",
"(",
"rasters",
"!=",
"null",
")",
"{",
"pixe... | Get the pixel at the coordinate
@param x
x coordinate
@param y
y coordinate
@return pixel value | [
"Get",
"the",
"pixel",
"at",
"the",
"coordinate"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiffImage.java#L147-L158 | train |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/extension/style/Styles.java | Styles.setStyle | public void setStyle(StyleRow styleRow, GeometryType geometryType) {
if (geometryType != null) {
if (styleRow != null) {
styles.put(geometryType, styleRow);
} else {
styles.remove(geometryType);
}
} else {
defaultStyle = styleRow;
}
} | java | public void setStyle(StyleRow styleRow, GeometryType geometryType) {
if (geometryType != null) {
if (styleRow != null) {
styles.put(geometryType, styleRow);
} else {
styles.remove(geometryType);
}
} else {
defaultStyle = styleRow;
}
} | [
"public",
"void",
"setStyle",
"(",
"StyleRow",
"styleRow",
",",
"GeometryType",
"geometryType",
")",
"{",
"if",
"(",
"geometryType",
"!=",
"null",
")",
"{",
"if",
"(",
"styleRow",
"!=",
"null",
")",
"{",
"styles",
".",
"put",
"(",
"geometryType",
",",
"s... | Set the style for the geometry type
@param styleRow
style row
@param geometryType
geometry type | [
"Set",
"the",
"style",
"for",
"the",
"geometry",
"type"
] | 889bffb5d18330a3f4bd89443acf7959ebe3a376 | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/style/Styles.java#L47-L57 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.