Package htsjdk.samtools.cram.compression.nametokenisation.tokens

# Class EncodeToken

java.lang.Object
htsjdk.samtools.cram.compression.nametokenisation.tokens.EncodeToken

Direct Known Subclasses:
  `EncodeToken.DupOrDiffToken`, `EncodeToken.EndToken`

public class EncodeToken extends Object
A token that represents one fragment of a read name that has been tokenized. Since not all token types have absolute and/or even relative values, there are a couple of subclasses defined below that are used to ensure that calling code never violates the assumptions of the token type. The subclasses enforce that the caller can only ask for and actual or relative value for token types that have them. Note: It would be more efficient to separate the encoded token cases where we want to store a numeric fragment from the cases where we store a string fragment, but for simplicity we store all fragments as strings, and let the caller interconvert them back to int on-demand.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`EncodeToken.DupOrDiffToken`
`static class`
`EncodeToken.EndToken`

## Constructor Summary

Constructors
Constructor
Description
`EncodeToken(byte type, String actualValue, String relativeValue)`
Token types TOKEN_DELTA, TOKEN_DELTA0, TOKEN_DIGITS, TOKEN_DIGITS0 all have a relative value that differs from the actual value of the original fragment, and for those token types, we need to preserve both during the encoding process.

## Method Summary

Modifier and Type
Method
Description
`String`
`getActualValue()`
`String`
`getRelativeValue()`
`byte`
`getTokenType()`
`int`
`hashCode()`

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

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

## Constructor Details

### EncodeToken

public EncodeToken(byte type, String actualValue, String relativeValue)
Token types TOKEN_DELTA, TOKEN_DELTA0, TOKEN_DIGITS, TOKEN_DIGITS0 all have a relative value that differs from the actual value of the original fragment, and for those token types, we need to preserve both during the encoding process. We need to preserve the absolute value for so we can use it to detect duplicate fragments in downstream reads, and we need to preserve the relative value since, if it's present, that's what we emit to the output stream.

Parameters:
  `type` -
  `actualValue` -
  `relativeValue` -

## Method Details

### getTokenType

public byte getTokenType()

### getActualValue

public String getActualValue()

### getRelativeValue

public String getRelativeValue()

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`