// 
// Decompiled by Procyon v0.6.0
// 

package it.unimi.dsi.fastutil.shorts;

import it.unimi.dsi.fastutil.HashCommon;
import java.util.Objects;
import it.unimi.dsi.fastutil.Pair;
import java.io.Serializable;

public class ShortDoubleImmutablePair implements ShortDoublePair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected final short left;
    protected final double right;
    
    public ShortDoubleImmutablePair(final short left, final double right) {
        this.left = left;
        this.right = right;
    }
    
    public static ShortDoubleImmutablePair of(final short left, final double right) {
        return new ShortDoubleImmutablePair(left, right);
    }
    
    @Override
    public short leftShort() {
        return this.left;
    }
    
    @Override
    public double rightDouble() {
        return this.right;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof ShortDoublePair) {
            return this.left == ((ShortDoublePair)other).leftShort() && this.right == ((ShortDoublePair)other).rightDouble();
        }
        return other instanceof Pair && Objects.equals(this.left, ((Pair)other).left()) && Objects.equals(this.right, ((Pair)other).right());
    }
    
    @Override
    public int hashCode() {
        return this.left * 19 + HashCommon.double2int(this.right);
    }
    
    @Override
    public String toString() {
        return "<" + this.leftShort() + "," + this.rightDouble() + ">";
    }
}
