KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > graph > model > Edge


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2005 Jennifer Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20
21 package ca.mcgill.sable.graph.model;
22
23 public class Edge extends Element {
24
25     private SimpleNode src;
26     private SimpleNode tgt;
27     private String JavaDoc label;
28     
29     /**
30      * @return Returns the label.
31      */

32     public String JavaDoc getLabel() {
33         return label;
34     }
35     /**
36      * @param label The label to set.
37      */

38     public void setLabel(String JavaDoc label) {
39         this.label = label;
40         fireStructureChange(EDGE_LABEL, label);
41     }
42     /**
43      *
44      */

45     public Edge(SimpleNode src, SimpleNode tgt) {
46         setSrc(src);
47         setTgt(tgt);
48         src.addOutput(this);
49         tgt.addInput(this);
50     }
51
52     /**
53      * @return
54      */

55     public SimpleNode getSrc() {
56         return src;
57     }
58
59     /**
60      * @param node
61      */

62     public void setSrc(SimpleNode node) {
63         src = node;
64     }
65
66     /**
67      * @return
68      */

69     public SimpleNode getTgt() {
70         return tgt;
71     }
72
73     /**
74      * @param node
75      */

76     public void setTgt(SimpleNode node) {
77         tgt = node;
78     }
79
80 }
81
Popular Tags