# Class CRAIEntry

java.lang.Object
htsjdk.samtools.cram.CRAIEntry

All Implemented Interfaces:
  `Comparable<CRAIEntry>`

public class CRAIEntry extends Object implements Comparable<CRAIEntry>
A class representing CRAI index entry: file and alignment offsets for each slice. Created by vadim on 10/08/2015.

## Constructor Summary

Constructors
Constructor
Description
`CRAIEntry(int sequenceId, int alignmentStart, int alignmentSpan, long containerStartByteOffset, int sliceByteOffsetFromCompressionHeaderStart, int sliceByteSize)`
`CRAIEntry(String line)`
Create a CRAI Entry from a serialized CRAI index line.

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(CRAIEntry other)`
Sort by numerical order of reference sequence ID, except that unmapped-unplaced reads come last For valid reference sequence ID (placed reads): - sort by alignment start - if alignment start is equal, sort by container offset - if alignment start and container offset are equal, sort by slice offset For unmapped-unplaced reads: - ignore (invalid) alignment start value - sort by container offset - if container offset is equal, sort by slice offset
`boolean`
`equals(Object o)`
`int`
`getAlignmentSpan()`
`int`
`getAlignmentStart()`
`long`
`getContainerStartByteOffset()`
`int`
`getSequenceId()`
`int`
`getSliceByteOffsetFromCompressionHeaderStart()`
`int`
`getSliceByteSize()`
`int`
`hashCode()`
`static boolean`
`intersect(CRAIEntry e0, CRAIEntry e1)`
`String`
`toString()`
`void`
`writeToStream(OutputStream os)`
Serialize the entry to a CRAI index stream.

### Methods inherited from class Object

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

## Constructor Details

### CRAIEntry

public CRAIEntry(int sequenceId, int alignmentStart, int alignmentSpan, long containerStartByteOffset, int sliceByteOffsetFromCompressionHeaderStart, int sliceByteSize)

### CRAIEntry

public CRAIEntry(String line)
Create a CRAI Entry from a serialized CRAI index line.

Parameters:
  `line` - string formatted as a CRAI index entry

## Method Details

### writeToStream

public void writeToStream(OutputStream os)
Serialize the entry to a CRAI index stream.

Parameters:
  `os` - stream to write to

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### compareTo

public int compareTo(CRAIEntry other)
Sort by numerical order of reference sequence ID, except that unmapped-unplaced reads come last For valid reference sequence ID (placed reads): - sort by alignment start - if alignment start is equal, sort by container offset - if alignment start and container offset are equal, sort by slice offset For unmapped-unplaced reads: - ignore (invalid) alignment start value - sort by container offset - if container offset is equal, sort by slice offset

Specified by:
  `compareTo` in interface `Comparable<CRAIEntry>`
Parameters:
  `other` - the CRAIEntry to compare against
Returns:
  int representing the comparison result, suitable for ordering

### intersect

public static boolean intersect(CRAIEntry e0, CRAIEntry e1)

### getSequenceId

public int getSequenceId()

### getAlignmentStart

public int getAlignmentStart()

### getAlignmentSpan

public int getAlignmentSpan()

### getContainerStartByteOffset

public long getContainerStartByteOffset()

### getSliceByteOffsetFromCompressionHeaderStart

public int getSliceByteOffsetFromCompressionHeaderStart()

### getSliceByteSize

public int getSliceByteSize()

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`