list

package
v0.0.0-...-b6b1d6e Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element interface {
	collection.Element
}

type LinkedList

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

func (*LinkedList) Add

func (l *LinkedList) Add(e interface{})

Add appends the specified element to the end of this list

func (*LinkedList) AddAll

func (l *LinkedList) AddAll(c ...interface{}) error

AddAll adds a list of elements at the end of the list

func (*LinkedList) AddAllAtIndex

func (l *LinkedList) AddAllAtIndex(index int, c ...Element) error

AddAllAtIndex adds a list of elements at the specified index

func (*LinkedList) AddAtIndex

func (l *LinkedList) AddAtIndex(index int, e interface{}) error

AddAtIndex inserts the specified element at the specified position in this list

func (*LinkedList) AddFirst

func (l *LinkedList) AddFirst(e Element) bool

AddFirst inserts the specified element at the beginning of this list

func (*LinkedList) AddLast

func (l *LinkedList) AddLast(e Element) bool

AddLast inserts the specified element at the end of this list

func (*LinkedList) Clear

func (l *LinkedList) Clear()

Clear removes all of the elements from this list

func (*LinkedList) Contains

func (l *LinkedList) Contains(e interface{}) bool

Contains checks if the element e exists in the list

func (*LinkedList) ContainsAll

func (l *LinkedList) ContainsAll(c collection.Collection) bool

func (*LinkedList) Equals

func (l *LinkedList) Equals(l2 *LinkedList) bool

func (*LinkedList) Get

func (l *LinkedList) Get(index int) (*Node, error)

func (*LinkedList) HashCode

func (l *LinkedList) HashCode() int

func (*LinkedList) IndexOf

func (l *LinkedList) IndexOf(o Element) int

func (*LinkedList) IsEmpty

func (l *LinkedList) IsEmpty() bool

func (*LinkedList) LastIndexOf

func (l *LinkedList) LastIndexOf(o Element) int

func (*LinkedList) Remove

func (l *LinkedList) Remove(e Element) bool

func (*LinkedList) RemoveAll

func (l *LinkedList) RemoveAll(c collection.Collection) bool

func (*LinkedList) RemoveIndex

func (l *LinkedList) RemoveIndex(index int) Element

func (*LinkedList) RemoveRange

func (l *LinkedList) RemoveRange(from, to int)

func (*LinkedList) RetainAll

func (l *LinkedList) RetainAll(c collection.Collection) bool

func (*LinkedList) Set

func (l *LinkedList) Set(index int, e Element) Element

func (*LinkedList) String

func (l *LinkedList) String() string

func (*LinkedList) SubList

func (l *LinkedList) SubList(from, to int) List

func (*LinkedList) ToArray

func (l *LinkedList) ToArray() []Element

type List

type List interface {
	// appends the specified element to the end of this list (optional operation)
	Add(e Element) bool
	// inserts the specified element at the specified position in this list (optional operation)
	AddAtIndex(index int, e Element)
	// inserts all of the elements in the specified collection into this list at the specified position (optional operation)
	AddAll(index int, c ...Element) bool
	// removes all of the elements from this list (optional operation)
	Clear()
	// returns true if this list contains the specified element
	Contains(e Element)
	// returns true if this list contains all of the elements of the specified collection
	ContainsAll(c collection.Collection) bool
	// compares the specified object with this list for equality
	Equals(o interface{}) bool
	// returns the element at the specified position in this list
	Get(index int)
	// returns the hash code value for this list
	HashCode() int
	// returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element
	IndexOf(o Element) int
	// returns true if this list contains no elements
	IsEmpty() bool
	//// returns an iterator over the elements in this list in proper sequence
	//Iterator() collection.Iterator
	// returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element
	LastIndexOf(o Element) int
	//// returns a list iterator over the elements in this list (in proper sequence)
	//ListIterator() ListIterator
	//// returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list
	//ListIteratorAtIndex(index int) ListIterator
	// removes the element at the specified position in this list (optional operation)
	RemoveIndex(index int) Element
	// removes the first occurrence of the specified element from this list, if it is present (optional operation)
	Remove(e Element) bool
	// removes from this list all of its elements that are contained in the specified collection (optional operation)
	RemoveAll(c collection.Collection) bool
	// retains only the elements in this list that are contained in the specified collection (optional operation)
	RetainAll(c collection.Collection) bool
	// removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive
	RemoveRange(from, to int)
	// replaces the element at the specified position in this list with the specified element (optional operation)
	Set(index int, e Element) Element
	// returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive
	SubList(from, to int) List
	// returns an array containing all of the elements in this list in proper sequence (from first to last element)
	ToArray() []Element
	// returns a string representation of this collection
	String() string
}

Derived from java.util.AbstractList

type ListIterator

type ListIterator interface{}

type Node

type Node struct {
	Val interface{}
	// contains filtered or unexported fields
}

func (*Node) Next

func (n *Node) Next() (*Node, error)

Next returns the next node in line, if exists, else errors out

func (*Node) Seek

func (n *Node) Seek(index int) (*Node, error)

Seek returns the node that is 'index' positions away, if possible, else errors out

Jump to

Keyboard shortcuts

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