/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.collection.mockup;

import java.io.Serializable;
import net.ranides.assira.generic.HashUtils;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class TPoint implements Serializable {
    
    private static final long serialVersionUID = 1L;

    public final int x;
    public final int y;
    public final int z;

    public TPoint(int x, int y, int z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    @Override
    public int hashCode() {
        return HashUtils.hashValues(3, 37, x, y);
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object == null) {
            return false;
        }
        if (getClass() != object.getClass()) {
            return false;
        }
        TPoint that = (TPoint)object;
        return 
            this.x == that.x &&
            this.y == that.y &&
            this.z == that.z;
    }
    
    @Override
    public String toString() {
        return "(" + x + ":" + y + ":" + z + ")";
    }
    
}
