Révision 4 petri/src/arcElement/ArcEntering.java

Voir les différences:

ArcEntering.java
1
package arc;
1
package arcElement;
2 2

  
3 3
import element.Place;
4 4

  
......
8 8

  
9 9
	public ArcEntering(Place place, int value) {
10 10
		super(place);
11
		// TODO Auto-generated constructor stub
11

  
12 12
		this.value=value;
13 13
	}
14 14
	
......
26 26
	public String toString() {
27 27
		return "ArcEntering value:"+value+", "+this.getPlace();
28 28
	}
29
	public static void main(String[] args) {
30
		System.out.println("TEST METHODS ARCENTERING");
31
		
32
		System.out.println(" => method isActive()");
33
		Place emptyPlace = new Place(0);
34
		ArcEntering arce = new ArcEntering(emptyPlace, 3);
35
		System.out.println("true : "+arce.isActive());
36 29

  
30

  
37 31
	
38
		System.out.println(" => method isPullable()");
39
		Place place3 = new Place(3);
40
		ArcEntering arce2 = new ArcEntering(place3, 2);
41
		ArcEntering arce4 = new ArcEntering(place3, 4);
42
		System.out.println(arce2);
43
		System.out.println("true : "+arce2.isPullable());
44
		System.out.println(arce4);
45
		System.out.println("true : "+arce4.isPullable());
46
		
47
		System.out.println(" => method doTranstion()");
48
		System.out.println("before : "+arce2);
49
		arce2.doTransition();
50
		System.out.println("after  : "+arce2);
51
		System.out.println(" => method equals()");
52
		// the method equals is test here because arc is an abstract method
53
		System.out.println("true : "+arce2.equals(arce2));
54
		System.out.println("false : "+arce2.equals(arce4));
55
	}
56
	
57 32

  
58 33
}

Formats disponibles : Unified diff