public class BufferedAuthorityFactory extends AbstractAuthorityFactory implements BufferedFactory
createFoo(String) methods first looks if a previously created object exists for the given code.
If such an object exists, it is returned. Otherwise, the object creation is delegated to the
authority factory specified at creation time, and the
result is cached in this buffered factory.
Objects are cached by strong references, up to the amount of objects specified at construction time. If a greater amount of objects are cached, the oldest ones will be retained through a weak reference instead of a strong one. This means that this buffered factory will continue to returns them as long as they are in use somewhere else in the Java virtual machine, but will be discarted (and recreated on the fly if needed) otherwise.
LOGGERhints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority| Modifier | Constructor and Description |
|---|---|
protected |
BufferedAuthorityFactory(AbstractAuthorityFactory factory)
Constructs an instance wrapping the specified factory with a default number of entries to
keep by strong reference.
|
protected |
BufferedAuthorityFactory(AbstractAuthorityFactory factory,
int maxStrongReferences)
Constructs an instance wrapping the specified factory.
|
| Modifier and Type | Method and Description |
|---|---|
CartesianCS |
createCartesianCS(String code)
Returns a cartesian coordinate system from a code.
|
CompoundCRS |
createCompoundCRS(String code)
Returns a 3D coordinate reference system from a code.
|
CoordinateOperation |
createCoordinateOperation(String code)
Returns an operation from a single operation code.
|
CoordinateReferenceSystem |
createCoordinateReferenceSystem(String code)
Returns an arbitrary coordinate reference system from a code.
|
CoordinateSystem |
createCoordinateSystem(String code)
Returns an arbitrary coordinate system from a code.
|
CoordinateSystemAxis |
createCoordinateSystemAxis(String code)
Returns a coordinate system axis from a code.
|
CylindricalCS |
createCylindricalCS(String code)
Returns a cylindrical coordinate system from a code.
|
Datum |
createDatum(String code)
Returns an arbitrary datum from a code.
|
DerivedCRS |
createDerivedCRS(String code)
Returns a derived coordinate reference system from a code.
|
Ellipsoid |
createEllipsoid(String code)
Returns an ellipsoid from a code.
|
EllipsoidalCS |
createEllipsoidalCS(String code)
Returns an ellipsoidal coordinate system from a code.
|
EngineeringCRS |
createEngineeringCRS(String code)
Returns an engineering coordinate reference system from a code.
|
EngineeringDatum |
createEngineeringDatum(String code)
Returns an engineering datum from a code.
|
Extent |
createExtent(String code)
Returns an extent (usually an area of validity) from a code.
|
Set<CoordinateOperation> |
createFromCoordinateReferenceSystemCodes(String sourceCRS,
String targetCRS)
Returns an operation from coordinate reference system codes.
|
GeocentricCRS |
createGeocentricCRS(String code)
Returns a geocentric coordinate reference system from a code.
|
GeodeticDatum |
createGeodeticDatum(String code)
Returns a geodetic datum from a code.
|
GeographicCRS |
createGeographicCRS(String code)
Returns a geographic coordinate reference system from a code.
|
ImageCRS |
createImageCRS(String code)
Returns an image coordinate reference system from a code.
|
ImageDatum |
createImageDatum(String code)
Returns an image datum from a code.
|
IdentifiedObject |
createObject(String code)
Returns an arbitrary object from a code.
|
OperationMethod |
createOperationMethod(String code)
Returns an operation method from a code.
|
ParameterDescriptor |
createParameterDescriptor(String code)
Returns a parameter descriptor from a code.
|
PolarCS |
createPolarCS(String code)
Returns a polar coordinate system from a code.
|
PrimeMeridian |
createPrimeMeridian(String code)
Returns a prime meridian from a code.
|
ProjectedCRS |
createProjectedCRS(String code)
Returns a projected coordinate reference system from a code.
|
SphericalCS |
createSphericalCS(String code)
Returns a spherical coordinate system from a code.
|
TemporalCRS |
createTemporalCRS(String code)
Returns a temporal coordinate reference system from a code.
|
TemporalDatum |
createTemporalDatum(String code)
Returns a temporal datum from a code.
|
TimeCS |
createTimeCS(String code)
Returns a temporal coordinate system from a code.
|
Unit<?> |
createUnit(String code)
Returns an unit from a code.
|
VerticalCRS |
createVerticalCRS(String code)
Returns a vertical coordinate reference system from a code.
|
VerticalCS |
createVerticalCS(String code)
Returns a vertical coordinate system from a code.
|
VerticalDatum |
createVerticalDatum(String code)
Returns a vertical datum from a code.
|
void |
dispose()
Releases resources immediately instead of waiting for the garbage collector.
|
Citation |
getAuthority()
Returns the organization or party responsible for definition and maintenance of the
underlying database.
|
Set<String> |
getAuthorityCodes(Class<? extends IdentifiedObject> type)
Returns the set of authority codes of the given type.
|
String |
getBackingStoreDescription()
Returns a description of the underlying backing store, or
null if unknow. |
InternationalString |
getDescriptionText(String code)
Gets a description of the object corresponding to a code.
|
IdentifiedObjectFinder |
getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
Returns a finder which can be used for looking up unidentified objects.
|
Citation |
getVendor()
Returns the vendor responsible for creating the underlying factory implementation.
|
noSuchAuthorityCode, trimAuthorityensureNonNulladdImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toStringgetImplementationHintsprotected BufferedAuthorityFactory(AbstractAuthorityFactory factory)
This constructor is protected because subclasses must declare which of the DatumAuthorityFactory, CSAuthorityFactory, CRSAuthorityFactory and CoordinateOperationAuthorityFactory interfaces they choose to implement.
factory - The factory to cache. Can not be null.protected BufferedAuthorityFactory(AbstractAuthorityFactory factory, int maxStrongReferences)
maxStrongReferences
argument specify the maximum number of objects to keep by strong reference. If a greater
amount of objects are created, then the strong references for the oldest ones are replaced by
weak references.
This constructor is protected because subclasses must declare which of the DatumAuthorityFactory, CSAuthorityFactory, CRSAuthorityFactory and CoordinateOperationAuthorityFactory interfaces they choose to implement.
factory - The factory to cache. Can not be null.maxStrongReferences - The maximum number of objects to keep by strong reference.public Citation getVendor()
getVendor in class ReferencingFactorypublic Citation getAuthority()
getAuthority in interface AuthorityFactorygetAuthority in class AbstractAuthorityFactorypublic String getBackingStoreDescription() throws FactoryException
null if unknow. This is for
example the database software used for storing the data.getBackingStoreDescription in class AbstractAuthorityFactorynull.FactoryException - if a failure occured while fetching the engine description.public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException
type argument specify the
base class.getAuthorityCodes in interface AuthorityFactorytype - The spatial reference objects type.FactoryException - if access to the underlying database failed.public InternationalString getDescriptionText(String code) throws NoSuchAuthorityCodeException, FactoryException
getDescriptionText in interface AuthorityFactorycode - Value allocated by authority.null if the object corresponding to the
specified code has no description.NoSuchAuthorityCodeException - if the specified code was not found.FactoryException - if the query failed for some other reason.public IdentifiedObject createObject(String code) throws FactoryException
createObject in interface AuthorityFactorycreateObject in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createCoordinateReferenceSystem(java.lang.String),
AbstractAuthorityFactory.createDatum(java.lang.String),
AbstractAuthorityFactory.createEllipsoid(java.lang.String),
AbstractAuthorityFactory.createUnit(java.lang.String)public Datum createDatum(String code) throws FactoryException
createDatum in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String),
AbstractAuthorityFactory.createVerticalDatum(java.lang.String),
AbstractAuthorityFactory.createTemporalDatum(java.lang.String)public EngineeringDatum createEngineeringDatum(String code) throws FactoryException
createEngineeringDatum in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createEngineeringCRS(java.lang.String)public ImageDatum createImageDatum(String code) throws FactoryException
createImageDatum in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createImageCRS(java.lang.String)public VerticalDatum createVerticalDatum(String code) throws FactoryException
createVerticalDatum in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createVerticalCRS(java.lang.String)public TemporalDatum createTemporalDatum(String code) throws FactoryException
createTemporalDatum in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createTemporalCRS(java.lang.String)public GeodeticDatum createGeodeticDatum(String code) throws FactoryException
createGeodeticDatum in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createEllipsoid(java.lang.String),
AbstractAuthorityFactory.createPrimeMeridian(java.lang.String),
AbstractAuthorityFactory.createGeographicCRS(java.lang.String),
AbstractAuthorityFactory.createProjectedCRS(java.lang.String)public Ellipsoid createEllipsoid(String code) throws FactoryException
createEllipsoid in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)public PrimeMeridian createPrimeMeridian(String code) throws FactoryException
createPrimeMeridian in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)public Extent createExtent(String code) throws FactoryException
createExtent in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public CoordinateSystem createCoordinateSystem(String code) throws FactoryException
createCoordinateSystem in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public CartesianCS createCartesianCS(String code) throws FactoryException
createCartesianCS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public PolarCS createPolarCS(String code) throws FactoryException
createPolarCS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public CylindricalCS createCylindricalCS(String code) throws FactoryException
createCylindricalCS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public SphericalCS createSphericalCS(String code) throws FactoryException
createSphericalCS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException
createEllipsoidalCS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public VerticalCS createVerticalCS(String code) throws FactoryException
createVerticalCS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public TimeCS createTimeCS(String code) throws FactoryException
createTimeCS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException
createCoordinateSystemAxis in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public Unit<?> createUnit(String code) throws FactoryException
createUnit in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException
createCoordinateReferenceSystem in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createGeographicCRS(java.lang.String),
AbstractAuthorityFactory.createProjectedCRS(java.lang.String),
AbstractAuthorityFactory.createVerticalCRS(java.lang.String),
AbstractAuthorityFactory.createTemporalCRS(java.lang.String),
AbstractAuthorityFactory.createCompoundCRS(java.lang.String)public CompoundCRS createCompoundCRS(String code) throws FactoryException
createCompoundCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public DerivedCRS createDerivedCRS(String code) throws FactoryException
createDerivedCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public EngineeringCRS createEngineeringCRS(String code) throws FactoryException
createEngineeringCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public GeographicCRS createGeographicCRS(String code) throws FactoryException
createGeographicCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)public GeocentricCRS createGeocentricCRS(String code) throws FactoryException
createGeocentricCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)public ImageCRS createImageCRS(String code) throws FactoryException
createImageCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public ProjectedCRS createProjectedCRS(String code) throws FactoryException
createProjectedCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)public TemporalCRS createTemporalCRS(String code) throws FactoryException
createTemporalCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createTemporalDatum(java.lang.String)public VerticalCRS createVerticalCRS(String code) throws FactoryException
createVerticalCRS in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.AbstractAuthorityFactory.createVerticalDatum(java.lang.String)public ParameterDescriptor createParameterDescriptor(String code) throws FactoryException
createParameterDescriptor in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public OperationMethod createOperationMethod(String code) throws FactoryException
createOperationMethod in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public CoordinateOperation createCoordinateOperation(String code) throws FactoryException
createCoordinateOperation in class AbstractAuthorityFactorycode - Value allocated by authority.FactoryException - if the object creation failed.public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) throws FactoryException
createFromCoordinateReferenceSystemCodes in class AbstractAuthorityFactorysourceCRS - Coded value of source coordinate reference system.targetCRS - Coded value of target coordinate reference system.sourceCRS to targetCRS.FactoryException - if the object creation failed.public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type) throws FactoryException
getIdentifiedObjectFinder in class AbstractAuthorityFactorytype - The type of objects to look for. Should be a GeoAPI interface like GeographicCRS.class, but this method accepts also implementation class. If the type is
unknown, use IdentifiedObject.class. A more accurate type may help to speed up
the search, since it reduces the amount of tables to scan in some implementations like
the factories backed by EPSG database.FactoryException - if the finder can not be created.public void dispose()
throws FactoryException
dispose in class AbstractAuthorityFactoryFactoryException - if an error occured while disposing the factory.Copyright © 1996–2019 Geotools. All rights reserved.