mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add hashCode and equals for ImageInfo index value
This commit is contained in:
@@ -20,7 +20,10 @@ import com.intellij.util.io.UnsyncByteArrayInputStream;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
@@ -243,6 +246,28 @@ public class ImageInfoReader {
|
||||
this.height = height;
|
||||
this.bpp = bpp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof Info)) return false;
|
||||
|
||||
Info info = (Info)o;
|
||||
|
||||
if (width != info.width) return false;
|
||||
if (height != info.height) return false;
|
||||
if (bpp != info.bpp) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = width;
|
||||
result = 31 * result + height;
|
||||
result = 31 * result + bpp;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user