de.charite.compbio.jannovar.reference.Strand Maven / Gradle / Ivy
package de.charite.compbio.jannovar.reference;
/**
* Representation for forward/backward strand.
*
* @author Manuel Holtgrewe
*/
public enum Strand {
/**
* forward strand
*/
FWD,
/**
* reverse strand
*/
REV;
/**
* @return true
if this is the forward strand
*/
public boolean isForward() {
return (this == FWD);
}
/**
* @return true
if this is the reverse strand
*/
public boolean isReverse() {
return (this == REV);
}
@Override
public String toString() {
return (this == FWD) ? "+" : "-";
}
/**
* @return {@link #REV} if the char is '-'
, otherwise returns {@link #FWD}.
*/
public Strand valueOf(char strand) {
return (strand == '-') ? REV : FWD;
}
}