// 
// 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 ShortDoubleMutablePair implements ShortDoublePair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected short left;
    protected double right;
    
    public ShortDoubleMutablePair(final short left, final double right) {
        this.left = left;
        this.right = right;
    }
    
    public static ShortDoubleMutablePair of(final short left, final double right) {
        return new ShortDoubleMutablePair(left, right);
    }
    
    @Override
    public short leftShort() {
        return this.left;
    }
    
    @Override
    public ShortDoubleMutablePair left(final short l) {
        this.left = l;
        return this;
    }
    
    @Override
    public double rightDouble() {
        return this.right;
    }
    
    @Override
    public ShortDoubleMutablePair right(final double r) {
        this.right = r;
        return this;
    }
    
    @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() + ">";
    }
}
