public class ParameterBlock extends Object implements Cloneable, Serializable
ParameterBlock
封装了所有关于源和参数的信息(对象)的renderableimageop要求,或其他类,图像处理。
虽然它可能将任意对象的源向量,这类用户可能对语义约束,如要求所有来源是renderedimages或renderableimage。ParameterBlock
本身只是一个容器,不执行检查源代码或参数类型。
在ParameterBlock
所有参数的对象;方便的添加和设置方法,以基础类型参数构建数相应的子类(如整数或浮点数)。相应的获取方法执行向下的抛出,并具有基本类型的返回值;如果存储的值没有正确的类型,则将引发异常。没有办法区分“短S;加(S)”和“添加(新短(S))的结果”。
请注意,获取和设置方法操作引用。因此,我们必须谨慎小心,不分享引用之间的ParameterBlock
s时这是不恰当的。例如,创建一个新的ParameterBlock
等于旧的除了添加的源,有人会写:
ParameterBlock addSource(parameterblock Pb、renderableimage IM){parameterblock PB1 =新parameterblock(Pb。getsources());PB1 addsource(IM);返回PB1;}
此代码将改变原来的ParameterBlock
的副作用,因为getsources操作返回参考其源向量。PB和PB1分享他们的源向量,和在任何一个变化都是可见的。
一个写addsource功能正确的办法是克隆的源向量:
ParameterBlock addSource(parameterblock Pb、renderableimage IM){parameterblock PB1 =新parameterblock(Pb。getsources()());PB1 addsource(IM);返回PB1;}
ParameterBlock
克隆的方法已经被定义为执行的源和参数向量为此克隆。一个标准的、浅克隆可以作为shallowclone。
的addsource,设置文件来源,添加和设置方法定义为返回这个加入他们争论之后。这允许使用的语法:
parameterblock PB =新parameterblock();OP =新renderableimageop(“操作”,铅。添加(arg1)。添加(2));
Modifier and Type | Field and Description |
---|---|
protected Vector<Object> |
parameters
非源参数向量,作为任意对象存储。
|
protected Vector<Object> |
sources
一个向量的来源,作为任意对象存储。
|
Constructor and Description |
---|
ParameterBlock()
虚拟构造函数。
|
ParameterBlock(Vector<Object> sources)
构建一个与给定的矢量源
ParameterBlock 。
|
ParameterBlock(Vector<Object> sources, Vector<Object> parameters)
构建一个与给定的向量和向量参数
ParameterBlock 来源。
|
Modifier and Type | Method and Description |
---|---|
ParameterBlock |
add(byte b)
在参数列表中添加一个字节。
|
ParameterBlock |
add(char c)
将一个字符添加到参数列表中。
|
ParameterBlock |
add(double d)
在参数列表中添加一个双。
|
ParameterBlock |
add(float f)
在参数列表中添加一个浮点数。
|
ParameterBlock |
add(int i)
在参数列表中添加一个整数。
|
ParameterBlock |
add(long l)
在参数列表中添加一个长的列表。
|
ParameterBlock |
add(Object obj)
将一个对象添加到参数列表中。
|
ParameterBlock |
add(short s)
在参数列表中添加一个短。
|
ParameterBlock |
addSource(Object source)
添加一个图像到源列表的结尾。
|
Object |
clone()
复制一个
ParameterBlock 。
|
byte |
getByteParameter(int index)
一个方便的方法来返回一个参数作为一个字节。
|
char |
getCharParameter(int index)
返回一个参数作为字符的方便方法。
|
double |
getDoubleParameter(int index)
一个方便的方法来返回一个参数作为一个双。
|
float |
getFloatParameter(int index)
一个方便的方法来返回一个参数作为一个浮动。
|
int |
getIntParameter(int index)
一个为int返回参数方便的方法
|
long |
getLongParameter(int index)
一个方便的方法返回一个参数作为一个长期的。
|
int |
getNumParameters()
返回参数的数目(不包括源图像)。
|
int |
getNumSources()
返回源图像的数目。
|
Object |
getObjectParameter(int index)
获取一个参数作为对象。
|
类[] |
getParamClasses()
返回一个描述参数类型的类对象数组。
|
Vector<Object> |
getParameters()
返回参数的整个向量。
|
RenderableImage |
getRenderableSource(int index)
作为一个renderableimage返回源。
|
RenderedImage |
getRenderedSource(int index)
作为一个
RenderedImage 返回源。
|
short |
getShortParameter(int index)
一个方便的方法来返回一个参数作为一个简短的。
|
Object |
getSource(int index)
返回一个通用对象的源代码。
|
Vector<Object> |
getSources()
返回源的整个向量。
|
void |
removeParameters()
清除参数列表。
|
void |
removeSources()
清除源图像列表。
|
ParameterBlock |
set(byte b, int index)
用字节替换参数列表中的对象。
|
ParameterBlock |
set(char c, int index)
用一个字符替换参数列表中的对象。
|
ParameterBlock |
set(double d, int index)
用双替换参数列表中的对象。
|
ParameterBlock |
set(float f, int index)
用浮动的参数列表中的对象替换。
|
ParameterBlock |
set(int i, int index)
用整数替换参数列表中的对象。
|
ParameterBlock |
set(long l, int index)
在参数列表中替换一个对象,用一个长的。
|
ParameterBlock |
set(Object obj, int index)
在参数列表中替换一个对象。
|
ParameterBlock |
set(short s, int index)
用短的参数列表中的对象替换。
|
void |
setParameters(Vector<Object> parameters)
将参数的整个向量设置为一个给定的向量。
|
ParameterBlock |
setSource(Object source, int index)
用新的源替换源列表中的条目。
|
void |
setSources(Vector<Object> sources)
将源的整个向量设置为一个给定的向量。
|
Object |
shallowClone()
创建一个
ParameterBlock 浅拷贝。
|
public ParameterBlock()
public ParameterBlock(Vector<Object> sources)
ParameterBlock
。
sources
-
Vector
源图像
public Object shallowClone()
ParameterBlock
浅拷贝。源和参数向量是通过引用复制的-添加或更改将是可见的两个版本。
ParameterBlock
克隆的对象。
public Object clone()
ParameterBlock
。克隆了源和参数向量,但实际的源和参数都是通过引用来复制的。这允许修改是对原
ParameterBlock
无形的秩序,在克隆源和参数个数,参数的共享资源或自己依然可见的变化。
public ParameterBlock addSource(Object source)
source
-图像对象被存储在源列表。
ParameterBlock
包含指定
source
。
public Object getSource(int index)
index
-源返回索引。
Object
表示源位于
sources
Vector
指定索引。
setSource(Object, int)
public ParameterBlock setSource(Object source, int index)
source
-指定源图像
index
的索引,
sources
Vector
插入指定的
source
source
在指定的
index
新
ParameterBlock
。
getSource(int)
public RenderedImage getRenderedSource(int index)
RenderedImage
返回源。此方法是一种方便的方法。一个例外是如果源是一个不renderedimage扔。
index
-源返回索引
RenderedImage
表示在
sources
Vector
指定索引的源图像。
public RenderableImage getRenderableSource(int index)
index
-源返回索引
RenderableImage
表示在
sources
Vector
指定索引的源图像。
public int getNumSources()
sources
Vector
源图像的数量。
public Vector<Object> getSources()
sources
Vector
。
setSources(Vector)
public void setSources(Vector<Object> sources)
sources
-源图像
Vector
getSources()
public void removeSources()
public int getNumParameters()
parameters
Vector
参数个数。
public Vector<Object> getParameters()
parameters
Vector
。
setParameters(Vector)
public void setParameters(Vector<Object> parameters)
parameters
-指定
Vector
参数
getParameters()
public void removeParameters()
public ParameterBlock add(Object obj)
obj
-
Object
添加到
parameters
Vector
ParameterBlock
包含指定的参数。
public ParameterBlock add(byte b)
b
-字节添加到
parameters
Vector
ParameterBlock
包含指定的参数。
public ParameterBlock add(char c)
c
的字符添加到
parameters
Vector
ParameterBlock
包含指定的参数。
public ParameterBlock add(short s)
s
-添加到
parameters
Vector
短
ParameterBlock
包含指定的参数。
public ParameterBlock add(int i)
i
- INT添加到
parameters
Vector
ParameterBlock
包含指定的参数。
public ParameterBlock add(long l)
l
-添加到
parameters
Vector
长
ParameterBlock
包含指定的参数。
public ParameterBlock add(float f)
f
-浮添加到
parameters
Vector
ParameterBlock
包含指定的参数。
public ParameterBlock add(double d)
d
-添加到
parameters
Vector
双
ParameterBlock
包含指定的参数。
public ParameterBlock set(Object obj, int index)
obj
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public ParameterBlock set(byte b, int index)
b
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public ParameterBlock set(char c, int index)
c
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public ParameterBlock set(short s, int index)
s
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public ParameterBlock set(int i, int index)
i
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public ParameterBlock set(long l, int index)
l
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public ParameterBlock set(float f, int index)
f
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public ParameterBlock set(double d, int index)
d
-取代参数在
parameters
Vector
指定索引的参数
index
的参数必须与指定的参数替代指标
ParameterBlock
包含指定的参数。
public Object getObjectParameter(int index)
index
-参数得到的指标
parameters
Vector
一
Object
。
public byte getByteParameter(int index)
null
或不
Byte
抛异常。
index
-参数将返回索引。
byte
价值。
ClassCastException
-如果指定索引处的参数不是一个
Byte
NullPointerException
-如果指定索引处的参数
null
ArrayIndexOutOfBoundsException
-如果
index
是负面或不低于本
ParameterBlock
对象的当前大小
public char getCharParameter(int index)
null
或不
Character
抛异常。
index
-参数将返回索引。
char
价值。
ClassCastException
-如果指定索引处的参数不是一个
Character
NullPointerException
-如果指定索引处的参数
null
ArrayIndexOutOfBoundsException
-如果
index
是负面或不低于本
ParameterBlock
对象的当前大小
public short getShortParameter(int index)
null
或不
Short
抛异常。
index
-参数将返回索引。
short
价值。
ClassCastException
-如果指定索引处的参数不是一个
Short
NullPointerException
-如果指定索引处的参数
null
ArrayIndexOutOfBoundsException
-如果
index
是负面或不低于本
ParameterBlock
对象的当前大小
public int getIntParameter(int index)
null
或不
Integer
扔返回参数的简便方法。
index
-参数将返回索引。
int
价值。
ClassCastException
-如果指定索引处的参数不是一个
Integer
NullPointerException
-如果指定索引处的参数
null
ArrayIndexOutOfBoundsException
-如果
index
是负面或不低于本
ParameterBlock
对象的当前大小
public long getLongParameter(int index)
null
或不
Long
抛异常。
index
-参数将返回索引。
long
价值。
ClassCastException
-如果指定索引处的参数不是一个
Long
NullPointerException
-如果指定索引处的参数
null
ArrayIndexOutOfBoundsException
-如果
index
是负面或不低于本
ParameterBlock
对象的当前大小
public float getFloatParameter(int index)
null
或不
Float
抛异常。
index
-参数将返回索引。
float
价值。
ClassCastException
-如果指定索引处的参数不是一个
Float
NullPointerException
-如果指定索引处的参数
null
ArrayIndexOutOfBoundsException
-如果
index
是负面或不低于本
ParameterBlock
对象的当前大小
public double getDoubleParameter(int index)
null
或不
Double
抛异常。
index
-参数将返回索引。
double
价值。
ClassCastException
-如果指定索引处的参数不是一个
Double
NullPointerException
-如果指定索引处的参数
null
ArrayIndexOutOfBoundsException
-如果
index
是负面或不低于本
ParameterBlock
对象的当前大小
public 类[] getParamClasses()
类
对象数组。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.