fr.orsay.lri.varna.models.templates
Class RNATemplate.RNATemplateElement

java.lang.Object
  extended by fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement
Direct Known Subclasses:
RNATemplate.RNATemplateHelix, RNATemplate.RNATemplateUnpairedSequence
Enclosing class:
RNATemplate

public abstract class RNATemplate.RNATemplateElement
extends Object

An endpoint of an RNA template, it can be an helix or a sequence of non-paired bases. You cannot create an object of this class directly, use RNATemplateHelix or RNATemplateUnpairedSequence instead.

Author:
Raphael Champeimont

Nested Class Summary
 class RNATemplate.RNATemplateElement.EdgeEndPoint
          An edge endpoint is where an edge can connect.
 
Field Summary
 int _id
           
private  RNATemplate.RNATemplateElement element
          This variable is just there so that "this" can be accessed by a name from the internal class EdgeEndPoint.
 
Constructor Summary
RNATemplate.RNATemplateElement()
          When the endpoint is created, it is added to the list of elements in this template.
 
Method Summary
 void connectTo(RNATemplate.EdgeEndPointPosition positionHere, RNATemplate.RNATemplateElement.EdgeEndPoint otherEndPoint)
          Connect the endpoint at position positionHere of this endpoint to the otherEndPoint.
 void connectTo(RNATemplate.EdgeEndPointPosition positionHere, RNATemplate.RNATemplateElement otherElement, RNATemplate.EdgeEndPointPosition positionOnOtherElement)
          Connect the endpoint at position positionHere of this endpoint to the endpoint of otherElement at position positionOnOtherElement.
abstract  void disconnectFromAny()
          Disconnect this endpoint from any other elements it may be connected to.
abstract  RNATemplate.RNATemplateElement.EdgeEndPoint getEndPointFromPosition(RNATemplate.EdgeEndPointPosition position)
          Get the EdgeEndPoint object corresponding to the the given position on this endpoint.
abstract  RNATemplate.RNATemplateElement.EdgeEndPoint getIn1EndPoint()
          Get the the IN endpoint in the case of a sequence and the IN1 endpoint in the case of an helix.
 String getName()
           
protected abstract  RNATemplate.RNATemplateElement.EdgeEndPoint getNextEndPoint(RNATemplate.RNATemplateElement.EdgeEndPoint endpoint)
          Provided endpoint is an endpoint of this endpoint, get the next endpoint, either on this same endpoint, or or the connected endpoint.
 RNATemplate getParentTemplate()
          Returns the template to which this endpoint belongs.
abstract  RNATemplate.EdgeEndPointPosition getPositionFromEndPoint(RNATemplate.RNATemplateElement.EdgeEndPoint endPoint)
          The inverse of getEndPointFromPosition.
protected abstract  RNATemplate.RNATemplateElement.EdgeEndPoint getPreviousEndPoint(RNATemplate.RNATemplateElement.EdgeEndPoint endpoint)
          Provided endpoint is an endpoint of this endpoint, get the previous endpoint, either on this same endpoint, or or the connected endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_id

public int _id

element

private final RNATemplate.RNATemplateElement element
This variable is just there so that "this" can be accessed by a name from the internal class EdgeEndPoint.

Constructor Detail

RNATemplate.RNATemplateElement

public RNATemplate.RNATemplateElement()
When the endpoint is created, it is added to the list of elements in this template. To remove it, call RNATemplate.removeElement().

Method Detail

getName

public String getName()

disconnectFromAny

public abstract void disconnectFromAny()
Disconnect this endpoint from any other elements it may be connected to.


getIn1EndPoint

public abstract RNATemplate.RNATemplateElement.EdgeEndPoint getIn1EndPoint()
Get the the IN endpoint in the case of a sequence and the IN1 endpoint in the case of an helix.


getParentTemplate

public RNATemplate getParentTemplate()
Returns the template to which this endpoint belongs.


getNextEndPoint

protected abstract RNATemplate.RNATemplateElement.EdgeEndPoint getNextEndPoint(RNATemplate.RNATemplateElement.EdgeEndPoint endpoint)
Provided endpoint is an endpoint of this endpoint, get the next endpoint, either on this same endpoint, or or the connected endpoint. Note that you should use the getNextEndPoint() method of the endpoint itself directly.


getPreviousEndPoint

protected abstract RNATemplate.RNATemplateElement.EdgeEndPoint getPreviousEndPoint(RNATemplate.RNATemplateElement.EdgeEndPoint endpoint)
Provided endpoint is an endpoint of this endpoint, get the previous endpoint, either on this same endpoint, or or the connected endpoint. Note that you should use the getPreviousEndPoint() method of the endpoint itself directly.


getEndPointFromPosition

public abstract RNATemplate.RNATemplateElement.EdgeEndPoint getEndPointFromPosition(RNATemplate.EdgeEndPointPosition position)
Get the EdgeEndPoint object corresponding to the the given position on this endpoint.


getPositionFromEndPoint

public abstract RNATemplate.EdgeEndPointPosition getPositionFromEndPoint(RNATemplate.RNATemplateElement.EdgeEndPoint endPoint)
The inverse of getEndPointFromPosition.


connectTo

public void connectTo(RNATemplate.EdgeEndPointPosition positionHere,
                      RNATemplate.RNATemplateElement.EdgeEndPoint otherEndPoint)
               throws fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected,
                      fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate
Connect the endpoint at position positionHere of this endpoint to the otherEndPoint.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected
fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate

connectTo

public void connectTo(RNATemplate.EdgeEndPointPosition positionHere,
                      RNATemplate.RNATemplateElement otherElement,
                      RNATemplate.EdgeEndPointPosition positionOnOtherElement)
               throws fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected,
                      fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected,
                      fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate
Connect the endpoint at position positionHere of this endpoint to the endpoint of otherElement at position positionOnOtherElement.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate
ExceptionEdgeEndpointAlreadyConnected, - ExceptionEdgeEndpointAlreadyConnected
fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected