Created new Add function whic allows pass directly low, high and object.

This commit is contained in:
Daniel Gil
2018-05-31 14:46:54 +02:00
parent f9d1375f1e
commit 1d6fd664fa
5 changed files with 145 additions and 133 deletions

View File

@@ -13,8 +13,11 @@ const (
// Intervals is an interface to handle Interval structures discovering the existence of gaps or overlays
type Intervals interface {
// Add appends a new interval to the list. If the interval range (low, high) is invalid, it returns an error
Add(itvl *Interval) error
// 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
// Sort sorts the intervals list by the Low property (ascending)
Sort()