Source Code Cross Referenced for ParameterBlock.java in  » Apache-Harmony-Java-SE » java-package » java » awt » image » renderable » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.awt.image.renderable 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:        /**
018:         * @author Igor V. Stolyarov
019:         * @version $Revision$
020:         */package java.awt.image.renderable;
021:
022:        import java.awt.image.RenderedImage;
023:        import java.io.Serializable;
024:        import java.util.Vector;
025:
026:        public class ParameterBlock implements  Cloneable, Serializable {
027:
028:            private static final long serialVersionUID = -7577115551785240750L;
029:
030:            protected Vector<Object> sources = new Vector<Object>();
031:
032:            protected Vector<Object> parameters = new Vector<Object>();
033:
034:            public ParameterBlock(Vector<Object> sources,
035:                    Vector<Object> parameters) {
036:                setSources(sources);
037:                setParameters(parameters);
038:            }
039:
040:            public ParameterBlock(Vector<Object> sources) {
041:                setSources(sources);
042:            }
043:
044:            public ParameterBlock() {
045:            }
046:
047:            public ParameterBlock setSource(Object source, int index) {
048:                if (sources.size() < index + 1) {
049:                    sources.setSize(index + 1);
050:                }
051:                sources.setElementAt(source, index);
052:                return this ;
053:            }
054:
055:            public ParameterBlock set(Object obj, int index) {
056:                if (parameters.size() < index + 1) {
057:                    parameters.setSize(index + 1);
058:                }
059:                parameters.setElementAt(obj, index);
060:                return this ;
061:            }
062:
063:            public ParameterBlock addSource(Object source) {
064:                sources.addElement(source);
065:                return this ;
066:            }
067:
068:            public ParameterBlock add(Object obj) {
069:                parameters.addElement(obj);
070:                return this ;
071:            }
072:
073:            public void setSources(Vector<Object> sources) {
074:                this .sources = sources;
075:            }
076:
077:            public void setParameters(Vector<Object> parameters) {
078:                this .parameters = parameters;
079:            }
080:
081:            public Vector<Object> getSources() {
082:                return sources;
083:            }
084:
085:            public Vector<Object> getParameters() {
086:                return parameters;
087:            }
088:
089:            public Object getSource(int index) {
090:                return sources.elementAt(index);
091:            }
092:
093:            public Object getObjectParameter(int index) {
094:                return parameters.elementAt(index);
095:            }
096:
097:            public Object shallowClone() {
098:                try {
099:                    return super .clone();
100:                } catch (Exception e) {
101:                    return null;
102:                }
103:            }
104:
105:            @SuppressWarnings("unchecked")
106:            @Override
107:            public Object clone() {
108:                ParameterBlock replica;
109:                try {
110:                    replica = (ParameterBlock) super .clone();
111:                } catch (Exception e) {
112:                    return null;
113:                }
114:                if (sources != null) {
115:                    replica.setSources((Vector<Object>) (sources.clone()));
116:                }
117:                if (parameters != null) {
118:                    replica
119:                            .setParameters((Vector<Object>) (parameters.clone()));
120:                }
121:                return replica;
122:            }
123:
124:            public Class[] getParamClasses() {
125:                int count = parameters.size();
126:                Class paramClasses[] = new Class[count];
127:
128:                for (int i = 0; i < count; i++) {
129:                    paramClasses[i] = parameters.elementAt(i).getClass();
130:                }
131:                return paramClasses;
132:            }
133:
134:            public RenderableImage getRenderableSource(int index) {
135:                return (RenderableImage) sources.elementAt(index);
136:            }
137:
138:            public ParameterBlock set(short s, int index) {
139:                return set(new Short(s), index);
140:            }
141:
142:            public ParameterBlock add(short s) {
143:                return add(new Short(s));
144:            }
145:
146:            public ParameterBlock set(long l, int index) {
147:                return set(new Long(l), index);
148:            }
149:
150:            public ParameterBlock add(long l) {
151:                return add(new Long(l));
152:            }
153:
154:            public ParameterBlock set(int i, int index) {
155:                return set(new Integer(i), index);
156:            }
157:
158:            public ParameterBlock add(int i) {
159:                return add(new Integer(i));
160:            }
161:
162:            public ParameterBlock set(float f, int index) {
163:                return set(new Float(f), index);
164:            }
165:
166:            public ParameterBlock add(float f) {
167:                return add(new Float(f));
168:            }
169:
170:            public ParameterBlock set(double d, int index) {
171:                return set(new Double(d), index);
172:            }
173:
174:            public ParameterBlock add(double d) {
175:                return add(new Double(d));
176:            }
177:
178:            public ParameterBlock set(char c, int index) {
179:                return set(new Character(c), index);
180:            }
181:
182:            public ParameterBlock add(char c) {
183:                return add(new Character(c));
184:            }
185:
186:            public ParameterBlock set(byte b, int index) {
187:                return set(new Byte(b), index);
188:            }
189:
190:            public ParameterBlock add(byte b) {
191:                return add(new Byte(b));
192:            }
193:
194:            public RenderedImage getRenderedSource(int index) {
195:                return (RenderedImage) sources.elementAt(index);
196:            }
197:
198:            public short getShortParameter(int index) {
199:                return ((Short) parameters.elementAt(index)).shortValue();
200:            }
201:
202:            public long getLongParameter(int index) {
203:                return ((Long) parameters.elementAt(index)).longValue();
204:            }
205:
206:            public int getIntParameter(int index) {
207:                return ((Integer) parameters.elementAt(index)).intValue();
208:            }
209:
210:            public float getFloatParameter(int index) {
211:                return ((Float) parameters.elementAt(index)).floatValue();
212:            }
213:
214:            public double getDoubleParameter(int index) {
215:                return ((Double) parameters.elementAt(index)).doubleValue();
216:            }
217:
218:            public char getCharParameter(int index) {
219:                return ((Character) parameters.elementAt(index)).charValue();
220:            }
221:
222:            public byte getByteParameter(int index) {
223:                return ((Byte) parameters.elementAt(index)).byteValue();
224:            }
225:
226:            public void removeSources() {
227:                sources.removeAllElements();
228:            }
229:
230:            public void removeParameters() {
231:                parameters.removeAllElements();
232:            }
233:
234:            public int getNumSources() {
235:                return sources.size();
236:            }
237:
238:            public int getNumParameters() {
239:                return parameters.size();
240:            }
241:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.