Package com.luciad.format.sqlite.lvdb
Class TLcdLVDBModelDecoder
java.lang.Object
com.luciad.format.sqlite.lvdb.TLcdLVDBModelDecoder
- All Implemented Interfaces:
ILcdModelDecoder
@LcdService(service=ILcdModelDecoder.class,
priority=20000)
public class TLcdLVDBModelDecoder
extends Object
implements ILcdModelDecoder
A model decoder that decodes Luciad Vector Databases (LVDB).
This format is intended for use only with existing Luciad applications and should not be used otherwise.
If you are looking for an SQLite-based exchange format, we advise to use OGC GeoPackage
instead.
Input Files
File | Required | Entry point | Description |
---|---|---|---|
*.lvdb | X | X | The database file |
Supported file transfer protocols
- This model decoder supports all transfer protocols that are supported by java.io.File.
Model structure
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel
.
Model descriptor
- All models returned by this model decoder have a
TLcdLVDBModelDescriptor
.
Model reference
- All models returned by this model decoder have a
com.luciad.reference.ILcdGridReference
orcom.luciad.reference.ILcdGeodeticReference
.
Model elements
- Each decoded model contains instances of
com.luciad.shape.ILcdShapeList
that implementcom.luciad.datamodel.ILcdDataObject
.
Thread safety
- The decoded models are thread-safe for read access.
- Since:
- 2013.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.int
returns the max number of objects that will be stored using hard references.void
setMaxCacheSize
(int aMaxCacheSize) Sets the max number of objects that will be stored using hard references.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdLVDBModelDecoder
public TLcdLVDBModelDecoder()Creates a newTLcdLVDBModelDecoder
.
-
-
Method Details
-
setMaxCacheSize
public void setMaxCacheSize(int aMaxCacheSize) Sets the max number of objects that will be stored using hard references. More objects will be stored using soft references.- Parameters:
aMaxCacheSize
- the max number of objects cached with hard references.
-
getMaxCacheSize
public int getMaxCacheSize()returns the max number of objects that will be stored using hard references.- Returns:
- the max number of objects cached with hard references.
-
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
canDecodeSource
Description copied from interface:ILcdModelDecoder
Checks whether this model decoder can decode the specified data source. It is acceptable for this method to returntrue
for a source name whiledecode
throws an exception for that same source name.For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.
- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be verified; typically a file name or a URL.- Returns:
true
if this decoder can likely decode the data specified by the source name,false
otherwise.- See Also:
-
decode
Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.- Specified by:
decode
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
null
is allowed, implementors are advised to throw an error instead. - Throws:
IOException
- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.public ILcdModel decode( String aSourceName ) throws IOException { try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) { // Perform decoding ... } catch (RuntimeException e) { throw new IOException(e); } }
- See Also:
-