Documentation ¶
Index ¶
- type List
- type SimpleList
- func (l *SimpleList) Back() interface{}
- func (l *SimpleList) Find(i interface{}) bool
- func (l *SimpleList) Foreach(f func(interface{}) bool)
- func (l *SimpleList) Front() interface{}
- func (l *SimpleList) Len() int
- func (l *SimpleList) PopBack() interface{}
- func (l *SimpleList) PopFront() interface{}
- func (l *SimpleList) PushBack(o interface{})
- func (l *SimpleList) PushFront(o interface{})
- func (l *SimpleList) Remove(o interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List interface { // PushBack push value in tail // @param o value PushBack(o interface{}) // PushFront push value in head // @param o value PushFront(o interface{}) // Remove remove an element // @param o value Remove(o interface{}) // Front get head element // @return interface{} Front() interface{} // Back get tail element // @return interface{} Back() interface{} // PopFront pop head element // @return interface{} PopFront() interface{} // PopBack pop tail element // @return interface{} PopBack() interface{} // Len calc list length // @return int Len() int // Foreach The function that accepts polling returns true to continue polling and false to terminate polling // @param f function Foreach(f func(interface{}) bool) // Find find element in list // @param i element // @return bool exist => true, not exist => false Find(i interface{}) bool }
type SimpleList ¶
type SimpleList struct {
// contains filtered or unexported fields
}
func NewSimpleList ¶
func NewSimpleList() *SimpleList
func (*SimpleList) Back ¶
func (l *SimpleList) Back() interface{}
Back Tail element (the last element), if nil is not returned
@receiver l @return interface{}
func (*SimpleList) Find ¶
func (l *SimpleList) Find(i interface{}) bool
Find Query whether there is a parameter object in the linked list
@receiver l list @param i elemnt @return bool success is true, fail is false
func (*SimpleList) Foreach ¶
func (l *SimpleList) Foreach(f func(interface{}) bool)
Foreach
@receiver l @param f The function that accepts polling returns true to continue polling and false to terminate polling
func (*SimpleList) Front ¶
func (l *SimpleList) Front() interface{}
Front First element (first element), if nil is not returned
@receiver l list @return interface{}
func (*SimpleList) Len ¶
func (l *SimpleList) Len() int
Len get list length
@receiver l list @return int list length
func (*SimpleList) PopBack ¶
func (l *SimpleList) PopBack() interface{}
PopBack Get the tail element and remove it, if nil is not returned
@receiver l list @return interface{}
func (*SimpleList) PopFront ¶
func (l *SimpleList) PopFront() interface{}
PopFront Get the first element and remove it, if nil is not returned
@receiver l list @return interface{}
func (*SimpleList) PushBack ¶
func (l *SimpleList) PushBack(o interface{})
PushBack add an element at the end of the linked list
@receiver l list @param o element
func (*SimpleList) PushFront ¶
func (l *SimpleList) PushFront(o interface{})
PushFront Add an element at the head of the linked list
@receiver l list @param o element
func (*SimpleList) Remove ¶
func (l *SimpleList) Remove(o interface{})
Remove remove element in list
@receiver l list @param o element
Click to show internal directories.
Click to hide internal directories.