internal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrUnsupportedScanType indicates an incompatible type was passed to Scan.
	ErrUnsupportedScanType = errors.New("unsupported scan type")
)

Functions

This section is empty.

Types

type AbstractList

type AbstractList[T any] struct {
	// contains filtered or unexported fields
}

AbstractList provides a skeletal implementation of the List interface, backed by a slice.

func NewAbstractList

func NewAbstractList[T any](elements ...T) *AbstractList[T]

NewAbstractList creates a new AbstractList with the given elements.

func NewAbstractListWithCapacity

func NewAbstractListWithCapacity[T any](capacity int) *AbstractList[T]

NewAbstractListWithCapacity creates a new empty AbstractList with the specified capacity.

func (*AbstractList[T]) Add

func (this *AbstractList[T]) Add(elements ...T) bool

Add appends the specified elements to the end of this list.

func (*AbstractList[T]) AddAll

func (this *AbstractList[T]) AddAll(c Collection[T]) bool

AddAll adds all of the elements in the specified collection to this list.

func (*AbstractList[T]) AddAt

func (this *AbstractList[T]) AddAt(index int, element T)

AddAt inserts the specified element at the specified position in this list.

func (*AbstractList[T]) Clear

func (this *AbstractList[T]) Clear()

Clear removes all elements from this list.

func (*AbstractList[T]) Contains

func (this *AbstractList[T]) Contains(element T) bool

Contains returns true if this list contains the specified element.

func (*AbstractList[T]) ContainsAll

func (this *AbstractList[T]) ContainsAll(c Collection[T]) bool

ContainsAll returns true if this list contains all of the elements in the specified collection.

func (*AbstractList[T]) Equals

func (this *AbstractList[T]) Equals(c Collection[T]) bool

Equals returns true if the specified collection is equal to this list.

func (*AbstractList[T]) Get

func (this *AbstractList[T]) Get(index int) T

Get returns the element at the specified position in this list.

func (*AbstractList[T]) IndexOf

func (this *AbstractList[T]) IndexOf(element T) int

IndexOf returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

func (*AbstractList[T]) IsEmpty

func (this *AbstractList[T]) IsEmpty() bool

IsEmpty returns true if this list contains no elements.

func (*AbstractList[T]) LastIndexOf

func (this *AbstractList[T]) LastIndexOf(element T) int

LastIndexOf returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

func (*AbstractList[T]) MarshalJSON

func (this *AbstractList[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*AbstractList[T]) Remove

func (this *AbstractList[T]) Remove(element T) bool

Remove removes the first occurrence of the specified element from this list, if it is present.

func (*AbstractList[T]) RemoveAll

func (this *AbstractList[T]) RemoveAll(c Collection[T]) bool

RemoveAll removes all of this list's elements that are also contained in the specified collection.

func (*AbstractList[T]) RemoveAt

func (this *AbstractList[T]) RemoveAt(index int) T

RemoveAt removes the element at the specified position in this list.

func (*AbstractList[T]) RetainAll

func (this *AbstractList[T]) RetainAll(c Collection[T]) bool

RetainAll retains only the elements in this list that are contained in the specified collection.

func (*AbstractList[T]) Scan

func (this *AbstractList[T]) Scan(src any) error

Scan implements sql.Scanner.

func (*AbstractList[T]) Seq

func (this *AbstractList[T]) Seq() iter.Seq[T]

Seq returns an iterator sequence over the elements in this list.

func (*AbstractList[T]) Set

func (this *AbstractList[T]) Set(index int, element T) T

Set replaces the element at the specified position in this list with the specified element.

func (*AbstractList[T]) Size

func (this *AbstractList[T]) Size() int

Size returns the number of elements in this list.

func (*AbstractList[T]) SubList

func (this *AbstractList[T]) SubList(fromIndex, toIndex int) List[T]

SubList returns an independent copy of the portion of this list between fromIndex, inclusive, and toIndex, exclusive. Changes to the returned list do not affect the original list.

func (*AbstractList[T]) ToSlice

func (this *AbstractList[T]) ToSlice() []T

ToSlice returns a copy of the underlying slice.

func (*AbstractList[T]) UnmarshalJSON

func (this *AbstractList[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*AbstractList[T]) Value

func (this *AbstractList[T]) Value() (driver.Value, error)

Value implements driver.Valuer.

type AbstractSet

type AbstractSet[T comparable] struct {
	// contains filtered or unexported fields
}

AbstractSet provides a skeletal implementation of the Set interface, backed by a Go map.

func NewAbstractSet

func NewAbstractSet[T comparable](elements ...T) *AbstractSet[T]

NewAbstractSet creates a new AbstractSet with the given elements.

func NewAbstractSetWithCapacity

func NewAbstractSetWithCapacity[T comparable](capacity int) *AbstractSet[T]

NewAbstractSetWithCapacity creates a new empty AbstractSet with the specified capacity.

func (*AbstractSet[T]) Add

func (this *AbstractSet[T]) Add(elements ...T) bool

Add adds the specified elements to this set.

func (*AbstractSet[T]) AddAll

func (this *AbstractSet[T]) AddAll(c Collection[T]) bool

AddAll adds all of the elements in the specified collection to this set.

func (*AbstractSet[T]) Clear

func (this *AbstractSet[T]) Clear()

Clear removes all elements from this set.

func (*AbstractSet[T]) Contains

func (this *AbstractSet[T]) Contains(element T) bool

Contains returns true if this set contains the specified element.

func (*AbstractSet[T]) ContainsAll

func (this *AbstractSet[T]) ContainsAll(c Collection[T]) bool

ContainsAll returns true if this set contains all of the elements in the specified collection.

func (*AbstractSet[T]) Equals

func (this *AbstractSet[T]) Equals(c Collection[T]) bool

Equals returns true if the specified collection is equal to this set.

func (*AbstractSet[T]) IsEmpty

func (this *AbstractSet[T]) IsEmpty() bool

IsEmpty returns true if this set contains no elements.

func (*AbstractSet[T]) MarshalJSON

func (this *AbstractSet[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*AbstractSet[T]) Remove

func (this *AbstractSet[T]) Remove(element T) bool

Remove removes the specified element from this set, if it is present.

func (*AbstractSet[T]) RemoveAll

func (this *AbstractSet[T]) RemoveAll(c Collection[T]) bool

RemoveAll removes all of this set's elements that are also contained in the specified collection.

func (*AbstractSet[T]) RetainAll

func (this *AbstractSet[T]) RetainAll(c Collection[T]) bool

RetainAll retains only the elements in this set that are contained in the specified collection.

func (*AbstractSet[T]) Scan

func (this *AbstractSet[T]) Scan(src any) error

Scan implements sql.Scanner.

func (*AbstractSet[T]) Seq

func (this *AbstractSet[T]) Seq() iter.Seq[T]

Seq returns an iterator sequence over the elements in this set.

func (*AbstractSet[T]) Size

func (this *AbstractSet[T]) Size() int

Size returns the number of elements in this set.

func (*AbstractSet[T]) ToSlice

func (this *AbstractSet[T]) ToSlice() []T

ToSlice returns a slice containing all elements in this set.

func (*AbstractSet[T]) UnmarshalJSON

func (this *AbstractSet[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*AbstractSet[T]) Value

func (this *AbstractSet[T]) Value() (driver.Value, error)

Value implements driver.Valuer.

Jump to

Keyboard shortcuts

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