APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt.font

public final Class TransformAttribute

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.awt.geom.AffineTransform, java.io.IOException, .ObjectStreamException, .Serial, .Serializable

The TransformAttribute class provides an immutable wrapper for a transform so that it is safe to use as an attribute.

Field Summary

Modifier and TypeField and Description
public static final TransformAttribute
IDENTITY

A TransformAttribute representing the identity transform.

private static final long
serialVersionUID

Use serialVersionUID from JDK 1.4 for interoperability.

private AffineTransform

Constructor Summary

AccessConstructor and Description
public
TransformAttribute(AffineTransform
the specified AffineTransform to be wrapped, or null.
transform
)

Wraps the specified transform.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the argument is a TransformAttribute whose transform is equal to this TransformAttribute's transform.
equals
(Object
the object to compare to
rhs
)

Overrides java.lang.Object.equals.

Returns true if rhs is a TransformAttribute whose transform is equal to this TransformAttribute's transform.

public AffineTransform

Returns:

an AffineTransform that is a copy of the wrapped transform of this TransformAttribute.
getTransform
()

Returns a copy of the wrapped transform.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean

Returns:

true if the wrapped transform is an identity transform; false otherwise.
isIdentity
()

Returns true if the wrapped transform is an identity transform.

private Object

Returns:

a newly created object from deserialized data
readResolve
()

Resolves a TransformAttribute object after serialization.

private void
writeObject(ObjectOutputStream
the ObjectOutputStream to write
s
)

Writes default serializable fields to stream.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

IDENTITYback to summary
public static final TransformAttribute IDENTITY

A TransformAttribute representing the identity transform.

Since
1.6
serialVersionUIDback to summary
private static final long serialVersionUID

Use serialVersionUID from JDK 1.4 for interoperability.

Annotations
@Serial
transformback to summary
private AffineTransform transform

Constructor Detail

TransformAttributeback to summary
public TransformAttribute(AffineTransform transform)

Wraps the specified transform. The transform is cloned and a reference to the clone is kept. The original transform is unchanged. If null is passed as the argument, this constructor behaves as though it were the identity transform. (Note that it is preferable to use IDENTITY in this case.)

Parameters
transform:AffineTransform

the specified AffineTransform to be wrapped, or null.

Method Detail

equalsback to summary
public boolean equals(Object rhs)

Overrides java.lang.Object.equals.

Returns true if rhs is a TransformAttribute whose transform is equal to this TransformAttribute's transform.

Parameters
rhs:Object

the object to compare to

Returns:boolean

true if the argument is a TransformAttribute whose transform is equal to this TransformAttribute's transform.

Since
1.6
getTransformback to summary
public AffineTransform getTransform()

Returns a copy of the wrapped transform.

Returns:AffineTransform

an AffineTransform that is a copy of the wrapped transform of this TransformAttribute.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Since
1.6
isIdentityback to summary
public boolean isIdentity()

Returns true if the wrapped transform is an identity transform.

Returns:boolean

true if the wrapped transform is an identity transform; false otherwise.

Since
1.4
readResolveback to summary
private Object readResolve() throws ObjectStreamException

Resolves a TransformAttribute object after serialization.

Returns:Object

a newly created object from deserialized data

Annotations
@Serial
Exceptions
ObjectStreamException:
if a new object replacing this object could not be created
Since
1.6
writeObjectback to summary
private void writeObject(ObjectOutputStream s) throws IOException

Writes default serializable fields to stream.

Parameters
s:ObjectOutputStream

the ObjectOutputStream to write

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs