public class StkFacilityDatabaseQuery extends Object
StkFacilityDatabase
.
The following example shows how to query the facility database for facilities matching certain criteria:
StkFacilityDatabase db = new StkFacilityDatabase(dbDirectory, "stkFacility");
// Create a query object and then populate it with the properties to query on.
// Regular expressions are used to query on strings.
StkFacilityDatabaseQuery query = new StkFacilityDatabaseQuery();
query.setFacilityName(Pattern.compile("^Diyarbak"));
// Get the database entries matching the query and print out the Longitude and Latitude of each.
for (StkFacilityDatabaseEntry entry : db.getEntries(query)) {
System.out.format("%s: Longitude %f, Latitude %f%n", entry.getFacilityName(), entry.getLongitude(), entry.getLatitude());
}
Constructor and Description |
---|
StkFacilityDatabaseQuery() |
Modifier and Type | Method and Description |
---|---|
Pattern |
getCentralBodyName()
|
Pattern |
getFacilityName()
|
Double |
getMaximumAltitude()
|
Double |
getMaximumLatitude()
|
Double |
getMaximumLongitude()
|
Double |
getMinimumAltitude()
|
Double |
getMinimumLatitude()
|
Double |
getMinimumLongitude()
|
Pattern |
getNetworkName()
|
boolean |
matches(StkFacilityDatabaseEntry entry)
Determines if an entry matches this query.
|
void |
setCentralBodyName(Pattern value)
|
void |
setFacilityName(Pattern value)
|
void |
setMaximumAltitude(Double value)
|
void |
setMaximumLatitude(Double value)
|
void |
setMaximumLongitude(Double value)
|
void |
setMinimumAltitude(Double value)
|
void |
setMinimumLatitude(Double value)
|
void |
setMinimumLongitude(Double value)
|
void |
setNetworkName(Pattern value)
|
public final Pattern getFacilityName()
public final void setFacilityName(Pattern value)
public final Pattern getNetworkName()
public final void setNetworkName(Pattern value)
public final Pattern getCentralBodyName()
public final void setCentralBodyName(Pattern value)
public final boolean matches(@Nonnull StkFacilityDatabaseEntry entry)
entry
- The entry to check.true
if the entry matches this query; otherwise false
.ArgumentNullException
- Thrown when entry
is null
.