Révision 4 petri/src/arcElement/ArcOutering.java
ArcOutering.java | ||
---|---|---|
1 |
package arc; |
|
1 |
package arcElement;
|
|
2 | 2 |
|
3 | 3 |
import element.Place; |
4 | 4 |
|
... | ... | |
25 | 25 |
public boolean isPullable() { |
26 | 26 |
return (this.getPlace().getToken()>=value); |
27 | 27 |
} |
28 |
public static void main(String[] args) { |
|
29 |
System.out.println("TEST METHODS ARCOUTERING"); |
|
30 |
|
|
31 |
System.out.println(" => method isActive()"); |
|
32 |
Place emptyPlace = new Place(0); |
|
33 |
ArcOutering arco = new ArcOutering(emptyPlace, 3); |
|
34 |
System.out.println("true : "+arco.isActive()); |
|
35 | 28 |
|
36 |
|
|
37 |
System.out.println(" => method isPullable()"); |
|
38 |
Place place3 = new Place(3); |
|
39 |
ArcOutering arco2 = new ArcOutering(place3, 2); |
|
40 |
ArcOutering arco4 = new ArcOutering(place3, 4); |
|
41 |
System.out.println(arco2); |
|
42 |
System.out.println("true : "+arco2.isPullable()); |
|
43 |
System.out.println(arco4); |
|
44 |
System.out.println("false : "+arco4.isPullable()); |
|
45 |
|
|
46 |
System.out.println(" => method doTranstion()"); |
|
47 |
System.out.println("before : "+arco2); |
|
48 |
arco2.doTransition(); |
|
49 |
System.out.println("after : "+arco2); |
|
50 |
System.out.println(" => method equals()"); |
|
51 |
// the method equals is test here because arc is an abstract method |
|
52 |
System.out.println("true : "+arco2.equals(arco2)); |
|
53 |
System.out.println("false : "+arco2.equals(arco4)); |
|
54 |
} |
|
55 | 29 |
|
56 | 30 |
|
57 | 31 |
} |
Formats disponibles : Unified diff