Package jebl.evolution.coalescent

# Class Intervals

java.lang.Object
jebl.evolution.coalescent.Intervals

All Implemented Interfaces:
  `IntervalList`

public class Intervals extends Object implements IntervalList
A concrete class for a set of coalescent intevals.

Version:
  $Id: Intervals.java 305 2006-04-26 00:22:30Z rambaut $
Author:
  Andrew Rambaut, Alexei Drummond

## Nested Class Summary

## Nested classes/interfaces inherited from interface jebl.evolution.coalescent.IntervalList

`IntervalList.IntervalType, IntervalList.Utils`

## Constructor Summary

Constructors
Constructor
Description
`Intervals(int maxEventCount)`
`Intervals(RootedTree tree)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addCoalescentEvent(double time)`
`void`
`addMigrationEvent(double time, int destination)`
`void`
`addNothingEvent(double time)`
`void`
`addSampleEvent(double time)`
`void`
`copyIntervals(Intervals source)`
`int`
`getCoalescentEvents(int i)`
Returns the number coalescent events in an interval
`double`
`getInterval(int i)`
Gets an interval.
`int`
`getIntervalCount()`
get number of intervals
`IntervalList.IntervalType`
`getIntervalType(int i)`
Returns the type of interval observed.
`int`
`getLineageCount(int i)`
Returns the number of uncoalesced lineages within this interval.
`int`
`getSampleCount()`
get the total number of sampling events.
`double`
`getTotalDuration()`
get the total duration of these intervals.
`boolean`
`isBinaryCoalescent()`
Checks whether this set of coalescent intervals is fully resolved (i.e.
`boolean`
`isCoalescentOnly()`
Checks whether this set of coalescent intervals coalescent only (i.e.
`void`
`resetEvents()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Intervals

public Intervals(RootedTree tree)

### Intervals

public Intervals(int maxEventCount)

## Method Details

### copyIntervals

public void copyIntervals(Intervals source)

### resetEvents

public void resetEvents()

### addSampleEvent

public void addSampleEvent(double time)

### addCoalescentEvent

public void addCoalescentEvent(double time)

### addMigrationEvent

public void addMigrationEvent(double time, int destination)

### addNothingEvent

public void addNothingEvent(double time)

### getSampleCount

public int getSampleCount()
Description copied from interface: `IntervalList`
get the total number of sampling events.

Specified by:
  `getSampleCount` in interface `IntervalList`

### getIntervalCount

public int getIntervalCount()
Description copied from interface: `IntervalList`
get number of intervals

Specified by:
  `getIntervalCount` in interface `IntervalList`

### getInterval

public double getInterval(int i)
Description copied from interface: `IntervalList`
Gets an interval.

Specified by:
  `getInterval` in interface `IntervalList`

### getLineageCount

public int getLineageCount(int i)
Description copied from interface: `IntervalList`
Returns the number of uncoalesced lineages within this interval. Required for s-coalescents, where new lineages are added as earlier samples are come across.

Specified by:
  `getLineageCount` in interface `IntervalList`

### getCoalescentEvents

public int getCoalescentEvents(int i)
Description copied from interface: `IntervalList`
Returns the number coalescent events in an interval

Specified by:
  `getCoalescentEvents` in interface `IntervalList`

### getIntervalType

public IntervalList.IntervalType getIntervalType(int i)
Description copied from interface: `IntervalList`
Returns the type of interval observed.

Specified by:
  `getIntervalType` in interface `IntervalList`

### getTotalDuration

public double getTotalDuration()
Description copied from interface: `IntervalList`
get the total duration of these intervals.

Specified by:
  `getTotalDuration` in interface `IntervalList`

### isBinaryCoalescent

public boolean isBinaryCoalescent()
Description copied from interface: `IntervalList`
Checks whether this set of coalescent intervals is fully resolved (i.e. whether is has exactly one coalescent event in each subsequent interval)

Specified by:
  `isBinaryCoalescent` in interface `IntervalList`

### isCoalescentOnly

public boolean isCoalescentOnly()
Description copied from interface: `IntervalList`
Checks whether this set of coalescent intervals coalescent only (i.e. whether is has exactly one or more coalescent event in each subsequent interval)

Specified by:
  `isCoalescentOnly` in interface `IntervalList`