sorts

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BySize

type BySize []*data.FileEntry

BySize is a list of FileEntries that can be sorted by size

func NewBySize

func NewBySize(entries data.EntryMap) BySize

NewBySize translates an EntryMAp into a BySize

func (BySize) Len

func (b BySize) Len() int

Len returns the length of the list

func (BySize) Less

func (b BySize) Less(i, j int) bool

Less decides if the entry at 'i' should sort lower than the entry at 'j'

func (BySize) Print

func (b BySize) Print()

Print writes out this list as a table, in sorted order

func (BySize) Swap

func (b BySize) Swap(i, j int)

Swap exchanges values at indices

type ByWeight

type ByWeight []*data.FileEntry

ByWeight is a list of FileEntries that can be sorted by weight

func (ByWeight) Len

func (b ByWeight) Len() int

Len returns the length of the list

func (ByWeight) Less

func (b ByWeight) Less(i, j int) bool

Less decides if the entry at 'i' should sort lower than the entry at 'j'

func (ByWeight) Swap

func (b ByWeight) Swap(i, j int)

Swap exchanges values at indices

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL