forked from Jus973/baseball-hit-trax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphableList.java
49 lines (41 loc) · 1.2 KB
/
graphableList.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
41
42
43
44
45
46
47
48
49
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
/**
* An object that represents a list of both graphable and graphableLine objects
* To be used as a container and is called during the GUI paint() function
*/
public class graphableList {
//stored not in graphables but in 2ds
private Queue<graphable> g;
private Queue<graphableLine> gL;
/**
* Main constructor for graphList. Takes two arrays and sets them to the local fields
* @param g1 The graphable list
* @param gL1 The graphableLine list
*/
public graphableList (ArrayList<graphable> g1, ArrayList<graphableLine> gL1){
g = new LinkedList<graphable>();
gL = new LinkedList<graphableLine>();
for (graphable i : g1) {
g.add(i);
}
for (graphableLine j : gL1) {
gL.add(j);
}
}
/**
* Getter method for the graphable list
* @return The graphable list
*/
public Queue<graphable> getPointList () {
return g;
}
/**
* Getter method for the graphableLine list
* @return The graphable line list
*/
public Queue<graphableLine> getLineList () {
return gL;
}
}