View Javadoc

1   /*
2    * ConnectionEndPoint
3    * 
4    * 19 October 2007 -- tds
5    *
6    * BSD License (http://galagosearch.org/license)
7    */
8   package org.galagosearch.tupleflow.execution;
9   
10  import java.io.Serializable;
11  
12  /***
13   * @author trevor
14   */
15  public class ConnectionEndPoint extends Locatable implements Cloneable, Serializable {
16      private String stageName;
17      private String pointName;
18      private ConnectionPointType type;
19      private ConnectionAssignmentType assignment;
20  
21      public ConnectionEndPoint(FileLocation location, String stageName, String pointName, ConnectionAssignmentType assignment, ConnectionPointType type) {
22          super(location);
23          this.stageName = stageName;
24          this.pointName = pointName;
25          this.type = type;
26          this.assignment = assignment;
27      }
28  
29      public ConnectionEndPoint(FileLocation location, String stageName, String pointName, ConnectionPointType type) {
30          this(location, stageName, pointName, ConnectionAssignmentType.Combined, type);
31      }
32  
33      public String getStageName() {
34          return stageName;
35      }
36  
37      public void setStageName(String stageName) {
38          this.stageName = stageName;
39      }
40  
41      public String getPointName() {
42          return pointName;
43      }
44  
45      public void setPointName(String pointName) {
46          this.pointName = pointName;
47      }
48  
49      public ConnectionAssignmentType getAssignment() {
50          return assignment;
51      }
52  
53      public ConnectionPointType getType() {
54          return type;
55      }
56  
57      @Override
58      public String toString() {
59          return String.format("%s:%s %s %s", stageName, pointName, assignment, type.toString());
60      }
61  
62      @Override
63      public ConnectionEndPoint clone() {
64          try {
65              return (ConnectionEndPoint) super.clone();
66          } catch (CloneNotSupportedException e) {
67              throw new RuntimeException("Expected superclass to handle cloning", e);
68          }
69      }
70  }