📄 parameterblock.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:34:18 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class ParameterBlock</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ParameterBlock.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../../java/awt/image/renderable/RenderableImageOp.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ParameterBlock.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.awt.image.renderable</FONT><BR>Class ParameterBlock</H2><PRE><A HREF="../../../../java/lang/Object.html">java.lang.Object</A> | +--<B>java.awt.image.renderable.ParameterBlock</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../java/lang/Cloneable.html">Cloneable</A>, <A HREF="../../../../java/io/Serializable.html">Serializable</A></DD></DL><HR><DL><DT>public class <B>ParameterBlock</B><DT>extends <A HREF="../../../../java/lang/Object.html">Object</A><DT>implements <A HREF="../../../../java/lang/Cloneable.html">Cloneable</A>, <A HREF="../../../../java/io/Serializable.html">Serializable</A></DL><P>A <code>ParameterBlock</code> encapsulates all the information about sources and parameters (Objects) required by a RenderableImageOp, or other classes that process images. <p> Although it is possible to place arbitrary objects in the source Vector, users of this class may impose semantic constraints such as requiring all sources to be RenderedImages or RenderableImage. <code>ParameterBlock</code> itself is merely a container and performs no checking on source or parameter types. <p> All parameters in a <code>ParameterBlock</code> are objects; convenience add and set methods are available that take arguments of base type and construct the appropriate subclass of Number (such as Integer or Float). Corresponding get methods perform a downward cast and have return values of base type; an exception will be thrown if the stored values do not have the correct type. There is no way to distinguish between the results of "short s; add(s)" and "add(new Short(s))". <p> Note that the get and set methods operate on references. Therefore, one must be careful not to share references between <code>ParameterBlock</code>s when this is inappropriate. For example, to create a new <code>ParameterBlock</code> that is equal to an old one except for an added source, one might be tempted to write: <pre> ParameterBlock addSource(ParameterBlock pb, RenderableImage im) { ParameterBlock pb1 = new ParameterBlock(pb.getSources()); pb1.addSource(im); return pb1; } </pre> <p> This code will have the side effect of altering the original <code>ParameterBlock</code>, since the getSources operation returned a reference to its source Vector. Both pb and pb1 share their source Vector, and a change in either is visible to both. <p> A correct way to write the addSource function is to clone the source Vector: <pre> ParameterBlock addSource (ParameterBlock pb, RenderableImage im) { ParameterBlock pb1 = new ParameterBlock(pb.getSources().clone()); pb1.addSource(im); return pb1; } </pre> <p> The clone method of <code>ParameterBlock</code> has been defined to perform a clone of both the source and parameter Vectors for this reason. A standard, shallow clone is available as shallowClone. <p> The addSource, setSource, add, and set methods are defined to return 'this' after adding their argument. This allows use of syntax like: <pre> ParameterBlock pb = new ParameterBlock(); op = new RenderableImageOp("operation", pb.add(arg1).add(arg2)); </pre><P><DL><DT><B>See Also: </B><DD><A HREF="../../../../serialized-form.html#java.awt.image.renderable.ParameterBlock">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../../java/util/Vector.html">Vector</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#parameters">parameters</A></B></CODE><BR> A Vector of non-source parameters, stored as arbitrary Objects.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../../java/util/Vector.html">Vector</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#sources">sources</A></B></CODE><BR> A Vector of sources, stored as arbitrary Objects.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#ParameterBlock()">ParameterBlock</A></B>()</CODE><BR> A dummy constructor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#ParameterBlock(java.util.Vector)">ParameterBlock</A></B>(<A HREF="../../../../java/util/Vector.html">Vector</A> sources)</CODE><BR> Constructs a <code>ParameterBlock</code> with a given Vector of sources.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#ParameterBlock(java.util.Vector, java.util.Vector)">ParameterBlock</A></B>(<A HREF="../../../../java/util/Vector.html">Vector</A> sources, <A HREF="../../../../java/util/Vector.html">Vector</A> parameters)</CODE><BR> Constructs a <code>ParameterBlock</code> with a given Vector of sources and Vector of parameters.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(byte)">add</A></B>(byte b)</CODE><BR> Adds a Byte to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(char)">add</A></B>(char c)</CODE><BR> Adds a Character to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(double)">add</A></B>(double d)</CODE><BR> Adds a Double to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(float)">add</A></B>(float f)</CODE><BR> Adds a Float to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(int)">add</A></B>(int i)</CODE><BR> Adds a Integer to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(long)">add</A></B>(long l)</CODE><BR> Adds a Long to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(java.lang.Object)">add</A></B>(<A HREF="../../../../java/lang/Object.html">Object</A> obj)</CODE><BR> Adds an object to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#add(short)">add</A></B>(short s)</CODE><BR> Adds a Short to the list of parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/awt/image/renderable/ParameterBlock.html">ParameterBlock</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#addSource(java.lang.Object)">addSource</A></B>(<A HREF="../../../../java/lang/Object.html">Object</A> source)</CODE><BR> Adds an image to end of the list of sources.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#clone()">clone</A></B>()</CODE><BR> Creates a copy of a <code>ParameterBlock</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#getByteParameter(int)">getByteParameter</A></B>(int index)</CODE><BR> A convenience method to return a parameter as a byte.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> char</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#getCharParameter(int)">getCharParameter</A></B>(int index)</CODE><BR> A convenience method to return a parameter as a char.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/image/renderable/ParameterBlock.html#getDoubleParameter(int)">getDoubleParameter</A></B>(int index)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -