Library std

v1.0.0Adam Yarris

The standard library for the Qilletni language

Entities

int This is a native Qilletni type. TODO: Add native type examples/descriptions
string This is a native Qilletni type. TODO: Add native type examples/descriptions
boolean This is a native Qilletni type. TODO: Add native type examples/descriptions
collection This is a native Qilletni type. TODO: Add native type examples/descriptions
song This is a native Qilletni type. TODO: Add native type examples/descriptions
album This is a native Qilletni type. TODO: Add native type examples/descriptions
list This is a native Qilletni type. TODO: Add native type examples/descriptions
java This is a native Qilletni type. TODO: Add native type examples/descriptions
Artist An artist who creates songs.
Date An entity that may store a date (not time).
Map A HashMap wrapper that may store keys and values of any type.
Optional An entity that may either hold a value or be empty. The value being held may be anything.
Queue
Stack
User An end user/listener of a song provider that may own playlists.

Global Functions

native fun _emptyJavaMap() Creates an empty HashMap instance.
native fun currentTimeMillis() Gets the current time in milliseconds
native fun exit(code) Exits the program with the given exit code.
native fun getEnv(name) Gets the environment variable of a given name. This will return a string, or throw an error if it can't be found.
fun getEnv(name, default) Gets the environment variable of a given name. If the value is not found, a default value is returned.
native fun hasEnv(name) Checks if an environment variable is set.
fun isEmpty() Checks if the stack is empty.
fun peek() Peeks at the top element of the stack.
native fun print(obj) Prints a string representation of the given object to the console, followed by a newline character.
fun printf(obj, formatParams) Prints a given string to the console, followed by a newline character. The string is formatted with string.format using the parameters provided.
native fun random(min, max) Generates a random integer between an inclusive lower bound and an exclusive upper bound.
fun size() Gets the size of the stack.
fun toList() Converts the stack to a list.

Import Aliases

spotify This is a description for spotify.
spotify.builder This is a description for spotify.builder.
spotify.friends This is a description for spotify.friends.
audio This is a description for audio.

Extension Functions

native fun getAllArtists() on album This is a description for redirectToList.
native fun getArtist() on album This is a description for redirectToList.
native fun getId() on album This is a description for redirectToList.
native fun getName() on album This is a description for redirectToList.
native fun getUrl() on album This is a description for redirectToList.
native fun anySongMatches(fn) on collection This is a description for redirectToList.
native fun containsArtist(artist) on collection This is a description for redirectToList.
native fun getCreator() on collection This is a description for redirectToList.
native fun getId() on collection This is a description for redirectToList.
native fun getName() on collection This is a description for redirectToList.
native fun getTrackCount() on collection This is a description for redirectToList.
native fun getUrl() on collection This is a description for redirectToList.
native fun add(item) on list This is a description for redirectToList.
native fun add(index, item) on list This is a description for redirectToList.
native fun addAll(itemList) on list This is a description for redirectToList.
native fun contains(item) on list This is a description for redirectToList.
native fun indexOf(item) on list This is a description for redirectToList.
fun isEmpty(lst) on list This is a description for redirectToList.
native fun join(delimiter) on list This is a description for redirectToList.
native fun remove(index) on list This is a description for redirectToList.
native fun size() on list This is a description for redirectToList.
native fun sort() on list This is a description for redirectToList.
native fun sortReverse() on list This is a description for redirectToList.
native fun subList(fromIndex, toIndex) on list This is a description for redirectToList.
native fun getAlbum() on song This is a description for redirectToList.
native fun getAllArtists() on song This is a description for redirectToList.
native fun getArtist() on song This is a description for redirectToList.
native fun getDuration() on song This is a description for redirectToList.
native fun getId() on song This is a description for redirectToList.
native fun getTitle() on song This is a description for redirectToList.
native fun getUrl() on song This is a description for redirectToList.
native fun contains(comparing) on string This is a description for redirectToList.
native fun format(formatList) on string This is a description for redirectToList.
native fun length() on string This is a description for redirectToList.
native fun substring(beginIndex) on string This is a description for redirectToList.
native fun substring(beginIndex, endIndex) on string This is a description for redirectToList.
native fun toInt() on string This is a description for redirectToList.
native fun toLower() on string This is a description for redirectToList.
native fun toUpper() on string This is a description for redirectToList.
native fun _emptyJavaMap() link

Creates an empty HashMap instance.

Returns HashMap

An instance of a HashMap

std:util/map.ql
native fun currentTimeMillis() link

Gets the current time in milliseconds

Returns int

The current time in milliseconds

std:core.ql
native fun exit(code) link

Exits the program with the given exit code.

Params
code ( int )

The exit code to exit with

std:core.ql
native fun getEnv(name) link

Gets the environment variable of a given name. This will return a string, or throw an error if it can't be found.

Params
name ( string )

The name of the environment variable to get

Returns

The value of the environment variable

std:core.ql
fun getEnv(name, default) link

Gets the environment variable of a given name. If the value is not found, a default value is returned.

Params
name ( string )

The name of the environment variable to get

defaultValue ( string )

The default value to return if the environment variable is not found

Returns

The value of the environment variable

std:core.ql
native fun hasEnv(name) link

Checks if an environment variable is set.

Params
name ( string )

The name of the environment variable to check for

Returns boolean

true if the environment variable is set, false if otherwise

std:core.ql
fun isEmpty() link

Checks if the stack is empty.

Returns boolean

true if the stack is empty, false if otherwise

std:types/collections/stack.ql
fun peek() link

Peeks at the top element of the stack.

Returns

The top element of the stack

Errors

If the stack is empty

std:types/collections/stack.ql
native fun print(obj) link

Prints a string representation of the given object to the console, followed by a newline character.

Params
obj

The object to print, of any type.

std:core.ql
fun printf(obj, formatParams) link

Prints a given string to the console, followed by a newline character. The string is formatted with string.format using the parameters provided.

Params
obj

The object to print, of any type.

std:core.ql
native fun random(min, max) link

Generates a random integer between an inclusive lower bound and an exclusive upper bound.

Params
min ( int )

The inclusive minimum range of the random number

max ( int )

The exclusive maximum range of the random number

Returns int

A random integer between the given range

std:math.ql
fun size() link

Gets the size of the stack.

Returns int

The size of the stack

std:types/collections/stack.ql
fun toList() link

Converts the stack to a list.

Returns list

A list of all elements in the stack

std:types/collections/stack.ql