import IllegalArgumentException from './IllegalArgumentException' ; /**
 * Simply encapsulates a width and height.
 */ export default class Dimension { public constructor ( private width , private height ) { if ( width < 0 || height < 0 ) { throw new IllegalArgumentException ( ) ; } } public getWidth ( ) { return this . width ; } public getHeight ( ) { return this . height ; } public equals ( other ) { if ( other instanceof Dimension ) { const d = < Dimension > other ; return this . width === d . width && this . height === d . height ; } return false ; } public hashCode ( ) { return this . width * 32713 + this . height ; } public toString ( ) { return this . width + 'x' + this . height ; } }