FileDocCategorySizeDatePackage
ResourcesKey.javaAPI DocAndroid 5.1 API2991Thu Mar 12 22:22:10 GMT 2015android.content.res

ResourcesKey

public final class ResourcesKey extends Object
hide

Fields Summary
final String
mResDir
final float
mScale
private final int
mHash
private final android.os.IBinder
mToken
public final int
mDisplayId
public final Configuration
mOverrideConfiguration
Constructors Summary
public ResourcesKey(String resDir, int displayId, Configuration overrideConfiguration, float scale, android.os.IBinder token)


          
                
        mResDir = resDir;
        mDisplayId = displayId;
        if (overrideConfiguration != null) {
            mOverrideConfiguration.setTo(overrideConfiguration);
        }
        mScale = scale;
        mToken = token;

        int hash = 17;
        hash = 31 * hash + (mResDir == null ? 0 : mResDir.hashCode());
        hash = 31 * hash + mDisplayId;
        hash = 31 * hash + (mOverrideConfiguration != null
                ? mOverrideConfiguration.hashCode() : 0);
        hash = 31 * hash + Float.floatToIntBits(mScale);
        mHash = hash;
    
Methods Summary
public booleanequals(java.lang.Object obj)

        if (!(obj instanceof ResourcesKey)) {
            return false;
        }
        ResourcesKey peer = (ResourcesKey) obj;

        if ((mResDir == null) && (peer.mResDir != null)) {
            return false;
        }
        if ((mResDir != null) && (peer.mResDir == null)) {
            return false;
        }
        if ((mResDir != null) && (peer.mResDir != null)) {
            if (!mResDir.equals(peer.mResDir)) {
                return false;
            }
        }
        if (mDisplayId != peer.mDisplayId) {
            return false;
        }
        if (mOverrideConfiguration != peer.mOverrideConfiguration) {
            if (mOverrideConfiguration == null || peer.mOverrideConfiguration == null) {
                return false;
            }
            if (!mOverrideConfiguration.equals(peer.mOverrideConfiguration)) {
                return false;
            }
        }
        if (mScale != peer.mScale) {
            return false;
        }
        return true;
    
public booleanhasOverrideConfiguration()

        return !Configuration.EMPTY.equals(mOverrideConfiguration);
    
public inthashCode()

        return mHash;
    
public java.lang.StringtoString()

        return Integer.toHexString(mHash);