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

java.lang.Object
  extended by org.eclipse.ohf.stem.definitions.adapters.spatial.geo.InlineLatLongDataProvider
All Implemented Interfaces:
LatLongDataProvider

public class InlineLatLongDataProvider
extends java.lang.Object
implements LatLongDataProvider

This class interprets a URI that contains embedded (i.e., "inline") lat/long data.

The format of the URI is a comma seperated list of lat/long pairs as double values. These can be seperated into "segments" by slashes ("/") which will create seperate lat/long sequences (arrays) in the return value.

   e.g., "inline:Lat1,Long1,Lat2,Long2/Lat3,Long3,Lat4,Long4"
 

See Also:
PlatformLatLongDataProvider, LatLongProviderAdapter

Field Summary
static java.lang.String INLINE_SCHEME
          This is the scheme for an "inline" data URI that specifies lat/long data in the URI
 
Constructor Summary
InlineLatLongDataProvider()
           
 
Method Summary
static java.lang.String createInlineURIString(LatLong latLong)
          Encode a list of arrays of double values representing polygons/lines into an inline URI string.
static java.lang.String createSpatialInlineURIString(LatLong segmentArrays)
          Encode a list of arrays of double values representing polygons/lines into an spatial inline URI string.
 LatLong getLatLong(org.eclipse.emf.common.util.URI dataURI)
           
 LatLong getLatLongNoWait(org.eclipse.emf.common.util.URI dataURI)
          This method is just like LatLongDataProvider.getLatLong(URI) except that it will immediately return with an empty LatLong instance if the data identified by the URI has not been retrieved.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INLINE_SCHEME

public static final java.lang.String INLINE_SCHEME
This is the scheme for an "inline" data URI that specifies lat/long data in the URI

See Also:
Constant Field Values
Constructor Detail

InlineLatLongDataProvider

public InlineLatLongDataProvider()
Method Detail

getLatLong

public LatLong getLatLong(org.eclipse.emf.common.util.URI dataURI)
Specified by:
getLatLong in interface LatLongDataProvider
Parameters:
dataURI -
Returns:
a latitude/longitude value

getLatLongNoWait

public LatLong getLatLongNoWait(org.eclipse.emf.common.util.URI dataURI)
Description copied from interface: LatLongDataProvider
This method is just like LatLongDataProvider.getLatLong(URI) except that it will immediately return with an empty LatLong instance if the data identified by the URI has not been retrieved. As a side effect, it will create a seperate Job (i.e., Thread) to retrieve the data. If that Job completes successfully, a future call will return the appropriate data.

Specified by:
getLatLongNoWait in interface LatLongDataProvider
Parameters:
dataURI - the data URI to be processed by this provider
Returns:
an instance of latitude/longitude data.
See Also:
LatLongDataProvider.getLatLongNoWait(org.eclipse.emf.common.util.URI)

createSpatialInlineURIString

public static java.lang.String createSpatialInlineURIString(LatLong segmentArrays)
Encode a list of arrays of double values representing polygons/lines into an spatial inline URI string.

Parameters:
segmentArrays - a list of arrays each of which represents a polygon/line
Returns:
the list of values in the arrays encoded in a spatial inline URI string

createInlineURIString

public static java.lang.String createInlineURIString(LatLong latLong)
Encode a list of arrays of double values representing polygons/lines into an inline URI string. This is the inverse operation of getLatLong(URI).

Parameters:
latLong -
Returns:
the list of values in the arrays encoded in an inline URI string