AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.markup.AbstractCurve<T>
All Implemented Interfaces:
IPathData, java.io.Serializable, java.lang.Iterable<T>
Direct Known Subclasses:
AbstractNetworkCurve, Curve

@AnyLogicInternalAPI
public abstract class AbstractCurve<T extends AbstractMarkupSegment>
extends java.lang.Object
implements IPathData, java.lang.Iterable<T>
See Also:
Serialized Form

Constructor Summary

Constructors 
AbstractCurve()  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void addSegment​(T segment)
Adss a segment to this curve when creating the curve from code.
Point getEndPoint​(Point out)
Returns the location of the end point
Position getPositionAtOffset​(double offset, Position out)
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
T getSegment​(int index)
Returns the segment by its index
int getSegmentCount()
Returns the number of segments
Point getStartPoint​(Point out)
Returns the location of the start point
boolean isInitialized()
Returns was this markup initialized of not
java.util.Iterator<T> iterator()
Creates and returns read-only iterator over segments
double length()
Returns the length of the markup element, calculated in 3D space.
java.util.stream.Stream<T> segmentsStream()
Creates and returns stream over segments
java.lang.String toString()  
Modifier and Type Method Description

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface java.lang.Iterable

forEach, spliterator

Constructor Detail

AbstractCurve

public AbstractCurve()

Method Detail

isInitialized

public final boolean isInitialized()
Returns was this markup initialized of not

addSegment

public void addSegment​(T segment)
Adss a segment to this curve when creating the curve from code. The curve should be uninitialized, while the segment should be initialized.
Parameters:
segment - a segment to be added

getSegmentCount

public int getSegmentCount()
Returns the number of segments
Returns:
the number of segments

getSegment

public T getSegment​(int index)
Returns the segment by its index
Parameters:
index - the segment index, [0 .. getSegmentCount() - 1]
Returns:
the segment

iterator

public java.util.Iterator<T> iterator()
Creates and returns read-only iterator over segments
Specified by:
iterator in interface java.lang.Iterable<T extends AbstractMarkupSegment>

segmentsStream

public java.util.stream.Stream<T> segmentsStream()
Creates and returns stream over segments

getStartPoint

public Point getStartPoint​(Point out)
Returns the location of the start point
Parameters:
out - output object to write to, may be null
Returns:
the Point object with coordinates of the first point

getEndPoint

public Point getEndPoint​(Point out)
Returns the location of the end point
Parameters:
out - output object to write to, may be null
Returns:
the Point object with coordinates of the last point

length

public final double length()
Returns the length of the markup element, calculated in 3D space.
Returns:
the length of the markup element (measured in pixels), a positive number

getPositionAtOffset

public final Position getPositionAtOffset​(double offset,
                                          Position out)
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
Parameters:
offset - offset, non-negative value, should be less or equal to the full length.
out - output object to write to, may be null
Returns:
the Position object with coordinates of the point with the given offset and orientation along markup element line at this point

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
How can we improve this article?