Class GSize

java.lang.Object
com.iizix.prop.GSize
All Implemented Interfaces:
Serializable, Cloneable

public class GSize extends Object implements Cloneable, Serializable
Simple immutable size class for multiple use accepting negative width and height.
Author:
Christopher Mindus
See Also:
  • Field Details Link icon

    • EMPTY_ARRAY Link icon

      public static final GSize[] EMPTY_ARRAY
      Empty array of Rect's.
    • ZERO Link icon

      public static final GSize ZERO
      Zero size.
  • Constructor Details Link icon

    • GSize Link icon

      public GSize()
      Constructor for cx=cy=0.
    • GSize Link icon

      public GSize(String string)
      Constructor from a String formatted as "cx,cy".
      Parameters:
      string - The string.
      Throws:
      IllegalArgumentException - If the string is not well formatted.
    • GSize Link icon

      public GSize(ReadTransaction trans)
      Constructor from a Transaction.
      Parameters:
      trans - The transaction.
    • GSize Link icon

      public GSize(int cx, int cy)
      Constructor.
      Parameters:
      cx - Width.
      cy - Height.
  • Method Details Link icon

    • equals Link icon

      public boolean equals(Object o)
      Checks if two sizes are equal. Supports comparison with Size.
      Overrides:
      equals in class Object
      Parameters:
      o - Another size GSize, but Size and DSize are also supported.
      Returns:
      true if equal, false otherwise.
    • clone Link icon

      public GSize clone()
      Clones this instance.
      Overrides:
      clone in class Object
      Returns:
      As GSize is immutable, cloning will return "this".
    • hashCode Link icon

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Returns the hash code.
    • toString Link icon

      public String toString()
      Formats to a string as "cx,cy".
      Overrides:
      toString in class Object
    • append Link icon

      public void append(SendTransaction trans)
      Appends the size to a transaction.
      Parameters:
      trans - Transaction to append to.
    • getCX Link icon

      public int getCX()
      Gets the width.
      Returns:
      The width.
    • getCY Link icon

      public int getCY()
      Gets the height.
      Returns:
      The height.
    • getWidth Link icon

      public int getWidth()
      Gets the width.
      Returns:
      The width.
    • getHeight Link icon

      public int getHeight()
      Gets the height.
      Returns:
      The height.