Documentation ¶
Index ¶
- func GroupBy[K comparable, T any](ts []T, getKey func(t T) K) map[K][]T
- type ArrayList
- func (l *ArrayList[T]) Add(t ...T) error
- func (l *ArrayList[T]) Clear()
- func (l *ArrayList[T]) Equals(o *ArrayList[T]) bool
- func (l *ArrayList[T]) Get(i int) gocommon.Optional[T]
- func (l *ArrayList[T]) IsEmpty() bool
- func (l *ArrayList[T]) Remove(index int) gocommon.Optional[T]
- func (l *ArrayList[T]) Size() int
- func (l *ArrayList[T]) Stream() Stream[T]
- func (l *ArrayList[T]) ToArray() []T
- type ArrayListOption
- type Collection
- type Error
- type FifoQueue
- type LinkedList
- func (l *LinkedList[T]) Add(t ...T) error
- func (l *LinkedList[T]) Clear()
- func (l *LinkedList[T]) Get(index int) gocommon.Optional[T]
- func (l *LinkedList[T]) IsEmpty() bool
- func (l *LinkedList[T]) Peek() gocommon.Optional[T]
- func (l *LinkedList[T]) Remove(index int) gocommon.Optional[T]
- func (l *LinkedList[T]) Size() int
- func (l *LinkedList[T]) Stream() Stream[T]
- func (l *LinkedList[T]) ToArray() []T
- type List
- type Queue
- type Set
- type Stream
- func (stream Stream[T]) AnyMatch(anyFunction func(t T) bool) bool
- func (stream Stream[T]) Filter(filter func(t T) bool) Stream[T]
- func (stream Stream[T]) FindFirst() gocommon.Optional[T]
- func (stream Stream[T]) ForEach(forEach func(t T))
- func (stream Stream[T]) NoneMatch(anyFunction func(t T) bool) bool
- func (stream Stream[T]) Peek(peekFunc func(t T)) Stream[T]
- func (stream Stream[T]) Reduce(identity T, reduce func(a, b T) T) T
- func (stream Stream[T]) Slice() []T
- func (stream Stream[T]) Sort(sortFunction func(a, b T) bool) Stream[T]
- func (stream Stream[T]) ToList() List[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupBy ¶
func GroupBy[K comparable, T any](ts []T, getKey func(t T) K) map[K][]T
Types ¶
type ArrayList ¶
type ArrayList[T any] struct { // contains filtered or unexported fields }
func NewArrayList ¶
func NewArrayList[T any](options ...ArrayListOption[T]) (*ArrayList[T], error)
type ArrayListOption ¶
func ArrayListWithInitialCapacity ¶
func ArrayListWithInitialCapacity[T any](capacity int) ArrayListOption[T]
func ArrayListWithLimit ¶
func ArrayListWithLimit[T any](limit int) ArrayListOption[T]
func ArrayListWithSlice ¶
func ArrayListWithSlice[T any](slice []T) ArrayListOption[T]
type Collection ¶
type LinkedList ¶
type LinkedList[T any] struct { // contains filtered or unexported fields }
func NewLinkedList ¶
func NewLinkedList[T any]() LinkedList[T]
func (*LinkedList[T]) Add ¶
func (l *LinkedList[T]) Add(t ...T) error
func (*LinkedList[T]) Clear ¶
func (l *LinkedList[T]) Clear()
func (*LinkedList[T]) IsEmpty ¶
func (l *LinkedList[T]) IsEmpty() bool
func (*LinkedList[T]) Peek ¶
func (l *LinkedList[T]) Peek() gocommon.Optional[T]
func (*LinkedList[T]) Size ¶
func (l *LinkedList[T]) Size() int
func (*LinkedList[T]) Stream ¶
func (l *LinkedList[T]) Stream() Stream[T]
func (*LinkedList[T]) ToArray ¶
func (l *LinkedList[T]) ToArray() []T
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.