public final class TransformAttribute extends Object implements Serializable
TransformAttribute类为
TransformAttribute提供了一个不可变的包装器,以便作为属性使用是安全的。
| Modifier and Type | Field and Description |
|---|---|
static TransformAttribute |
IDENTITY
A
TransformAttribute表示身份转换。
|
| Constructor and Description |
|---|
TransformAttribute(AffineTransform transform)
包装指定的变换。
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object rhs)
返回
true如果RHS是
TransformAttribute ,其变换等于该
TransformAttribute的变换。
|
AffineTransform |
getTransform()
返回包装转换的副本。
|
int |
hashCode()
返回对象的哈希码值。
|
boolean |
isIdentity()
返回
true如果包装转换是一个恒等变换。
|
public static final TransformAttribute IDENTITY
TransformAttribute表示身份转换。
public TransformAttribute(AffineTransform transform)
transform - 要包装的指定的AffineTransform ,或null。
public AffineTransform getTransform()
AffineTransform是这个
TransformAttribute的包装转换的
TransformAttribute 。
public boolean isIdentity()
true如果包装转换是一个恒等变换。
true如果包装的变换是一个身份转换;
false否则。
public int hashCode()
Object复制
HashMap提供的那样 。
hashCode的总合同是:
hashCode方法必须始终返回相同的整数,前提是修改了对象中equals比较中的信息。 该整数不需要从一个应用程序的执行到相同应用程序的另一个执行保持一致。 equals(Object)方法两个对象相等,则在两个对象中的每个对象上调用hashCode方法必须产生相同的整数结果。 Object.equals(java.lang.Object)方法不相等,那么在两个对象中的每个对象上调用hashCode方法必须产生不同的整数结果。 但是,程序员应该意识到,为不等对象生成不同的整数结果可能会提高哈希表的性能。 尽可能合理实用,由类别Object定义的hashCode方法确实为不同对象返回不同的整数。 (这通常通过将对象的内部地址转换为整数来实现,但Java的编程语言不需要此实现技术。)
hashCode在类别
Object
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
public boolean equals(Object rhs)
true如果RHS是
TransformAttribute ,其变换等于该
TransformAttribute的变换。
equals在类别
Object
rhs - 要比较的对象
true如果参数是
TransformAttribute ,其变换等于此
TransformAttribute的变换。
Object.hashCode() , HashMap
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.