Package jebl.evolution.alignments

# Interface Pattern

public interface Pattern
An interface representing a list of states for a list of taxa (e.g. an alignment column).

Version:
  $Id: Pattern.java 658 2007-03-20 03:27:20Z twobeers $
Author:
  Andrew Rambaut, Alexei Drummond

## Method Summary

Modifier and Type
Method
Description
`int`
`getLength()`
`State`
`getMostFrequentState()`
Returns the most frequent state in this pattern
`State`
`getMostFrequentState(boolean includeAmbiguous)`
Returns the most frequent state in this pattern, optionally including ambiguous states
`SequenceType`
`getSequenceType()`
`State`
`getState(int index)`
Get the state for the ith taxon
`int`
`getStateCount(State state)`
Returns the count of the given state in this pattern
`double`
`getStateFrequency(State state)`
Returns the frequent of the given state in this pattern
`List<State>`
`getStates()`
`Set<State>`
`getStateSet()`
`List<Taxon>`
`getTaxa()`
`double`
`getWeight()`
Get the weight of this pattern

## Method Details

### getSequenceType

SequenceType getSequenceType()

Returns:
  the data type of the states in this pattern.

### getLength

int getLength()

### getTaxa

List<Taxon> getTaxa()

Returns:
  the list of taxa that the state values correspond to.

### getState

State getState(int index)
Get the state for the ith taxon

Parameters:
  `index` -
Returns:
  the state

### getStates

List<State> getStates()

Returns:
  the list of state values of this pattern.

### getStateSet

Set<State> getStateSet()

Returns:
  the set of state values of this pattern.

### getWeight

double getWeight()
Get the weight of this pattern

Returns:
  the weight

### getMostFrequentState

State getMostFrequentState()
Returns the most frequent state in this pattern

Returns:
  the most frequent state

### getMostFrequentState

State getMostFrequentState(boolean includeAmbiguous)
Returns the most frequent state in this pattern, optionally including ambiguous states

Parameters:
  `includeAmbiguous` - whether to include ambiguous states
Returns:
  the most frequent state

### getStateFrequency

double getStateFrequency(State state)
Returns the frequent of the given state in this pattern

Parameters:
  `state` -
Returns:
  the frequency

### getStateCount

int getStateCount(State state)
Returns the count of the given state in this pattern

Parameters:
  `state` -
Returns:
  the count