Class Rotation

java.lang.Object
org.jfree.util.Rotation
All Implemented Interfaces:
Serializable

public final class Rotation extends Object implements Serializable
Represents a direction of rotation (CLOCKWISE or ANTICLOCKWISE).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Rotation
    The reverse order renders the primary dataset first.
    static final Rotation
    Clockwise.
    private double
    The factor (-1.0 for CLOCKWISE and 1.0 for ANTICLOCKWISE).
    private String
    The name.
    private static final long
    For serialization.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Rotation(String name, double factor)
    Private constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares this object for equality with an other object.
    double
    Returns the rotation factor, which is -1.0 for CLOCKWISE and 1.0 for ANTICLOCKWISE.
    int
    Returns a hash code value for the object.
    private Object
    Ensures that serialization returns the unique instances.
    Returns a string representing the object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For serialization.
      See Also:
    • CLOCKWISE

      public static final Rotation CLOCKWISE
      Clockwise.
    • ANTICLOCKWISE

      public static final Rotation ANTICLOCKWISE
      The reverse order renders the primary dataset first.
    • name

      private String name
      The name.
    • factor

      private double factor
      The factor (-1.0 for CLOCKWISE and 1.0 for ANTICLOCKWISE).
  • Constructor Details

    • Rotation

      private Rotation(String name, double factor)
      Private constructor.
      Parameters:
      name - the name.
      factor - the rotation factor.
  • Method Details

    • toString

      public String toString()
      Returns a string representing the object.
      Overrides:
      toString in class Object
      Returns:
      the string (never null).
    • getFactor

      public double getFactor()
      Returns the rotation factor, which is -1.0 for CLOCKWISE and 1.0 for ANTICLOCKWISE.
      Returns:
      the rotation factor.
    • equals

      public boolean equals(Object o)
      Compares this object for equality with an other object. Implementation note: This simply compares the factor instead of the name.
      Overrides:
      equals in class Object
      Parameters:
      o - the other object
      Returns:
      true or false
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      the hashcode
    • readResolve

      private Object readResolve() throws ObjectStreamException
      Ensures that serialization returns the unique instances.
      Returns:
      the object.
      Throws:
      ObjectStreamException - if there is a problem.