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

package it.unimi.dsi.fastutil.doubles;

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

public class DoubleDoubleImmutablePair implements DoubleDoublePair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected final double left;
    protected final double right;
    
    public DoubleDoubleImmutablePair(final double left, final double right) {
        this.left = left;
        this.right = right;
    }
    
    public static DoubleDoubleImmutablePair of(final double left, final double right) {
        return new DoubleDoubleImmutablePair(left, right);
    }
    
    @Override
    public double leftDouble() {
        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 DoubleDoublePair) {
            return this.left == ((DoubleDoublePair)other).leftDouble() && this.right == ((DoubleDoublePair)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 HashCommon.double2int(this.left) * 19 + HashCommon.double2int(this.right);
    }
    
    @Override
    public String toString() {
        return "<" + this.leftDouble() + "," + this.rightDouble() + ">";
    }
}
