Created
July 31, 2012 15:22
-
-
Save levinotik/3217779 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait RectangleLike { | |
| def getX(): Double | |
| def getY(): Double | |
| def getHeight(): Double | |
| def getWidth(): Double | |
| def setLocation(x: Double, y: Double, width: Double, height: Double): Unit | |
| def translate(dx: Double, dy: Double){setLocation(getX()+dx, getY()+dy, getWidth(), getHeight)} | |
| def grow(horizontal: Double, vertical: Double){setLocation(getX(), getY(), getWidth()+horizontal, getHeight()+vertical)} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment