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

gu.sql2java.UnnameRow Maven / Gradle / Ivy

The newest version!
package gu.sql2java;

import java.util.Arrays;


public class UnnameRow extends BaseRow {

	private final Object[] values;
	private String initializedHex;
	private String modifiedHex;
	public UnnameRow(RowMetaData metaData) {
		super(metaData);
		this.values = new Object[metaData.defaultColumnIdList.length];
		byte[] bytes = new byte[(metaData.columnCount+Byte.SIZE-1)/Byte.SIZE];
		Arrays.fill(bytes, (byte)0xff);
		initializedHex=ArraySupport.toHex(bytes);
		Arrays.fill(bytes, (byte)0);
		modifiedHex=ArraySupport.toHex(bytes);
	}

	@Override
	public boolean isNew() {
		return false;
	}
	
	@Override
	public void setNew(boolean isNew) {

	}
	
	@Override
	public String getInitialized() {
		return initializedHex;
	}
	
	@Override
	public void setInitialized(String initialized) {
	}
	@Override
	public String getModified() {
		return modifiedHex;
	}
	@Override
	public void setModified(String modified) {
	}
	@Override
	public void resetModified() {
	}
	@Override
	public void resetModified(int columnID) {
	}

	@Override
	public void modified(int columnID) {
	}

	@Override
	public final boolean isInitialized(int columnID) {
		return columnID>=0 && columnID < metaData.columnCount;
	}

	@Override
	public final boolean isModified(int columnID) {
		return false;
	}

	@SuppressWarnings("unchecked")
	@Override
	public final  T getValue(int columnID) {
		try{
			return (T) values[columnID];
		} catch (IndexOutOfBoundsException e) {
			return null;
		}
	}

	@Override
	public  T getOriginValue(int columnID) {
		return getValue(columnID);
	}

	@Override
	public final  void setValue(int columnID, T value) {
		try{
			values[columnID] = value;
		} catch (IndexOutOfBoundsException e) {
		}
	}

	@Override
	public Object[] asValueArray(int...columnIds){
		if(null == columnIds || columnIds.length == 0){
			return values;
		}
		return super.asValueArray(columnIds);
	}

	@Override
	public UnnameRow clone(){
		return (UnnameRow) super.clone();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy