Package mil.nga.mgrs.grid
Enum GridType
- java.lang.Object
-
- java.lang.Enum<GridType>
-
- mil.nga.mgrs.grid.GridType
-
- All Implemented Interfaces:
Serializable
,Comparable<GridType>
public enum GridType extends Enum<GridType>
Grid type enumeration- Author:
- wnewman, osbornb
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GZD
Grid Zone DesignatorHUNDRED_KILOMETER
Hundred KilometerHUNDRED_METER
Hundred MeterKILOMETER
KilometerMETER
MeterTEN_KILOMETER
Ten KilometerTEN_METER
Ten Meter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAccuracy()
Get the Grid Type accuracy number of digits in the easting and northing valuesint
getPrecision()
Get the precision in metersstatic GridType
getPrecision(double value)
Get the precision of the value in meters based upon trailing 0'sstatic Set<GridType>
lessPrecise(GridType type)
Get the less precise (larger precision value) grid typesstatic Set<GridType>
morePrecise(GridType type)
Get the more precise (smaller precision value) grid typesstatic GridType
valueOf(String name)
Returns the enum constant of this type with the specified name.static GridType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.static GridType
withAccuracy(int accuracy)
Get the Grid Type with the accuracy number of digits in the easting and northing values.
-
-
-
Enum Constant Detail
-
GZD
public static final GridType GZD
Grid Zone Designator
-
HUNDRED_KILOMETER
public static final GridType HUNDRED_KILOMETER
Hundred Kilometer
-
TEN_KILOMETER
public static final GridType TEN_KILOMETER
Ten Kilometer
-
KILOMETER
public static final GridType KILOMETER
Kilometer
-
HUNDRED_METER
public static final GridType HUNDRED_METER
Hundred Meter
-
TEN_METER
public static final GridType TEN_METER
Ten Meter
-
METER
public static final GridType METER
Meter
-
-
Method Detail
-
values
public static GridType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GridType c : GridType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GridType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getPrecision
public int getPrecision()
Get the precision in meters- Returns:
- precision meters
-
getAccuracy
public int getAccuracy()
Get the Grid Type accuracy number of digits in the easting and northing values- Returns:
- accuracy digits
-
withAccuracy
public static GridType withAccuracy(int accuracy)
Get the Grid Type with the accuracy number of digits in the easting and northing values. Accuracy must be inclusively between 0 (HUNDRED_KILOMETER
) and 5 (METER
).- Parameters:
accuracy
- accuracy digits between 0 (inclusive) and 5 (inclusive)- Returns:
- grid type
-
getPrecision
public static GridType getPrecision(double value)
Get the precision of the value in meters based upon trailing 0's- Parameters:
value
- value in meters- Returns:
- precision grid type
-
lessPrecise
public static Set<GridType> lessPrecise(GridType type)
Get the less precise (larger precision value) grid types- Parameters:
type
- grid type- Returns:
- grid types less precise
-
-