public class Camera.Size
extends Object
java.lang.Object | |
↳ | android.hardware.Camera.Size |
该类在API级别21中已被弃用。
我们建议将新的android.hardware.camera2
API用于新应用程序。
图像大小(宽度和高度尺寸)。
Fields |
|
---|---|
public int |
height 图片的高度 |
public int |
width 图片的宽度 |
Public constructors |
|
---|---|
Camera.Size(int w, int h) 设置图片的尺寸。 |
Public methods |
|
---|---|
boolean |
equals(Object obj) 将 |
int |
hashCode() 返回对象的哈希码值。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
Camera.Size (int w, int h)
设置图片的尺寸。
Parameters | |
---|---|
w |
int : the photo width (pixels) |
h |
int : the photo height (pixels) |
boolean equals (Object obj)
将 obj
与此大小比较。
Parameters | |
---|---|
obj |
Object : the object to compare this size with. |
Returns | |
---|---|
boolean |
true if the width and height of obj is the same as those of this size. false otherwise. |
int hashCode ()
返回对象的哈希码值。 为了散列表的好处而支持该方法,例如由HashMap
提供的HashMap
。
hashCode
的总合同是:
hashCode
method must consistently return the same integer, provided no information used in equals
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. equals(Object)
method, then calling the hashCode
method on each of the two objects must produce the same integer result. equals(java.lang.Object)
method, then calling the hashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables. 尽可能合理实用,类Object
定义的hashCode方法确实为不同的对象返回不同的整数。 (这通常通过将对象的内部地址转换为整数来实现,但Java TM编程语言不需要此实现技术。)
Returns | |
---|---|
int |
a hash code value for this object. |