struct Lapper::Interval(T)

Overview

Represent an interval that can hold a val of any type

Included Modules

Defined in:

lapper.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(start : Int32, stop : Int32, val : T) #

Creates an Interval

iv = Interval(String).new(5, 10, "chr1")

[View source]

Instance Method Detail

def <=>(other : self) #

Compare two intervals


[View source]
def intersect(other : self) : Int32 #

Compute the intersect between two intervals

iv = Interval(Int32).new(0, 5, 0)
iv.intersect(Interval(Int32).new(4, 6, 0)) # => 1

[View source]
def overlap(start : Int32, stop : Int32) : Bool #

Compute wheter self overlaps a range

iv = Interval(Int32).new(0, 5, 0)
iv.overlap(4, 6) # => true

[View source]
def start #

[View source]
def stop #

[View source]
def val #

[View source]