Class DMSConverter
Object
DMSConverter
- All Implemented Interfaces:
Converter
This class converts DMSCoordinate objects to DecimalCoordinate objects.
This class should be constructed with a DMSCoordinate object.
Once that object is set, convert() can be called to convert the DMSObj
to a DecimalCoordinate object and set it appropriately.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) DecimalCoordinateOnce convert() is called, this convertedObj is set to the correct DecimalCoordinate.(package private) DMSCoordinateThe DMSCoordinate object to be converted. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor to assign DMSObj to 0.DMSConverter(DMSCoordinate DMSObj) Overloaded constructor that takes in a pre-existing DMSCoordinate object and sets DMSObj equal to it. -
Method Summary
Modifier and TypeMethodDescriptionvoidconvert()Implements the convert() method from the Converter interface.Returns convertedObj.
-
Field Details
-
DMSObj
DMSCoordinate DMSObjThe DMSCoordinate object to be converted. -
convertedObj
DecimalCoordinate convertedObjOnce convert() is called, this convertedObj is set to the correct DecimalCoordinate.
-
-
Constructor Details
-
DMSConverter
public DMSConverter()Default constructor to assign DMSObj to 0. -
DMSConverter
Overloaded constructor that takes in a pre-existing DMSCoordinate object and sets DMSObj equal to it.- Parameters:
DMSObj-DMSCoordinateobject with values already set.
-
-
Method Details
-
getConvertedObj
Returns convertedObj. -
convert
public void convert()Implements the convert() method from the Converter interface. Should take the DMSObj and convert that to a DecimalCoordinate, once converted, set convertedObj to the new DecimalCoordinate. Remember all of the useful getters included with the DMSCoordinate class.When creating and setting the convertedObj, I would recommend to use the
DecimalCoordinate(double, double)constructor. A helpful graphic of the formula in action is in the GitHub README, and a link to an explanation is available in the README.
-