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

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

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

import com.xxdb.io.ExtendedDataInput;

import java.io.IOException;
import java.time.LocalTime;
import java.util.List;

/**
 * 
 * Corresponds to DolphinDB nanotime matrix.
 *
 */

public class BasicNanoTimeMatrix extends BasicLongMatrix{
	public BasicNanoTimeMatrix(int rows, int columns){
		super(rows, columns);
	}

	public BasicNanoTimeMatrix(int rows, int columns, List listOfArrays) throws Exception {
		super(rows,columns, listOfArrays);
	}

	public BasicNanoTimeMatrix(ExtendedDataInput in) throws IOException {
		super(in);
	}

	public void setNanoTime(int row, int column, LocalTime value){
		setLong(row, column, Utils.countNanoseconds(value));
	}
	
	public LocalTime getNanoTime(int row, int column){
		return Utils.parseNanoTime(getLong(row, column));
	}

	@Override
	public Scalar get(int row, int column) {
		return new BasicNanoTime(getLong(row, column));
	}

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

	@Override
	public DATA_TYPE getDataType() {
		return DATA_TYPE.DT_NANOTIME;
	}
	
	@Override
	public Class getElementClass(){
		return BasicNanoTime.class;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy