1 /*
2 * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
76 * pb1.addSource(im);
77 * return pb1;
78 * }
79 * </pre>
80 *
81 * <p> The clone method of <code>ParameterBlock</code> has been defined to
82 * perform a clone of both the source and parameter Vectors for
83 * this reason. A standard, shallow clone is available as
84 * shallowClone.
85 *
86 * <p> The addSource, setSource, add, and set methods are
87 * defined to return 'this' after adding their argument. This allows
88 * use of syntax like:
89 *
90 * <pre>
91 * ParameterBlock pb = new ParameterBlock();
92 * op = new RenderableImageOp("operation", pb.add(arg1).add(arg2));
93 * </pre>
94 * */
95 public class ParameterBlock implements Cloneable, Serializable {
96 /** A Vector of sources, stored as arbitrary Objects. */
97 protected Vector<Object> sources = new Vector<Object>();
98
99 /** A Vector of non-source parameters, stored as arbitrary Objects. */
100 protected Vector<Object> parameters = new Vector<Object>();
101
102 /** A dummy constructor. */
103 public ParameterBlock() {}
104
105 /**
106 * Constructs a <code>ParameterBlock</code> with a given Vector
107 * of sources.
108 * @param sources a <code>Vector</code> of source images
109 */
110 public ParameterBlock(Vector<Object> sources) {
111 setSources(sources);
112 }
113
114 /**
115 * Constructs a <code>ParameterBlock</code> with a given Vector of sources and
|
1 /*
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
76 * pb1.addSource(im);
77 * return pb1;
78 * }
79 * </pre>
80 *
81 * <p> The clone method of <code>ParameterBlock</code> has been defined to
82 * perform a clone of both the source and parameter Vectors for
83 * this reason. A standard, shallow clone is available as
84 * shallowClone.
85 *
86 * <p> The addSource, setSource, add, and set methods are
87 * defined to return 'this' after adding their argument. This allows
88 * use of syntax like:
89 *
90 * <pre>
91 * ParameterBlock pb = new ParameterBlock();
92 * op = new RenderableImageOp("operation", pb.add(arg1).add(arg2));
93 * </pre>
94 * */
95 public class ParameterBlock implements Cloneable, Serializable {
96 private static final long serialVersionUID = -7577115551785240750L;
97
98 /** A Vector of sources, stored as arbitrary Objects. */
99 protected Vector<Object> sources = new Vector<Object>();
100
101 /** A Vector of non-source parameters, stored as arbitrary Objects. */
102 protected Vector<Object> parameters = new Vector<Object>();
103
104 /** A dummy constructor. */
105 public ParameterBlock() {}
106
107 /**
108 * Constructs a <code>ParameterBlock</code> with a given Vector
109 * of sources.
110 * @param sources a <code>Vector</code> of source images
111 */
112 public ParameterBlock(Vector<Object> sources) {
113 setSources(sources);
114 }
115
116 /**
117 * Constructs a <code>ParameterBlock</code> with a given Vector of sources and
|