Search in sources :

Example 6 with GenericLocation

use of org.sbolstandard.core2.GenericLocation in project libSBOLj by SynBioDex.

the class SequenceAnnotation method addGenericLocation.

/**
 * Creates a generic location 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 generic location 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 generic location to be created
 * @param orientation the orientation type
 * @return the created generic location instance
 * @throws SBOLValidationException if any of the following SBOL validation rules was violated:
 * 10201, 10202, 10204, 10206.
 */
public GenericLocation addGenericLocation(String displayId, OrientationType orientation) throws SBOLValidationException {
    URI identity = createCompliantURI(this.getPersistentIdentity().toString(), displayId, this.getVersion());
    GenericLocation genericLocation = new GenericLocation(identity);
    genericLocation.setPersistentIdentity(createCompliantURI(this.getPersistentIdentity().toString(), displayId, ""));
    genericLocation.setDisplayId(displayId);
    genericLocation.setVersion(this.getVersion());
    genericLocation.setOrientation(orientation);
    addLocation(genericLocation);
    return genericLocation;
}
Also used : URI(java.net.URI) URIcompliance.createCompliantURI(org.sbolstandard.core2.URIcompliance.createCompliantURI)

Aggregations

URI (java.net.URI)5 URIcompliance.createCompliantURI (org.sbolstandard.core2.URIcompliance.createCompliantURI)5 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 QName (javax.xml.namespace.QName)2 Literal (org.sbolstandard.core.datatree.Literal)2 StringifyQName (org.sbolstandard.core.io.json.StringifyQName)2 Test (org.junit.Test)1 NestedDocument (org.sbolstandard.core.datatree.NestedDocument)1 Cut (org.sbolstandard.core2.Cut)1 GenericLocation (org.sbolstandard.core2.GenericLocation)1 Location (org.sbolstandard.core2.Location)1 Range (org.sbolstandard.core2.Range)1