[Go] Add exported getter method to Interval.

This commit is contained in:
WAKAYAMA Shirou 2017-07-07 13:14:16 +09:00
parent c41426c87e
commit 749fa81993
1 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,18 @@ func NewInterval(start, stop int) *Interval {
return i
}
func (i *Interval) GetStart() int {
return i.start
}
func (i *Interval) GetStop() int {
return i.stop
}
func (i *Interval) Contains(item int) bool {
return i.contains(item)
}
func (i *Interval) contains(item int) bool {
return item >= i.start && item < i.stop
}