public class TLcdVPFDatabase extends Object implementsILcdFeatured,ILcdFeaturedDescriptor
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.
Modifier and Type | Field and Description |
---|---|
static int |
ADDRESSEE
Index of the "Addressee" feature in the
ILcdFeatured view on this database object. |
static int |
DATABASE_DESCRIPTION
Index of the "Database Description" feature in the
ILcdFeatured view on this database object. |
static int |
DATABASE_NAME
Index of the "Database Name" feature in the
ILcdFeatured view on this database object. |
static int |
EDITION_NUMBER
Index of the "Edition Number" feature in the
ILcdFeatured view on this database object. |
static String[] |
fFeatureNames
Deprecated.
This field is for internal use only and should not be modified or used by API users.
|
static int |
ORIGINATOR
Index of the "Originator" feature in the
ILcdFeatured view on this database object. |
static int |
RELEASABILITY
Index of the "Releasability" feature in the
ILcdFeatured view on this database object. |
static int |
SECURITY__CLASS
Index of the "Security Class" feature in the
ILcdFeatured view on this database object. |
Constructor and Description |
---|
TLcdVPFDatabase(String aSourceName)
Creates a new
TLcdVPFDatabase for the given source. |
TLcdVPFDatabase(String aSourceName,
ILcdBuffer aBuffer)
Deprecated.
ILcdBuffer objects are no longer used in VPF. The buffer in this constructor will be ignored. |
TLcdVPFDatabase(String aSourceName,
ILcdInputStreamFactory aInputStreamFactory)
Creates a new
TLcdVPFDatabase for the given source. |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aIndex)
Returns whether features can be set on this
ILcdFeatured objects. |
protected void |
decodeDHT()
Deprecated.
the
DHT table is decoded automatically at construction time.
This method should no longer be called explicitly. |
void |
decodeLAT(boolean aInitLibs)
Deprecated.
the LAT table is decoded automatically on the first attempt to access it.
This method should no longer be called explicitly.
|
boolean |
equals(Object o)
Returns
true if this VPF database is equal to the given object. |
TLcdVPFDataQualityDescriptor |
getDataQualityDescriptor()
Returns a description of the data quality of this database,
or
null if no data quality information is available for this database. |
String |
getDescription()
Returns a brief textual description for this entity.
|
Object |
getFeature(int aIndex)
Returns the feature
Object at the given index. |
Class |
getFeatureClass(int aIndex)
Returns the
Class of the feature at the given index. |
int |
getFeatureCount()
Returns the number of features.
|
int |
getFeatureIndex(String aName)
Returns the index of the given feature name if it exists, -1 otherwise.
|
String |
getFeatureName(int aIndex)
Returns the name of the feature at the given index.
|
TLcdVPFLibrary[] |
getLibraries()
Returns an array containing all libraries that are part of this database.
|
TLcdVPFLibrary[] |
getLibraries(ILcdBounds aBounds)
Returns an array containing all libraries that are part of this database
and overlap with the given bounds.
|
TLcdVPFLibrary |
getLibrary(String aLibraryName)
Returns the
TLcdVPFLibrary of this database which name is aLibraryName . |
String[] |
getLibraryNames()
Returns the names of all libraries contained in this database.
|
String |
getName()
Returns the short name of this entity, used as identifier in the VPF database.
|
String |
getPathName()
Returns the path to the directory of this database, for example
/data/vmaplv0/ . |
int |
hashCode() |
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
TLcdVPFLibrary[] |
retrieveLibraries()
Deprecated.
use getLibaries()
|
TLcdVPFLibrary[] |
retrieveLibraries(ILcdBounds aBounds)
Deprecated.
use getLibaries(com.luciad.shape.ILcdBounds)
|
float[] |
retrieveLibraryBoundingRectangle(String aLibraryName)
Returns the bounds of
TLcdVPFLibrary with name aLibraryName , expressed in
geodetic coordinates. |
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setFeature(int aIndex,
Object aFeature)
Always throws an
IllegalArgumentException , as this object is immutable. |
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
String |
toString()
Returns a brief textual description for this database.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFeatureUnitOfMeasure
public static final int DATABASE_NAME
ILcdFeatured
view on this database object.public static final int DATABASE_DESCRIPTION
ILcdFeatured
view on this database object.public static final int ORIGINATOR
ILcdFeatured
view on this database object.public static final int ADDRESSEE
ILcdFeatured
view on this database object.public static final int SECURITY__CLASS
ILcdFeatured
view on this database object.public static final int RELEASABILITY
ILcdFeatured
view on this database object.public static final int EDITION_NUMBER
ILcdFeatured
view on this database object.public static final String[] fFeatureNames
ILcdFeatured
object.public TLcdVPFDatabase(String aSourceName) throws TLcdCodecException, FileNotFoundException
TLcdVPFDatabase
for the given source.aSourceName
- source of the VPF database. This source should be the root directory of the VPF database,
containing the DHT and LAT file.TLcdCodecException
- if a problem occurs during the decoding of the DHT
file.FileNotFoundException
- if aSourceName
does not point to a DHT
file or a directory
containing a DHT
file.NullPointerException
- if aSourceName == null
public TLcdVPFDatabase(String aSourceName, ILcdInputStreamFactory aInputStreamFactory) throws TLcdCodecException, FileNotFoundException
TLcdVPFDatabase
for the given source.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.TLcdCodecException
- if a problem occurs during the decoding of the DHT
file.FileNotFoundException
- if aSourceName
does not point to a DHT
file or a directory
containing a DHT
file.NullPointerException
- if aSourceName == null
public TLcdVPFDatabase(String aSourceName, ILcdBuffer aBuffer) throws TLcdCodecException, FileNotFoundException
ILcdBuffer
objects are no longer used in VPF. The buffer in this constructor will be ignored.TLcdVPFDatabase
for the given source.aSourceName
- source of the VPF database. This source should be the root directory of the VPF database,
containing the DHT
and LAT table
, or the full path of the
DHT
or LAT
file.aBuffer
- this parameter is no longer used.TLcdCodecException
- if a problem occurs during the decoding of the DHT
file.FileNotFoundException
- if aSourceName
does not point to a DHT
file or a directory
containing a DHT
file.public String getPathName()
/data/vmaplv0/
.public TLcdVPFLibrary[] getLibraries()
LAT
table is preserved.public TLcdVPFLibrary[] getLibraries(ILcdBounds aBounds)
LAT
table is preserved.aBounds
- the bounds with which the libraries should overlap, expressed in
geodetic coordinates.public String[] getLibraryNames()
LAT
table is preserved.public TLcdVPFLibrary getLibrary(String aLibraryName)
TLcdVPFLibrary
of this database which name is aLibraryName
.
If no library exists with the given name, null
is returned.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.TLcdVPFLibrary
of this database which name is aLibraryName
.NullPointerException
- if aLibraryName == null
public float[] retrieveLibraryBoundingRectangle(String aLibraryName)
TLcdVPFLibrary
with name aLibraryName
, expressed in
geodetic coordinates.
The bounds are returned as a float[]
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.aLibraryName
- the name of the library for which to return the bounds.float[]
array of length 4, containing the bounds of the given library.NullPointerException
- if aLibraryName == null
public TLcdVPFDataQualityDescriptor getDataQualityDescriptor()
null
if no data quality information is available for this database.TLcdVPFDataQualityDescriptor
describing the data quality of this database.public int getFeatureCount()
ILcdFeatured
getFeatureCount
in interface ILcdFeatured
getFeatureCount
in interface ILcdFeaturedDescriptor
public Object getFeature(int aIndex) throws IndexOutOfBoundsException
ILcdFeatured
Object
at the given index.getFeature
in interface ILcdFeatured
aIndex
- a valid feature index.Object
at the given index.IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.ILcdFeatured.setFeature(int, java.lang.Object)
public void setFeature(int aIndex, Object aFeature) throws IllegalArgumentException
IllegalArgumentException
, as this object is immutable.setFeature
in interface ILcdFeatured
aIndex
- the index of the feature to set.aFeature
- the new value of the feature to set.IllegalArgumentException
- is always thrown, as this object is immutable.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public boolean canSetFeature(int aIndex)
ILcdFeatured
objects. Always returns false
,
as this object is immutable.canSetFeature
in interface ILcdFeatured
aIndex
- the index of the feature to test for.false
, this opobject is immutable.public String getFeatureName(int aIndex)
ILcdFeaturedDescriptor
getFeatureName
in interface ILcdFeaturedDescriptor
aIndex
- a valid feature index.public int getFeatureIndex(String aName)
ILcdFeaturedDescriptor
getFeatureIndex
in interface ILcdFeaturedDescriptor
aName
- a feature name.public Class getFeatureClass(int aIndex)
ILcdFeaturedDescriptor
Class
of the feature at the given index.getFeatureClass
in interface ILcdFeaturedDescriptor
aIndex
- a valid feature index.Class
of the feature at the given index.protected void decodeDHT() throws TLcdCodecException, FileNotFoundException
DHT
table is decoded automatically at construction time.
This method should no longer be called explicitly.DHT
table of this database.TLcdCodecException
- if an IO exception occurs during decoding of the DHT
table.FileNotFoundException
- if the DHT
table does not exist.public void decodeLAT(boolean aInitLibs) throws TLcdCodecException, FileNotFoundException
aInitLibs
- this parameter is no longer used.TLcdCodecException
- if an IO exception occurs during decoding of the LAT
table.FileNotFoundException
- if the LAT
table does not exist.public TLcdVPFLibrary[] retrieveLibraries()
TLcdVPFLibrary
contained by
this TLcdVPFDatabase
.getLibraries()
public TLcdVPFLibrary[] retrieveLibraries(ILcdBounds aBounds)
TLcdVPFLibrary
which bounds intersect with
the given aBounds
.
If no such libraries exits, an array of size 0 is returned.aBounds
- the bounds with which the libraries should overlap, expressed in
geodetic coordinates.getLibraries(com.luciad.shape.ILcdBounds)
public String toString()
getName()
or getDescription()
might be used as a good source of a textual description for this database.public boolean equals(Object o)
true
if this VPF database is equal to the given object.
Two VPF database are considered equal if their root directories, containing the DHT
and LAT
files, are identical.public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.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.public boolean isTraceOn()
true
if tracing is enabled for this class.public String getName()
public String getDescription()