Documentation
¶
Index ¶
- type Array
- func (a *Array) Append(value types.Object)
- func (a *Array) Clear()
- func (a *Array) Equals(other types.Object) bool
- func (a *Array) Get(index int) types.Object
- func (a *Array) Insert(index int, value types.Object)
- func (a *Array) Len() int
- func (a *Array) Remove(index int) types.Object
- func (a *Array) Set(index int, value types.Object)
- func (a *Array) ToStr() string
- func (a *Array) TypeCode() uint8
- func (a *Array) TypeName() string
- type Map
- func (m *Map) Clear()
- func (m *Map) Delete(key string) types.Object
- func (m *Map) Equals(other types.Object) bool
- func (m *Map) Get(key string) types.Object
- func (m *Map) Has(key string) bool
- func (m *Map) Keys() *Array
- func (m *Map) Len() int
- func (m *Map) Set(key string, value types.Object)
- func (m *Map) ToStr() string
- func (m *Map) TypeCode() uint8
- func (m *Map) TypeName() string
- func (m *Map) Values() *Array
- type OrderedMap
- func (om *OrderedMap) Clear()
- func (om *OrderedMap) Delete(key string) types.Object
- func (om *OrderedMap) Equals(other types.Object) bool
- func (om *OrderedMap) Get(key string) types.Object
- func (om *OrderedMap) Has(key string) bool
- func (om *OrderedMap) Keys() *Array
- func (om *OrderedMap) Len() int
- func (om *OrderedMap) MoveTo(key string, index int) bool
- func (om *OrderedMap) MoveToFirst(key string) bool
- func (om *OrderedMap) MoveToLast(key string) bool
- func (om *OrderedMap) Set(key string, value types.Object)
- func (om *OrderedMap) Sort(comparator func(a, b string) bool)
- func (om *OrderedMap) ToStr() string
- func (om *OrderedMap) TypeCode() uint8
- func (om *OrderedMap) TypeName() string
- func (om *OrderedMap) Values() *Array
- type Queue
- func (q *Queue) Clear()
- func (q *Queue) Dequeue() types.Object
- func (q *Queue) Enqueue(value types.Object)
- func (q *Queue) Equals(other types.Object) bool
- func (q *Queue) IsEmpty() bool
- func (q *Queue) Len() int
- func (q *Queue) Peek() types.Object
- func (q *Queue) ToStr() string
- func (q *Queue) TypeCode() uint8
- func (q *Queue) TypeName() string
- type RangeIterator
- type Seq
- func (s *Seq) Append(value types.Object) *Seq
- func (s *Seq) AppendMany(values ...types.Object) *Seq
- func (s *Seq) Clear()
- func (s *Seq) Elements() []types.Object
- func (s *Seq) Equals(other types.Object) bool
- func (s *Seq) Fill(value types.Object, count int) *Seq
- func (s *Seq) Filter(fn func(types.Object, int) bool) *Seq
- func (s *Seq) Find(fn func(types.Object, int) bool) types.Object
- func (s *Seq) FindIndex(fn func(types.Object, int) bool) int
- func (s *Seq) ForEach(fn func(types.Object, int))
- func (s *Seq) Get(index int) types.Object
- func (s *Seq) GetAuto(index int) types.Object
- func (s *Seq) Includes(value types.Object) bool
- func (s *Seq) IndexOf(value types.Object) int
- func (s *Seq) Join(sep string) string
- func (s *Seq) Len() int
- func (s *Seq) Map(fn func(types.Object, int) types.Object) *Seq
- func (s *Seq) Pop() types.Object
- func (s *Seq) Range(start, end int) *Seq
- func (s *Seq) Resize(newSize int)
- func (s *Seq) Reverse() *Seq
- func (s *Seq) Set(index int, value types.Object) types.Object
- func (s *Seq) ToStr() string
- func (s *Seq) TypeCode() uint8
- func (s *Seq) TypeName() string
- type Stack
- func (s *Stack) Clear()
- func (s *Stack) Equals(other types.Object) bool
- func (s *Stack) IsEmpty() bool
- func (s *Stack) Len() int
- func (s *Stack) Peek() types.Object
- func (s *Stack) Pop() types.Object
- func (s *Stack) Push(value types.Object)
- func (s *Stack) ToStr() string
- func (s *Stack) TypeCode() uint8
- func (s *Stack) TypeName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
Array represents a dynamic array of objects
func NewArrayWithElements ¶
NewArrayWithElements creates a new array with the given elements
type Map ¶
Map represents an unordered key-value map
type OrderedMap ¶
OrderedMap represents an ordered key-value map that preserves insertion order
func (*OrderedMap) Delete ¶
func (om *OrderedMap) Delete(key string) types.Object
Delete removes the key from the map
func (*OrderedMap) Equals ¶
func (om *OrderedMap) Equals(other types.Object) bool
Equals implements types.Object interface
func (*OrderedMap) Get ¶
func (om *OrderedMap) Get(key string) types.Object
Get returns the value for the given key
func (*OrderedMap) Has ¶
func (om *OrderedMap) Has(key string) bool
Has checks if the map contains the given key
func (*OrderedMap) Keys ¶
func (om *OrderedMap) Keys() *Array
Keys returns all keys in insertion order as an array
func (*OrderedMap) Len ¶
func (om *OrderedMap) Len() int
Len returns the number of entries in the map
func (*OrderedMap) MoveTo ¶
func (om *OrderedMap) MoveTo(key string, index int) bool
MoveTo moves the given key to the specified 0-based index Returns true if the key exists and index is valid, false otherwise
func (*OrderedMap) MoveToFirst ¶
func (om *OrderedMap) MoveToFirst(key string) bool
MoveToFirst moves the given key to the first position
func (*OrderedMap) MoveToLast ¶
func (om *OrderedMap) MoveToLast(key string) bool
MoveToLast moves the given key to the last position
func (*OrderedMap) Set ¶
func (om *OrderedMap) Set(key string, value types.Object)
Set sets the value for the given key
func (*OrderedMap) Sort ¶
func (om *OrderedMap) Sort(comparator func(a, b string) bool)
Sort sorts the map keys using the given comparator
func (*OrderedMap) ToStr ¶
func (om *OrderedMap) ToStr() string
ToStr implements types.Object interface
func (*OrderedMap) TypeCode ¶
func (om *OrderedMap) TypeCode() uint8
TypeCode implements types.Object interface
func (*OrderedMap) TypeName ¶
func (om *OrderedMap) TypeName() string
TypeName implements types.Object interface
func (*OrderedMap) Values ¶
func (om *OrderedMap) Values() *Array
Values returns all values in insertion order as an array
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue represents a FIFO (first-in first-out) data structure
type RangeIterator ¶ added in v1.1.0
type RangeIterator struct {
// contains filtered or unexported fields
}
func NewRangeIterator ¶ added in v1.1.0
func NewRangeIterator(start, end, step int) *RangeIterator
func (*RangeIterator) Equals ¶ added in v1.1.0
func (ri *RangeIterator) Equals(other types.Object) bool
func (*RangeIterator) HasNext ¶ added in v1.1.0
func (ri *RangeIterator) HasNext() bool
func (*RangeIterator) Next ¶ added in v1.1.0
func (ri *RangeIterator) Next() types.Object
func (*RangeIterator) ToStr ¶ added in v1.1.0
func (ri *RangeIterator) ToStr() string
func (*RangeIterator) TypeCode ¶ added in v1.1.0
func (ri *RangeIterator) TypeCode() uint8
func (*RangeIterator) TypeName ¶ added in v1.1.0
func (ri *RangeIterator) TypeName() string
type Seq ¶
type Seq struct {
// contains filtered or unexported fields
}
Seq represents a self-growing sequence (auto-incrementing array) It automatically grows when accessing indices beyond its current length
func NewSeqWithCapacity ¶
NewSeqWithCapacity creates a new sequence with initial capacity
func NewSeqWithElements ¶
NewSeqWithElements creates a new sequence with the given elements
func (*Seq) AppendMany ¶
AppendMany adds multiple elements to the end of the sequence
func (*Seq) Get ¶
Get returns the element at the given index If index is beyond current length, returns undefined (auto-growth on read returns undefined)
func (*Seq) Map ¶
Map returns a new sequence with the results of applying the function to each element
func (*Seq) Resize ¶
Resize changes the size of the sequence If new size is larger, new elements are initialized to undefined If new size is smaller, elements are removed from the end
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack represents a LIFO (last-in first-out) data structure