Package com.luciad.geometries.observable
Class ObservablePolylineUtil
java.lang.Object
com.luciad.geometries.observable.ObservablePolylineUtil
This class provides utility methods for
Observable
instance for Polyline
.-
Method Summary
Modifier and TypeMethodDescriptionstatic Observable
<@Nullable Point> derivePointAtEnd
(Observable<@Nullable Polyline> observablePolyline) Derives anObservable
Point
from the given observable polyline that represents the end point of the polyline (regardless of the point count).static Observable
<@Nullable Point> derivePointAtIndex
(Observable<@Nullable Polyline> observablePolyline, long index) Derives anObservable
Point
from the given observable polyline that represents the point at the given index.static Observable
<@Nullable Point> derivePointAtStart
(Observable<@Nullable Polyline> observablePolyline) Derives anObservable
Point
from the given observable polyline that represents the start point.static Observable
<@Nullable Point> derivePointOnSegment
(Observable<@Nullable Polyline> observablePolyline, long segmentIndex, double parameter) Derives anObservable
Point
from the given observable polyline that represents a point on a segment of the polyline.
-
Method Details
-
derivePointAtIndex
@NotNull public static Observable<@Nullable Point> derivePointAtIndex(@NotNull Observable<@Nullable Polyline> observablePolyline, long index) Derives anObservable
Point
from the given observable polyline that represents the point at the given index.This observable point will be updated when the given observable polyline changes.
Notes:
- When the observable polyline contains a
null
value, the observable point instance will contain anull
value too. - When the given index >= point count, the observable point instance will contain a
null
value. Observable#setValue
will throw an exception for derived instances.
- Parameters:
observablePolyline
- an observable polyline from which to derive the pointindex
- the point index- Returns:
- a derived
Observable
- When the observable polyline contains a
-
derivePointAtStart
@NotNull public static Observable<@Nullable Point> derivePointAtStart(@NotNull Observable<@Nullable Polyline> observablePolyline) Derives anObservable
Point
from the given observable polyline that represents the start point.This observable point will be updated when the given observable polyline changes.
Notes:
- When the observable polyline contains a
null
value, the observable point instance will contain anull
value too. Observable#setValue
will throw an exception for derived instances.
- Parameters:
observablePolyline
- an observable polyline from which to derive the point- Returns:
- a derived
Observable
- When the observable polyline contains a
-
derivePointAtEnd
@NotNull public static Observable<@Nullable Point> derivePointAtEnd(@NotNull Observable<@Nullable Polyline> observablePolyline) Derives anObservable
Point
from the given observable polyline that represents the end point of the polyline (regardless of the point count).This observable point will be updated when the given observable polyline changes.
Notes:
- When the observable polyline contains a
null
value, the observable point instance will contain anull
value too. Observable#setValue
will throw an exception for derived instances.
- Parameters:
observablePolyline
- an observable polyline from which to derive the point- Returns:
- a derived
Observable
- When the observable polyline contains a
-
derivePointOnSegment
@NotNull public static Observable<@Nullable Point> derivePointOnSegment(@NotNull Observable<@Nullable Polyline> observablePolyline, long segmentIndex, double parameter) Derives anObservable
Point
from the given observable polyline that represents a point on a segment of the polyline.This observable point will be updated when the given observable polyline changes.
Notes:
- When the observable polyline contains a
null
value, the observable point instance will contain anull
value too. - When the given segmentIndex >= point count - 1, the observable point instance will contain a
null
value. Observable#setValue
will throw an exception for derived instances.
- Parameters:
observablePolyline
- an observable polyline from which to derive the pointsegmentIndex
- a segment index: a value between [0, pointCount - 2]. For example: segment index 0 corresponds with the segment between the points with index 0 and 1.parameter
- a parameter value between [0, 1] that determines which point of the segment is chosen. This can for example be 0.5, to get the middle of the segment- Returns:
- a derived
Observable
- When the observable polyline contains a
-