📄 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 + "]";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -