org.geneweaver.domain.Located Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gweaver-stream-io Show documentation
Show all versions of gweaver-stream-io Show documentation
The IO bundle for Geneweaver.
package org.geneweaver.domain;
import java.util.UUID;
/**
* Some entities have a location.
* @author gerrim
*
*/
public interface Located extends IdGenerator {
/**
* The start location (base pairs).
* @return
*/
Integer getStart();
/**
* The end location (base pairs).
* @return
*/
Integer getEnd();
/**
* The chromosome on which the entity is located.
* @return
*/
String getChr();
static Located at(String chr, Integer start, Integer end) {
final UUID rand = UUID.randomUUID();
return new Located() {
@Override
public String id() {
return rand.toString();
}
@Override
public Integer getStart() {
return start;
}
@Override
public Integer getEnd() {
return end;
}
@Override
public String getChr() {
return chr;
}
};
}
}