-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSegments.java
53 lines (40 loc) · 903 Bytes
/
Segments.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
50
51
52
import java.util.ArrayList;
import java.util.List;
public class Segments extends Curve {
/* creating a list array*/
List<Double> fs = new ArrayList<>();
/*storing the values in segment*/
public Segments(double x_intercept,double y_intercept,double slope)
{
this.fs.add(x_intercept);
this.fs.add(1, y_intercept);
this.fs.add(2, slope);
}
public Segments(double x_intercept,double y_intercept)
{
this.fs.add(x_intercept);
this.fs.add(1, y_intercept);
//this.fs.add(2, slope);
}
public Segments() {
// TODO Auto-generated constructor stub
}
/*to get the values of the requested segment*/
public List<Double> getValue()
{
return fs;
//System.out.println("getting the value");
}
public double getarrayValue(int i)
{
return fs.get(i);
}
public void setarrayValue(int i, double x)
{
fs.set(i, x);
}
public int getSize()
{
return fs.size();
}
}