GoCollections/collections/Queue.go

19 lines
370 B
Go
Raw Normal View History

2021-05-21 23:07:48 +08:00
package collections
2022-03-21 11:02:41 +08:00
import (
"github.com/tursom/GoCollections/exceptions"
"github.com/tursom/GoCollections/lang"
)
2021-05-21 23:07:48 +08:00
2022-04-23 11:53:41 +08:00
type (
Queue[T lang.Object] interface {
MutableIterable[T]
2021-05-21 23:07:48 +08:00
2022-04-23 11:53:41 +08:00
Offer(element T) exceptions.Exception
OfferAndGetNode(element T) (QueueNode[T], exceptions.Exception)
Poll() (T, exceptions.Exception)
}
QueueNode[T lang.Object] = StackNode[T]
)