Class EzrList
- Namespace
- EzrSquared.Runtime.Types.Collections
- Assembly
- ezrSquared-lib.dll
The mutable, list type object.
public class EzrList : EzrObject, IEzrMutableObject, IMutable<IEzrMutableObject>, IEzrIndexedCollection, IEzrEnumerable, IEzrObject
- Inheritance
-
objectEzrList
- Implements
- Inherited Members
Constructors
EzrList(RuntimeEzrObjectList, Context, Position, Position)
public EzrList(RuntimeEzrObjectList elements, Context parentContext, Position startPosition, Position endPosition)
Parameters
elements
RuntimeEzrObjectListThe base value.
parentContext
ContextThe parent context.
startPosition
PositionThe starting position of the object.
endPosition
PositionThe ending position of the object.
Fields
Value
The list value.
public readonly RuntimeEzrObjectList Value
Field Value
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. If the other object is a list, appends its elements.
public override void Addition(IEzrObject other, RuntimeResult result)
Parameters
other
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime result for carrying the result and any errors.
At(int)
Gets the object at the specified index.
public IEzrObject At(int index)
Parameters
index
intThe index.
Returns
- IEzrObject
The object at the index.
Compare(IEzrIndexedCollection, RuntimeResult)
Compares the current list with another collection.
private bool Compare(IEzrIndexedCollection other, RuntimeResult result)
Parameters
other
IEzrIndexedCollectionThe other collection.
result
RuntimeResultRuntime result to carray any errors.
Returns
- bool
The result of the comparison.
ComparisonEqual(IEzrObject, RuntimeResult)
Compares the object to another, checks equality.
public override void ComparisonEqual(IEzrObject other, RuntimeResult result)
Parameters
other
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime result for carrying the result and any errors.
ComparisonLessThan(IEzrObject, RuntimeResult)
Gets the object(s) at the specified index/indices.
public override void ComparisonLessThan(IEzrObject other, RuntimeResult result)
Parameters
other
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime result for carrying the result and any errors.
ComparisonLessThanOrEqual(IEzrObject, RuntimeResult)
Gets the object(s) at the specified index/indices.
public override void ComparisonLessThanOrEqual(IEzrObject other, RuntimeResult result)
Parameters
other
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
RuntimeResultRuntime result for carrying any errors.
Returns
- int
The evaluated value.
Contains(IEzrObject, RuntimeResult)
Checks if the specified object is contained in the current list.
private bool Contains(IEzrObject ezrObject, RuntimeResult result)
Parameters
ezrObject
IEzrObjectThe object to check.
result
RuntimeResultRuntime result to carray any errors.
Returns
- bool
The result of the check.
DeepCopy(RuntimeResult)
Creates a deep copy of the IMutable<T>.
public IMutable<IEzrMutableObject>? DeepCopy(RuntimeResult result)
Parameters
result
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime result for carrying the result and any errors.
Remarks
Here, "divide" means "duplicate/decrease the current value X times".
EvaluateBoolean(RuntimeResult)
Evaluates the current object as a boolean value.
public override bool EvaluateBoolean(RuntimeResult result)
Parameters
result
RuntimeResultRuntime result for carrying any errors.
Returns
- bool
The evaluated value.
~EzrList()
Destructor.
protected ~EzrList()
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
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime result for carrying the result and any errors.
Multiplication(IEzrObject, RuntimeResult)
Performs the multiplication operation between the current object and another.
public override void Multiplication(IEzrObject other, RuntimeResult result)
Parameters
other
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime result for carrying the result and any errors.
Remarks
Here, "multiply" means "duplicate/decrease the current value X times".
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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime result for carrying any errors.
Returns
- bool
Subtraction(IEzrObject, RuntimeResult)
Removes the object(s) at the specified index/indices.
public override void Subtraction(IEzrObject other, RuntimeResult result)
Parameters
other
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
RuntimeResultRuntime result for carrying any errors.
Returns
- string
The evaluated value.