Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByHigh ¶
type ByHigh []*Interval
ByHigh implements sort.Interface for []Interval based on the High field.
type ByLow ¶
type ByLow []*Interval
ByLow implements sort.Interface for []Interval based on the Low field.
type IntervalPlot ¶
type IntervalPlot interface {
PlotData(path string, intervals Intervals, addIntervals, addGaps, addOverlapped, addMerges bool) error
CreatePlot(title string, xys plotter.XYs, plotType PlotType) (*Superplot, error)
AlignPlots(plotItems []*Superplot, minLow, maxHigh int) *vgimg.Canvas
CreateFileFromCanvas(path string, img *vgimg.Canvas) error
}
func NewPlot ¶
func NewPlot(lowInclusive bool, highInclusive bool) IntervalPlot
type Intervals ¶
type Intervals interface {
// Add creates an interval from the input parameters and call AddInterval
Add(low, high int, obj interface{}) error
// AddInterval appends a new interval to the list. If the interval range (low, high) is invalid, it returns an error
AddInterval(itvl *Interval) error
// HasGaps returns true if exists gaps for the introduced intervals between MinLow and MaxHigh
HasGaps() bool
// Get returns the interval list
GetIntervals() []*Interval
// Gaps returns the interval gaps
Gaps() []*Interval
// Merge fussion together overlapped intervals
Merge() []*Interval
// HasOverlapped returns true if exists overlapping for the introduced intervals
HasOverlapped() bool
// Overlapped returns the overlapped intervals
Overlapped() []*Interval
// FindIntervalsForValue returns all the intervals which contains the passed value
FindIntervalsForValue(value int) []*Interval
// IsLowInclusive indicates if the Low part of the interval is included, e. g. (3,5) --> the 3 is included as part of the interval
IsLowInclusive() bool
// IsHighInclusive indicates if the High part of the interval is included, e. g. (3,5) --> the 5 is included as part of the interval
IsHighInclusive() bool
// GetMinLow returns the minimal Low, either the one configured in the constructor, or the self-adjusted calculated if SelfAdjustMinLow=true
GetMinLow() int
// GetMaxHigh returns the maximal High, either the one configured in the constructor, or the self-adjusted calculated if SelfAdjustMaxHigh=true
GetMaxHigh() int
}
Intervals is an interface to handle Interval structures discovering the existence of gaps or overlays
func New ¶ added in v0.1.1
func New(minLow, maxHigh int, lowInclusive, highInclusive, selfAdjustMinLow, selfAdjustMaxHigh bool) Intervals
New is a constructor that returns an instance of the Intervals interface
func NewIntervalsDefault ¶
func NewIntervalsDefault() Intervals
NewIntervalsDefault is a constructor that returns an instance of the Intervals interface with default values
Source Files
¶
Click to show internal directories.
Click to hide internal directories.

