// 
// 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 ShortLongMutablePair implements ShortLongPair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected short left;
    protected long right;
    
    public ShortLongMutablePair(final short left, final long right) {
        this.left = left;
        this.right = right;
    }
    
    public static ShortLongMutablePair of(final short left, final long right) {
        return new ShortLongMutablePair(left, right);
    }
    
    @Override
    public short leftShort() {
        return this.left;
    }
    
    @Override
    public ShortLongMutablePair left(final short l) {
        this.left = l;
        return this;
    }
    
    @Override
    public long rightLong() {
        return this.right;
    }
    
    @Override
    public ShortLongMutablePair right(final long r) {
        this.right = r;
        return this;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof ShortLongPair) {
            return this.left == ((ShortLongPair)other).leftShort() && this.right == ((ShortLongPair)other).rightLong();
        }
        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.long2int(this.right);
    }
    
    @Override
    public String toString() {
        return "<" + this.leftShort() + "," + this.rightLong() + ">";
    }
}
