Class Rotation

  • All Implemented Interfaces:
    java.io.Serializable

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

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Compares this object for equality with an other object.
      double getFactor()
      Returns the rotation factor, which is -1.0 for CLOCKWISE and 1.0 for ANTICLOCKWISE.
      int hashCode()
      Returns a hash code value for the object.
      private java.lang.Object readResolve()
      Ensures that serialization returns the unique instances.
      java.lang.String toString()
      Returns a string representing the object.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 for CLOCKWISE and 1.0 for ANTICLOCKWISE).
    • Constructor Detail

      • Rotation

        private Rotation​(java.lang.String name,
                         double factor)
        Private constructor.
        Parameters:
        name - the name.
        factor - the rotation factor.
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representing the object.
        Overrides:
        toString in class java.lang.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​(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:
        equals in class java.lang.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 java.lang.Object
        Returns:
        the hashcode
      • readResolve

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