Documentation
¶
Index ¶
- Variables
- type ArrayList
- func (this *ArrayList) Add(data ...interface{}) bool
- func (this *ArrayList) AsSlice() interface{}
- func (this *ArrayList) Clear()
- func (this *ArrayList) Clone() interface{}
- func (this *ArrayList) Contains(value interface{}) bool
- func (this *ArrayList) Delete(value interface{}) bool
- func (this *ArrayList) DeleteAt(pos int) bool
- func (this *ArrayList) Elements() []interface{}
- func (this *ArrayList) Enumerator() Enumerator
- func (this *ArrayList) Equals(e interface{}) bool
- func (this *ArrayList) Find(value interface{}) (int, interface{})
- func (this *ArrayList) Get(pos int) interface{}
- func (this *ArrayList) HashCode() int
- func (this *ArrayList) Set(pos int, value interface{})
- func (this *ArrayList) Size() int
- func (this *ArrayList) Sort(less func(a, b interface{}) bool) []interface{}
- func (this *ArrayList) String() string
- type ArrayListEnumerator
- type BigFifo
- type Collection
- type Enumerator
- type Fifo
- type FileFifo
- type HashMap
- func (this *HashMap) Clear()
- func (this *HashMap) Clone() interface{}
- func (this *HashMap) Delete(key Hasher) interface{}
- func (this *HashMap) Elements() []*KeyValue
- func (this *HashMap) Equals(e interface{}) bool
- func (this *HashMap) Get(key Hasher) (interface{}, bool)
- func (this *HashMap) HashCode() int
- func (this *HashMap) Iterator() Iterator
- func (this *HashMap) Put(key Hasher, value interface{}) interface{}
- func (this *HashMap) Size() int
- func (this *HashMap) String() string
- func (this *HashMap) Values() []interface{}
- type HashMapIterator
- type HashSet
- func (this *HashSet) Add(data ...interface{}) bool
- func (this *HashSet) AsSlice() interface{}
- func (this *HashSet) Clear()
- func (this *HashSet) Clone() interface{}
- func (this *HashSet) Contains(value interface{}) bool
- func (this *HashSet) Delete(value interface{}) bool
- func (this *HashSet) Elements() []interface{}
- func (this *HashSet) Enumerator() Enumerator
- func (this *HashSet) Equals(e interface{}) bool
- func (this *HashSet) HashCode() int
- func (this *HashSet) Size() int
- func (this *HashSet) Sort(less func(a, b interface{}) bool) []interface{}
- func (this *HashSet) String() string
- type HashSetEnumerator
- type IList
- type Iterator
- type KeyValue
- type LinkedHashMap
- func (this *LinkedHashMap) Clear()
- func (this *LinkedHashMap) Clone() interface{}
- func (this *LinkedHashMap) Delete(key Hasher) interface{}
- func (this *LinkedHashMap) Elements() []*KeyValue
- func (this *LinkedHashMap) Equals(e interface{}) bool
- func (this *LinkedHashMap) Get(key Hasher) (interface{}, bool)
- func (this *LinkedHashMap) HashCode() int
- func (this *LinkedHashMap) Iterator() Iterator
- func (this *LinkedHashMap) Put(key Hasher, value interface{}) interface{}
- func (this *LinkedHashMap) Size() int
- func (this *LinkedHashMap) String() string
- func (this *LinkedHashMap) Values() []interface{}
- type LinkedHashMapIterator
- type LinkedHashSet
- type Map
Constants ¶
This section is empty.
Variables ¶
var ErrNilData = errors.New("nil data")
var ErrShortRead = errors.New("short read")
Functions ¶
This section is empty.
Types ¶
type ArrayList ¶
type ArrayList struct {
// contains filtered or unexported fields
}
func NewArrayList ¶
func NewArrayList() *ArrayList
func (*ArrayList) Enumerator ¶
func (this *ArrayList) Enumerator() Enumerator
returns a function that in every call return the next value and a flag to see if a value was retrived, even if it was nil
type ArrayListEnumerator ¶
type ArrayListEnumerator struct {
// contains filtered or unexported fields
}
func (*ArrayListEnumerator) HasNext ¶
func (this *ArrayListEnumerator) HasNext() bool
func (*ArrayListEnumerator) Next ¶
func (this *ArrayListEnumerator) Next() interface{}
func (*ArrayListEnumerator) Peek ¶
func (this *ArrayListEnumerator) Peek() interface{}
func (*ArrayListEnumerator) Remove ¶
func (this *ArrayListEnumerator) Remove()
type BigFifo ¶
func NewBigFifo ¶
func NewBigFifo(threshold int, dir string, fileCap int64, codec tk.Codec, zero interface{}) (*BigFifo, error)
NewBigFifo creates a FIFO that after a certain number of elements will use disk files to store the elements.
threshold: buffer size. number after which will store to disk. dir: directory where the files will be created. codec: codec to convert between []byte and interface{} zero: zero data type
func (*BigFifo) Peek ¶
func (this *BigFifo) Peek() interface{}
Peek returns the next element. When we consume it it might be different
type Collection ¶
type Collection interface { Base Size() int Clear() Contains(value interface{}) bool Add(data ...interface{}) bool Delete(key interface{}) bool Enumerator() Enumerator Elements() []interface{} AsSlice() interface{} // returns elements in an array. ex: []int Sort(greater func(a, b interface{}) bool) []interface{} }
type Enumerator ¶
type Enumerator interface { HasNext() bool Next() interface{} Peek() interface{} Remove() }
type Fifo ¶
type Fifo struct {
// contains filtered or unexported fields
}
the Idea is to have a FIFO with a windowing (circular) feature. If the max size is reached, the oldest element will be removed.
func NewLockFifo ¶
NewLockFifo creates a Queue to be accessed concurrently
func (*Fifo) Peek ¶
func (this *Fifo) Peek() interface{}
Peek returns the tail element without removing it.
type FileFifo ¶
type FileFifo struct {
// contains filtered or unexported fields
}
FileFifo stores stores all data to disk.
func NewFileFifo ¶
NewFileFifo creates a FIFO supported by files. The supporting files will have a max size. Whenever that size is exceeded, a new file will be created. When all elements of a file are consumed (Pop) that file will be deleted.
FileFifo is not safe for concurrent access.
type HashMap ¶
type HashMap struct {
// contains filtered or unexported fields
}
func NewHashMap ¶
func NewHashMap() *HashMap
type HashMapIterator ¶
type HashMapIterator struct {
// contains filtered or unexported fields
}
func (*HashMapIterator) HasNext ¶
func (this *HashMapIterator) HasNext() bool
func (*HashMapIterator) Next ¶
func (this *HashMapIterator) Next() *KeyValue
func (*HashMapIterator) Peek ¶
func (this *HashMapIterator) Peek() *KeyValue
func (*HashMapIterator) Remove ¶
func (this *HashMapIterator) Remove()
type HashSet ¶
type HashSet struct {
// contains filtered or unexported fields
}
func NewHashSet ¶
func NewHashSet() *HashSet
func (*HashSet) Enumerator ¶
func (this *HashSet) Enumerator() Enumerator
returns a function that in every call return the next value if no value was retrived
type HashSetEnumerator ¶
type HashSetEnumerator struct {
// contains filtered or unexported fields
}
func (*HashSetEnumerator) HasNext ¶
func (this *HashSetEnumerator) HasNext() bool
func (*HashSetEnumerator) Next ¶
func (this *HashSetEnumerator) Next() interface{}
func (*HashSetEnumerator) Peek ¶
func (this *HashSetEnumerator) Peek() interface{}
func (*HashSetEnumerator) Remove ¶
func (this *HashSetEnumerator) Remove()
type LinkedHashMap ¶
type LinkedHashMap struct {
// contains filtered or unexported fields
}
func NewLinkedHashMap ¶
func NewLinkedHashMap() *LinkedHashMap
func (*LinkedHashMap) Clear ¶
func (this *LinkedHashMap) Clear()
func (*LinkedHashMap) Clone ¶
func (this *LinkedHashMap) Clone() interface{}
func (*LinkedHashMap) Delete ¶
func (this *LinkedHashMap) Delete(key Hasher) interface{}
func (*LinkedHashMap) Elements ¶
func (this *LinkedHashMap) Elements() []*KeyValue
func (*LinkedHashMap) Equals ¶
func (this *LinkedHashMap) Equals(e interface{}) bool
func (*LinkedHashMap) Get ¶
func (this *LinkedHashMap) Get(key Hasher) (interface{}, bool)
func (*LinkedHashMap) HashCode ¶
func (this *LinkedHashMap) HashCode() int
func (*LinkedHashMap) Iterator ¶
func (this *LinkedHashMap) Iterator() Iterator
returns a function that in every call return the next value if key is null, no value was retrieved
func (*LinkedHashMap) Put ¶
func (this *LinkedHashMap) Put(key Hasher, value interface{}) interface{}
func (*LinkedHashMap) Size ¶
func (this *LinkedHashMap) Size() int
func (*LinkedHashMap) String ¶
func (this *LinkedHashMap) String() string
func (*LinkedHashMap) Values ¶
func (this *LinkedHashMap) Values() []interface{}
type LinkedHashMapIterator ¶
type LinkedHashMapIterator struct {
// contains filtered or unexported fields
}
func (*LinkedHashMapIterator) HasNext ¶
func (this *LinkedHashMapIterator) HasNext() bool
func (*LinkedHashMapIterator) Next ¶
func (this *LinkedHashMapIterator) Next() *KeyValue
func (*LinkedHashMapIterator) Peek ¶
func (this *LinkedHashMapIterator) Peek() *KeyValue
func (*LinkedHashMapIterator) Remove ¶
func (this *LinkedHashMapIterator) Remove()
type LinkedHashSet ¶
type LinkedHashSet struct {
HashSet
}
func NewLinkedHashSet ¶
func NewLinkedHashSet() *LinkedHashSet
func (*LinkedHashSet) Clear ¶
func (this *LinkedHashSet) Clear()
func (*LinkedHashSet) HashCode ¶
func (this *LinkedHashSet) HashCode() int