Class Dimension2DImpl

    • Field Detail

      • width

        public double width
        Width
      • height

        public double height
        Height
    • Constructor Detail

      • Dimension2DImpl

        public Dimension2DImpl()
        Constructor 0/0
      • Dimension2DImpl

        public Dimension2DImpl​(Dimension dim)
        Constructor 0/0
        Parameters:
        dim - dimension
      • Dimension2DImpl

        public Dimension2DImpl​(double Width,
                               double Height)
        Constructor 0/0
        Parameters:
        Width - width
        Height - height
    • Method Detail

      • setSize

        public void setSize​(double Width,
                            double Height)
        Set Size
        Specified by:
        setSize in class Dimension2D
        Parameters:
        Width - width
        Height - height
      • setSize

        public void setSize​(Dimension dim)
        Set Size
        Parameters:
        dim - dimension
      • addBelow

        public void addBelow​(double dWidth,
                             double dHeight)
        Add Size below existing
        Parameters:
        dWidth - width to increase if below
        dHeight - height to add
      • addBelow

        public void addBelow​(Dimension dim)
        Add Size below existing
        Parameters:
        dim - add dimension
      • roundUp

        public void roundUp()
        Round to next Int value
      • getWidth

        public double getWidth()
        Get Width
        Specified by:
        getWidth in class Dimension2D
        Returns:
        width
      • getHeight

        public double getHeight()
        Get Height
        Specified by:
        getHeight in class Dimension2D
        Returns:
        height
      • hashCode

        public int hashCode()
        Hash Code
        Overrides:
        hashCode in class Object
        Returns:
        hash code
      • equals

        public boolean equals​(Object obj)
        Equals
        Overrides:
        equals in class Object
        Parameters:
        obj - object
        Returns:
        true if w/h is same
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class Object
        Returns:
        info