org.eclipse.ohf.stem.definitions.adapters.spatial.geo
Class LatLong.SegmentBuilder

java.lang.Object
  extended by org.eclipse.ohf.stem.definitions.adapters.spatial.geo.LatLong.SegmentBuilder
Enclosing class:
LatLong

public static class LatLong.SegmentBuilder
extends java.lang.Object

This class creates LatLong.Segment's


Constructor Summary
LatLong.SegmentBuilder()
           
 
Method Summary
 void add(double latitude, double longitude)
           
 void add(java.lang.String latitudeString, java.lang.String longitudeString)
           
 void clear()
          Remove all of the collected latitude/longitdue pairs collected so far
 int size()
           
 LatLong.Segment toSegment()
           
 LatLong.Segment toSegment(int sampleFrequency)
          Create a LatLong.Segment, but reduce the number of data points it contains by the sample frequency.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatLong.SegmentBuilder

public LatLong.SegmentBuilder()
Method Detail

add

public void add(java.lang.String latitudeString,
                java.lang.String longitudeString)
Parameters:
latitudeString - a double latitude value represented as a String
longitudeString - a double longitude value represented as a String

add

public void add(double latitude,
                double longitude)
Parameters:
latitude -
longitude -

size

public int size()
Returns:
the number of latitude/longitude data pairs in the segment being built.

clear

public void clear()
Remove all of the collected latitude/longitdue pairs collected so far


toSegment

public LatLong.Segment toSegment()
Returns:
the collected latitude/longitude data pairs as a segment.

toSegment

public LatLong.Segment toSegment(int sampleFrequency)
Create a LatLong.Segment, but reduce the number of data points it contains by the sample frequency. A value of "1" means all points are included, a value of "2" means that every 2nd point is included. The first and last points are always included.

Parameters:
sampleFrequency - the frequency in data points at which the pairs are sampled.
Returns:
a subset of the collected latitude/longitude data pairs as a segment.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()