New adds a new split to the list for given table, and with associated values, which are copied before saving into Values list, and any number of rows from the table associated with this split (also copied). Any existing Aggs are deleted by this.
(dt *Table, values []string, rows ...int)
| 94 | // from the table associated with this split (also copied). |
| 95 | // Any existing Aggs are deleted by this. |
| 96 | func (spl *Splits) New(dt *Table, values []string, rows ...int) *IndexView { |
| 97 | spl.Aggs = nil |
| 98 | ix := &IndexView{Table: dt} |
| 99 | spl.Splits = append(spl.Splits, ix) |
| 100 | if len(rows) > 0 { |
| 101 | ix.Indexes = append(ix.Indexes, slices.Clone(rows)...) |
| 102 | } |
| 103 | if len(values) > 0 { |
| 104 | spl.Values = append(spl.Values, slices.Clone(values)) |
| 105 | } else { |
| 106 | spl.Values = append(spl.Values, nil) |
| 107 | } |
| 108 | return ix |
| 109 | } |
| 110 | |
| 111 | // ByValue finds split indexes by matching to split values, returns nil if not found. |
| 112 | // values are used in order as far as they go and any remaining values are assumed |
no test coverage detected