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

net.maizegenetics.dna.snp.TranslateIndexRange Maven / Gradle / Ivy

Go to download

TASSEL is a software package to evaluate traits associations, evolutionary patterns, and linkage disequilibrium.

The newest version!
/*
 *  TranslateIndexRange
 * 
 *  Created on Dec 14, 2016
 */
package net.maizegenetics.dna.snp;

/**
 *
 * @author Terry Casstevens
 */
public class TranslateIndexRange extends TranslateIndex {

    private final int myRangeStart;
    private final int myRangeEnd;

    /**
     * Index Range Translation
     *
     * @param start start index (inclusive)
     * @param end end index (inclusive)
     */
    TranslateIndexRange(int start, int end) {
        super(end - start + 1, true);
        myRangeStart = start;
        myRangeEnd = end;
    }

    @Override
    public int translate(int index) {
        return index + myRangeStart;
    }

    @Override
    public int reverseTranslateIndex(int index) {
        return index - myRangeStart;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy