public class TriangleWavePositionIterator extends Object implements Iterator
           /\             /\         <--- Amplitude
          /  \           /  \
 ________/    \_________/    \_____
 ^            ^
 | Wave length|
 | Modifier and Type | Field and Description | 
|---|---|
| protected double | amplitudeAmplitude of the wave, in meters. | 
| protected Position | firstPositionFirst position along the line. | 
| protected Globe | globeGlobe used to compute geographic positions. | 
| protected Angle | halfWaveLengthWavelength, as a geographic angle. | 
| protected Position | nextControlPositionPosition of the next control point. | 
| protected Iterator<? extends Position> | positionsControl positions. | 
| protected int | stateCurrent state of the state machine. | 
| protected static int | STATE_FIRSTInitial state. | 
| protected static int | STATE_LINEDrawing connecting line between waves. | 
| protected static int | STATE_TOOTH_PEAKAt peak of wave. | 
| protected static int | STATE_WAVE_STARTAbout to draw wave. | 
| protected Position | thisPositionCurrent position. | 
| protected double | thisStepDistance (in meters) to the next wave start or end. | 
| protected Position | waveEndPositionEnd position for the current wave. | 
| Constructor and Description | 
|---|
| TriangleWavePositionIterator(Iterable<? extends Position> positions,
                            double waveLength,
                            double amplitude,
                            Globe globe)Create a new iterator to compute the positions of a triangle wave. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Position | computeNext()Compute the next position along the line, and transition the state machine to the next state (if appropriate). | 
| boolean | hasNext() | 
| Position | next() | 
| void | remove()Not supported. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingprotected double amplitude
protected Position firstPosition
protected Globe globe
protected Angle halfWaveLength
protected Position nextControlPosition
protected int state
protected static final int STATE_FIRST
protected static final int STATE_LINE
protected static final int STATE_TOOTH_PEAK
protected static final int STATE_WAVE_START
protected Position thisPosition
protected double thisStep
protected Position waveEndPosition
public TriangleWavePositionIterator(Iterable<? extends Position> positions, double waveLength, double amplitude, Globe globe)
positions - Control positions for the triangle wave line.waveLength - Distance (in meters) between waves.amplitude - Amplitude (in meters) of the wave. This is the distance from the base line to the tip of each
                   triangular wave.globe - Globe used to compute geographic positions.protected Position computeNext()