Back to project page SIC.
The source code is released under:
MIT License
If you think the Android project SIC listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sun.imageloader.core; //from w ww .j av a2 s . com public class ImageKey { final int _imageKey; final String _imageName; private int _sampleSize; private boolean _isValid = true; /** * {@link ImageKey} used to uniquely identify an image according to the URL provided. * * @param imageKey_ * @param sampleSize_ */ public ImageKey(int imageKey_, int sampleSize_){ _sampleSize = sampleSize_; _imageKey = imageKey_; if((_sampleSize <= 0 || _imageKey <= 0) ){ _isValid = false; } _imageName = new StringBuilder().append(imageKey_).append("|") .append(_sampleSize).toString(); } public boolean hasValidKey(){ return _isValid; } public int key(){ return _imageKey; } public String getImageFilename(){ return _imageName; } @Override public String toString() { return "Image key: " + _imageKey + ", with sample size: " + _sampleSize; } public int getSampleSize(){ return _sampleSize; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + _imageKey; result = prime * result + _sampleSize; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ImageKey other = (ImageKey) obj; if (_imageKey != other._imageKey) return false; if (_sampleSize != other._sampleSize) return false; return true; } }