Class TLcdVPFDatabase

java.lang.Object
com.luciad.format.vpf.TLcdVPFDatabase
All Implemented Interfaces:
ILcdFeatured, ILcdFeaturedDescriptor, Serializable

public class TLcdVPFDatabase extends Object implements ILcdFeatured, ILcdFeaturedDescriptor
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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Index of the "Addressee" feature in the ILcdFeatured view on this database object.
    static final int
    Index of the "Database Description" feature in the ILcdFeatured view on this database object.
    static final int
    Index of the "Database Name" feature in the ILcdFeatured view on this database object.
    static final int
    Index of the "Edition Number" feature in the ILcdFeatured 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 the ILcdFeatured view on this database object.
    static final int
    Index of the "Releasability" feature in the ILcdFeatured view on this database object.
    static final int
    Index of the "Security Class" feature in the ILcdFeatured view on this database object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TLcdVPFDatabase(String aSourceName)
    Creates a new TLcdVPFDatabase for the given source.
    TLcdVPFDatabase(String aSourceName, ILcdInputStreamFactory aInputStreamFactory)
    Creates a new TLcdVPFDatabase for the given source.
    TLcdVPFDatabase(String aSourceName, ILcdBuffer aBuffer)
    Deprecated.
    ILcdBuffer objects are no longer used in VPF.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canSetFeature(int aIndex)
    Returns whether features can be set on this ILcdFeatured objects.
    protected void
    Deprecated.
    the DHT 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
    Returns true if this VPF database is equal to the given object.
    Returns a description of the data quality of this database, or null if no data quality information is available for this database.
    Returns a brief textual description for this entity.
    getFeature(int aIndex)
    Returns the feature Object at the given index.
    getFeatureClass(int aIndex)
    Returns the Class of the feature at the given index.
    int
    Returns the number of features.
    int
    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.
    Returns an array containing all libraries that are part of this database and overlap with the given bounds.
    getLibrary(String aLibraryName)
    Returns the TLcdVPFLibrary of this database which name is aLibraryName.
    Returns the names of all libraries contained in this database.
    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
     
    boolean
    Deprecated.
    This method has been deprecated.
    Deprecated.
    use getLibaries()
    Deprecated.
    use getLibaries(com.luciad.shape.ILcdBounds)
    float[]
    Returns the bounds of TLcdVPFLibrary with name aLibraryName, expressed in geodetic coordinates.
    static void
    setClassTraceOn(boolean aClassTraceOn)
    Deprecated.
    This method has been deprecated.
    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.
    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_NAME
      Index of the "Database Name" feature in the ILcdFeatured view on this database object.
      See Also:
    • DATABASE_DESCRIPTION

      public static final int DATABASE_DESCRIPTION
      Index of the "Database Description" feature in the ILcdFeatured view on this database object.
      See Also:
    • ORIGINATOR

      public static final int ORIGINATOR
      Index of the "Originator" feature in the ILcdFeatured view on this database object.
      See Also:
    • ADDRESSEE

      public static final int ADDRESSEE
      Index of the "Addressee" feature in the ILcdFeatured view on this database object.
      See Also:
    • SECURITY__CLASS

      public static final int SECURITY__CLASS
      Index of the "Security Class" feature in the ILcdFeatured view on this database object.
      See Also:
    • RELEASABILITY

      public static final int RELEASABILITY
      Index of the "Releasability" feature in the ILcdFeatured view on this database object.
      See Also:
    • EDITION_NUMBER

      public static final int EDITION_NUMBER
      Index of the "Edition Number" feature in the ILcdFeatured view on this database object.
      See Also:
    • fFeatureNames

      public static final String[] 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 this ILcdFeatured object.
  • Constructor Details

    • TLcdVPFDatabase

      public TLcdVPFDatabase(String aSourceName) throws TLcdCodecException, FileNotFoundException
      Creates a new TLcdVPFDatabase 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 the DHT file.
      FileNotFoundException - if aSourceName does not point to a DHT file or a directory containing a DHT file.
      NullPointerException - if aSourceName == null
    • TLcdVPFDatabase

      public TLcdVPFDatabase(String aSourceName, ILcdInputStreamFactory aInputStreamFactory) throws TLcdCodecException, FileNotFoundException
      Creates a new TLcdVPFDatabase 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 the DHT file.
      FileNotFoundException - if aSourceName does not point to a DHT file or a directory containing a DHT file.
      NullPointerException - if aSourceName == 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 new TLcdVPFDatabase 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 table, or the full path of the DHT or LAT file.
      aBuffer - this parameter is no longer used.
      Throws:
      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.
  • Method Details

    • getPathName

      public String getPathName()
      Returns the path to the directory of this database, for example /data/vmaplv0/.
      Returns:
      the path to the directory of this database.
    • getLibraries

      public TLcdVPFLibrary[] 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 the LAT table is preserved.
      Returns:
      all libraries that are part of this database.
    • getLibraries

      public TLcdVPFLibrary[] getLibraries(ILcdBounds aBounds)
      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 the LAT 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

      public String[] getLibraryNames()
      Returns the names of all libraries contained in this database. The order of the libraries in the LAT table is preserved.
      Returns:
      the names of all libraries contained in this database.
    • getLibrary

      public TLcdVPFLibrary getLibrary(String aLibraryName)
      Returns the TLcdVPFLibrary of this database which name is aLibraryName. 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 is aLibraryName.
      Throws:
      NullPointerException - if aLibraryName == null
    • retrieveLibraryBoundingRectangle

      public float[] retrieveLibraryBoundingRectangle(String aLibraryName)
      Returns the bounds of 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.
      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 - if aLibraryName == null
    • getDataQualityDescriptor

      public TLcdVPFDataQualityDescriptor getDataQualityDescriptor()
      Returns a description of the data quality of this database, or null 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 interface ILcdFeatured
      Specified by:
      getFeatureCount in interface ILcdFeaturedDescriptor
      Returns:
      the number of features.
    • getFeature

      public Object getFeature(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdFeatured
      Returns the feature Object at the given index.
      Specified by:
      getFeature in interface ILcdFeatured
      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

      public void setFeature(int aIndex, Object aFeature) throws IllegalArgumentException
      Always throws an IllegalArgumentException, as this object is immutable.
      Specified by:
      setFeature in interface ILcdFeatured
      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 this ILcdFeatured objects. Always returns false, as this object is immutable.
      Specified by:
      canSetFeature in interface ILcdFeatured
      Parameters:
      aIndex - the index of the feature to test for.
      Returns:
      always returns false, this opobject is immutable.
    • getFeatureName

      public String getFeatureName(int aIndex)
      Description copied from interface: ILcdFeaturedDescriptor
      Returns the name of the feature at the given index.
      Specified by:
      getFeatureName in interface ILcdFeaturedDescriptor
      Parameters:
      aIndex - a valid feature index.
      Returns:
      the name of the feature at the given index.
    • getFeatureIndex

      public int getFeatureIndex(String aName)
      Description copied from interface: ILcdFeaturedDescriptor
      Returns the index of the given feature name if it exists, -1 otherwise.
      Specified by:
      getFeatureIndex in interface ILcdFeaturedDescriptor
      Parameters:
      aName - a feature name.
      Returns:
      the index of the given feature name if it exists, -1 otherwise.
    • getFeatureClass

      public Class getFeatureClass(int aIndex)
      Description copied from interface: ILcdFeaturedDescriptor
      Returns the Class of the feature at the given index.
      Specified by:
      getFeatureClass in interface ILcdFeaturedDescriptor
      Parameters:
      aIndex - a valid feature index.
      Returns:
      the Class of the feature at the given index.
    • decodeDHT

      protected void decodeDHT() throws TLcdCodecException, FileNotFoundException
      Deprecated.
      the DHT table is decoded automatically at construction time. This method should no longer be called explicitly.
      Decodes the DHT table of this database.
      Throws:
      TLcdCodecException - if an IO exception occurs during decoding of the DHT table.
      FileNotFoundException - if the DHT table does not exist.
    • decodeLAT

      public void decodeLAT(boolean aInitLibs) throws TLcdCodecException, FileNotFoundException
      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 the LAT table.
      FileNotFoundException - if the LAT table does not exist.
    • retrieveLibraries

      public TLcdVPFLibrary[] retrieveLibraries()
      Deprecated.
      use getLibaries()
      This method returns all the instances of TLcdVPFLibrary contained by this TLcdVPFDatabase.
      Returns:
      all libraries that are part of this database.
      See Also:
    • retrieveLibraries

      public TLcdVPFLibrary[] retrieveLibraries(ILcdBounds aBounds)
      Deprecated.
      use getLibaries(com.luciad.shape.ILcdBounds)
      This method returns the code of TLcdVPFLibrary which bounds intersect with the given aBounds. 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

      public String 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, the getName() or getDescription() might be used as a good source of a textual description for this database.
      Overrides:
      toString in class Object
      Returns:
      a brief textual description for this database.
    • equals

      public boolean equals(Object o)
      Returns 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.
      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare this database with.
      Returns:
      true if this object and o are equal, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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 is true 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 either 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.
      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.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • getName

      public String 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

      public String getDescription()
      Returns a brief textual description for this entity.
      Returns:
      a brief textual description for this entity.