FieldBasedAccessorGenerator.java

package org.microspace.specific;

import org.microspace.space.AccessorGenerator;
import org.microspace.table.column.Accessor;

/**
 * An accessor generator based upon fields.
 * @author Gaspar Sinai - {@literal gaspar.sinai@microspace.org}
 * @version 2016-06-26
 */
public class FieldBasedAccessorGenerator implements AccessorGenerator {
	private int indexSize;
	
	public FieldBasedAccessorGenerator () {
		this.indexSize = Integer.MAX_VALUE;
	}
	
	public FieldBasedAccessorGenerator (int indexSize) {
		this.indexSize = indexSize;
	}
	
	public <T> Accessor<T> newAccessor (Class<T> clazz) {
		return new FieldBasedAccessor<T> (clazz, indexSize);
	}	
}