This library some useful data structures
lang/data
Queue
Implementation of a single-ended queue.
Supports in
operator and iteration
None
void add(this, object obj)
Add object to back of queue
void clear(this)
object peek(this)
Get object from front without popping it.
If queue is empty, null is returned
object pop(this)
Pop object from front.
If queue is empty, null is returned
num size(this)
Deque
Implementation of a double-ended queue.
Supports in
operator and iteration
None
void addBack(this, object obj)
Add object to back of queue
void addFront(this, object obj)
Add object to front of queue
void clear(this)
object peekBack(this)
Get object from front without popping it.
If queue is empty, null is returned
object peekFront(this)
Get object from front without popping it.
If queue is empty, null is returned
object popBack(this)
Pop object from back.
If queue is empty, null is returned
object popFront(this)
Pop object from front.
If queue is empty, null is returned
num size(this)
Set
Implementation of a set.
Can contain only booleans, strings and numbers
Supports in
operator, equality check and iteration
None
_constructor(this, list | void values)
Constructs an empty set and adds all values (if specified)
void add(this, bool | string | num obj)
Add object to set. If object is already in set - nothing happens
void clear(this)
object static intersection(a, b)
Intersection of 2 sets
void remove(this, bool | string | num obj)
Remove object from set. If object is not in set - nothing happens
num size(this)
object static union(a, b)
Union of 2 sets
Bytes
Implementation of a byte array.
Supports equality check, iteration, indexing and subscripts
None
object static and(string | object a, string | object b)
string static asBase64(string | object bytes)
num static asBits(string | object bytes)
num static asSignedInt(string | object bytes)
num static asUnsignedInt(string | object bytes)
bool bitAt(this, num pos)
object static fromBase64(string b64)
object static fromBits(string bits)
object static fromSignedInt(num uint)
object static implies(string | object a, string | object b)
object static nand(string | object a, string | object b)
object static nor(string | object a, string | object b)
object static or(string | object a, string | object b)
void setBitAt(this, num pos, bool bit)
object static xnor(string | object a, string | object b)
object static xor(string | object a, string | object b)