File: InsertVariousPointsCmd.java

package info (click to toggle)
gpsprune 26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,824 kB
  • sloc: java: 52,154; sh: 25; makefile: 21; python: 15
file content (29 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package tim.prune.cmd;

import java.util.ArrayList;

import tim.prune.data.DataPoint;

/**
 * Command to insert a series of points at various different places in the track,
 * for example an interpolation, or the undo of a compression
 */
public class InsertVariousPointsCmd extends CompoundCommand
{
	private final int _numAdded;


	public InsertVariousPointsCmd(ArrayList<Integer> inIndexes, ArrayList<DataPoint> inPoints)
	{
		_numAdded = inPoints.size();
		addCommand(new AppendRangeCmd(inPoints));
		addCommand(new RearrangePointsCmd(inIndexes));
	}

	/**
	 * @return the total number of points inserted by this command
	 */
	public int getNumInserted() {
		return _numAdded;
	}
}