Function

com.reactific.riddl.language.ast.Definitions.Function

A function definition which can be part of a bounded context or an entity.

Value parameters

brief

A brief description (one sentence) for use in documentation

description

An optional description of the function.

examples

The set of examples that define the behavior of the function.

id

The identifier that names the function

input

An optional type expression that names and types the fields of the input of the function

loc

The location of the function definition

output

An optional type expression that names and types the fields of the output of the function

Attributes

Graph
Supertypes

Members list

Value members

Concrete methods

override def isEmpty: Boolean

determine if this node is empty or not.

determine if this node is empty or not. Non-containers are always empty

Attributes

Definition Classes
override def maturity: Int

Compute the 'maturity' of a definition.

Compute the 'maturity' of a definition. Maturity is a score with no maximum but with scoring rules that target 100 points per definition. Maturity is broken down this way:

  • has a description - up to 50 points depending on # of non empty lines

  • has a brief description - 5 points

  • has options specified - 5 points

  • has terms defined -

  • has an author in or above the definition - 5 points \-

  • definition specific things: 0.65

Attributes

Returns
Definition Classes

Inherited methods

Attributes

Inherited from:
BrieflyDescribedValue
def completeness: (Int, Int)

Compute the completeness of this definition.

Compute the completeness of this definition. Vital definitions should have options, terms, and authors but includes are optional. Incompleteness is signalled by child definitions that are empty.

Attributes

Returns

A numerator and denominator for percent complete

Inherited from:
VitalDefinition

Attributes

Inherited from:
DescribedValue
override def format: String

Format the node to a string

Format the node to a string

Attributes

Definition Classes
Inherited from:
WithOptions

Attributes

Inherited from:
WithOptions
override def hasAuthors: Boolean

Attributes

Definition Classes
Inherited from:
WithAuthors
override def hasDefinitions: Boolean

Attributes

Definition Classes
Inherited from:
Definition

Attributes

Inherited from:
WithOptions
override def hasOptions: Boolean

Attributes

Definition Classes
Inherited from:
WithOptions

Attributes

Inherited from:
WithTerms
override def hasTypes: Boolean

Attributes

Definition Classes
Inherited from:
WithTypes

Attributes

Inherited from:
Definition

Attributes

Inherited from:
Definition
override def isContainer: Boolean

Determine if this node is a container or not

Determine if this node is a container or not

Attributes

Definition Classes
Inherited from:
Container
override def isDefinition: Boolean

Attributes

Definition Classes
Inherited from:
Definition

Attributes

Inherited from:
Definition

Attributes

Inherited from:
Container
override def isVital: Boolean

Attributes

Definition Classes
Inherited from:
VitalDefinition
final def nonEmpty: Boolean

Attributes

Inherited from:
RiddlNode

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Definition

Concrete fields

lazy override val contents: Seq[FunctionDefinition]
final val kind: String

Implicits

Inherited implicits

implicit def bool2int(b: Boolean): Int

Implicit conversion of boolean to Int for easier computation of statistics below

Implicit conversion of boolean to Int for easier computation of statistics below

Value parameters

b

The boolean to convert to an Int

Attributes

Returns
Inherited from:
VitalDefinition