public class SequenceAnnotation extends Identified implements Comparable<SequenceAnnotation>
Modifier and Type | Method and Description |
---|---|
Cut |
addCut(String displayId,
int at)
Creates a cut with the given arguments and then adds it to this sequence annotation's
list of locations.
|
Cut |
addCut(String displayId,
int at,
OrientationType orientation)
Creates a cut with the given arguments and then adds it to this sequence annotation's
list of locations.
|
GenericLocation |
addGenericLocation(String displayId)
Creates a generic location with the given arguments and then adds it to this sequence annotation's
list of locations.
|
GenericLocation |
addGenericLocation(String displayId,
OrientationType orientation)
Creates a generic location with the given arguments and then adds it to this sequence annotation's
list of locations.
|
Range |
addRange(String displayId,
int start,
int end)
Creates a range with the given arguments and then adds it to this sequence annotation's
list of locations.
|
Range |
addRange(String displayId,
int start,
int end,
OrientationType orientation)
Creates a range with the given arguments and then adds it to this sequence annotation's
list of locations.
|
boolean |
addRole(URI roleURI)
Adds the given role to this sequence annotation's set of roles.
|
void |
clearRoles()
Removes all entries of this sequence annotation's set of roles.
|
int |
compareTo(SequenceAnnotation sa) |
boolean |
containsRole(URI roleURI)
Checks if the given role is included in this sequence annotation's set of roles.
|
boolean |
equals(Object obj) |
Component |
getComponent()
Returns the component this sequence annotation refers to.
|
ComponentDefinition |
getComponentDefinition()
Returns the component definition for the component annotated by this sequence annotation.
|
URI |
getComponentIdentity()
Returns the component identity this sequence annotation refers to.
|
URI |
getComponentURI()
Returns the component that this sequence annotation refers to.
|
Location |
getLocation(String displayId)
Returns the location owned by this sequence annotation
that matches the given display ID.
|
Location |
getLocation(URI locationURI)
Returns the location owned by this sequence annotation
that matches the given identity URI.
|
Set<Location> |
getLocations()
Returns the set of locations referenced by this sequence annotation.
|
Set<Location> |
getPreciseLocations()
Returns the set of Range/Cut locations referenced by this sequence annotation.
|
Set<URI> |
getRoles()
Returns this sequence annotation's set of roles.
|
List<Location> |
getSortedLocations()
Returns a sorted list of locations owned by this sequence annotation.
|
int |
hashCode() |
boolean |
isSetComponent()
Test if the reference component is set.
|
boolean |
removeLocation(Location location)
Removes the given location from the list of locations.
|
boolean |
removeRole(URI roleURI)
Removes the given role from this sequence annotation's set of roles.
|
void |
setComponent(String displayId)
Sets this sequence annotation's reference component (its identity URI) to the one matching
the given display ID.
|
void |
setComponent(URI componentURI)
Sets the reference component's identity URI to the given URI.
|
void |
setRoles(Set<URI> roles)
Clears the existing set of roles first, and then adds the given
set of the roles to this sequence annotation.
|
String |
toString() |
void |
unsetComponent()
Sets the reference component to
null . |
addWasDerivedFrom, addWasGeneratedBy, clearAnnotations, clearWasDerivedFroms, clearWasGeneratedBys, containsWasDerivedFrom, containsWasGeneratedBy, createAnnotation, createAnnotation, createAnnotation, createAnnotation, createAnnotation, createAnnotation, getAnnotation, getAnnotations, getDescription, getDisplayId, getIdentity, getName, getPersistentIdentity, getVersion, getWasDerivedFrom, getWasDerivedFroms, getWasGeneratedBys, hasAnnotations, isSetDescription, isSetDisplayId, isSetName, isSetPersistentIdentity, isSetVersion, isSetWasDerivedFrom, removeAnnotation, removeWasDerivedFrom, removeWasGeneratedBy, setDescription, setName, setWasDerivedFrom, setWasDerivedFroms, setWasGeneratedBys, unsetDescription, unsetName, unsetWasDerivedFrom
public GenericLocation addGenericLocation(String displayId) throws SBOLValidationException
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.
displayId
- the display ID for the generic location to be createdSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206.public GenericLocation addGenericLocation(String displayId, OrientationType orientation) throws SBOLValidationException
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.
displayId
- the display ID for the generic location to be createdorientation
- the orientation typeSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206.public Cut addCut(String displayId, int at) throws SBOLValidationException
This method first creates a compliant URI for the cut 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.
displayId
- the display ID for the cut to be createdat
- the at property for the cut to be createdSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 11202.public Cut addCut(String displayId, int at, OrientationType orientation) throws SBOLValidationException
This method first creates a compliant URI for the cut 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.
displayId
- the display ID for the cut to be createdat
- the at property for the cut to be createdorientation
- the orientation typeSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 11202.public Range addRange(String displayId, int start, int end) throws SBOLValidationException
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.
displayId
- the display ID for the range to be createdstart
- the start index for the range to be createdend
- the end index for the range to be createdSBOLValidationException
- 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
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.
displayId
- the display ID for the range to be createdstart
- the start index for the range to be createdend
- the end index for the range to be createdorientation
- the orientation typeSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 11102, 11103, 11104.public boolean removeLocation(Location location) throws SBOLValidationException
location
- the location to be removedtrue
if the matching location was removed successfully, false
otherwiseSBOLValidationException
- if the following SBOL validation rule was violated: 10902public Location getLocation(String displayId)
This method first creates a compliant URI. It starts with the sequence annotation's persistent identity URI, followed by the given display ID, and ends with this sequence annotation's version. This compliant URI is used to look up for the location to be retrieved.
displayId
- the display ID of the location to be retrievedpublic Location getLocation(URI locationURI)
locationURI
- the URI identity of the location to be retrievedpublic Set<Location> getLocations()
public Set<Location> getPreciseLocations()
public List<Location> getSortedLocations()
public boolean isSetComponent()
true
if this sequence annotation refers to a component, false
otherwisepublic URI getComponentURI()
public URI getComponentIdentity()
If this sequence annotation's parent component definition is null
, this method returns null
.
Otherwise, it returns its child component which is also referenced by this sequence annotation.
public Component getComponent()
If this sequence annotation's parent component definition is null
, this method returns null
.
Otherwise, it returns its child component which is also referenced by this sequence annotation.
public void setComponent(String displayId) throws SBOLValidationException
This method first creates a compliant URI for the reference component. It starts with this sequence annotation's parent component defintion's persistent identity URI, followed by the given display ID, and ends with this sequence annotation's parent component defintion's version.
displayId
- the given display ID for the reference componentSBOLValidationException
- if either of the following conditions is satisfied:
public void setComponent(URI componentURI) throws SBOLValidationException
componentURI
- the given component identity URISBOLValidationException
- if either of the following SBOL validation rules was violated:
10522, 10905, 10909.public void unsetComponent()
null
.public boolean addRole(URI roleURI) throws SBOLValidationException
roleURI
- the role to be addedtrue
if this set did not already contain the specified role, false
otherwiseSBOLValidationException
- if component property is already setpublic boolean removeRole(URI roleURI)
roleURI
- the given role to be removedtrue
if the matching role was removed successfully, false
otherwisepublic void setRoles(Set<URI> roles) throws SBOLValidationException
roles
- the set of roles to be setSBOLValidationException
- if component property is already setpublic Set<URI> getRoles()
public boolean containsRole(URI roleURI)
roleURI
- the role to be checkedtrue
if this set contains the given role, false
otherwisepublic void clearRoles()
public int hashCode()
hashCode
in class Identified
public boolean equals(Object obj)
equals
in class Identified
public ComponentDefinition getComponentDefinition()
If the parent component definition for this sequence annotation is not set, then this method
returns null
. The component definition returned is the definition of the component that
is referenced by the "component" field of this sequence annotation.
public String toString()
toString
in class Identified
public int compareTo(SequenceAnnotation sa)
compareTo
in interface Comparable<SequenceAnnotation>