package  org.ts.ddcs.datatemplate;


/**
 * 数据模板抽象类
 *
 * @author dylan
 */
public abstract class DataTemplate {
    protected TestState state = TestState.LOOK;
    protected int length = 0;
    protected int featureWeight = 0;
    protected String templateName;
    protected byte[] featureKey;
    protected byte[] featureIndex;
    protected String agreement;

    public void setFeature(byte[] featureKey, byte[] featureIndex) {
        if (null != featureKey && null != featureIndex) {
            this.featureKey = new byte[featureKey.length];
            System.arraycopy(featureKey, 0, this.featureKey, 0, featureKey.length);
            this.featureIndex = new byte[featureIndex.length];
            System.arraycopy(featureIndex, 0, this.featureIndex, 0, featureIndex.length);
        }
    }

    public abstract boolean checkFeature(byte[] check, int pos, int length);
}
