Statistiques
| Révision:

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

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

1 4 a19coudr
package arcElement;
2 2 a19coudr
3 3 a19coudr
import element.Place;
4 4 a19coudr
import junit.framework.TestCase;
5 3 a19coudr
6 6 a19coudr
/**
7
 * Abstract class for the arc
8
 *
9
 */
10 4 a19coudr
public abstract class Arc extends TestCase implements ArcInterface  {
11 6 a19coudr
12 2 a19coudr
        private Place place;
13 6 a19coudr
        /**
14
         * @param place link to the arc
15
         *
16
         */
17 2 a19coudr
        public Arc(Place place) {
18
                this.place=place;
19
        }
20
        public Place getPlace() {
21
                return this.place;
22
        }
23 6 a19coudr
        /**
24
         * @param Object to compare to the arc
25
         *the goal of this method is to check if two arcs are the same object (same identityHashCode)
26
         */
27 2 a19coudr
        public boolean equals(Object o) {
28
                if((o instanceof Arc) &&(System.identityHashCode(((Arc)o))==System.identityHashCode(this))) {
29
                        return true;
30
                }
31
                else {
32
                        return false;
33
                }
34 6 a19coudr
35 2 a19coudr
        }
36
37
}