22 |
package nongnu.cashews.language.process; |
package nongnu.cashews.language.process; |
23 |
|
|
24 |
import java.net.URI; |
import java.net.URI; |
25 |
|
import java.net.URISyntaxException; |
26 |
|
|
27 |
/** |
/** |
28 |
* Takes a set of inputs, does some processing and returns a set of |
* Takes a set of inputs, does some processing and returns a set of |
50 |
*/ |
*/ |
51 |
private URI name; |
private URI name; |
52 |
|
|
53 |
|
/** |
54 |
|
* Constructs a new <code>Process</code> with the specified name. |
55 |
|
* |
56 |
|
* @param name the name of the process. |
57 |
|
* @throws URISyntaxException if the supplied name is not a valid URI. |
58 |
|
*/ |
59 |
|
public Process(String name) |
60 |
|
throws URISyntaxException |
61 |
|
{ |
62 |
|
setName(name); |
63 |
|
} |
64 |
|
|
65 |
|
/** |
66 |
|
* Constructs a new <code>Process</code> with the specified name. |
67 |
|
* |
68 |
|
* @param name the name of the process. |
69 |
|
*/ |
70 |
|
public Process(URI name) |
71 |
|
{ |
72 |
|
setName(name); |
73 |
|
} |
74 |
|
|
75 |
|
/** |
76 |
|
* Sets the name of this process to that specified. |
77 |
|
* |
78 |
|
* @param name the name of the process. |
79 |
|
* @throws URISyntaxException if the supplied name is not a valid URI. |
80 |
|
*/ |
81 |
|
public void setName(String name) |
82 |
|
throws URISyntaxException |
83 |
|
{ |
84 |
|
setName(new URI(name)); |
85 |
|
} |
86 |
|
|
87 |
|
/** |
88 |
|
* Sets the name of this process to that specified. |
89 |
|
* |
90 |
|
* @param name the name of the process. |
91 |
|
*/ |
92 |
|
public void setName(URI name) |
93 |
|
{ |
94 |
|
this.name = name; |
95 |
|
} |
96 |
|
|
97 |
|
/** |
98 |
|
* Returns a <code>String</code> representation of this process. |
99 |
|
* |
100 |
|
* @return a textual representation. |
101 |
|
*/ |
102 |
|
public String toString() |
103 |
|
{ |
104 |
|
return getClass().getName() + |
105 |
|
"[name=" + |
106 |
|
name + |
107 |
|
"]"; |
108 |
|
} |
109 |
|
|
110 |
} |
} |
111 |
|
|