use of org.sbolstandard.core2.Range in project libSBOLj by SynBioDex.
the class SequenceAnnotation method addRange.
/**
* Creates a range with the given arguments and then adds it to this sequence annotation's
* list of locations.
* <p>
* This method first creates a compliant URI for the range to be created.
* It starts with this sequence annotation's persistent identity URI,
* followed by the given display ID, and ends an empty string for version.
*
* @param displayId the display ID for the range to be created
* @param start the start index for the range to be created
* @param end the end index for the range to be created
* @param orientation the orientation type
* @return the created range
* @throws SBOLValidationException if any of the following SBOL validation rules was violated:
* 10201, 10202, 10204, 10206, 11102, 11103, 11104.
*/
public Range addRange(String displayId, int start, int end, OrientationType orientation) throws SBOLValidationException {
URI identity = createCompliantURI(this.getPersistentIdentity().toString(), displayId, this.getVersion());
Range range = new Range(identity, start, end);
range.setPersistentIdentity(createCompliantURI(this.getPersistentIdentity().toString(), displayId, ""));
range.setDisplayId(displayId);
range.setVersion(this.getVersion());
range.setOrientation(orientation);
addLocation(range);
return range;
}
Aggregations