Elements - craterdog/go-component-framework GitHub Wiki
Overview
An element is a primitive component type that cannot be broken down into smaller parts. All primitive component types including element types are immutable.
The following element class types are supported in this package:
Angle
- An angle element represents an angular measurement in the range[0..τ)
, whereτ = 2π
(see The Tau Manifesto for more details). Angle elements support the standard trigonometric operations.Boolean
- A boolean element must have a value offalse
ortrue
and boolean elements support the standard logic operations.Duration
- A duration element represents a "duration of time" represented using ISO 8601 format.Glyph
- A glyph element represents a single 32 bit unicode "code point".Moment
- A moment element represents a "moment in time" represented using ISO 8601 format.Number
- A number element supports most types of numbers including integers, reals, imaginary numbers, and even complex numbers.Percentage
- A percentage element represents the standard concept of a percentage.Probability
- A probability element captures all the real values in the range(0.0..1.0]
and support all of the traditional logic operations.Resource
- A resource element represents any uniform resource identifier (aka URI).Symbol
- A symbol element represents the name of a variable rather than its value.
To view the details of a particular element class type click on the links listed in the side bar in the upper right corner ↗️ of this page.
Class Model
The following UML diagram shows the ClassLike
interfaces (shown in blue)
that are defined for each element class. The ClassLike
interfaces define
the constructors that are used to create new instances of each class type.
The element
package itself defines global functions (shown in yellow) for
accessing each class interface. The global functions are the only concrete
functions defined in the package—everything else is either an abstract type or
an interface. This is in accordance with the Crater Dog Coding Conventions
defined
here.