public class Component extends ComponentInstance
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 component'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 component's
list of locations.
|
GenericLocation |
addGenericLocation(String displayId)
Creates a generic location with the given arguments and then adds it to this component's
list of locations.
|
GenericLocation |
addGenericLocation(String displayId,
OrientationType orientation)
Creates a generic location with the given arguments and then adds it to this component's
list of locations.
|
GenericLocation |
addGenericSourceLocation(String displayId)
Creates a generic location with the given arguments and then adds it to this components's
list of source locations.
|
GenericLocation |
addGenericSourceLocation(String displayId,
OrientationType orientation)
Creates a generic location with the given arguments and then adds it to this component's
list of source locations.
|
Range |
addRange(String displayId,
int start,
int end)
Creates a range with the given arguments and then adds it to this component'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 component's
list of locations.
|
boolean |
addRole(URI roleURI)
Adds the given role URI to this component's set of role URIs.
|
Cut |
addSourceCut(String displayId,
int at)
Creates a cut with the given arguments and then adds it to this component's
list of source locations.
|
Cut |
addSourceCut(String displayId,
int at,
OrientationType orientation)
Creates a cut with the given arguments and then adds it to this component's
list of source locations.
|
Range |
addSourceRange(String displayId,
int start,
int end)
Creates a range with the given arguments and then adds it to this component's
list of source locations.
|
Range |
addSourceRange(String displayId,
int start,
int end,
OrientationType orientation)
Creates a range with the given arguments and then adds it to this component's
list of source locations.
|
void |
clearMapsTos()
Removes all entries the list of mapsTos.
|
void |
clearRoles()
Removes all entries of this component's set of role URIs.
|
boolean |
containsRole(URI roleURI)
Checks if the given role URI is included in this component's set of role URIs.
|
MapsTo |
createMapsTo(String displayId,
RefinementType refinement,
String localId,
String remoteId)
Creates a child mapsTo for this component with the given arguments, and then adds it to its list of mapsTos.
|
MapsTo |
createMapsTo(String displayId,
RefinementType refinement,
URI local,
URI remote)
Creates a child mapsTo for this component with the given arguments,
and then adds it to its list of mapsTos.
|
boolean |
equals(Object obj) |
Location |
getLocation(String displayId)
Returns the location owned by this component
that matches the given display ID.
|
Location |
getLocation(URI locationURI)
Returns the location owned by this component
that matches the given identity URI.
|
Set<Location> |
getLocations()
Returns the set of locations referenced by this component.
|
MapsTo |
getMapsTo(String displayId)
Returns the mapsTo that matches the given display ID.
|
MapsTo |
getMapsTo(URI mapsToURI)
Returns the mapsTo that matches the given URI.
|
Set<MapsTo> |
getMapsTos()
Returns the set of mapsTos owned by this instance.
|
Set<Location> |
getPreciseLocations()
Returns the set of Range/Cut locations referenced by this component.
|
Set<Location> |
getPreciseSourceLocations()
Returns the set of Range/Cut sourceLocations referenced by this component.
|
RoleIntegrationType |
getRoleIntegration()
Returns the roleIntegration property of this object.
|
Set<URI> |
getRoles()
Returns the set of role URIs owned by this component.
|
List<Location> |
getSortedLocations()
Returns a sorted list of locations owned by this component.
|
List<Location> |
getSortedSourceLocations()
Returns a sorted list of sourceLocations owned by this component.
|
Location |
getSourceLocation(String displayId)
Returns a source location owned by this component
that matches the given display ID.
|
Location |
getSourceLocation(URI sourceLocationURI)
Returns a sourceLocation owned by this component
that matches the given identity URI.
|
Set<Location> |
getSourceLocations()
Returns the set of sourceLocations referenced by this component.
|
int |
hashCode() |
boolean |
isSetRoleIntegration()
Test if the roleIntegration property is set.
|
boolean |
removeLocation(Location location)
Removes the given location from the list of locations.
|
boolean |
removeMapsTo(MapsTo mapsTo)
Removes the given mapsTo from the list of
mapsTos.
|
boolean |
removeRole(URI roleURI)
Removes the given role URI from the set of roles.
|
boolean |
removeSourceLocation(Location sourceLocation)
Removes the given location from the list of source locations.
|
void |
setDefinition(URI definition)
Sets the definition property to the given one.
|
void |
setRoleIntegration(RoleIntegrationType roleIntegration)
Sets the roleIntegration property of this object to the given one.
|
void |
setRoles(Set<URI> roles)
Clears the existing set of roles first, and then adds the given
set of the roles to this component.
|
String |
toString() |
void |
unsetRoleIntegration()
Sets the roleIntegration property of this object to
null . |
getAccess, getDefinition, getDefinitionIdentity, getDefinitionURI, setAccess
clearMeasures, createMeasure, getMeasure, getMeasure, getMeasures, removeMeasure
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 boolean addRole(URI roleURI) throws SBOLValidationException
roleURI
- the role URI to be addedtrue
if this set did not already contain the specified role, false
otherwise.SBOLValidationException
- if RoleIntegration is not set (10709).public boolean removeRole(URI roleURI)
roleURI
- the given role URI to be removedtrue
if the matching role reference was removed successfully, false
otherwise.public void setRoles(Set<URI> roles) throws SBOLValidationException
roles
- the set of roles to be setSBOLValidationException
- if RoleIntegration is not set (10709).public Set<URI> getRoles()
public boolean containsRole(URI roleURI)
roleURI
- the role URI to be checkedtrue
if this set contains the given role URI, false
otherwise.public void clearRoles()
public boolean isSetRoleIntegration()
true
if it is not null
public RoleIntegrationType getRoleIntegration()
public void setRoleIntegration(RoleIntegrationType roleIntegration) throws SBOLValidationException
roleIntegration
- indicates how role is to be integrated with related roles.SBOLValidationException
- if there are roles on this Component (10709).public void unsetRoleIntegration() throws SBOLValidationException
null
.SBOLValidationException
- if there are roles on this Component (10709).public MapsTo createMapsTo(String displayId, RefinementType refinement, String localId, String remoteId) throws SBOLValidationException
This method creates compliant local and remote URIs first.
The compliant local URI is created with this component's persistent identity URI, followed by
the given local component's display ID, followed by this component's version.
The compliant remote URI is created following the same pattern.
It then calls createMapsTo(String, RefinementType, URI, URI)
with the given mapsTo's display ID, its refinement type,
and the created compliant local and remote components' URIs.
This method calls ComponentDefinition.createComponent(String, AccessType, String, String)
to automatically
create a local component with the given display ID of referenced local component definition,
AccessType.PUBLIC
, and an empty version string, if all of the following conditions are satisfied:
null
;SBOLDocument.isCreateDefaults()
returns true
;displayId
- the display ID of the mapsTo to be createdrefinement
- the relationship between the local and remote componentslocalId
- the display ID of the local componentremoteId
- the display ID of the remote componentSBOLValidationException
- if any of the following condition is satisfied:
ComponentDefinition.createComponent(String, AccessType, String, String)
; orcreateMapsTo(String, RefinementType, URI, URI)
.public MapsTo createMapsTo(String displayId, RefinementType refinement, URI local, URI remote) throws SBOLValidationException
This method creates a compliant URI for the mapsTo to be created. It starts with this component's persistent identity, followed by the mapsTo's display ID, and ends with this component's version.
displayId
- the display ID of the mapsTo to be createdrefinement
- the relationship between the local and remote componentslocal
- the identity URI of the local componentremote
- the identity URI of the remote componentSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10526, 10802, 10803, 10804, 10805, 10807, 10808, 10809, 10811.public boolean removeMapsTo(MapsTo mapsTo)
mapsTo
- a mapsTo to be removedtrue
if the matching mapsTo is removed successfully,
false
otherwise.public MapsTo getMapsTo(String displayId)
This method first creates a compliant URI for the mapsTo to be retrieved. It starts with this component's persistent identity, followed by the given display ID, and ends with this component's version.
displayId
- the display ID of the mapsTo to be retrievedpublic MapsTo getMapsTo(URI mapsToURI)
mapsToURI
- The URI of the mapsTo to be retrievedpublic Set<MapsTo> getMapsTos()
public void clearMapsTos()
public void setDefinition(URI definition) throws SBOLValidationException
setDefinition
in class ComponentInstance
definition
- the given definition URI to set toSBOLValidationException
- if either of the following SBOL validation rules was violated: 10604, 10605.public GenericLocation addGenericSourceLocation(String displayId) throws SBOLValidationException
This method first creates a compliant URI for the generic location to be created. It starts with this component'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 addGenericSourceLocation(String displayId, OrientationType orientation) throws SBOLValidationException
This method first creates a compliant URI for the generic location to be created. It starts with this component'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 addSourceCut(String displayId, int at) throws SBOLValidationException
This method first creates a compliant URI for the cut to be created. It starts with this component'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 addSourceCut(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 component'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 addSourceRange(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 component'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 addSourceRange(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 component'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 removeSourceLocation(Location sourceLocation)
sourceLocation
- the location to be removedtrue
if the matching location was removed successfully, false
otherwisepublic Location getSourceLocation(String displayId)
This method first creates a compliant URI. It starts with the component's persistent identity URI, followed by the given display ID, and ends with this component'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 getSourceLocation(URI sourceLocationURI)
sourceLocationURI
- the URI identity of the location to be retrievedpublic Set<Location> getSourceLocations()
public Set<Location> getPreciseSourceLocations()
public List<Location> getSortedSourceLocations()
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 component'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 component'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 component'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 component'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 component'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 component'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)
location
- the location to be removedtrue
if the matching location was removed successfully, false
otherwisepublic Location getLocation(String displayId)
This method first creates a compliant URI. It starts with the component's persistent identity URI, followed by the given display ID, and ends with this component'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 int hashCode()
hashCode
in class ComponentInstance
public boolean equals(Object obj)
equals
in class ComponentInstance
public String toString()
toString
in class ComponentInstance