Package org.jfree.util
Class Rotation
- java.lang.Object
-
- org.jfree.util.Rotation
-
- All Implemented Interfaces:
java.io.Serializable
public final class Rotation extends java.lang.Object implements java.io.SerializableRepresents a direction of rotation (CLOCKWISEorANTICLOCKWISE).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static RotationANTICLOCKWISEThe reverse order renders the primary dataset first.static RotationCLOCKWISEClockwise.private doublefactorThe factor (-1.0 forCLOCKWISEand 1.0 forANTICLOCKWISE).private java.lang.StringnameThe name.private static longserialVersionUIDFor serialization.
-
Constructor Summary
Constructors Modifier Constructor Description privateRotation(java.lang.String name, double factor)Private constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Compares this object for equality with an other object.doublegetFactor()Returns the rotation factor, which is -1.0 forCLOCKWISEand 1.0 forANTICLOCKWISE.inthashCode()Returns a hash code value for the object.private java.lang.ObjectreadResolve()Ensures that serialization returns the unique instances.java.lang.StringtoString()Returns a string representing the object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
CLOCKWISE
public static final Rotation CLOCKWISE
Clockwise.
-
ANTICLOCKWISE
public static final Rotation ANTICLOCKWISE
The reverse order renders the primary dataset first.
-
name
private java.lang.String name
The name.
-
factor
private double factor
The factor (-1.0 forCLOCKWISEand 1.0 forANTICLOCKWISE).
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representing the object.- Overrides:
toStringin classjava.lang.Object- Returns:
- the string (never
null).
-
getFactor
public double getFactor()
Returns the rotation factor, which is -1.0 forCLOCKWISEand 1.0 forANTICLOCKWISE.- Returns:
- the rotation factor.
-
equals
public boolean equals(java.lang.Object o)
Compares this object for equality with an other object. Implementation note: This simply compares the factor instead of the name.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the other object- Returns:
- true or false
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode
-
readResolve
private java.lang.Object readResolve() throws java.io.ObjectStreamExceptionEnsures that serialization returns the unique instances.- Returns:
- the object.
- Throws:
java.io.ObjectStreamException- if there is a problem.
-
-