func (q *queue) Clear() {
	for e := q.head; e != nil; {
		next := e.next
		e.next, e.value = nil, nil
		e = next
	}
	q.head, q.tail, q.length = nil, nil, 0
}
Clear removes all the elements from this queue.
package queue
import (
	"github.com/ahrtr/gocontainer/collection"
)
type Interface interface {
	collection.Interface
	Add(vals ...interface{})
	Peek() interface{}
	Poll() interface{}
}
type element struct {
	next  *element
	value interface{}
}
type queue struct {
	head   *element
	tail   *element
	length int
}
func New() Interface {
	return &queue{
		head:   nil,
		tail:   nil,
		length: 0,
	}
}
func (q *queue) Size() int {
	return q.length
}
func (q *queue) IsEmpty() bool {
	return q.Size() == 0
}
func (q *queue) Add(vals ...interface{}) {
	for _, v := range vals {
		e := element{
			next:  nil,
			value: v,
		}
		if nil == q.tail {
			q.head, q.tail = &e, &e
		} else {
			q.tail.next = &e
			q.tail = &e
		}
		q.length++
	}
}
func (q *queue) Peek() interface{} {
	if q.head != nil {
		return q.head.value
	}
	return nil
}
func (q *queue) Poll() interface{} {
	if q.head != nil {
		val := q.head.value
		q.head = q.head.next
		if nil == q.head {
			q.tail = nil
		}
		q.length--
		return val
	}
	return nil
}