edu.uconn.mcb.lineageevolver.graph
Class EdgeListGraphTopology.EdgeData

java.lang.Object
  extended byedu.uconn.mcb.lineageevolver.graph.EdgeListGraphTopology.EdgeData
Enclosing class:
EdgeListGraphTopology

protected class EdgeListGraphTopology.EdgeData
extends java.lang.Object

Encapsulation class used for storing multiple items inside an edge for EdgeListGraphTopology objects. Every EdgeData object must be associated to an Edge.

Author:
Hasan Khalil

Nested Class Summary
(package private)  class EdgeListGraphTopology.EdgeData.Event
          Encapsulation class used for storing Event information inside an EdgeData object.
protected  class EdgeListGraphTopology.EdgeData.ForkEvent
          Event produced for carryout out a forkation on the topology.
protected  class EdgeListGraphTopology.EdgeData.GenomeEvent
          Common abstract class for all events dealing directly with Genomes, as a GenomeVisitor.
protected  class EdgeListGraphTopology.EdgeData.LineageEvent
          Common abstract class for all events dealing with Lineages.
protected  class EdgeListGraphTopology.EdgeData.SubstitutionEvent
          Event produced for carrying out substitution.
 
Field Summary
(package private)  int cur
          The current number of time units traversed along this branch.
(package private)  java.lang.Object data
          The data stored in this edge.
(package private)  EdgeListEdge edge
          The edge that we're bound to.
(package private)  java.util.ArrayList events
          Our list of events, in order.
(package private)  EdgeListGraphTopology.EdgeData.SubstitutionEvent substitutionEvent
          The substitution event to run when substitution should occur.
(package private)  int substitutions
          The number of substitutions along this branch.
(package private)  int time
          The number of time units along this branch.
 
Constructor Summary
EdgeListGraphTopology.EdgeData(int substitutions, int time, java.lang.Object data, EdgeListEdge edge)
          Constructor for EdgeData objects, specifying all instance variables.
 
Method Summary
(package private)  EdgeListGraphTopology.EdgeData.SubstitutionEvent getSubstitutionEvent(int subsitiutions)
          Returns a SubstitutionEvent with appropriate configuration given a number of substitutions.
(package private)  EdgeListGraphTopology.EdgeData.Event nextEvent()
          Returns the next event on this edge according to this.cur.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

substitutions

int substitutions
The number of substitutions along this branch.


time

int time
The number of time units along this branch.


cur

int cur
The current number of time units traversed along this branch.


events

java.util.ArrayList events
Our list of events, in order.


edge

EdgeListEdge edge
The edge that we're bound to.


data

java.lang.Object data
The data stored in this edge.


substitutionEvent

EdgeListGraphTopology.EdgeData.SubstitutionEvent substitutionEvent
The substitution event to run when substitution should occur.

Constructor Detail

EdgeListGraphTopology.EdgeData

public EdgeListGraphTopology.EdgeData(int substitutions,
                                      int time,
                                      java.lang.Object data,
                                      EdgeListEdge edge)
Constructor for EdgeData objects, specifying all instance variables.

Parameters:
substitutions - the branch length in substitutions.
time - the branch length in time intervals.
data - any extra data that this EdgeData should store.
edge - the Edge that this EdgeData should belong to.
Method Detail

getSubstitutionEvent

EdgeListGraphTopology.EdgeData.SubstitutionEvent getSubstitutionEvent(int subsitiutions)
Returns a SubstitutionEvent with appropriate configuration given a number of substitutions. Each EdgeData stores with it a SubstitutionEvent, which is re-used with each call of this method. As such, this is not thread safe.

Parameters:
subsitiutions - the number of substitutions that the returned SubstitutionEvent should be configured for.
Returns:
the configured SubstitutionEvent.

nextEvent

EdgeListGraphTopology.EdgeData.Event nextEvent()
Returns the next event on this edge according to this.cur. If no events after this.cur are found, and there are children, the fork event is returned. Otherwise, null is returned.

Returns:
the next event on this edge.