home
features
quick start
download
documentation
thymol files
configuration
message resources
control parameters
expression objects
thymol types
thymol API
thymol extensions
examples
sessions
say-hello
stsm example
with-dialect
extrathyme
petclinic
news
credits
user forum
issues
browser constraints
other known issues
create new issue
thymeleaf

thymoljs

thymol types

In creating a JavaScript emulation of a Java framework, it has been necessary to make some compromises with the use of data types associated with the Expression Utility Objects, these are summarised here.

list and array types

As far as Thymol is concerned, List and Array types are interchangeable and are represented by the JavaScript native Array type.

date and calendar types

As far as Thymol is concerned, Date and Calendar types are interchangeable and are represented by the JavaScript native Date type.

set and map types

Thymol includes implementations Set and Map that emulate the Java equivalents as far as is necessary for the Expression Utility Objects to work. These implementations are ThSet and ThMap respectively.

ThSet exports the following functions:

        add = function(key)
        addAll = function(keys)
        clear = function()
        contains = function(key)
        containsAll = function(keys)
        isEmpty = function()
        size = function()
        remove = function(key)
        toArray = function()
        toString = function()

There is another utility function that constructs a ThSet from an Array (removing duplicate keys in the process)

        ThSet.prototype.fromArray = function(array)

ThMap extends ThSet and additionally exports the following functions:

        containsKey = function(key)
        containsValue = function(value)
        entrySet = function()
        get = function(key)
        keySet = function()
        put = function(key, value)
        putAll = function(collection)
        values = function()