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

java.lang.Object
  extended by fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement.EdgeEndPoint
Enclosing class:
RNATemplate.RNATemplateElement

public class RNATemplate.RNATemplateElement.EdgeEndPoint
extends Object

An edge endpoint is where an edge can connect.


Field Summary
private  RNATemplate.RNATemplateElement.EdgeEndPoint otherEndPoint
           
 
Constructor Summary
private RNATemplate.RNATemplateElement.EdgeEndPoint()
           
 
Method Summary
 void connectTo(RNATemplate.RNATemplateElement.EdgeEndPoint otherEndPoint)
          Create an edge between two edge endpoints.
 void disconnect()
          Disconnect this endpoint from the other, ie.
 RNATemplate.RNATemplateElement getElement()
          Returns the endpoint on which this edge endpoint is.
 RNATemplate.RNATemplateElement.EdgeEndPoint getNextEndPoint()
          Get the next endpoint.
 RNATemplate.RNATemplateElement getOtherElement()
          Returns the endpoint at the other endpoint of the edge.
 RNATemplate.RNATemplateElement.EdgeEndPoint getOtherEndPoint()
          Returns the other endpoint of the edge.
 RNATemplate.EdgeEndPointPosition getPosition()
          Get the position on the endpoint where this endpoint is.
 RNATemplate.RNATemplateElement.EdgeEndPoint getPreviousEndPoint()
          Same as getNextEndPoint(), but with the previous endpoint.
 boolean isConnected()
          Tells whether this endpoint is connected with an edge to an other endpoint.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

otherEndPoint

private RNATemplate.RNATemplateElement.EdgeEndPoint otherEndPoint
Constructor Detail

RNATemplate.RNATemplateElement.EdgeEndPoint

private RNATemplate.RNATemplateElement.EdgeEndPoint()
Method Detail

getNextEndPoint

public RNATemplate.RNATemplateElement.EdgeEndPoint getNextEndPoint()
Get the next endpoint. If this endpoint is an "in" endpoint, returns the corresponding "out" endpoint. If this endpoint is an "out" endpoint, return the connected endpoint if there is one, otherwise return null.


getPreviousEndPoint

public RNATemplate.RNATemplateElement.EdgeEndPoint getPreviousEndPoint()
Same as getNextEndPoint(), but with the previous endpoint.


getPosition

public RNATemplate.EdgeEndPointPosition getPosition()
Get the position on the endpoint where this endpoint is.


getElement

public RNATemplate.RNATemplateElement getElement()
Returns the endpoint on which this edge endpoint is.


getOtherEndPoint

public RNATemplate.RNATemplateElement.EdgeEndPoint getOtherEndPoint()
Returns the other endpoint of the edge. Will be null if there is no edge connecter to this endpoint.


getOtherElement

public RNATemplate.RNATemplateElement getOtherElement()
Returns the endpoint at the other endpoint of the edge. Will be null if there is no edge connecter to this endpoint.


disconnect

public void disconnect()
Disconnect this endpoint from the other, ie. delete the edge between them. Note that this will modify both endpoints, and that x.disconnect() is equivalent to x.getOtherEndPoint().disconnect(). If this endpoint is not connected, does nothing.


isConnected

public boolean isConnected()
Tells whether this endpoint is connected with an edge to an other endpoint.


connectTo

public void connectTo(RNATemplate.RNATemplateElement.EdgeEndPoint otherEndPoint)
               throws fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected,
                      fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate
Create an edge between two edge endpoints. This is a symmetric operation and it will modify both endpoints. It means x.connectTo(y) is equivalent to y.connectTo(x). The edge endpoint must be free (ie. not yet connected). Also, elements connected together must belong to the same template.

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

toString

public String toString()
Overrides:
toString in class Object