Documentation
¶
Index ¶
- type ArrayList
- func (l *ArrayList[T]) Add(e T) bool
- func (l *ArrayList[T]) AddAll(c ...T) bool
- func (l *ArrayList[T]) AddAtIndex(i int, e T)
- func (l *ArrayList[T]) Clear()
- func (l *ArrayList[T]) Clone() collection.List[T]
- func (l *ArrayList[T]) Contains(e T) bool
- func (l *ArrayList[T]) ContainsAll(c ...T) bool
- func (l *ArrayList[T]) Equals(o any) bool
- func (l *ArrayList[T]) Get(i int) T
- func (l *ArrayList[T]) IndexOf(e T) int
- func (l *ArrayList[T]) IsEmpty() bool
- func (l *ArrayList[T]) Iter() iter.Seq[T]
- func (l *ArrayList[T]) LastIndexOf(e T) int
- func (l *ArrayList[T]) Remove(e T) bool
- func (l *ArrayList[T]) RemoveAll(c ...T) bool
- func (l *ArrayList[T]) RemoveAtIndex(i int) T
- func (l *ArrayList[T]) RemoveIf(f func(T) bool) bool
- func (l *ArrayList[T]) RetainAll(c ...T) bool
- func (l *ArrayList[T]) Set(i int, e T) T
- func (l *ArrayList[T]) Size() int
- func (l *ArrayList[T]) ToSlice() []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayList ¶
type ArrayList[T any] []T
func NewArrayList ¶
NewArrayList creates and returns a new empty list.
func (*ArrayList[T]) AddAtIndex ¶
AddAtIndex inserts the specified element at the specified position in this list.
func (*ArrayList[T]) Clear ¶
func (l *ArrayList[T]) Clear()
Clear removes all of the elements from this list.
func (*ArrayList[T]) Clone ¶
func (l *ArrayList[T]) Clone() collection.List[T]
Clone returns a copy of this list.
func (*ArrayList[T]) ContainsAll ¶
ContainsAll returns true if this list contains all of the elements.
func (*ArrayList[T]) IndexOf ¶
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 (*ArrayList[T]) Iter ¶
Iter returns an iterator over the elements in this list in proper sequence.
func (*ArrayList[T]) LastIndexOf ¶
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 (*ArrayList[T]) Remove ¶
Remove removes all occurrences of the specified element from this list, if it is present. Returns true if this list contained the specified element.
func (*ArrayList[T]) RemoveAll ¶
RemoveAll removes all occurrences of the specified elements from this list, if they are present. Returns true if this list contained any of the specified elements.
func (*ArrayList[T]) RemoveAtIndex ¶
RemoveAtIndex removes the element at the specified position in this list. Returns the element that was removed from the list.
func (*ArrayList[T]) RemoveIf ¶
RemoveIf removes all of the elements of this list that satisfy the given predicate. Returns true if any elements were removed.
func (*ArrayList[T]) RetainAll ¶
RetainAll retains only the elements in this list that are contained in the specified elements. In other words, removes from this list all of its elements that are not contained in the specified elements. Returns true if this list changed as a result of the call.
func (*ArrayList[T]) Set ¶
Set replaces the element at the specified position in this list with the specified element. Returns the element previously at the specified position. If the index is equal to the size of this list, the element is appended to the end of this list and a zero value is returned.