Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotInt = fmt.Errorf("Attempting to insert a non-int type") ErrIndexOOB = fmt.Errorf("Index is out of bounds") ErrNotManipulatable = fmt.Errorf("Filtered arrays are not directly manipulatable") ErrMustBeObservable = fmt.Errorf("The inner array must satisfy the Observable interface. Consider wrapping it with the ObservableArray type.") )
Functions ¶
This section is empty.
Types ¶
type Acceptable ¶
type Acceptable func(data interface{}) bool
type Array ¶
type Array interface { Insert(index int, data interface{}) error Remove(i int) (olddata interface{}, err error) Get(index int) interface{} Len() int }
func NewFilteredArray ¶
func NewFilteredArray(inner Array, accept Acceptable) (Array, error)
type BasicArray ¶
type BasicArray struct {
// contains filtered or unexported fields
}
func (*BasicArray) Get ¶
func (a *BasicArray) Get(index int) interface{}
func (*BasicArray) Insert ¶
func (a *BasicArray) Insert(index int, data interface{}) error
func (*BasicArray) Len ¶
func (a *BasicArray) Len() int
func (*BasicArray) Remove ¶
func (a *BasicArray) Remove(i int) (olddata interface{}, err error)
type BoundsCheckingArray ¶
type BoundsCheckingArray struct {
Array
}
func (*BoundsCheckingArray) Get ¶
func (b *BoundsCheckingArray) Get(index int) interface{}
func (*BoundsCheckingArray) Insert ¶
func (b *BoundsCheckingArray) Insert(index int, data interface{}) error
func (*BoundsCheckingArray) Remove ¶
func (b *BoundsCheckingArray) Remove(index int) (interface{}, error)
type Compare ¶
type Compare func(a, b interface{}) ComparisonResult
type ComparisonResult ¶
type ComparisonResult int
const ( Less ComparisonResult = iota Equal Greater )
type InsertedData ¶
type InsertedData struct {
Index int
}
type IntArray ¶
type IntArray struct {
BasicArray
}
type ObservableArray ¶
type ObservableArray struct { util.BasicObservable Array }
func (*ObservableArray) Insert ¶
func (a *ObservableArray) Insert(index int, data interface{}) error
func (*ObservableArray) Remove ¶
func (a *ObservableArray) Remove(i int) (olddata interface{}, err error)
type PriorityQueue ¶
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
type RemovedData ¶
type RemovedData struct { Index int Data interface{} }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.