001: /*
002: * $RCSfile: ParameterList.java,v $
003: *
004: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005: *
006: * Use is subject to license terms.
007: *
008: * $Revision: 1.1 $
009: * $Date: 2005/02/11 04:57:14 $
010: * $State: Exp $
011: */
012: package javax.media.jai;
013:
014: /**
015: * An interface to represent a list of parameter name-value pairs.
016: *
017: * <p> All comparisons using <code>String</code>s are done in a case
018: * insensitive (but retentive) manner.
019: *
020: * @see ParameterListDescriptor
021: *
022: * @since JAI 1.1
023: */
024: public interface ParameterList {
025:
026: /**
027: * Returns the associated <code>ParameterListDescriptor</code>.
028: */
029: public ParameterListDescriptor getParameterListDescriptor();
030:
031: /**
032: * Sets a named parameter to a <code>byte</code> value.
033: *
034: * Implementing classes are free but not required to check class type,
035: * ranges, and enumeration types.
036: *
037: * @param paramName a <code>String</code> naming a parameter.
038: * @param b a <code>byte</code> value for the parameter.
039: *
040: * @throws IllegalArgumentException if paramName is null.
041: * @throws IllegalArgumentException if there is no parameter with the
042: * specified name.
043: */
044: public ParameterList setParameter(String paramName, byte b);
045:
046: /**
047: * Sets a named parameter to a <code>boolean</code> value.
048: *
049: * Implementing classes are free but not required to check class type,
050: * ranges, and enumeration types.
051: *
052: * @param paramName a <code>String</code> naming a parameter.
053: * @param b a <code>boolean</code> value for the parameter.
054: *
055: * @throws IllegalArgumentException if paramName is null.
056: * @throws IllegalArgumentException if there is no parameter with the
057: * specified name.
058: */
059: public ParameterList setParameter(String paramName, boolean b);
060:
061: /**
062: * Sets a named parameter to a <code>char</code> value.
063: *
064: * Implementing classes are free but not required to check class type,
065: * ranges, and enumeration types.
066: *
067: * @param paramName a <code>String</code> naming a parameter.
068: * @param c a <code>char</code> value for the parameter.
069: *
070: * @throws IllegalArgumentException if paramName is null.
071: * @throws IllegalArgumentException if there is no parameter with the
072: * specified name.
073: */
074: public ParameterList setParameter(String paramName, char c);
075:
076: /**
077: * Sets a named parameter to a <code>short</code> value.
078: *
079: * Implementing classes are free but not required to check class type,
080: * ranges, and enumeration types.
081: *
082: * @param paramName a <code>String</code> naming a parameter.
083: * @param s a <code>short</code> value for the parameter.
084: *
085: * @throws IllegalArgumentException if paramName is null.
086: * @throws IllegalArgumentException if there is no parameter with the
087: * specified name.
088: */
089: public ParameterList setParameter(String paramName, short s);
090:
091: /**
092: * Sets a named parameter to an <code>int</code> value.
093: *
094: * Implementing classes are free but not required to check class type,
095: * ranges, and enumeration types.
096: *
097: * @param paramName a <code>String</code> naming a parameter.
098: * @param i an <code>int</code> value for the parameter.
099: *
100: * @throws IllegalArgumentException if paramName is null.
101: * @throws IllegalArgumentException if there is no parameter with the
102: * specified name.
103: */
104: public ParameterList setParameter(String paramName, int i);
105:
106: /**
107: * Sets a named parameter to a <code>long</code> value.
108: *
109: * Implementing classes are free but not required to check class type,
110: * ranges, and enumeration types.
111: *
112: * @param paramName a <code>String</code> naming a parameter.
113: * @param l a <code>long</code> value for the parameter.
114: *
115: * @throws IllegalArgumentException if paramName is null.
116: * @throws IllegalArgumentException if there is no parameter with the
117: * specified name.
118: */
119: public ParameterList setParameter(String paramName, long l);
120:
121: /**
122: * Sets a named parameter to a <code>float</code> value.
123: *
124: * Implementing classes are free but not required to check class type,
125: * ranges, and enumeration types.
126: *
127: * @param paramName a <code>String</code> naming a parameter.
128: * @param f a <code>float</code> value for the parameter.
129: *
130: * @throws IllegalArgumentException if paramName is null.
131: * @throws IllegalArgumentException if there is no parameter with the
132: * specified name.
133: */
134: public ParameterList setParameter(String paramName, float f);
135:
136: /**
137: * Sets a named parameter to a <code>double</code> value.
138: *
139: * Implementing classes are free but not required to check class type,
140: * ranges, and enumeration types.
141: *
142: * @param paramName a <code>String</code> naming a parameter.
143: * @param d a <code>double</code> value for the parameter.
144: *
145: * @throws IllegalArgumentException if paramName is null.
146: * @throws IllegalArgumentException if there is no parameter with the
147: * specified name.
148: */
149: public ParameterList setParameter(String paramName, double d);
150:
151: /**
152: * Sets a named parameter to an <code>Object</code> value.
153: *
154: * Implementing classes are free but not required to check class type,
155: * ranges, and enumeration types.
156: *
157: * @param paramName a <code>String</code> naming a parameter.
158: * @param obj an <code>Object</code> value for the parameter.
159: *
160: * @throws IllegalArgumentException if paramName is null.
161: * @throws IllegalArgumentException if there is no parameter with the
162: * specified name.
163: * pointed to by the paramName.
164: */
165: public ParameterList setParameter(String paramName, Object obj);
166:
167: /**
168: * Gets a named parameter as an <code>Object</code>. Parameters
169: * belonging to a primitive type, such as int, will be returned as a
170: * member of the corresponding wrapper class, such as
171: * <code>Integer</code>.
172: *
173: * @param paramName the name of the parameter to be returned.
174: *
175: * @throws IllegalArgumentException if paramName is null.
176: * @throws IllegalArgumentException if there is no parameter with the
177: * specified name.
178: * @throws IllegalStateException if the parameter value is still
179: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
180: */
181: public Object getObjectParameter(String paramName);
182:
183: /**
184: * A convenience method to return a parameter as a <code>byte</code>.
185: *
186: * @param paramName the name of the parameter to be returned.
187: *
188: * @throws IllegalArgumentException if paramName is null.
189: * @throws IllegalArgumentException if there is no parameter with the
190: * specified name.
191: * @throws ClassCastException if the parameter is of a different type.
192: * @throws IllegalStateException if the parameter value is still
193: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
194: */
195: public byte getByteParameter(String paramName);
196:
197: /**
198: * A convenience method to return a parameter as a <code>boolean</code>.
199: *
200: * @param paramName the name of the parameter to be returned.
201: *
202: * @throws IllegalArgumentException if paramName is null.
203: * @throws IllegalArgumentException if there is no parameter with the
204: * specified name.
205: * @throws ClassCastException if the parameter is of a different type.
206: * @throws IllegalStateException if the parameter value is still
207: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
208: */
209: public boolean getBooleanParameter(String paramName);
210:
211: /**
212: * A convenience method to return a parameter as a <code>char</code>.
213: *
214: * @param paramName the name of the parameter to be returned.
215: *
216: * @throws IllegalArgumentException if paramName is null.
217: * @throws IllegalArgumentException if there is no parameter with the
218: * specified name.
219: * @throws ClassCastException if the parameter is of a different type.
220: * @throws IllegalStateException if the parameter value is still
221: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
222: */
223: public char getCharParameter(String paramName);
224:
225: /**
226: * A convenience method to return a parameter as a <code>short</code>.
227: *
228: * @param paramName the name of the parameter to be returned.
229: *
230: * @throws IllegalArgumentException if paramName is null.
231: * @throws IllegalArgumentException if there is no parameter with the
232: * specified name.
233: * @throws ClassCastException if the parameter is of a different type.
234: * @throws IllegalStateException if the parameter value is still
235: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
236: */
237: public short getShortParameter(String paramName);
238:
239: /**
240: * A convenience method to return a parameter as an <code>int</code>.
241: *
242: * @param paramName the name of the parameter to be returned.
243: *
244: * @throws IllegalArgumentException if paramName is null.
245: * @throws IllegalArgumentException if there is no parameter with the
246: * specified name.
247: * @throws ClassCastException if the parameter is of a different type.
248: * @throws IllegalStateException if the parameter value is still
249: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
250: */
251: public int getIntParameter(String paramName);
252:
253: /**
254: * A convenience method to return a parameter as a <code>long</code>.
255: *
256: * @param paramName the name of the parameter to be returned.
257: *
258: * @throws IllegalArgumentException if paramName is null.
259: * @throws IllegalArgumentException if there is no parameter with the
260: * specified name.
261: * @throws ClassCastException if the parameter is of a different type.
262: * @throws IllegalStateException if the parameter value is still
263: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
264: */
265: public long getLongParameter(String paramName);
266:
267: /**
268: * A convenience method to return a parameter as a <code>float</code>.
269: *
270: * @param paramName the name of the parameter to be returned.
271: *
272: * @throws IllegalArgumentException if paramName is null.
273: * @throws IllegalArgumentException if there is no parameter with the
274: * specified name.
275: * @throws ClassCastException if the parameter is of a different type.
276: * @throws IllegalStateException if the parameter value is still
277: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
278: */
279: public float getFloatParameter(String paramName);
280:
281: /**
282: * A convenience method to return a parameter as a <code>double</code>.
283: *
284: * @param paramName the name of the parameter to be returned.
285: *
286: * @throws IllegalArgumentException if paramName is null.
287: * @throws IllegalArgumentException if there is no parameter with the
288: * specified name.
289: * @throws ClassCastException if the parameter is of a different type.
290: * @throws IllegalStateException if the parameter value is still
291: * ParameterListDescriptor.NO_PARAMETER_DEFAULT
292: */
293: public double getDoubleParameter(String paramName);
294: }
|