-
Notifications
You must be signed in to change notification settings - Fork 2
/
CarBridge.java
64 lines (63 loc) · 1.67 KB
/
CarBridge.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
53
54
55
56
57
58
59
60
61
62
63
64
public abstract class CarBridge<E> implements Bridge<E>
{
private E length;
private String[] materials = new String[3];
private E weightLimit;
private E speedLimit;
private int numLanes;
public CarBridge(String[] m, E l, E wL, E sL, int nL) {
String temp;
if( m.length > materials.length ) {
System.out.println("Only three materials please!");
}
for( int k = 0; k < materials.length; k++ ) {
materials[k] = m[k];
}
length = l;
weightLimit = wL;
speedLimit = sL;
numLanes = nL;
}
public void materials(String[] m) {
if( m.length > materials.length ) {
System.out.println("Only three materials please!");
}
m = materials;
}
public String returnMaterials() {
String temp = "[ ";
for(String str: materials) {
temp += str + ", ";
}
temp += "]";
return temp;
}
public void length(E l) {
length = l;
}
public E returnLength() {
return length;
}
public void weightLimit(E lim) {
weightLimit = lim;
}
public E returnWeightLimit() {
return weightLimit;
}
public void speedLimit(E lim){
speedLimit = lim;
}
public E returnSpeedLimit() {
return speedLimit;
}
public void numLanes(int lanes) {
numLanes = lanes;
}
public int returnNumLanes() {
return numLanes;
}
public abstract void archRadius(E aR);
public abstract void archLength(E aL);
public abstract void cantileverLength(E length);
public abstract void tensions(double[] tensions);
}