public final class ObservablePolylineUtil extends Object
Observable
instance for Polyline
.Modifier and Type | Method and Description |
---|---|
static Observable<Point> |
derivePointAtEnd(Observable<Polyline> observablePolyline)
Derives an
Observable Point from the given observable polyline that represents the end point of the polyline (regardless of the point count). |
static Observable<Point> |
derivePointAtIndex(Observable<Polyline> observablePolyline,
long index)
Derives an
Observable Point from the given observable polyline that represents the point at the given index. |
static Observable<Point> |
derivePointAtStart(Observable<Polyline> observablePolyline)
Derives an
Observable Point from the given observable polyline that represents the start point. |
static Observable<Point> |
derivePointOnSegment(Observable<Polyline> observablePolyline,
long segmentIndex,
double parameter)
Derives an
Observable Point from the given observable polyline that represents a point on a segment of the polyline. |
@NotNull public static Observable<Point> derivePointAtIndex(@NotNull Observable<Polyline> observablePolyline, long index)
Observable
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:
null
value, the observable point instance will contain a null
value too.
null
value.
Observable#setValue
will throw an exception for derived instances.
observablePolyline
- an observable polyline from which to derive the pointindex
- the point indexObservable
@NotNull public static Observable<Point> derivePointAtStart(@NotNull Observable<Polyline> observablePolyline)
Observable
Point
from the given observable polyline that represents the start point.
This observable point will be updated when the given observable polyline changes.
Notes:
null
value, the observable point instance will contain a null
value too.
Observable#setValue
will throw an exception for derived instances.
observablePolyline
- an observable polyline from which to derive the pointObservable
@NotNull public static Observable<Point> derivePointAtEnd(@NotNull Observable<Polyline> observablePolyline)
Observable
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:
null
value, the observable point instance will contain a null
value too.
Observable#setValue
will throw an exception for derived instances.
observablePolyline
- an observable polyline from which to derive the pointObservable
@NotNull public static Observable<Point> derivePointOnSegment(@NotNull Observable<Polyline> observablePolyline, long segmentIndex, double parameter)
Observable
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:
null
value, the observable point instance will contain a null
value too.
null
value.
Observable#setValue
will throw an exception for derived instances.
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 segmentObservable