github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/core/util/list.go (about) 1 package util 2 3 import ( 4 "sort" 5 ) 6 7 // util/CollectionUtil.java 8 9 func IntroSort(data sort.Interface) { 10 if data.Len() <= 1 { 11 return 12 } 13 newListIntroSorter(data).Sort(0, data.Len()) 14 } 15 16 type ListIntroSorter struct { 17 *IntroSorter 18 } 19 20 func newListIntroSorter(data sort.Interface) *ListIntroSorter { 21 ans := new(ListIntroSorter) 22 ans.IntroSorter = NewIntroSorter(ans, data) 23 return ans 24 } 25 26 func (s *ListIntroSorter) SetPivot(i int) { 27 panic("not implemented yet") 28 } 29 30 func (s *ListIntroSorter) PivotLess(j int) bool { 31 panic("not implemented yet") 32 }