forked from PhilJay/MPAndroidChart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFSize.java
More file actions
47 lines (39 loc) · 1.04 KB
/
FSize.java
File metadata and controls
47 lines (39 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.github.mikephil.charting.utils;
/**
* Immutable class for describing width and height dimensions in some arbitrary
* unit.
* Replacement for the android.Util.SizeF which is available only on API >= 21.
*/
public final class FSize {
public final float width;
public final float height;
public FSize(final float width, final float height) {
this.width = width;
this.height = height;
}
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (this == obj) {
return true;
}
if (obj instanceof FSize) {
final FSize other = (FSize) obj;
return width == other.width && height == other.height;
}
return false;
}
@Override
public String toString() {
return width + "x" + height;
}
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
return Float.floatToIntBits(width) ^ Float.floatToIntBits(height);
}
}