# Class CountByType

java.lang.Object
org.snpeff.stats.CountByType

All Implemented Interfaces:
  `Serializable`

public class CountByType extends Object implements Serializable
Counters indexed by 'type' (type is a generic string that can mean anything)

Author:
  pcingola
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`TOTAL_TYPE`

## Constructor Summary

Constructors
Constructor
Description
`CountByType()`

## Method Summary

Modifier and Type
Method
Description
`long`
`addScore(String type, double score)`
Add score for a type
`boolean`
`contains(String key)`
`long`
`get(String type)`
How many counts of this type?
`String`
`getColorHtml(String type)`
Background color used for table (heatmap)
`long`
`getCount(String type)`
Count for this type
`double`
`getScore(String type)`
Score for this type
`long`
`getTotalCount()`
`List<String>`
`getTypeList()`
List all types (alphabetically sorted) We need it as a getter for summary page (freemarker)
`boolean`
`hasCount(String type)`
`boolean`
`hasData()`
`boolean`
`hasScore(String type)`
`long`
`inc(String type)`
`long`
`inc(String type, int increment)`
Increment counter for a given type
`boolean`
`isEmpty()`
Is this empty
`Set<String>`
`keySet()`
`List<String>`
`keysRanked(boolean reverse)`
List all types (sorted by count)
`List<String>`
`keysSorted()`
List all types (alphabetically sorted)
`long`
`max()`
Maximum count
`long`
`min()`
Minimum count
`double`
`percent(String type)`
Percentage by type
`Map<String,Integer>`
`ranks(boolean reverse)`
A map: key -> rank(counts)
`void`
`remove(String type)`
Remove this entry type
`void`
`setScore(String type, double score)`
`long`
`sum()`
Sum all counts.
`String`
`toString()`
`String`
`toString(boolean showScores)`
`String`
`toString(String type)`
`String`
`toStringLine()`
`String`
`toStringSort()`
`String`
`toStringTop(int n)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### TOTAL_TYPE

public static final String TOTAL_TYPE

See Also:
  - Constant Field Values

## Constructor Details

### CountByType

public CountByType()

## Method Details

### addScore

public long addScore(String type, double score)
Add score for a type

### contains

public boolean contains(String key)

### get

public long get(String type)
How many counts of this type?

### getColorHtml

public String getColorHtml(String type)
Background color used for table (heatmap)

Returns:
  An html coded color

### getCount

public long getCount(String type)
Count for this type

### getScore

public double getScore(String type)
Score for this type

### getTotalCount

public long getTotalCount()

### getTypeList

public List<String> getTypeList()
List all types (alphabetically sorted) We need it as a getter for summary page (freemarker)

### hasCount

public boolean hasCount(String type)

### hasData

public boolean hasData()

### hasScore

public boolean hasScore(String type)

### inc

public long inc(String type)

### inc

public long inc(String type, int increment)
Increment counter for a given type

### isEmpty

public boolean isEmpty()
Is this empty

### keySet

public Set<String> keySet()

### keysRanked

public List<String> keysRanked(boolean reverse)
List all types (sorted by count)

### keysSorted

public List<String> keysSorted()
List all types (alphabetically sorted)

### max

public long max()
Maximum count

### min

public long min()
Minimum count

### percent

public double percent(String type)
Percentage by type

### ranks

public Map<String,Integer> ranks(boolean reverse)
A map: key -> rank(counts)

### remove

public void remove(String type)
Remove this entry type

### setScore

public void setScore(String type, double score)

### sum

public long sum()
Sum all counts.

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### toString

public String toString(boolean showScores)

### toString

public String toString(String type)

### toStringLine

public String toStringLine()

### toStringSort

public String toStringSort()

### toStringTop

public String toStringTop(int n)