Documentation ¶
Index ¶
- Constants
- func C128equal(p, q unsafe.Pointer) bool
- func C128hash(p unsafe.Pointer, h uintptr) uintptr
- func C64equal(p, q unsafe.Pointer) bool
- func C64hash(p unsafe.Pointer, h uintptr) uintptr
- func F32equal(p, q unsafe.Pointer) bool
- func F32hash(p unsafe.Pointer, h uintptr) uintptr
- func F64equal(p, q unsafe.Pointer) bool
- func F64hash(p unsafe.Pointer, h uintptr) uintptr
- func Fastrand() uint32
- func Interequal(p, q unsafe.Pointer) bool
- func Interhash(p unsafe.Pointer, h uintptr) uintptr
- func Memequal0(p, q unsafe.Pointer) bool
- func Memequal128(p, q unsafe.Pointer) bool
- func Memequal16(p, q unsafe.Pointer) bool
- func Memequal32(p, q unsafe.Pointer) bool
- func Memequal64(p, q unsafe.Pointer) bool
- func Memequal8(p, q unsafe.Pointer) bool
- func Memhash0(p unsafe.Pointer, h uintptr) uintptr
- func Memhash128(p unsafe.Pointer, h uintptr) uintptr
- func Memhash16(p unsafe.Pointer, h uintptr) uintptr
- func Memhash32(p unsafe.Pointer, seed uintptr) uintptr
- func Memhash64(p unsafe.Pointer, seed uintptr) uintptr
- func Memhash8(p unsafe.Pointer, h uintptr) uintptr
- func Nilinterequal(p, q unsafe.Pointer) bool
- func Nilinterhash(p unsafe.Pointer, h uintptr) uintptr
- func Strequal(p, q unsafe.Pointer) bool
- func Strhash(a unsafe.Pointer, h uintptr) uintptr
- func SyncRuntimeCanSpin(i int) bool
- func SyncRuntimeDoSpin()
- func SyncRuntimeNanoTime() int64
- func SyncRuntimeSemacquire(s *uint32)
- func SyncRuntimeSemacquireMutex(s *uint32, lifo bool)
- func SyncRuntimeSemrelease(s *uint32, handoff bool)
- type BlockingQueue
- type Collection
- type Comparable
- type Comparator
- type ConcurrentHashMap
- type CounterCell
- type Iterable
- type Iterator
- type Object
- type PriorityBlockingQueue
- func (this *PriorityBlockingQueue) Add(i interface{}) bool
- func (this *PriorityBlockingQueue) AddAll(coll Collection) bool
- func (this *PriorityBlockingQueue) Clear()
- func (this *PriorityBlockingQueue) Contains(i interface{}) bool
- func (this *PriorityBlockingQueue) ContainsAll(coll Collection) bool
- func (this *PriorityBlockingQueue) DrainTo(coll Collection) int
- func (this *PriorityBlockingQueue) DrainToWithLimit(coll Collection, total int) int
- func (this *PriorityBlockingQueue) Element() interface{}
- func (this *PriorityBlockingQueue) Equals(i interface{}) bool
- func (this *PriorityBlockingQueue) FillArray(arr []interface{}) []interface{}
- func (this *PriorityBlockingQueue) ForEach(consumer func(i interface{}))
- func (this *PriorityBlockingQueue) HashCode() int
- func (this *PriorityBlockingQueue) IsEmpty() bool
- func (this *PriorityBlockingQueue) Iterator() Iterator
- func (this *PriorityBlockingQueue) Offer(i interface{}) bool
- func (this *PriorityBlockingQueue) OfferWithTimeout(i interface{}, t time.Duration) bool
- func (this *PriorityBlockingQueue) Peek() interface{}
- func (this *PriorityBlockingQueue) Poll() interface{}
- func (this *PriorityBlockingQueue) PollWithTimeout(t time.Duration) interface{}
- func (this *PriorityBlockingQueue) Put(i interface{})
- func (this *PriorityBlockingQueue) RemainingCapacity() int
- func (this *PriorityBlockingQueue) Remove(i interface{}) bool
- func (this *PriorityBlockingQueue) RemoveAll(coll Collection) bool
- func (this *PriorityBlockingQueue) RemoveHead() interface{}
- func (this *PriorityBlockingQueue) RemoveIf(predicate func(i interface{}) bool) bool
- func (this *PriorityBlockingQueue) RetainAll(coll Collection) bool
- func (this *PriorityBlockingQueue) Size() int
- func (this *PriorityBlockingQueue) Take() interface{}
- func (this *PriorityBlockingQueue) ToArray() []interface{}
- type PriorityQueue
- func (this *PriorityQueue) Add(i interface{}) bool
- func (this *PriorityQueue) AddAll(coll Collection) bool
- func (this *PriorityQueue) Clear()
- func (this *PriorityQueue) Contains(i interface{}) bool
- func (this *PriorityQueue) ContainsAll(coll Collection) bool
- func (this *PriorityQueue) Element() interface{}
- func (this *PriorityQueue) Equals(i interface{}) bool
- func (this *PriorityQueue) FillArray(arr []interface{}) []interface{}
- func (this *PriorityQueue) ForEach(consumer func(i interface{}))
- func (this *PriorityQueue) HashCode() int
- func (this *PriorityQueue) IsEmpty() bool
- func (this *PriorityQueue) Iterator() Iterator
- func (this *PriorityQueue) Offer(i interface{}) bool
- func (this *PriorityQueue) Peek() interface{}
- func (this *PriorityQueue) Poll() interface{}
- func (this *PriorityQueue) Remove(item interface{}) bool
- func (this *PriorityQueue) RemoveAll(coll Collection) bool
- func (this *PriorityQueue) RemoveHead() interface{}
- func (this *PriorityQueue) RemoveIf(predicate func(i interface{}) bool) bool
- func (this *PriorityQueue) RetainAll(coll Collection) bool
- func (this *PriorityQueue) Size() int
- func (this *PriorityQueue) ToArray() []interface{}
- type Queue
Constants ¶
const (
CacheLineSize = 64
)
FIXME!
Variables ¶
This section is empty.
Functions ¶
func Interequal ¶
func Memequal128 ¶
func Memequal16 ¶
func Memequal32 ¶
func Memequal64 ¶
func Nilinterequal ¶
func SyncRuntimeCanSpin ¶
Active spinning runtime support. runtime_canSpin returns true is spinning makes sense at the moment.
func SyncRuntimeSemacquire ¶
func SyncRuntimeSemacquire(s *uint32)
Semacquire waits until *s > 0 and then atomically decrements it. It is intended as a simple sleep primitive for use by the synchronization library and should not be used directly.
func SyncRuntimeSemacquireMutex ¶
SemacquireMutex is like Semacquire, but for profiling contended Mutexes. If lifo is true, queue waiter at the head of wait queue.
func SyncRuntimeSemrelease ¶
Semrelease atomically increments *s and notifies a waiting goroutine if one is blocked in Semacquire. It is intended as a simple wakeup primitive for use by the synchronization library and should not be used directly. If handoff is true, pass count directly to the first waiter.
Types ¶
type BlockingQueue ¶
type Collection ¶
type Collection interface { Iterable Size() int IsEmpty() bool Contains(i interface{}) bool ToArray() []interface{} FillArray(arr []interface{}) []interface{} Add(i interface{}) bool Remove(i interface{}) bool ContainsAll(coll Collection) bool AddAll(coll Collection) bool RemoveAll(coll Collection) bool RemoveIf(predicate func(i interface{}) bool) bool RetainAll(coll Collection) bool Clear() Equals(i interface{}) bool HashCode() int }
type Comparable ¶
type Comparable interface {
CompareTo(i interface{}) int
}
this interface is used for ordering the objects of each struct
type Comparator ¶
type Comparator interface {
Compare(o1, o2 interface{}) int
}
this interface represents the function that compares two objects
type ConcurrentHashMap ¶
type ConcurrentHashMap struct {
// contains filtered or unexported fields
}
TODO list 1. LongAdder like total count 2. bucket tree degenerate, ps: golang has no build-in comparable interface 3. iterator 4. multi-goroutine cooperate resize
func NewConcurrentHashMap ¶
func NewConcurrentHashMap(initialCapacity, concurrencyLevel int32) *ConcurrentHashMap
func (*ConcurrentHashMap) Contains ¶
func (m *ConcurrentHashMap) Contains(key interface{}) bool
func (*ConcurrentHashMap) IsEmpty ¶
func (m *ConcurrentHashMap) IsEmpty() bool
func (*ConcurrentHashMap) Load ¶
func (m *ConcurrentHashMap) Load(key interface{}) (interface{}, bool)
func (*ConcurrentHashMap) Size ¶
func (m *ConcurrentHashMap) Size() int
func (*ConcurrentHashMap) Store ¶
func (m *ConcurrentHashMap) Store(key, value interface{}) interface{}
type CounterCell ¶
type CounterCell struct {
// contains filtered or unexported fields
}
type Iterable ¶
type Iterable interface { Iterator() Iterator ForEach(consumer func(i interface{})) }
type Iterator ¶
type Iterator interface { HasNext() bool Next() interface{} Remove() ForEachRemaining(consumer func(i interface{})) }
type Object ¶
type Object interface {
Equals(i interface{}) bool
}
this interface imposes basic operations on objects
type PriorityBlockingQueue ¶
type PriorityBlockingQueue struct {
// contains filtered or unexported fields
}
func NewPriorityBlockingQueue ¶
func NewPriorityBlockingQueue() *PriorityBlockingQueue
func NewPriorityBlockingQueueWithComparator ¶
func NewPriorityBlockingQueueWithComparator(comparator Comparator) *PriorityBlockingQueue
func (*PriorityBlockingQueue) Add ¶
func (this *PriorityBlockingQueue) Add(i interface{}) bool
func (*PriorityBlockingQueue) AddAll ¶
func (this *PriorityBlockingQueue) AddAll(coll Collection) bool
func (*PriorityBlockingQueue) Clear ¶
func (this *PriorityBlockingQueue) Clear()
func (*PriorityBlockingQueue) Contains ¶
func (this *PriorityBlockingQueue) Contains(i interface{}) bool
func (*PriorityBlockingQueue) ContainsAll ¶
func (this *PriorityBlockingQueue) ContainsAll(coll Collection) bool
func (*PriorityBlockingQueue) DrainTo ¶
func (this *PriorityBlockingQueue) DrainTo(coll Collection) int
func (*PriorityBlockingQueue) DrainToWithLimit ¶
func (this *PriorityBlockingQueue) DrainToWithLimit(coll Collection, total int) int
func (*PriorityBlockingQueue) Element ¶
func (this *PriorityBlockingQueue) Element() interface{}
func (*PriorityBlockingQueue) Equals ¶
func (this *PriorityBlockingQueue) Equals(i interface{}) bool
func (*PriorityBlockingQueue) FillArray ¶
func (this *PriorityBlockingQueue) FillArray(arr []interface{}) []interface{}
func (*PriorityBlockingQueue) ForEach ¶
func (this *PriorityBlockingQueue) ForEach(consumer func(i interface{}))
func (*PriorityBlockingQueue) HashCode ¶
func (this *PriorityBlockingQueue) HashCode() int
func (*PriorityBlockingQueue) IsEmpty ¶
func (this *PriorityBlockingQueue) IsEmpty() bool
func (*PriorityBlockingQueue) Iterator ¶
func (this *PriorityBlockingQueue) Iterator() Iterator
func (*PriorityBlockingQueue) Offer ¶
func (this *PriorityBlockingQueue) Offer(i interface{}) bool
func (*PriorityBlockingQueue) OfferWithTimeout ¶
func (this *PriorityBlockingQueue) OfferWithTimeout(i interface{}, t time.Duration) bool
func (*PriorityBlockingQueue) Peek ¶
func (this *PriorityBlockingQueue) Peek() interface{}
func (*PriorityBlockingQueue) Poll ¶
func (this *PriorityBlockingQueue) Poll() interface{}
func (*PriorityBlockingQueue) PollWithTimeout ¶
func (this *PriorityBlockingQueue) PollWithTimeout(t time.Duration) interface{}
func (*PriorityBlockingQueue) Put ¶
func (this *PriorityBlockingQueue) Put(i interface{})
func (*PriorityBlockingQueue) RemainingCapacity ¶
func (this *PriorityBlockingQueue) RemainingCapacity() int
func (*PriorityBlockingQueue) Remove ¶
func (this *PriorityBlockingQueue) Remove(i interface{}) bool
func (*PriorityBlockingQueue) RemoveAll ¶
func (this *PriorityBlockingQueue) RemoveAll(coll Collection) bool
func (*PriorityBlockingQueue) RemoveHead ¶
func (this *PriorityBlockingQueue) RemoveHead() interface{}
func (*PriorityBlockingQueue) RemoveIf ¶
func (this *PriorityBlockingQueue) RemoveIf(predicate func(i interface{}) bool) bool
func (*PriorityBlockingQueue) RetainAll ¶
func (this *PriorityBlockingQueue) RetainAll(coll Collection) bool
func (*PriorityBlockingQueue) Size ¶
func (this *PriorityBlockingQueue) Size() int
func (*PriorityBlockingQueue) Take ¶
func (this *PriorityBlockingQueue) Take() interface{}
func (*PriorityBlockingQueue) ToArray ¶
func (this *PriorityBlockingQueue) ToArray() []interface{}
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
func NewPriority ¶
func NewPriority() *PriorityQueue
func NewPriorityWithComparator ¶
func NewPriorityWithComparator(comparator Comparator) *PriorityQueue
func (*PriorityQueue) Add ¶
func (this *PriorityQueue) Add(i interface{}) bool
func (*PriorityQueue) AddAll ¶
func (this *PriorityQueue) AddAll(coll Collection) bool
func (*PriorityQueue) Clear ¶
func (this *PriorityQueue) Clear()
func (*PriorityQueue) Contains ¶
func (this *PriorityQueue) Contains(i interface{}) bool
func (*PriorityQueue) ContainsAll ¶
func (this *PriorityQueue) ContainsAll(coll Collection) bool
func (*PriorityQueue) Element ¶
func (this *PriorityQueue) Element() interface{}
func (*PriorityQueue) Equals ¶
func (this *PriorityQueue) Equals(i interface{}) bool
func (*PriorityQueue) FillArray ¶
func (this *PriorityQueue) FillArray(arr []interface{}) []interface{}
func (*PriorityQueue) ForEach ¶
func (this *PriorityQueue) ForEach(consumer func(i interface{}))
func (*PriorityQueue) HashCode ¶
func (this *PriorityQueue) HashCode() int
func (*PriorityQueue) IsEmpty ¶
func (this *PriorityQueue) IsEmpty() bool
func (*PriorityQueue) Iterator ¶
func (this *PriorityQueue) Iterator() Iterator
func (*PriorityQueue) Offer ¶
func (this *PriorityQueue) Offer(i interface{}) bool
func (*PriorityQueue) Peek ¶
func (this *PriorityQueue) Peek() interface{}
func (*PriorityQueue) Poll ¶
func (this *PriorityQueue) Poll() interface{}
func (*PriorityQueue) Remove ¶
func (this *PriorityQueue) Remove(item interface{}) bool
func (*PriorityQueue) RemoveAll ¶
func (this *PriorityQueue) RemoveAll(coll Collection) bool
func (*PriorityQueue) RemoveHead ¶
func (this *PriorityQueue) RemoveHead() interface{}
func (*PriorityQueue) RemoveIf ¶
func (this *PriorityQueue) RemoveIf(predicate func(i interface{}) bool) bool
func (*PriorityQueue) RetainAll ¶
func (this *PriorityQueue) RetainAll(coll Collection) bool
func (*PriorityQueue) Size ¶
func (this *PriorityQueue) Size() int
func (*PriorityQueue) ToArray ¶
func (this *PriorityQueue) ToArray() []interface{}
type Queue ¶
type Queue interface { Collection Offer(i interface{}) bool // retrieve and remove head // panic if empty RemoveHead() interface{} // retrieve and remove head // return nil if empty Poll() interface{} // retrieve head of the queue // panic if empty Element() interface{} // retrieve head of the queue // return nil if empty Peek() interface{} }