GoCollections/collections/Queue.go

25 lines
527 B
Go
Raw Normal View History

2022-11-25 18:19:33 +08:00
/*
* Copyright (c) 2022 tursom. All rights reserved.
* Use of this source code is governed by a GPL-3
* license that can be found in the LICENSE file.
*/
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)
}
2022-04-24 16:01:22 +08:00
QueueNode[T lang.Object] StackNode[T]
2022-04-23 11:53:41 +08:00
)