|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.factory.AbstractFactory
org.geotools.referencing.factory.ReferencingFactory
org.geotools.referencing.factory.AbstractAuthorityFactory
org.geotools.referencing.factory.BufferedAuthorityFactory
public class BufferedAuthorityFactory
An authority factory that caches all objects created by an other factory. All
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.
Field Summary |
---|
Fields inherited from class org.geotools.referencing.factory.ReferencingFactory |
---|
LOGGER |
Fields inherited from class org.geotools.factory.AbstractFactory |
---|
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
org.opengis.referencing.cs.CartesianCS |
createCartesianCS(java.lang.String code)
Returns a cartesian coordinate system from a code. |
org.opengis.referencing.crs.CompoundCRS |
createCompoundCRS(java.lang.String code)
Returns a 3D coordinate reference system from a code. |
org.opengis.referencing.operation.CoordinateOperation |
createCoordinateOperation(java.lang.String code)
Returns an operation from a single operation code. |
org.opengis.referencing.crs.CoordinateReferenceSystem |
createCoordinateReferenceSystem(java.lang.String code)
Returns an arbitrary coordinate reference system from a code. |
org.opengis.referencing.cs.CoordinateSystem |
createCoordinateSystem(java.lang.String code)
Returns an arbitrary coordinate system from a code. |
org.opengis.referencing.cs.CoordinateSystemAxis |
createCoordinateSystemAxis(java.lang.String code)
Returns a coordinate system axis from a code. |
org.opengis.referencing.cs.CylindricalCS |
createCylindricalCS(java.lang.String code)
Returns a cylindrical coordinate system from a code. |
org.opengis.referencing.datum.Datum |
createDatum(java.lang.String code)
Returns an arbitrary datum from a code. |
org.opengis.referencing.crs.DerivedCRS |
createDerivedCRS(java.lang.String code)
Returns a derived coordinate reference system from a code. |
org.opengis.referencing.datum.Ellipsoid |
createEllipsoid(java.lang.String code)
Returns an ellipsoid from a code. |
org.opengis.referencing.cs.EllipsoidalCS |
createEllipsoidalCS(java.lang.String code)
Returns an ellipsoidal coordinate system from a code. |
org.opengis.referencing.crs.EngineeringCRS |
createEngineeringCRS(java.lang.String code)
Returns an engineering coordinate reference system from a code. |
org.opengis.referencing.datum.EngineeringDatum |
createEngineeringDatum(java.lang.String code)
Returns an engineering datum from a code. |
org.opengis.metadata.extent.Extent |
createExtent(java.lang.String code)
Returns an extent (usually an area of validity) from a code. |
java.util.Set<org.opengis.referencing.operation.CoordinateOperation> |
createFromCoordinateReferenceSystemCodes(java.lang.String sourceCRS,
java.lang.String targetCRS)
Returns an operation from coordinate reference system codes. |
org.opengis.referencing.crs.GeocentricCRS |
createGeocentricCRS(java.lang.String code)
Returns a geocentric coordinate reference system from a code. |
org.opengis.referencing.datum.GeodeticDatum |
createGeodeticDatum(java.lang.String code)
Returns a geodetic datum from a code. |
org.opengis.referencing.crs.GeographicCRS |
createGeographicCRS(java.lang.String code)
Returns a geographic coordinate reference system from a code. |
org.opengis.referencing.crs.ImageCRS |
createImageCRS(java.lang.String code)
Returns an image coordinate reference system from a code. |
org.opengis.referencing.datum.ImageDatum |
createImageDatum(java.lang.String code)
Returns an image datum from a code. |
org.opengis.referencing.IdentifiedObject |
createObject(java.lang.String code)
Returns an arbitrary object from a code. |
org.opengis.referencing.operation.OperationMethod |
createOperationMethod(java.lang.String code)
Returns an operation method from a code. |
org.opengis.parameter.ParameterDescriptor |
createParameterDescriptor(java.lang.String code)
Returns a parameter descriptor from a code. |
org.opengis.referencing.cs.PolarCS |
createPolarCS(java.lang.String code)
Returns a polar coordinate system from a code. |
org.opengis.referencing.datum.PrimeMeridian |
createPrimeMeridian(java.lang.String code)
Returns a prime meridian from a code. |
org.opengis.referencing.crs.ProjectedCRS |
createProjectedCRS(java.lang.String code)
Returns a projected coordinate reference system from a code. |
org.opengis.referencing.cs.SphericalCS |
createSphericalCS(java.lang.String code)
Returns a spherical coordinate system from a code. |
org.opengis.referencing.crs.TemporalCRS |
createTemporalCRS(java.lang.String code)
Returns a temporal coordinate reference system from a code. |
org.opengis.referencing.datum.TemporalDatum |
createTemporalDatum(java.lang.String code)
Returns a temporal datum from a code. |
org.opengis.referencing.cs.TimeCS |
createTimeCS(java.lang.String code)
Returns a temporal coordinate system from a code. |
javax.measure.unit.Unit<?> |
createUnit(java.lang.String code)
Returns an unit from a code. |
org.opengis.referencing.crs.VerticalCRS |
createVerticalCRS(java.lang.String code)
Returns a vertical coordinate reference system from a code. |
org.opengis.referencing.cs.VerticalCS |
createVerticalCS(java.lang.String code)
Returns a vertical coordinate system from a code. |
org.opengis.referencing.datum.VerticalDatum |
createVerticalDatum(java.lang.String code)
Returns a vertical datum from a code. |
void |
dispose()
Releases resources immediately instead of waiting for the garbage collector. |
org.opengis.metadata.citation.Citation |
getAuthority()
Returns the organization or party responsible for definition and maintenance of the underlying database. |
java.util.Set<java.lang.String> |
getAuthorityCodes(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type)
Returns the set of authority codes of the given type. |
java.lang.String |
getBackingStoreDescription()
Returns a description of the underlying backing store, or null if unknow. |
org.opengis.util.InternationalString |
getDescriptionText(java.lang.String code)
Gets a description of the object corresponding to a code. |
IdentifiedObjectFinder |
getIdentifiedObjectFinder(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type)
Returns a finder which can be used for looking up unidentified objects. |
org.opengis.metadata.citation.Citation |
getVendor()
Returns the vendor responsible for creating the underlying factory implementation. |
Methods inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory |
---|
noSuchAuthorityCode, trimAuthority |
Methods inherited from class org.geotools.referencing.factory.ReferencingFactory |
---|
ensureNonNull |
Methods inherited from class org.geotools.factory.AbstractFactory |
---|
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.geotools.factory.Factory |
---|
getImplementationHints |
Constructor Detail |
---|
protected 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.Method Detail |
---|
public org.opengis.metadata.citation.Citation getVendor()
getVendor
in class ReferencingFactory
public org.opengis.metadata.citation.Citation getAuthority()
getAuthority
in interface org.opengis.referencing.AuthorityFactory
getAuthority
in class AbstractAuthorityFactory
public java.lang.String getBackingStoreDescription() throws org.opengis.referencing.FactoryException
null
if unknow.
This is for example the database software used for storing the data.
getBackingStoreDescription
in class AbstractAuthorityFactory
null
.
org.opengis.referencing.FactoryException
- if a failure occured while fetching the engine description.public java.util.Set<java.lang.String> getAuthorityCodes(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type) throws org.opengis.referencing.FactoryException
type
argument specify the base class.
getAuthorityCodes
in interface org.opengis.referencing.AuthorityFactory
type
- The spatial reference objects type.
org.opengis.referencing.FactoryException
- if access to the underlying database failed.public org.opengis.util.InternationalString getDescriptionText(java.lang.String code) throws org.opengis.referencing.NoSuchAuthorityCodeException, org.opengis.referencing.FactoryException
getDescriptionText
in interface org.opengis.referencing.AuthorityFactory
code
- Value allocated by authority.
null
if the object
corresponding to the specified code
has no description.
org.opengis.referencing.NoSuchAuthorityCodeException
- if the specified code
was not found.
org.opengis.referencing.FactoryException
- if the query failed for some other reason.public org.opengis.referencing.IdentifiedObject createObject(java.lang.String code) throws org.opengis.referencing.FactoryException
createObject
in interface org.opengis.referencing.AuthorityFactory
createObject
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.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 org.opengis.referencing.datum.Datum createDatum(java.lang.String code) throws org.opengis.referencing.FactoryException
createDatum
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
,
AbstractAuthorityFactory.createVerticalDatum(java.lang.String)
,
AbstractAuthorityFactory.createTemporalDatum(java.lang.String)
public org.opengis.referencing.datum.EngineeringDatum createEngineeringDatum(java.lang.String code) throws org.opengis.referencing.FactoryException
createEngineeringDatum
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createEngineeringCRS(java.lang.String)
public org.opengis.referencing.datum.ImageDatum createImageDatum(java.lang.String code) throws org.opengis.referencing.FactoryException
createImageDatum
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createImageCRS(java.lang.String)
public org.opengis.referencing.datum.VerticalDatum createVerticalDatum(java.lang.String code) throws org.opengis.referencing.FactoryException
createVerticalDatum
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createVerticalCRS(java.lang.String)
public org.opengis.referencing.datum.TemporalDatum createTemporalDatum(java.lang.String code) throws org.opengis.referencing.FactoryException
createTemporalDatum
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createTemporalCRS(java.lang.String)
public org.opengis.referencing.datum.GeodeticDatum createGeodeticDatum(java.lang.String code) throws org.opengis.referencing.FactoryException
createGeodeticDatum
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.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 org.opengis.referencing.datum.Ellipsoid createEllipsoid(java.lang.String code) throws org.opengis.referencing.FactoryException
createEllipsoid
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public org.opengis.referencing.datum.PrimeMeridian createPrimeMeridian(java.lang.String code) throws org.opengis.referencing.FactoryException
createPrimeMeridian
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public org.opengis.metadata.extent.Extent createExtent(java.lang.String code) throws org.opengis.referencing.FactoryException
createExtent
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.CoordinateSystem createCoordinateSystem(java.lang.String code) throws org.opengis.referencing.FactoryException
createCoordinateSystem
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.CartesianCS createCartesianCS(java.lang.String code) throws org.opengis.referencing.FactoryException
createCartesianCS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.PolarCS createPolarCS(java.lang.String code) throws org.opengis.referencing.FactoryException
createPolarCS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.CylindricalCS createCylindricalCS(java.lang.String code) throws org.opengis.referencing.FactoryException
createCylindricalCS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.SphericalCS createSphericalCS(java.lang.String code) throws org.opengis.referencing.FactoryException
createSphericalCS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.EllipsoidalCS createEllipsoidalCS(java.lang.String code) throws org.opengis.referencing.FactoryException
createEllipsoidalCS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.VerticalCS createVerticalCS(java.lang.String code) throws org.opengis.referencing.FactoryException
createVerticalCS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.TimeCS createTimeCS(java.lang.String code) throws org.opengis.referencing.FactoryException
createTimeCS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.cs.CoordinateSystemAxis createCoordinateSystemAxis(java.lang.String code) throws org.opengis.referencing.FactoryException
createCoordinateSystemAxis
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public javax.measure.unit.Unit<?> createUnit(java.lang.String code) throws org.opengis.referencing.FactoryException
createUnit
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem(java.lang.String code) throws org.opengis.referencing.FactoryException
createCoordinateReferenceSystem
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.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 org.opengis.referencing.crs.CompoundCRS createCompoundCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createCompoundCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.crs.DerivedCRS createDerivedCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createDerivedCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.crs.EngineeringCRS createEngineeringCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createEngineeringCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.crs.GeographicCRS createGeographicCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createGeographicCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public org.opengis.referencing.crs.GeocentricCRS createGeocentricCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createGeocentricCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public org.opengis.referencing.crs.ImageCRS createImageCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createImageCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.crs.ProjectedCRS createProjectedCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createProjectedCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public org.opengis.referencing.crs.TemporalCRS createTemporalCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createTemporalCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createTemporalDatum(java.lang.String)
public org.opengis.referencing.crs.VerticalCRS createVerticalCRS(java.lang.String code) throws org.opengis.referencing.FactoryException
createVerticalCRS
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.AbstractAuthorityFactory.createVerticalDatum(java.lang.String)
public org.opengis.parameter.ParameterDescriptor createParameterDescriptor(java.lang.String code) throws org.opengis.referencing.FactoryException
createParameterDescriptor
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.operation.OperationMethod createOperationMethod(java.lang.String code) throws org.opengis.referencing.FactoryException
createOperationMethod
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.operation.CoordinateOperation createCoordinateOperation(java.lang.String code) throws org.opengis.referencing.FactoryException
createCoordinateOperation
in class AbstractAuthorityFactory
code
- Value allocated by authority.
org.opengis.referencing.FactoryException
- if the object creation failed.public java.util.Set<org.opengis.referencing.operation.CoordinateOperation> createFromCoordinateReferenceSystemCodes(java.lang.String sourceCRS, java.lang.String targetCRS) throws org.opengis.referencing.FactoryException
createFromCoordinateReferenceSystemCodes
in class AbstractAuthorityFactory
sourceCRS
- Coded value of source coordinate reference system.targetCRS
- Coded value of target coordinate reference system.
sourceCRS
to targetCRS
.
org.opengis.referencing.FactoryException
- if the object creation failed.public IdentifiedObjectFinder getIdentifiedObjectFinder(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type) throws org.opengis.referencing.FactoryException
getIdentifiedObjectFinder
in class AbstractAuthorityFactory
type
- 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.
org.opengis.referencing.FactoryException
- if the finder can not be created.public void dispose() throws org.opengis.referencing.FactoryException
dispose
in class AbstractAuthorityFactory
org.opengis.referencing.FactoryException
- if an error occured while disposing the factory.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |