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

com.xxdb.data.Void Maven / Gradle / Ivy

Go to download

The messaging and data conversion protocol between Java and DolphinDB server

There is a newer version: 1.0.27
Show newest version
package com.xxdb.data;

import java.io.IOException;
import java.time.temporal.Temporal;

import com.xxdb.io.ExtendedDataOutput;

public class Void extends AbstractScalar{

	@Override
	public boolean isNull() {
		return true;
	}

	@Override
	public void setNull() {
	}

	@Override
	public DATA_CATEGORY getDataCategory() {
		return DATA_CATEGORY.NOTHING;
	}

	@Override
	public DATA_TYPE getDataType() {
		return DATA_TYPE.DT_VOID;
	}
	
	public Number getNumber() throws Exception{
		throw new Exception("Imcompatible data type");
	}

	@Override
	public Temporal getTemporal() throws Exception {
		throw new Exception("Imcompatible data type");
	}
	
	@Override
	public String getString() {
		return "";
	}
	
	@Override
	public boolean equals(Object o){
		if(! (o instanceof Void) || o == null)
			return false;
		else
			return true;
	}
	
	@Override
	public int hashCode(){
		return 0;
	}
	
	@Override
	public int hashBucket(int buckets){
		return -1;
	}
	
	protected void writeScalarToOutputStream(ExtendedDataOutput out) throws IOException{
		out.writeBoolean(false); //explicit null value
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy