All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xxdb.io.Double2 Maven / Gradle / Ivy

There is a newer version: 3.00.2.2
Show newest version
package com.xxdb.io;

import java.util.Objects;

public class Double2 {
	public double x;
	public double y;
	
	public Double2(double x, double y){
		this.x = x;
		this.y = y;
	}
	
	public boolean isNull(){
		return x==-Double.MAX_VALUE || y==-Double.MAX_VALUE;
	}
	
	public void setNull(){
		x = -Double.MAX_VALUE;
		y = -Double.MAX_VALUE;
	}
	
	public boolean equals(Object o){
		if (Objects.isNull(o))
			return false;
		else if (!(o instanceof Double2))
			return false;
		else
			return x== ((Double2)o).x && y== ((Double2)o).y;
	}
	
	@Override
	public int hashCode(){
		return new Double(x).hashCode() ^ new Double(y).hashCode();
	}
	
	public int hashBucket(int buckets){
		return -1;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy