Statistiques
| Révision:

fr_b02 / petri / src / arcElement / ArcEntering.java @ 6

Historique | Voir | Annoter | Télécharger (933 octets)

1
package arcElement;
2

    
3
import element.Place;
4

    
5
public class ArcEntering extends Arc{
6
        
7
        private int value;
8
        /**
9
         * @param the place link to ArcEntering and the value of this Arc
10
         * Constructor for ArcEntering
11
         *
12
         */
13
        public ArcEntering(Place place, int value) {
14
                super(place);
15

    
16
                this.value=value;
17
        }
18
        /**
19
         * Do the transition for the ArcEntering (add to the place value token)
20
         *
21
         */
22
        public void doTransition() {
23
                this.getPlace().changeToken(this.value);
24
        }
25
        /**
26
         * Check if the ArcEntering is active (always true)
27
         *@return true
28
         */
29
        public boolean isActive() {
30
                return true;
31
        }
32
        /**
33
         * Check if the ArcEntering is Pullable (always true)
34
         *@return true
35
         */
36
        public boolean isPullable() {
37
                return true;
38
        }
39
        /**
40
         * @return a string that describe the ArcEntering
41
         *
42
         */
43
        public String toString() {
44
                return "ArcEntering value:"+value+", "+this.getPlace();
45
        }
46

    
47

    
48
        
49

    
50
}