Package com.luciad.format.vpf
Class TLcdVPFDatabase
java.lang.Object
com.luciad.format.vpf.TLcdVPFDatabase
- All Implemented Interfaces:
ILcdFeatured,ILcdFeaturedDescriptor,Serializable
Models the VPF database level.
A VPF database is the root level of a VPF data set and contains a set of libraries
(TLcdVPFLibrary).
Optionally, a data quality descriptor can be associated with each database.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndex of the "Addressee" feature in theILcdFeaturedview on this database object.static final intIndex of the "Database Description" feature in theILcdFeaturedview on this database object.static final intIndex of the "Database Name" feature in theILcdFeaturedview on this database object.static final intIndex of the "Edition Number" feature in theILcdFeaturedview on this database object.static final String[]Deprecated.This field is for internal use only and should not be modified or used by API users.static final intIndex of the "Originator" feature in theILcdFeaturedview on this database object.static final intIndex of the "Releasability" feature in theILcdFeaturedview on this database object.static final intIndex of the "Security Class" feature in theILcdFeaturedview on this database object. -
Constructor Summary
ConstructorsConstructorDescriptionTLcdVPFDatabase(String aSourceName) Creates a newTLcdVPFDatabasefor the given source.TLcdVPFDatabase(String aSourceName, ILcdInputStreamFactory aInputStreamFactory) Creates a newTLcdVPFDatabasefor the given source.TLcdVPFDatabase(String aSourceName, ILcdBuffer aBuffer) Deprecated.ILcdBufferobjects are no longer used in VPF. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSetFeature(int aIndex) Returns whether features can be set on thisILcdFeaturedobjects.protected voidDeprecated.theDHTtable is decoded automatically at construction time.voiddecodeLAT(boolean aInitLibs) Deprecated.the LAT table is decoded automatically on the first attempt to access it.booleanReturnstrueif this VPF database is equal to the given object.Returns a description of the data quality of this database, ornullif no data quality information is available for this database.Returns a brief textual description for this entity.getFeature(int aIndex) Returns the featureObjectat the given index.getFeatureClass(int aIndex) Returns theClassof the feature at the given index.intReturns the number of features.intgetFeatureIndex(String aName) Returns the index of the given feature name if it exists, -1 otherwise.getFeatureName(int aIndex) Returns the name of the feature at the given index.Returns an array containing all libraries that are part of this database.getLibraries(ILcdBounds aBounds) Returns an array containing all libraries that are part of this database and overlap with the given bounds.getLibrary(String aLibraryName) Returns theTLcdVPFLibraryof this database which name isaLibraryName.String[]Returns the names of all libraries contained in this database.getName()Returns the short name of this entity, used as identifier in the VPF database.Returns the path to the directory of this database, for example/data/vmaplv0/.inthashCode()booleanDeprecated.This method has been deprecated.Deprecated.use getLibaries()retrieveLibraries(ILcdBounds aBounds) Deprecated.use getLibaries(com.luciad.shape.ILcdBounds)float[]retrieveLibraryBoundingRectangle(String aLibraryName) Returns the bounds ofTLcdVPFLibrarywith nameaLibraryName, expressed in geodetic coordinates.static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetFeature(int aIndex, Object aFeature) Always throws anIllegalArgumentException, as this object is immutable.voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.toString()Returns a brief textual description for this database.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.util.ILcdFeaturedDescriptor
getFeatureUnitOfMeasure
-
Field Details
-
DATABASE_NAME
public static final int DATABASE_NAMEIndex of the "Database Name" feature in theILcdFeaturedview on this database object.- See Also:
-
DATABASE_DESCRIPTION
public static final int DATABASE_DESCRIPTIONIndex of the "Database Description" feature in theILcdFeaturedview on this database object.- See Also:
-
ORIGINATOR
public static final int ORIGINATORIndex of the "Originator" feature in theILcdFeaturedview on this database object.- See Also:
-
ADDRESSEE
public static final int ADDRESSEEIndex of the "Addressee" feature in theILcdFeaturedview on this database object.- See Also:
-
SECURITY__CLASS
public static final int SECURITY__CLASSIndex of the "Security Class" feature in theILcdFeaturedview on this database object.- See Also:
-
RELEASABILITY
public static final int RELEASABILITYIndex of the "Releasability" feature in theILcdFeaturedview on this database object.- See Also:
-
EDITION_NUMBER
public static final int EDITION_NUMBERIndex of the "Edition Number" feature in theILcdFeaturedview on this database object.- See Also:
-
fFeatureNames
Deprecated.This field is for internal use only and should not be modified or used by API users.Array containing the feature names of thisILcdFeaturedobject.
-
-
Constructor Details
-
TLcdVPFDatabase
Creates a newTLcdVPFDatabasefor the given source.- Parameters:
aSourceName- source of the VPF database. This source should be the root directory of the VPF database, containing the DHT and LAT file.- Throws:
TLcdCodecException- if a problem occurs during the decoding of theDHTfile.FileNotFoundException- ifaSourceNamedoes not point to aDHTfile or a directory containing aDHTfile.NullPointerException- ifaSourceName == null
-
TLcdVPFDatabase
public TLcdVPFDatabase(String aSourceName, ILcdInputStreamFactory aInputStreamFactory) throws TLcdCodecException, FileNotFoundException Creates a newTLcdVPFDatabasefor the given source.- Parameters:
aSourceName- source of the VPF database. This source should be the root directory of the VPF database, containing the DHT and LAT file.aInputStreamFactory- the inputstream factory to be used for creating input streams for the VPF tables.- Throws:
TLcdCodecException- if a problem occurs during the decoding of theDHTfile.FileNotFoundException- ifaSourceNamedoes not point to aDHTfile or a directory containing aDHTfile.NullPointerException- ifaSourceName == null
-
TLcdVPFDatabase
public TLcdVPFDatabase(String aSourceName, ILcdBuffer aBuffer) throws TLcdCodecException, FileNotFoundException Deprecated.ILcdBufferobjects are no longer used in VPF. The buffer in this constructor will be ignored.Creates a newTLcdVPFDatabasefor the given source.- Parameters:
aSourceName- source of the VPF database. This source should be the root directory of the VPF database, containing theDHTandLAT table, or the full path of theDHTorLATfile.aBuffer- this parameter is no longer used.- Throws:
TLcdCodecException- if a problem occurs during the decoding of theDHTfile.FileNotFoundException- ifaSourceNamedoes not point to aDHTfile or a directory containing aDHTfile.
-
-
Method Details
-
getPathName
Returns the path to the directory of this database, for example/data/vmaplv0/.- Returns:
- the path to the directory of this database.
-
getLibraries
Returns an array containing all libraries that are part of this database. If the database contains no libraries, an array of length zero will be returned. The order of the libraries in theLATtable is preserved.- Returns:
- all libraries that are part of this database.
-
getLibraries
Returns an array containing all libraries that are part of this database and overlap with the given bounds. If no libraries overlap with the given bounds, an array of length zero will be returned. The order of the libraries in theLATtable is preserved.- Parameters:
aBounds- the bounds with which the libraries should overlap, expressed in geodetic coordinates.- Returns:
- all libraries, part of this database and overlapping with the given bounds.
-
getLibraryNames
Returns the names of all libraries contained in this database. The order of the libraries in theLATtable is preserved.- Returns:
- the names of all libraries contained in this database.
-
getLibrary
Returns theTLcdVPFLibraryof this database which name isaLibraryName. If no library exists with the given name,nullis returned.- Parameters:
aLibraryName- the name of the library to be returned. This should correspond to the name that is in the LIBRARY_NAME column of the LAT table.- Returns:
- the
TLcdVPFLibraryof this database which name isaLibraryName. - Throws:
NullPointerException- ifaLibraryName == null
-
retrieveLibraryBoundingRectangle
Returns the bounds ofTLcdVPFLibrarywith nameaLibraryName, expressed in geodetic coordinates. The bounds are returned as afloat[]array of length 4, containing the westernmost longitude, the southernmost latitude, the easternmost longitude and the northernmost latitude, in that order. If this database doesn't contain a library with the given name,nullis returned.- Parameters:
aLibraryName- the name of the library for which to return the bounds.- Returns:
- a
float[]array of length 4, containing the bounds of the given library. - Throws:
NullPointerException- ifaLibraryName == null
-
getDataQualityDescriptor
Returns a description of the data quality of this database, ornullif no data quality information is available for this database.- Returns:
- the
TLcdVPFDataQualityDescriptordescribing the data quality of this database.
-
getFeatureCount
public int getFeatureCount()Description copied from interface:ILcdFeaturedReturns the number of features.- Specified by:
getFeatureCountin interfaceILcdFeatured- Specified by:
getFeatureCountin interfaceILcdFeaturedDescriptor- Returns:
- the number of features.
-
getFeature
Description copied from interface:ILcdFeaturedReturns the featureObjectat the given index.- Specified by:
getFeaturein interfaceILcdFeatured- Parameters:
aIndex- a valid feature index.- Returns:
- the feature
Objectat the given index. - Throws:
IndexOutOfBoundsException- when an index is chosen greater than the result of getFeatureCount.- See Also:
-
setFeature
Always throws anIllegalArgumentException, as this object is immutable.- Specified by:
setFeaturein interfaceILcdFeatured- Parameters:
aIndex- the index of the feature to set.aFeature- the new value of the feature to set.- Throws:
IllegalArgumentException- is always thrown, as this object is immutable.- See Also:
-
canSetFeature
public boolean canSetFeature(int aIndex) Returns whether features can be set on thisILcdFeaturedobjects. Always returnsfalse, as this object is immutable.- Specified by:
canSetFeaturein interfaceILcdFeatured- Parameters:
aIndex- the index of the feature to test for.- Returns:
- always returns
false, this opobject is immutable.
-
getFeatureName
Description copied from interface:ILcdFeaturedDescriptorReturns the name of the feature at the given index.- Specified by:
getFeatureNamein interfaceILcdFeaturedDescriptor- Parameters:
aIndex- a valid feature index.- Returns:
- the name of the feature at the given index.
-
getFeatureIndex
Description copied from interface:ILcdFeaturedDescriptorReturns the index of the given feature name if it exists, -1 otherwise.- Specified by:
getFeatureIndexin interfaceILcdFeaturedDescriptor- Parameters:
aName- a feature name.- Returns:
- the index of the given feature name if it exists, -1 otherwise.
-
getFeatureClass
Description copied from interface:ILcdFeaturedDescriptorReturns theClassof the feature at the given index.- Specified by:
getFeatureClassin interfaceILcdFeaturedDescriptor- Parameters:
aIndex- a valid feature index.- Returns:
- the
Classof the feature at the given index.
-
decodeDHT
Deprecated.theDHTtable is decoded automatically at construction time. This method should no longer be called explicitly.Decodes theDHTtable of this database.- Throws:
TLcdCodecException- if an IO exception occurs during decoding of theDHTtable.FileNotFoundException- if theDHTtable does not exist.
-
decodeLAT
Deprecated.the LAT table is decoded automatically on the first attempt to access it. This method should no longer be called explicitly.Decodes the LAT table of this database.- Parameters:
aInitLibs- this parameter is no longer used.- Throws:
TLcdCodecException- if an IO exception occurs during decoding of theLATtable.FileNotFoundException- if theLATtable does not exist.
-
retrieveLibraries
Deprecated.use getLibaries()This method returns all the instances ofTLcdVPFLibrarycontained by thisTLcdVPFDatabase.- Returns:
- all libraries that are part of this database.
- See Also:
-
retrieveLibraries
Deprecated.use getLibaries(com.luciad.shape.ILcdBounds)This method returns the code ofTLcdVPFLibrarywhich bounds intersect with the givenaBounds. If no such libraries exits, an array of size 0 is returned.- Parameters:
aBounds- the bounds with which the libraries should overlap, expressed in geodetic coordinates.- Returns:
- all libraries, part of this database and overlapping with the given bounds.
- See Also:
-
toString
Returns a brief textual description for this database. The exact details of the representation are unspecified and subject to change. Depending on the application, thegetName()orgetDescription()might be used as a good source of a textual description for this database. -
equals
Returnstrueif this VPF database is equal to the given object. Two VPF database are considered equal if their root directories, containing theDHTandLATfiles, are identical. -
hashCode
public int hashCode() -
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istruethen all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrueif tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
getName
Returns the short name of this entity, used as identifier in the VPF database. For example:- vmaplv0 for a database
- eusproto for a library
- trans for a coverage
- roadl for a feature class
- Returns:
- the short name of this entity.
-
getDescription
Returns a brief textual description for this entity.- Returns:
- a brief textual description for this entity.
-