Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.io.shp.reader.internal
Class ShapeInstanceReader

java.lang.Object
  extended by eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider
      extended by eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider
          extended by eu.esdihumboldt.hale.common.core.io.impl.GZipEnabledImport
              extended by eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceReader
                  extended by eu.esdihumboldt.hale.io.shp.reader.internal.ShapeInstanceReader
All Implemented Interfaces:
ImportProvider, IOProvider, InstanceReader, ShapefileConstants

public class ShapeInstanceReader
extends AbstractInstanceReader
implements ShapefileConstants

Reads instances from a shapefile.

Author:
Thorsten Reitz, Simon Templer

Nested Class Summary
 
Nested classes/interfaces inherited from class eu.esdihumboldt.hale.common.core.io.impl.GZipEnabledImport
GZipEnabledImport.GZipInputSupplier
 
Field Summary
 
Fields inherited from interface eu.esdihumboldt.hale.io.shp.ShapefileConstants
DEFAULT_TYPE_NAME, PARAM_TYPENAME, SHAPEFILE_NS
 
Fields inherited from interface eu.esdihumboldt.hale.common.core.io.ImportProvider
PARAM_RESOURCE_ID, PARAM_SOURCE
 
Fields inherited from interface eu.esdihumboldt.hale.common.core.io.IOProvider
PARAM_CONTENT_TYPE
 
Constructor Summary
ShapeInstanceReader()
          Default constructor.
 
Method Summary
static int checkCompatibility(TypeDefinition schemaType, TypeDefinition dataType)
          Determines if the compatibility rating between the two Shapefile type definitions.
protected  IOReport execute(ProgressIndicator progress, IOReporter reporter)
          Execute the I/O provider.
protected  String getDefaultTypeName()
          Get the default type name if no content type is provided
 InstanceCollection getInstances()
          Get the instances
static Pair<TypeDefinition,Integer> getMostCompatibleShapeType(TypeIndex types, TypeDefinition dataType)
          Determine the type out of the the mapping relevant types in the given type index, that matches the given data type best.
 boolean isCancelable()
          States if the execution of the provider is cancelable
 
Methods inherited from class eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceReader
getCrsProvider, getSourceSchema, setCRSProvider, setSourceSchema, validate
 
Methods inherited from class eu.esdihumboldt.hale.common.core.io.impl.GZipEnabledImport
getSource
 
Methods inherited from class eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider
createReporter, execute, generateResourceId, getResourceIdentifier, setParameter, setSource, storeConfiguration
 
Methods inherited from class eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider
addSupportedParameter, fail, getContentType, getParameter, getSupportedParameters, getTypeName, loadConfiguration, setContentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.esdihumboldt.hale.common.core.io.ImportProvider
getResourceIdentifier, getSource, setSource
 
Methods inherited from interface eu.esdihumboldt.hale.common.core.io.IOProvider
createReporter, execute, getContentType, getParameter, getSupportedParameters, loadConfiguration, setContentType, setParameter, storeConfiguration
 

Constructor Detail

ShapeInstanceReader

public ShapeInstanceReader()
Default constructor.

Method Detail

isCancelable

public boolean isCancelable()
Description copied from interface: IOProvider
States if the execution of the provider is cancelable

Specified by:
isCancelable in interface IOProvider
Returns:
if the execution is cancelable
See Also:
IOProvider.isCancelable()

execute

protected IOReport execute(ProgressIndicator progress,
                           IOReporter reporter)
                    throws IOProviderConfigurationException,
                           IOException
Description copied from class: AbstractIOProvider
Execute the I/O provider.

Specified by:
execute in class AbstractIOProvider
Parameters:
progress - the progress indicator
reporter - the reporter to use for the execution report
Returns:
the execution report
Throws:
IOProviderConfigurationException - if the I/O provider was not configured properly
IOException - if an I/O operation fails
See Also:
AbstractIOProvider.execute(ProgressIndicator, IOReporter)

getMostCompatibleShapeType

public static Pair<TypeDefinition,Integer> getMostCompatibleShapeType(TypeIndex types,
                                                                      TypeDefinition dataType)
Determine the type out of the the mapping relevant types in the given type index, that matches the given data type best.

Parameters:
types - the type index
dataType - the Shapefile data type
Returns:
the most compatible type found together with is compatibility rating or null if there is no type that at least has one matching property
See Also:
checkCompatibility(TypeDefinition, TypeDefinition)

checkCompatibility

public static int checkCompatibility(TypeDefinition schemaType,
                                     TypeDefinition dataType)
Determines if the compatibility rating between the two Shapefile type definitions.

Parameters:
schemaType - the type to test for compatibility
dataType - the type representing the data to read
Returns:
the percentage of compatibility (value from 0 to 100), where 100 represents an exact match and 0 no compatibility

getDefaultTypeName

protected String getDefaultTypeName()
Description copied from class: AbstractIOProvider
Get the default type name if no content type is provided

Specified by:
getDefaultTypeName in class AbstractIOProvider
Returns:
the default content type
See Also:
AbstractIOProvider.getDefaultTypeName()

getInstances

public InstanceCollection getInstances()
Description copied from interface: InstanceReader
Get the instances

Specified by:
getInstances in interface InstanceReader
Returns:
the instance collection
See Also:
InstanceReader.getInstances()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d