SHARE
TWEET

Untitled

advictoriam Feb 5th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.awt.Rectangle;
  2.  
  3. public class RectangleDoubler implements Doubler
  4. {
  5.    RectangleDoubler(){}
  6.    
  7.    public Object makeDouble(Object obj)
  8.    {
  9.       int x = (int)((Rectangle)(obj)).getX();
  10.       int y = (int)((Rectangle)(obj)).getY();
  11.       int height = (int)((Rectangle)(obj)).getHeight();
  12.       int width = (int)((Rectangle)(obj)).getWidth();
  13.       return new Rectangle(x, y, width*2, height*2);  
  14.    }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top