www.pudn.com > MoviesWeb.zip > Size.java


package com.blue.imageio; 
 
/** 
 *  
 * @author Lucifer 
 * 
 */ 
public class Size implements Cloneable, java.io.Serializable { 
 
	/** 
	 *  
	 */ 
	private static final long serialVersionUID = 8817855642408400854L; 
 
	private int width; 
	private int height; 
 
	public Size() { 
		width = height = 0; 
	} 
 
	public Size(int width, int height) { 
		this.width = width; 
		this.height = height; 
	} 
 
	public int getHeight() { 
		return height; 
	} 
 
	public void setHeight(int height) { 
		this.height = height; 
	} 
 
	public int getWidth() { 
		return width; 
	} 
 
	public void setWidth(int width) { 
		this.width = width; 
	} 
 
	protected Object clone() throws CloneNotSupportedException { 
		try { 
		    return super.clone(); 
		} catch (CloneNotSupportedException e) { 
		    // this shouldn't happen, since we are Cloneable 
		    throw new InternalError(); 
		} 
	} 
 
	public boolean equals(Object obj) { 
		if (obj instanceof Size) { 
			Size size = (Size) obj; 
		    return (getWidth() == size.getWidth()) && (getHeight() == size.getWidth()); 
		} 
		return super.equals(obj); 
	} 
 
	public int hashCode() { 
		long bits = java.lang.Double.doubleToLongBits(getWidth()); 
		bits ^= java.lang.Double.doubleToLongBits(getHeight()) * 31; 
		return (((int) bits) ^ ((int) (bits >> 32))); 
	} 
 
	public String toString() { 
		return getClass().getName() + "[width=" + width + ",height=" + height + "]"; 
	} 
}