Documentation ¶
Index ¶
- type BitArray
- type FloatArray
- func (f *FloatArray) Capacity() int
- func (f *FloatArray) GetValue(pos int) float64
- func (f *FloatArray) HasValue(pos int) bool
- func (f *FloatArray) IsEmpty() bool
- func (f *FloatArray) IsSingle() bool
- func (f *FloatArray) Marks() []uint8
- func (f *FloatArray) NewIterator() *FloatArrayIterator
- func (f *FloatArray) Reset()
- func (f *FloatArray) SetSingle(single bool)
- func (f *FloatArray) SetValue(pos int, value float64)
- func (f *FloatArray) Size() int
- type FloatArrayIterator
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitArray ¶
type BitArray struct {
// contains filtered or unexported fields
}
BitArray is a simple struct for maintaining state of a bit array, which is useful for tracking bool type values efficiently. Not thread-safe.
func NewBitArray ¶
NewBitArray returns a new BitArray from buf.
type FloatArray ¶
type FloatArray struct {
// contains filtered or unexported fields
}
FloatArray encapsulates methods for using the float array support mark pos if it has value
func NewFloatArray ¶
func NewFloatArray(capacity int) *FloatArray
NewFloatArray creates a float array with a certain capacity
func (*FloatArray) Capacity ¶
func (f *FloatArray) Capacity() int
Capacity returns the capacity of array
func (*FloatArray) GetValue ¶
func (f *FloatArray) GetValue(pos int) float64
GetValue returns value with pos, if it has not value return 0
func (*FloatArray) HasValue ¶
func (f *FloatArray) HasValue(pos int) bool
HasValue returns if has value with pos
func (*FloatArray) IsSingle ¶
func (f *FloatArray) IsSingle() bool
IsSingle return if is single value
func (*FloatArray) NewIterator ¶
func (f *FloatArray) NewIterator() *FloatArrayIterator
NewIterator returns an iterator over the array
func (*FloatArray) Reset ¶
func (f *FloatArray) Reset()
Reset resets all values and mark for reusing
func (*FloatArray) SetSingle ¶
func (f *FloatArray) SetSingle(single bool)
SetSingle sets is array is single value, mean all values is same
func (*FloatArray) SetValue ¶
func (f *FloatArray) SetValue(pos int, value float64)
SetValue sets value with pos, if pos out of bounds, return it
type FloatArrayIterator ¶
type FloatArrayIterator struct {
// contains filtered or unexported fields
}
FloatArrayIterator represents a float array iterator
func (*FloatArrayIterator) HasNext ¶
func (it *FloatArrayIterator) HasNext() bool
HasNext returns if this iterator has more values
func (*FloatArrayIterator) Next ¶
func (it *FloatArrayIterator) Next() (idx int, value float64)
Next returns the next value and index
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack represents a last-in-first-out(LIFO) stack of interface, using slice saving data. NOTICE: not safe for goroutine concurrent
func (*Stack) Peek ¶
func (s *Stack) Peek() interface{}
Peek looks at the element at the top of this stack without removing it from the stack
func (*Stack) Pop ¶
func (s *Stack) Pop() interface{}
Pop removes the element at the top of this stack, if stack is empty return nil