column

package
v0.0.0-...-a8a07f9 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

ex7.8 provides iterative columnar sorting for Persons.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByColumns

type ByColumns struct {
	// contains filtered or unexported fields
}

func NewByColumns

func NewByColumns(p []Person, maxColumns int) *ByColumns

func (*ByColumns) Len

func (c *ByColumns) Len() int

func (*ByColumns) Less

func (c *ByColumns) Less(i, j int) bool

func (*ByColumns) LessAge

func (c *ByColumns) LessAge(a, b *Person) comparison

func (*ByColumns) LessName

func (c *ByColumns) LessName(a, b *Person) comparison

func (*ByColumns) LessSumOfAgeDigits

func (c *ByColumns) LessSumOfAgeDigits(a, b *Person) comparison

func (*ByColumns) Select

func (c *ByColumns) Select(cmp columnCmp)

func (*ByColumns) Swap

func (c *ByColumns) Swap(i, j int)

type Person

type Person struct {
	Name string
	Age  int
}

func (Person) String

func (p Person) String() string

Jump to

Keyboard shortcuts

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