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
Modifier and TypeFieldDescriptionstatic final int
Index of the "Addressee" feature in theILcdFeatured
view on this database object.static final int
Index of the "Database Description" feature in theILcdFeatured
view on this database object.static final int
Index of the "Database Name" feature in theILcdFeatured
view on this database object.static final int
Index of the "Edition Number" feature in theILcdFeatured
view 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 int
Index of the "Originator" feature in theILcdFeatured
view on this database object.static final int
Index of the "Releasability" feature in theILcdFeatured
view on this database object.static final int
Index of the "Security Class" feature in theILcdFeatured
view on this database object. -
Constructor Summary
ConstructorDescriptionTLcdVPFDatabase
(String aSourceName) Creates a newTLcdVPFDatabase
for the given source.TLcdVPFDatabase
(String aSourceName, ILcdInputStreamFactory aInputStreamFactory) Creates a newTLcdVPFDatabase
for the given source.TLcdVPFDatabase
(String aSourceName, ILcdBuffer aBuffer) Deprecated.ILcdBuffer
objects are no longer used in VPF. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canSetFeature
(int aIndex) Returns whether features can be set on thisILcdFeatured
objects.protected void
Deprecated.theDHT
table is decoded automatically at construction time.void
decodeLAT
(boolean aInitLibs) Deprecated.the LAT table is decoded automatically on the first attempt to access it.boolean
Returnstrue
if this VPF database is equal to the given object.Returns a description of the data quality of this database, ornull
if no data quality information is available for this database.Returns a brief textual description for this entity.getFeature
(int aIndex) Returns the featureObject
at the given index.getFeatureClass
(int aIndex) Returns theClass
of the feature at the given index.int
Returns the number of features.int
getFeatureIndex
(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 theTLcdVPFLibrary
of 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/
.int
hashCode()
boolean
Deprecated.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 ofTLcdVPFLibrary
with nameaLibraryName
, expressed in geodetic coordinates.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setFeature
(int aIndex, Object aFeature) Always throws anIllegalArgumentException
, as this object is immutable.void
setTraceOn
(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, wait
Methods inherited from interface com.luciad.util.ILcdFeaturedDescriptor
getFeatureUnitOfMeasure
-
Field Details
-
DATABASE_NAME
public static final int DATABASE_NAMEIndex of the "Database Name" feature in theILcdFeatured
view on this database object.- See Also:
-
DATABASE_DESCRIPTION
public static final int DATABASE_DESCRIPTIONIndex of the "Database Description" feature in theILcdFeatured
view on this database object.- See Also:
-
ORIGINATOR
public static final int ORIGINATORIndex of the "Originator" feature in theILcdFeatured
view on this database object.- See Also:
-
ADDRESSEE
public static final int ADDRESSEEIndex of the "Addressee" feature in theILcdFeatured
view on this database object.- See Also:
-
SECURITY__CLASS
public static final int SECURITY__CLASSIndex of the "Security Class" feature in theILcdFeatured
view on this database object.- See Also:
-
RELEASABILITY
public static final int RELEASABILITYIndex of the "Releasability" feature in theILcdFeatured
view on this database object.- See Also:
-
EDITION_NUMBER
public static final int EDITION_NUMBERIndex of the "Edition Number" feature in theILcdFeatured
view 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 thisILcdFeatured
object.
-
-
Constructor Details
-
TLcdVPFDatabase
Creates a newTLcdVPFDatabase
for 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 theDHT
file.FileNotFoundException
- ifaSourceName
does not point to aDHT
file or a directory containing aDHT
file.NullPointerException
- ifaSourceName == null
-
TLcdVPFDatabase
public TLcdVPFDatabase(String aSourceName, ILcdInputStreamFactory aInputStreamFactory) throws TLcdCodecException, FileNotFoundException Creates a newTLcdVPFDatabase
for 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 theDHT
file.FileNotFoundException
- ifaSourceName
does not point to aDHT
file or a directory containing aDHT
file.NullPointerException
- ifaSourceName == null
-
TLcdVPFDatabase
public TLcdVPFDatabase(String aSourceName, ILcdBuffer aBuffer) throws TLcdCodecException, FileNotFoundException Deprecated.ILcdBuffer
objects are no longer used in VPF. The buffer in this constructor will be ignored.Creates a newTLcdVPFDatabase
for the given source.- Parameters:
aSourceName
- source of the VPF database. This source should be the root directory of the VPF database, containing theDHT
andLAT table
, or the full path of theDHT
orLAT
file.aBuffer
- this parameter is no longer used.- Throws:
TLcdCodecException
- if a problem occurs during the decoding of theDHT
file.FileNotFoundException
- ifaSourceName
does not point to aDHT
file or a directory containing aDHT
file.
-
-
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 theLAT
table 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 theLAT
table 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 theLAT
table is preserved.- Returns:
- the names of all libraries contained in this database.
-
getLibrary
Returns theTLcdVPFLibrary
of this database which name isaLibraryName
. If no library exists with the given name,null
is 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
TLcdVPFLibrary
of this database which name isaLibraryName
. - Throws:
NullPointerException
- ifaLibraryName == null
-
retrieveLibraryBoundingRectangle
Returns the bounds ofTLcdVPFLibrary
with 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,null
is 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, ornull
if no data quality information is available for this database.- Returns:
- the
TLcdVPFDataQualityDescriptor
describing the data quality of this database.
-
getFeatureCount
public int getFeatureCount()Description copied from interface:ILcdFeatured
Returns the number of features.- Specified by:
getFeatureCount
in interfaceILcdFeatured
- Specified by:
getFeatureCount
in interfaceILcdFeaturedDescriptor
- Returns:
- the number of features.
-
getFeature
Description copied from interface:ILcdFeatured
Returns the featureObject
at the given index.- Specified by:
getFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- a valid feature index.- Returns:
- the feature
Object
at 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:
setFeature
in 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 thisILcdFeatured
objects. Always returnsfalse
, as this object is immutable.- Specified by:
canSetFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- the index of the feature to test for.- Returns:
- always returns
false
, this opobject is immutable.
-
getFeatureName
Description copied from interface:ILcdFeaturedDescriptor
Returns the name of the feature at the given index.- Specified by:
getFeatureName
in interfaceILcdFeaturedDescriptor
- Parameters:
aIndex
- a valid feature index.- Returns:
- the name of the feature at the given index.
-
getFeatureIndex
Description copied from interface:ILcdFeaturedDescriptor
Returns the index of the given feature name if it exists, -1 otherwise.- Specified by:
getFeatureIndex
in interfaceILcdFeaturedDescriptor
- Parameters:
aName
- a feature name.- Returns:
- the index of the given feature name if it exists, -1 otherwise.
-
getFeatureClass
Description copied from interface:ILcdFeaturedDescriptor
Returns theClass
of the feature at the given index.- Specified by:
getFeatureClass
in interfaceILcdFeaturedDescriptor
- Parameters:
aIndex
- a valid feature index.- Returns:
- the
Class
of the feature at the given index.
-
decodeDHT
Deprecated.theDHT
table is decoded automatically at construction time. This method should no longer be called explicitly.Decodes theDHT
table of this database.- Throws:
TLcdCodecException
- if an IO exception occurs during decoding of theDHT
table.FileNotFoundException
- if theDHT
table 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 theLAT
table.FileNotFoundException
- if theLAT
table does not exist.
-
retrieveLibraries
Deprecated.use getLibaries()This method returns all the instances ofTLcdVPFLibrary
contained 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 ofTLcdVPFLibrary
which 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
Returnstrue
if this VPF database is equal to the given object. Two VPF database are considered equal if their root directories, containing theDHT
andLAT
files, 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 istrue
then 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 eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then 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.Returnstrue
if 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.
-