diff options
author | Michael Bien <[email protected]> | 2009-10-19 19:26:15 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2009-10-19 19:26:15 +0200 |
commit | cb7fa23952a10795215eda50848530828b92895e (patch) | |
tree | e9e34a7cf55505fe3a381e474ddeb9d224caf545 /src/com/mbien/opencl/CLDevice.java | |
parent | 9abfd00399e4ca5c351df9cdf25cd85c960b3d44 (diff) |
initial import of CLBuffer and CLKernel.
added hashCode(), equals() and toString() methods.
updated JUnit test to test new classes.
Diffstat (limited to 'src/com/mbien/opencl/CLDevice.java')
-rw-r--r-- | src/com/mbien/opencl/CLDevice.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java index d9f643ce..dcc9ee97 100644 --- a/src/com/mbien/opencl/CLDevice.java +++ b/src/com/mbien/opencl/CLDevice.java @@ -191,9 +191,17 @@ public final class CLDevice { @Override public boolean equals(Object obj) { - if(obj != null && obj instanceof CLDevice) - return ((CLDevice)obj).deviceID == deviceID; - return false; + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CLDevice other = (CLDevice) obj; + if (this.deviceID != other.deviceID) { + return false; + } + return true; } @Override |