org.eclipse.ohf.stem.definitions.adapters.spatial.geo
Class LatLongProviderAdapter

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterImpl
      extended by org.eclipse.ohf.stem.definitions.adapters.spatial.SpatialProviderAdapter
          extended by org.eclipse.ohf.stem.definitions.adapters.spatial.geo.LatLongProviderAdapter
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, LatLongProvider, SpatialProvider

public class LatLongProviderAdapter
extends SpatialProviderAdapter
implements LatLongProvider

This class adapts Identifiable's to LatLongProvider's. It extracts the lat/long data by examining the spatial attribute of an Identifiable's dublin core instance. Typically, the value of the attribute will be recognized by the adapter and the values returned. If the attribute does not have a value or the format of the value is not recognized, then an empty list will be returned.

The format recognized by the adapter is a URI with the scheme defined by the constant STEM_SPATIAL_SCHEME

See Also:
Identifiable

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
 
Fields inherited from class org.eclipse.ohf.stem.definitions.adapters.spatial.SpatialProviderAdapter
STEM_SPATIAL_SCHEME, STEM_SPATIAL_SCHEME_PREFIX
 
Constructor Summary
LatLongProviderAdapter()
           
 
Method Summary
 LatLong getLatLong()
           
static java.util.Map<java.lang.String,LatLongDataProvider> getLatLongDataProviders()
           
 LatLong getLatLongNoWait()
          This is just like LatLongProvider.getLatLong() except that it returns an empty instance of LatLong if the data has not been retrieved yet.
 boolean isAdapterForType(java.lang.Object type)
           
static void registerLatLongDataProvider(java.lang.String scheme, LatLongDataProvider latLongDataProvider)
          Add the latLongDataProvider to the collection of available to this adapter
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, notifyChanged, setTarget, unsetTarget
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatLongProviderAdapter

public LatLongProviderAdapter()
Method Detail

registerLatLongDataProvider

public static void registerLatLongDataProvider(java.lang.String scheme,
                                               LatLongDataProvider latLongDataProvider)
Add the latLongDataProvider to the collection of available to this adapter

Parameters:
scheme - the key of the URI's that the data provider processes
latLongDataProvider - the data provider

getLatLongDataProviders

public static java.util.Map<java.lang.String,LatLongDataProvider> getLatLongDataProviders()
Returns:
the map between scheme's and their lat/long data providers

isAdapterForType

public boolean isAdapterForType(java.lang.Object type)
Specified by:
isAdapterForType in interface org.eclipse.emf.common.notify.Adapter
Overrides:
isAdapterForType in class SpatialProviderAdapter
See Also:
AdapterImpl.isAdapterForType(java.lang.Object)

getLatLong

public LatLong getLatLong()
Specified by:
getLatLong in interface LatLongProvider
Returns:
the lat/long value

getLatLongNoWait

public LatLong getLatLongNoWait()
Description copied from interface: LatLongProvider
This is just like LatLongProvider.getLatLong() except that it returns an empty instance of LatLong if the data has not been retrieved yet. As a side effect, it immediately schedules a Job to retrieve the data. As such, a future call might produce a fully populated result.

Specified by:
getLatLongNoWait in interface LatLongProvider
Returns:
the lat/long value