Table of Contents

Class EzrDictionary

Namespace
EzrSquared.Runtime.Types.Collections
Assembly
ezrSquared-lib.dll

The mutable dictionary type object.

public class EzrDictionary : EzrObject, IEzrMutableObject, IMutable<IEzrMutableObject>, IEzrDictionary, IEzrEnumerable, IEzrObject
Inheritance
object
EzrDictionary
Implements
Inherited Members

Constructors

EzrDictionary(RuntimeEzrObjectDictionary, Context, Position, Position)

Creates a new EzrDictionary.

public EzrDictionary(RuntimeEzrObjectDictionary value, Context parentContext, Position startPosition, Position endPosition)

Parameters

value RuntimeEzrObjectDictionary

The base value.

parentContext Context

The parent context.

startPosition Position

The starting position of the object.

endPosition Position

The ending position of the object.

Fields

Value

The dictionary value.

public readonly RuntimeEzrObjectDictionary Value

Field Value

RuntimeEzrObjectDictionary

Properties

Count

Gets the number of elements in the collection.

[WrapMember("length", false, false)]
public int Count { get; }

Property Value

int

The number of elements in the collection.

Tag

The tag of the type of this object, similar to C# namespace naming conventions.

public override string Tag { get; protected internal set; }

Property Value

string

TypeName

The name of the type of this object, in plain text, all lowercase. Spaces are allowed.

public override string TypeName { get; protected internal set; }

Property Value

string

Methods

Addition(IEzrObject, RuntimeResult)

Appends the current object with the other object and its key. If the other object is a dictionary, merges it with the current object.

public override void Addition(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

At(IEzrObject, RuntimeResult)

Gets the object at the specified key.

public IEzrObject At(IEzrObject key, RuntimeResult result)

Parameters

key IEzrObject

The key.

result RuntimeResult

Runtime result for operations on the key.

Returns

IEzrObject

The object at the key.

Exceptions

KeyNotFoundException

Thrown if the key could not be hashed or was not found.

ComparisonEqual(IEzrObject, RuntimeResult)

Compares the object to another, checks equality.

public override void ComparisonEqual(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComparisonLessThan(IEzrObject, RuntimeResult)

Gets the object at the specified key.

public override void ComparisonLessThan(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComparisonLessThanOrEqual(IEzrObject, RuntimeResult)

Gets the object at the specified key.

public override void ComparisonLessThanOrEqual(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComparisonNotEqual(IEzrObject, RuntimeResult)

Compares the object to another, checks unequality.

public override void ComparisonNotEqual(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComputeHashCode(RuntimeResult)

Evaluates the current object as its hash.

public override int ComputeHashCode(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

int

The evaluated value.

DeepCopy(RuntimeResult)

Creates a deep copy of the IMutable<T>.

public IMutable<IEzrMutableObject>? DeepCopy(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for raising errors./

Returns

IMutable<IEzrMutableObject>

The copy, or, null if failed.

Remarks

The deep copy here means that all IMutable<T> properties and fields in the object are also copied.

Division(IEzrObject, RuntimeResult)

Performs the division operation between the current object and another.

public override void Division(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

Remarks

Here, "divide" means "decrease the number of pairs in the dictionary X times".

~EzrDictionary()

Destructor.

protected ~EzrDictionary()

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<IEzrObject> GetEnumerator()

Returns

IEnumerator<IEzrObject>

An enumerator that can be used to iterate through the collection.

GetEnumerator(RuntimeResult)

Similar to System.Collections.Generic.IEnumerable<T>.GetEnumerator().

public IEnumerator<IEzrObject> GetEnumerator(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying errors.

Returns

IEnumerator<IEzrObject>

The System.Collections.Generic.IEnumerator<T>.

Remarks

Use this when exposing the enumerator to the ezrĀ² runtime. For example, this is used by EzrDictionary to copy read-only keys so that they can't be edited at runtime.

HasValueContained(IEzrObject, RuntimeResult)

Checks if the other object is contained in the current object.

public override void HasValueContained(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

NotHasValueContained(IEzrObject, RuntimeResult)

Checks if the other object is NOT contained in the current object.

public override void NotHasValueContained(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

StrictEquals(IEzrObject, RuntimeResult)

Strictly compares the current object to another, taking into account inheritance.

public override bool StrictEquals(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying any errors.

Returns

bool

Subtraction(IEzrObject, RuntimeResult)

Removes the object at the specified key.

public override void Subtraction(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ToString(RuntimeResult)

Evaluates the current object as a string value.

public override string ToString(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

string

The evaluated value.

TryAt(IEzrObject, RuntimeResult)

Tries to get the object at the specified key.

public IEzrObject? TryAt(IEzrObject key, RuntimeResult result)

Parameters

key IEzrObject

The key.

result RuntimeResult

Runtime result for operations on the key.

Returns

IEzrObject

The object at the key or null if not found or something went wrong.