Core Types (pdk.core)

Contains core data structure definitions

Any

A root type from which all other data types and structures are derived.

Superstructures: none


Object

A superstructure for all non-primitive structures (i.e. those not used to describe simple data types).

A primitive data structure (simple type) cannot contain any other properties, only its own value.

Superstructures: Any


UserObject

A base structure from which all user-defined data structures are derived.

Superstructures: Object <- Any


Number

A superstructure for all numeric data types.

Superstructures: Any


Integer

Represents whole numbers and to store numeric values without fractional or decimal parts. These values can be both positive and negative.

Superstructures: Number <- Any


Float

Represents real numbers - numbers that can contain a fractional component (have a decimal point) . It is used to store both positive and negative real numbers with arbitrary precision.

Superstructures: Number <- Any


String

Represents a sequence of characters, typically intended to store and manipulate text. A string can contain any letters, numbers, symbols, and whitespace characters.

Superstructures: Object <- Any


Boolean

Represents a simple binary/logical value that can be either true or false.

Superstructures: Any


Date

Represents a specific moment in date and time with millisecond precision.

The Date structure is intended to reflect coordinated universal time (UTC). Nearly all modern operating systems assume that 1 day = 24 × 60 × 60 = 86400 seconds in all cases. In UTC, however, about once every year or two there is an extra second, called a "leap second".

In all platform functions using Date type that accept or return year, month, date, hours, minutes, and seconds values, the following representations are used:

  • A year y is represented by the integer y - 1900.

  • A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December.

  • A date (day of month) is represented by an integer from 1 to 31 in the usual manner.

  • An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is hour 0, and the hour from noon to 1 p.m. is hour 12.

  • A minute is represented by an integer from 0 to 59 in the usual manner.

  • A second is represented by an integer from 0 to 61; the values 60 and 61 occur only for leap seconds. Because of the manner in which leap seconds are currently introduced, it is extremely unlikely that two leap seconds will occur in the same minute, but this specification follows the date and time conventions for ISO C.

In all cases, arguments given to methods for these purposes need not fall within the indicated ranges; for example, a date may be specified as January 32 and is interpreted as meaning February 1.

Superstructures: Any


Byte

Represents an 8-bit signed integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The byte structure can be useful sometimes to save memory occupied by very large arrays.

Superstructures: Any


Array

A data structure that stores a collection of items, such as a sequence of elements, of the same type. Each element in an array can be accessed by its index, which starts with 0 (i.e. the first element in an array is referenced by an index of 0).

Example:

numbers : Array<String>
numbers = ['A', 'B', 'C']

index of 'A' = 0
index of 'B' = 1
index of 'C' = 2

Array is a parameterized type. It means that the type of the array's elements must be explicitly chosen in a property with Array type is defined.

Example of parameterization:

Animal extends UserObject
Tiger extends Animal
Capybara extends Animal

Zoo extends UserObject
    allAnimals:  Array<Animal>
    tigers:  Array<Tiger>

In the above example, allAnimals array can hold both Tiger and Capybara elements, while tigers can hold only Tiger.

Superstructures: Object <- Any


Map

A structure that maps string keys to values so that each value can be looked up by its unique key. A map cannot contain duplicate keys: each key can map to at most one value.

Keys in the map can only be of type pdk.core.String

Map is a parameterized type.

Here is an example in a pseudo-language to demonstrate its use:

orders: Map<Order> = {} // empty map

// Populate new book order structure instance
bookOrder: Order = {
    "id": 1,
    "price": 10.99,
    "count": 5
}

// Call Map.put() function to add a new map entry
Map.put(orders, "1", bookOrder)

// Resulting map
orders = {
    "1": {
        "id": 1,
        "price": 10.99,
        "count": 5
    }
}

Superstructures: Object <- Any


MapEntry

A single entry (key-value pair) in the pdk.core.Map data structure.

MapEntry is a parameterized type.

Properties:

Last updated