Class NTv2GridShiftFactory
Object
AbstractFactory
ReferencingFactory
NTv2GridShiftFactory
- All Implemented Interfaces:
Factory,BufferedFactory,Factory,RegistrableFactory
Loads and caches NTv2 grid files. Thisthat incorporates a soft cache mechanism to keep grids in memory when first
loaded. It also checks NTv2 grid file format in
#isNTv2Grid(String) method.- Author:
- Oscar Fonts
-
Field Summary
FieldsFields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a factory with the default priority.NTv2GridShiftFactory(int priority) Constructs an instance using the specified priority level. -
Method Summary
Modifier and TypeMethodDescriptionGridShiftFilecreateNTv2Grid(URL gridLocation) Creates a NTv2 Grid.booleanisNTv2Grid(URL location) Performs a NTv2 grid file lookup given its name, and checks for file format correctness.protected booleanisNTv2GridFileValid(URL url) Checks if a given resource is a valid NTv2 file without fully loading it.Methods inherited from class ReferencingFactory
ensureNonNull, getVendorMethods inherited from class AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toStringMethods inherited from interface Factory
getImplementationHints
-
Field Details
-
LOGGER
Logger.
-
-
Constructor Details
-
NTv2GridShiftFactory
public NTv2GridShiftFactory()Constructs a factory with the default priority. -
NTv2GridShiftFactory
public NTv2GridShiftFactory(int priority) Constructs an instance using the specified priority level.- Parameters:
priority- The priority for this factory, as a number betweenMINIMUM_PRIORITYandMAXIMUM_PRIORITYinclusive.
-
-
Method Details
-
isNTv2Grid
Performs a NTv2 grid file lookup given its name, and checks for file format correctness.- Parameters:
location- The NTv2 grid file location- Returns:
trueif file exists and is valid,falseotherwise
-
createNTv2Grid
Creates a NTv2 Grid.- Parameters:
gridLocation- The NTv2 grid file location- Returns:
- the grid
- Throws:
FactoryException- if grid cannot be created
-
isNTv2GridFileValid
Checks if a given resource is a valid NTv2 file without fully loading it.If file is not valid, the cause is logged at
warning level.- Parameters:
url- the NTv2 file absolute path- Returns:
- true if file has NTv2 format, false otherwise
-