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

package it.unimi.dsi.fastutil.doubles;

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

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