Statistiques
| Révision:

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

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

1
package arcElement;
2

    
3
import element.Place;
4
import junit.framework.TestCase;
5

    
6
/**
7
 * Abstract class for the arc 
8
 *
9
 */
10
public abstract class Arc extends TestCase implements ArcInterface  {
11

    
12
        private Place place;
13
        /**
14
         * @param place link to the arc
15
         *
16
         */
17
        public Arc(Place place) {
18
                this.place=place;
19
        }
20
        public Place getPlace() {
21
                return this.place;
22
        }
23
        /**
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
        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

    
35
        }
36

    
37
}