fr.orsay.lri.varna.models.treealign
Class RNANodeValue2

java.lang.Object
  extended by fr.orsay.lri.varna.models.treealign.RNANodeValue2
All Implemented Interfaces:
GraphvizDrawableNodeValue

public class RNANodeValue2
extends Object
implements GraphvizDrawableNodeValue

In this model, nodes are either: 1. a couple of paired bases, and in that case they may have children, in this case singleNode is true 2. a single base that comes from a broken base pair (broken during planarization), without children, in this case singleNode is true 3. a list of consecutive non-paired bases, without children. in this case singleNode is false Note that case 2 happens only if original sequences contained pseudoknots, otherwise this case can be ignored.

Author:
Raphael Champeimont

Field Summary
private  RNANodeValue node
          Defined if singleNode is true.
private  List<RNANodeValue> nodes
          Defined if singleNode is false;
private  boolean singleNode
          Says whether we have a single node or a list of nodes.
 
Constructor Summary
RNANodeValue2(boolean singleNode)
           
 
Method Summary
 char[] computeSequence()
          In case of multiple nodes, return the sequence of nucleotides.
 RNANodeValue getNode()
          In case of a single node, return it.
 List<RNANodeValue> getNodes()
          In case of multiple nodes, return them.
 boolean isSingleNode()
           
 void setNode(RNANodeValue node)
           
 void setNodes(List<RNANodeValue> nodes)
           
 String toGraphvizNodeName()
          Returns a string that will be displayed on the node by graphviz.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

singleNode

private boolean singleNode
Says whether we have a single node or a list of nodes.


node

private RNANodeValue node
Defined if singleNode is true.


nodes

private List<RNANodeValue> nodes
Defined if singleNode is false;

Constructor Detail

RNANodeValue2

public RNANodeValue2(boolean singleNode)
Method Detail

getNode

public RNANodeValue getNode()
In case of a single node, return it. Will throw RNANodeValue2WrongTypeException if singleNode = false.


setNode

public void setNode(RNANodeValue node)

getNodes

public List<RNANodeValue> getNodes()
In case of multiple nodes, return them. Will throw RNANodeValue2WrongTypeException if singleNode = true.


computeSequence

public char[] computeSequence()
In case of multiple nodes, return the sequence of nucleotides.


setNodes

public void setNodes(List<RNANodeValue> nodes)

isSingleNode

public boolean isSingleNode()

toString

public String toString()
Overrides:
toString in class Object

toGraphvizNodeName

public String toGraphvizNodeName()
Description copied from interface: GraphvizDrawableNodeValue
Returns a string that will be displayed on the node by graphviz.

Specified by:
toGraphvizNodeName in interface GraphvizDrawableNodeValue