Documentation
¶
Overview ¶
Package listx Created by xuzhuoxi on 2019-04-03. @author xuzhuoxi
Package listx Created by xuzhuoxi on 2019-04-03. @author xuzhuoxi
Package listx Created by xuzhuoxi on 2019-04-03. @author xuzhuoxi
Index ¶
- type ArrayList
- func (l *ArrayList) Add(ele ...interface{}) (suc bool)
- func (l *ArrayList) AddAll(index int, list IList) (suc bool)
- func (l *ArrayList) AddAt(index int, ele ...interface{}) (suc bool)
- func (l *ArrayList) Clear()
- func (l *ArrayList) Contains(ele interface{}) (contains bool)
- func (l *ArrayList) First() (ele interface{}, ok bool)
- func (l *ArrayList) FirstMulti(amount int) (ele []interface{}, ok bool)
- func (l *ArrayList) ForEach(each func(index int, ele interface{}) (stop bool))
- func (l *ArrayList) ForEachLast(each func(index int, ele interface{}) (stop bool))
- func (l *ArrayList) Get(index int) (ele interface{}, ok bool)
- func (l *ArrayList) GetAll() []interface{}
- func (l *ArrayList) GetMulti(index int, amount int) (ele []interface{}, ok bool)
- func (l *ArrayList) GetMultiLast(lastIndex int, amount int) (ele []interface{}, ok bool)
- func (l *ArrayList) IndexOf(ele interface{}) (index int, ok bool)
- func (l *ArrayList) Last() (ele interface{}, ok bool)
- func (l *ArrayList) LastIndexOf(ele interface{}) (index int, ok bool)
- func (l *ArrayList) LastMulti(amount int) (ele []interface{}, ok bool)
- func (l *ArrayList) Len() int
- func (l *ArrayList) RemoveAt(index int) (ele interface{}, suc bool)
- func (l *ArrayList) RemoveFirst() (ele interface{}, suc bool)
- func (l *ArrayList) RemoveFirstMulti(amount int) (ele []interface{}, suc bool)
- func (l *ArrayList) RemoveLast() (ele interface{}, suc bool)
- func (l *ArrayList) RemoveLastMulti(amount int) (ele []interface{}, suc bool)
- func (l *ArrayList) RemoveMultiAt(index int, amount int) (ele []interface{}, suc bool)
- func (l *ArrayList) Swap(i, j int)
- type IList
- type LinkedList
- func (l *LinkedList) Add(ele ...interface{}) (suc bool)
- func (l *LinkedList) AddAll(index int, list IList) (suc bool)
- func (l *LinkedList) AddAt(index int, ele ...interface{}) (suc bool)
- func (l *LinkedList) Clear()
- func (l *LinkedList) Contains(ele interface{}) (contains bool)
- func (l *LinkedList) First() (ele interface{}, ok bool)
- func (l *LinkedList) FirstMulti(amount int) (ele []interface{}, ok bool)
- func (l *LinkedList) ForEach(each func(index int, ele interface{}) (stop bool))
- func (l *LinkedList) ForEachLast(each func(index int, ele interface{}) (stop bool))
- func (l *LinkedList) Get(index int) (ele interface{}, ok bool)
- func (l *LinkedList) GetAll() []interface{}
- func (l *LinkedList) GetMulti(index int, amount int) (ele []interface{}, ok bool)
- func (l *LinkedList) GetMultiLast(lastIndex int, amount int) (ele []interface{}, ok bool)
- func (l *LinkedList) IndexOf(ele interface{}) (index int, ok bool)
- func (l *LinkedList) Last() (ele interface{}, ok bool)
- func (l *LinkedList) LastIndexOf(ele interface{}) (index int, ok bool)
- func (l *LinkedList) LastMulti(amount int) (ele []interface{}, ok bool)
- func (l *LinkedList) Len() int
- func (l *LinkedList) RemoveAt(index int) (ele interface{}, suc bool)
- func (l *LinkedList) RemoveFirst() (ele interface{}, suc bool)
- func (l *LinkedList) RemoveFirstMulti(amount int) (ele []interface{}, suc bool)
- func (l *LinkedList) RemoveLast() (ele interface{}, suc bool)
- func (l *LinkedList) RemoveLastMulti(amount int) (ele []interface{}, suc bool)
- func (l *LinkedList) RemoveMultiAt(index int, amount int) (ele []interface{}, suc bool)
- func (l *LinkedList) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayList ¶
type ArrayList struct {
// contains filtered or unexported fields
}
func NewArrayList ¶
NewArrayList 实例化一个用数组实现的List ArrayList maxSize: 列表允许的最大长度 initCap: 列表数组的初始化cap maxSize >= initCap
func (*ArrayList) FirstMulti ¶
func (*ArrayList) ForEachLast ¶
func (*ArrayList) GetMultiLast ¶
func (*ArrayList) LastIndexOf ¶
func (*ArrayList) RemoveFirst ¶
func (*ArrayList) RemoveFirstMulti ¶
func (*ArrayList) RemoveLast ¶
func (*ArrayList) RemoveLastMulti ¶
func (*ArrayList) RemoveMultiAt ¶
type IList ¶
type IList interface { // Len //the number of elements in the collection. Len() int // Swap // swaps the elements with indexes i and j. Swap(i, j int) // Clear // Removes all of the elements from this list (optional operation). Clear() // Add // Appends the elements to the end of this list (optional operation). Add(ele ...interface{}) (suc bool) // AddAt // Inserts the specified elements at the specified position in this list (optional operation). AddAt(index int, ele ...interface{}) (suc bool) // AddAll // Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation) AddAll(index int, list IList) (suc bool) // RemoveAt // Removes the element at the specified position in this list (optional operation). RemoveAt(index int) (ele interface{}, suc bool) // RemoveMultiAt // Removes some elements at the specified position in this list (optional operation). RemoveMultiAt(index int, amount int) (ele []interface{}, suc bool) // RemoveLast // Removes the last element at from this list (optional operation). RemoveLast() (ele interface{}, suc bool) // RemoveLastMulti // Removes some elements from this list started at the last position. RemoveLastMulti(amount int) (ele []interface{}, suc bool) // RemoveFirst // Removes the first element at from this list (optional operation). RemoveFirst() (ele interface{}, suc bool) // RemoveFirstMulti // Removes some elements from this list started at the first position. RemoveFirstMulti(amount int) (ele []interface{}, suc bool) // Get // Returns the element at the specified position in this list. Get(index int) (ele interface{}, ok bool) // GetMulti // Returns some elements in this list started at the specified position. GetMulti(index int, amount int) (ele []interface{}, ok bool) // GetMultiLast // Returns some elements in this list started at the specified position. GetMultiLast(lastIndex int, amount int) (ele []interface{}, ok bool) // GetAll // Returns all elements in this list. GetAll() []interface{} // First // Returns the first element of this list. First() (ele interface{}, ok bool) // FirstMulti // Returns some elements in this list started at the first position. FirstMulti(amount int) (ele []interface{}, ok bool) // Last // Returns the last element of this list. Last() (ele interface{}, ok bool) // LastMulti // Returns some elements in this list started at the last position. LastMulti(amount int) (ele []interface{}, ok bool) // 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. IndexOf(ele interface{}) (index int, ok bool) // 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. LastIndexOf(ele interface{}) (index int, ok bool) // Contains // Returns true if this list contains the specified element. Contains(ele interface{}) (contains bool) // ForEach // Performs the given action for each element of the list ForEach(each func(index int, ele interface{}) (stop bool)) // ForEachLast // Performs the given action for each element of the list ForEachLast(each func(index int, ele interface{}) (stop bool)) }
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
func (*LinkedList) Add ¶
func (l *LinkedList) Add(ele ...interface{}) (suc bool)
func (*LinkedList) AddAt ¶
func (l *LinkedList) AddAt(index int, ele ...interface{}) (suc bool)
func (*LinkedList) Clear ¶
func (l *LinkedList) Clear()
func (*LinkedList) Contains ¶
func (l *LinkedList) Contains(ele interface{}) (contains bool)
func (*LinkedList) First ¶
func (l *LinkedList) First() (ele interface{}, ok bool)
func (*LinkedList) FirstMulti ¶
func (l *LinkedList) FirstMulti(amount int) (ele []interface{}, ok bool)
func (*LinkedList) ForEach ¶
func (l *LinkedList) ForEach(each func(index int, ele interface{}) (stop bool))
func (*LinkedList) ForEachLast ¶
func (l *LinkedList) ForEachLast(each func(index int, ele interface{}) (stop bool))
func (*LinkedList) Get ¶
func (l *LinkedList) Get(index int) (ele interface{}, ok bool)
func (*LinkedList) GetAll ¶
func (l *LinkedList) GetAll() []interface{}
func (*LinkedList) GetMulti ¶
func (l *LinkedList) GetMulti(index int, amount int) (ele []interface{}, ok bool)
func (*LinkedList) GetMultiLast ¶
func (l *LinkedList) GetMultiLast(lastIndex int, amount int) (ele []interface{}, ok bool)
func (*LinkedList) IndexOf ¶
func (l *LinkedList) IndexOf(ele interface{}) (index int, ok bool)
func (*LinkedList) Last ¶
func (l *LinkedList) Last() (ele interface{}, ok bool)
func (*LinkedList) LastIndexOf ¶
func (l *LinkedList) LastIndexOf(ele interface{}) (index int, ok bool)
func (*LinkedList) LastMulti ¶
func (l *LinkedList) LastMulti(amount int) (ele []interface{}, ok bool)
func (*LinkedList) Len ¶
func (l *LinkedList) Len() int
func (*LinkedList) RemoveAt ¶
func (l *LinkedList) RemoveAt(index int) (ele interface{}, suc bool)
func (*LinkedList) RemoveFirst ¶
func (l *LinkedList) RemoveFirst() (ele interface{}, suc bool)
func (*LinkedList) RemoveFirstMulti ¶
func (l *LinkedList) RemoveFirstMulti(amount int) (ele []interface{}, suc bool)
func (*LinkedList) RemoveLast ¶
func (l *LinkedList) RemoveLast() (ele interface{}, suc bool)
func (*LinkedList) RemoveLastMulti ¶
func (l *LinkedList) RemoveLastMulti(amount int) (ele []interface{}, suc bool)
func (*LinkedList) RemoveMultiAt ¶
func (l *LinkedList) RemoveMultiAt(index int, amount int) (ele []interface{}, suc bool)
func (*LinkedList) Swap ¶
func (l *LinkedList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.