forked from jasder/antlr
[Go] Add exported getter method to Interval.
This commit is contained in:
parent
c41426c87e
commit
749fa81993
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue