Skip to main content

Class: abstract AbstractModel

The base class for all model elements.

Extended by

Implements

  • ValueObject

Constructors

new AbstractModel()

new AbstractModel(): AbstractModel

Returns

AbstractModel

Accessors

parent

get parent(): undefined | AbstractModel

Returns the parent model element.

Returns

undefined | AbstractModel

The parent model element.

Defined in

packages/verse-core/src/model/model.ts:74

Methods

accept()

abstract accept<T, S>(visitor: ModelVisitor<T, S>, state?: S): T

Accepts a visitor and returns the result of visiting this model element.

Type Parameters

Type ParameterDefault type
T-
Sunknown

Parameters

ParameterTypeDescription
visitorModelVisitor<T, S>The visitor to accept.
state?SAn optional state to pass to the visitor.

Returns

T

The result of visiting this model element.

Defined in

packages/verse-core/src/model/model.ts:41


equals()

abstract equals(other: unknown): boolean

Checks if the current object is equal to the provided object.

Parameters

ParameterTypeDescription
otherunknownThe object to compare with.

Returns

boolean

Whether the objects are equal or not.

Implementation of

ValueObject.equals

Defined in

packages/verse-core/src/model/model.ts:97


hashCode()

abstract hashCode(): number

Returns the hash code of this object.

Returns

number

The hash code.

Implementation of

ValueObject.hashCode

Defined in

packages/verse-core/src/model/model.ts:103


rewrite()

rewrite(rewriter: ModelRewriter): AbstractModel

Rewrite method for processing a given model with a rewriter.

Parameters

ParameterTypeDescription
rewriterModelRewriterThe rewriter to use for rewriting the model.

Returns

AbstractModel

The rewritten model.

Defined in

packages/verse-core/src/model/model.ts:55


toJSON()

toJSON(): string

Returns a JSON representation of this model element.

Returns

string

The JSON representation.

Defined in

packages/verse-core/src/model/model.ts:82


toObject()

abstract toObject(): object

Returns this instance as a plain object.

Returns

object

The plain object.

Defined in

packages/verse-core/src/model/model.ts:47