github.com/tobgu/qframe@v0.4.0/internal/ecolumn/view.go (about)

     1  package ecolumn
     2  
     3  import "github.com/tobgu/qframe/internal/index"
     4  
     5  type View struct {
     6  	column Column
     7  	index  index.Int
     8  }
     9  
    10  func (v View) ItemAt(i int) *string {
    11  	return v.column.stringPtrAt(v.index[i])
    12  }
    13  
    14  func (v View) Len() int {
    15  	return len(v.index)
    16  }
    17  
    18  func (v View) Slice() []*string {
    19  	result := make([]*string, v.Len())
    20  	for i := range v.index {
    21  		result[i] = v.ItemAt(i)
    22  	}
    23  
    24  	return result
    25  }