1 |
iliev |
596 |
/* |
2 |
|
|
* jlscp - a java LinuxSampler control protocol API |
3 |
|
|
* |
4 |
iliev |
1139 |
* Copyright (C) 2005-2006 Grigor Iliev <grigor@grigoriliev.com> |
5 |
iliev |
596 |
* |
6 |
|
|
* This file is part of jlscp. |
7 |
|
|
* |
8 |
|
|
* jlscp is free software; you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License version 2 |
10 |
|
|
* as published by the Free Software Foundation. |
11 |
|
|
* |
12 |
|
|
* jlscp is distributed in the hope that it will be useful, |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
* GNU General Public License for more details. |
16 |
|
|
* |
17 |
|
|
* You should have received a copy of the GNU General Public License |
18 |
|
|
* along with jlscp; if not, write to the Free Software |
19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
|
|
* MA 02111-1307 USA |
21 |
|
|
*/ |
22 |
|
|
|
23 |
|
|
package org.linuxsampler.lscp; |
24 |
|
|
|
25 |
|
|
/** |
26 |
|
|
* This class represents a factory for creating <code>Parameter</code> instances. |
27 |
|
|
* @author Grigor Iliev |
28 |
|
|
*/ |
29 |
|
|
public class ParameterFactory { |
30 |
|
|
private |
31 |
|
|
ParameterFactory() { |
32 |
|
|
|
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
/** |
36 |
|
|
* Creates a <code>Parameter<Boolean></code> |
37 |
|
|
* instance with the specified name and value. |
38 |
|
|
* @param name The parameter name. |
39 |
|
|
* @param value The parameter value. |
40 |
|
|
* @return The newly created <code>Parameter<Boolean></code> |
41 |
|
|
* instance with the specified name and value. |
42 |
|
|
*/ |
43 |
|
|
public static Parameter<Boolean> |
44 |
|
|
createParameter(String name, Boolean value) { |
45 |
|
|
return new BoolParameter(name, value); |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
/** |
49 |
|
|
* Creates a <code>Parameter<Boolean[]></code> |
50 |
|
|
* instance with the specified name and value. |
51 |
|
|
* @param name The parameter name. |
52 |
|
|
* @param value The parameter value. |
53 |
|
|
* @return The newly created <code>Parameter<Boolean[]></code> |
54 |
|
|
* instance with the specified name and value. |
55 |
|
|
*/ |
56 |
|
|
public static Parameter<Boolean[]> |
57 |
|
|
createParameter(String name, Boolean[] value) { |
58 |
|
|
return new BoolListParameter(name, value); |
59 |
|
|
} |
60 |
|
|
|
61 |
|
|
/** |
62 |
|
|
* Creates a <code>Parameter<Float></code> |
63 |
|
|
* instance with the specified name and value. |
64 |
|
|
* @param name The parameter name. |
65 |
|
|
* @param value The parameter value. |
66 |
|
|
* @return The newly created <code>Parameter<Float></code> |
67 |
|
|
* instance with the specified name and value. |
68 |
|
|
*/ |
69 |
|
|
public static Parameter<Float> |
70 |
|
|
createParameter(String name, Float value) { |
71 |
|
|
return new FloatParameter(name, value); |
72 |
|
|
} |
73 |
|
|
|
74 |
|
|
/** |
75 |
|
|
* Creates a <code>Parameter<Float[]></code> |
76 |
|
|
* instance with the specified name and value. |
77 |
|
|
* @param name The parameter name. |
78 |
|
|
* @param value The parameter value. |
79 |
|
|
* @return The newly created <code>Parameter<Float[]></code> |
80 |
|
|
* instance with the specified name and value. |
81 |
|
|
*/ |
82 |
|
|
public static Parameter<Float[]> |
83 |
|
|
createParameter(String name, Float[] value) { |
84 |
|
|
return new FloatListParameter(name, value); |
85 |
|
|
} |
86 |
|
|
|
87 |
|
|
/** |
88 |
|
|
* Creates a <code>Parameter<Integer></code> |
89 |
|
|
* instance with the specified name and value. |
90 |
|
|
* @param name The parameter name. |
91 |
|
|
* @param value The parameter value. |
92 |
|
|
* @return The newly created <code>Parameter<Integer></code> |
93 |
|
|
* instance with the specified name and value. |
94 |
|
|
*/ |
95 |
|
|
public static Parameter<Integer> |
96 |
|
|
createParameter(String name, Integer value) { |
97 |
|
|
return new IntParameter(name, value); |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
/** |
101 |
|
|
* Creates a <code>Parameter<Integer[]></code> |
102 |
|
|
* instance with the specified name and value. |
103 |
|
|
* @param name The parameter name. |
104 |
|
|
* @param value The parameter value. |
105 |
|
|
* @return The newly created <code>Parameter<Integer[]></code> |
106 |
|
|
* instance with the specified name and value. |
107 |
|
|
*/ |
108 |
|
|
public static Parameter<Integer[]> |
109 |
|
|
createParameter(String name, Integer[] value) { |
110 |
|
|
return new IntListParameter(name, value); |
111 |
|
|
} |
112 |
|
|
|
113 |
|
|
/** |
114 |
|
|
* Creates a <code>Parameter<String></code> |
115 |
|
|
* instance with the specified name and value. |
116 |
|
|
* @param name The parameter name. |
117 |
|
|
* @param value The parameter value. |
118 |
|
|
* @return The newly created <code>Parameter<String></code> |
119 |
|
|
* instance with the specified name and value. |
120 |
|
|
*/ |
121 |
|
|
public static Parameter<String> |
122 |
|
|
createParameter(String name, String value) { |
123 |
|
|
return new StringParameter(name, value); |
124 |
|
|
} |
125 |
|
|
|
126 |
|
|
/** |
127 |
|
|
* Creates a <code>Parameter<String[]></code> |
128 |
|
|
* instance with the specified name and value. |
129 |
|
|
* @param name The parameter name. |
130 |
|
|
* @param value The parameter value. |
131 |
|
|
* @return The newly created <code>Parameter<String[]></code> |
132 |
|
|
* instance with the specified name and value. |
133 |
|
|
*/ |
134 |
|
|
public static Parameter<String[]> |
135 |
|
|
createParameter(String name, String[] value) { |
136 |
|
|
return new StringListParameter(name, value); |
137 |
|
|
} |
138 |
|
|
} |