View Javadoc

1   /*
2    * Copyright 2010 Fraunhofer Gesellschaft, Munich, Germany,
3    * for its Fraunhofer Institute for Computer Architecture and Software
4    * Technology (FIRST), Berlin, Germany. All rights reserved.
5    * http://www.first.fraunhofer.de/
6    */
7   
8   package net.kwfgrid.gworkflowdl.structure;
9   
10  /***
11   * Link in AnalysisTransition to Place with describing expression.
12   */
13  public final class StdEdge implements Edge {
14      /***
15       * place the edge is pointing to.
16       */
17      private Place place;
18  
19      /***
20       * expression of edge.
21       */
22      private String expression;
23  
24      public StdEdge() {
25          place = Edge.DEFAULT_PLACE;
26          expression = Edge.DEFAULT_EXPRESSION;
27      }
28  
29      /***
30       * Edge construction by given place and expression.
31       *
32       * @param pl Place Edge should point to
33       * @param ex Edge expression
34       */
35      public StdEdge(final Place pl, final String ex) {
36          place = pl;
37          expression = ex;
38      }
39  
40      /***
41       * set Place the Edge is pointing to.
42       *
43       * @param p Place Edge should point to
44       */
45      public void setPlace(final Place p) {
46          place = p;
47      }
48  
49      /***
50       * get place the edge is pointing to.
51       *
52       * @return place Place Edge points to
53       */
54      public Place getPlace() {
55          return place;
56      }
57  
58      public String getPlaceID() {
59          return getPlace().getID();
60      }
61  
62      /***
63       * set Edge's expression.
64       *
65       * @param ex Edge expression
66       */
67      public void setExpression(final String ex) {
68          expression = ex;
69      }
70  
71      /***
72       * get Edge's expression.
73       *
74       * @return Edge expression
75       */
76      public String getExpression() {
77          return expression;
78      }
79  }