/
TypeB.java
40 lines (30 loc) · 891 Bytes
/
TypeB.java
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
30
31
32
33
34
35
36
37
38
39
40
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gis;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
*
* @author User
*/
public final class TypeB extends Tracker {
private CopyOnWriteArrayList tempList=new CopyOnWriteArrayList();
@Override
public void showPath() {
i=history.iterator();
System.out.println("Type B tracker shows path");
while(i.hasNext()){
Waypoint temp=(Waypoint) i.next();
boolean add = tempList.add(temp);
boolean contains=tempList.contains(temp);
if(contains){
tempList.remove(temp);
}
temp.getWaypoint();
}
System.out.println("end of list\n");
}
}