All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.maxifier.mxcache.hashing.BooleanArrayHashingStrategy Maven / Gradle / Ivy

Go to download

Constains all classes necessary for launching a MxCache-instrumentated application

There is a newer version: 2.6.9
Show newest version
/*
 * Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
 */
package com.maxifier.mxcache.hashing;

import java.io.ObjectStreamException;
import java.util.Arrays;

/**
 * @author Alexander Kochurov ([email protected])
 */
public final class BooleanArrayHashingStrategy implements gnu.trove.strategy.HashingStrategy {
    private static final long serialVersionUID = 100L;

    private static final BooleanArrayHashingStrategy INSTANCE = new BooleanArrayHashingStrategy();

    private BooleanArrayHashingStrategy() {}

    public static BooleanArrayHashingStrategy getInstance() {
        return INSTANCE;
    }

    @Override
    public int computeHashCode(boolean[] object) {
        return Arrays.hashCode(object);
    }

    @Override
    public boolean equals(boolean[] o1, boolean[] o2) {
        return Arrays.equals(o1, o2);
    }

    private Object readResolve() throws ObjectStreamException {
        return INSTANCE;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy