RestrictedContext

com.phasmidsoftware.number.algebra.core.RestrictedContext
case class RestrictedContext(factor: Factor) extends Context

A case class that represents a restricted evaluation context for a specific Factor.

The RestrictedContext is a specialized Context implementation that confines its qualifications to a single Factor. It determines whether a given factor matches the specific factor (context) it was instantiated with. This ensures that only evaluations respecting this restricted context are allowed.

Value parameters

factor

the specific factor that defines the restrictive context. Only factors matching this will qualify.

Attributes

Constructor

Creates a RestrictedContext with a predefined Factor to enforce context-based restrictions.

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Context
trait CoreContext
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def factorQualifies(f: Factor): Boolean

Determines whether the given factor qualifies for this Context.

Determines whether the given factor qualifies for this Context.

Value parameters

f

the factor.

Attributes

Returns

true if the factor qualifies; false otherwise.

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

override def and(that: CoreContext): Context

Produces a new context that requires both this context and the provided context to qualify a factor. The resulting context effectively applies a logical AND operation between this context and the given context.

Produces a new context that requires both this context and the provided context to qualify a factor. The resulting context effectively applies a logical AND operation between this context and the given context.

Value parameters

that

the second context that will be combined with this context using a logical AND operation.

Attributes

Returns

a new Context that qualifies a factor only if it qualifies in both this context and the given context.

Definition Classes
Inherited from:
Context
def fieldQualifies(f: Field): Boolean

Checks if the given Field qualifies based on its associated factor, if any.

Checks if the given Field qualifies based on its associated factor, if any.

CONSIDER moving Field into inner package.

Value parameters

f

the field to evaluate.

Attributes

Returns

true if the field's associated factor qualifies, or if no factor is associated; false otherwise.

Inherited from:
CoreContext
override def not: Context

Negates the qualification of a factor in the current context.

Negates the qualification of a factor in the current context.

Attributes

Returns

A new context that inverts the qualification logic for factors.

Definition Classes
Inherited from:
Context
override def or(that: CoreContext): Context

Combines this Context with another Context using a logical OR operation. The resulting Context qualifies a factor if it qualifies in either the current Context or the provided Context.

Combines this Context with another Context using a logical OR operation. The resulting Context qualifies a factor if it qualifies in either the current Context or the provided Context.

Value parameters

that

the other Context to combine with this Context.

Attributes

Returns

a new Context that represents the logical OR of the two contexts.

Definition Classes
Inherited from:
Context
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
def qualifyingEagerValue(so: Option[Eager]): Option[Eager]

Determines if a given optional Scalar is qualified within this context.

Determines if a given optional Scalar is qualified within this context.

The method evaluates the provided optional Scalar's associated factor, and checks if the factor satisfies the qualification criteria defined in this context. If the factor qualifies, the Scalar itself is returned wrapped in an Option. Otherwise, the result is None.

Value parameters

so

an optional Scalar to evaluate; if None is provided, the method directly returns None

Attributes

Returns

an optional Scalar that qualifies, or None if either the input is None or the factor does not meet the qualification criteria

Inherited from:
Context
def qualifyingField(fo: Option[Field]): Option[Field]

Determines whether a given optional field qualifies based on its associated factor.

Determines whether a given optional field qualifies based on its associated factor.

This method evaluates an optional Field to determine if it can be considered a qualifying field within the given context. The Field must have an associated factor, and that factor must qualify based on the fieldQualifies logic.

Value parameters

fo

an optional Field to be evaluated.

Attributes

Returns

an optional Field if it qualifies; otherwise, None.

Inherited from:
CoreContext
def valuableQualifies(v: Valuable): Boolean

Determines whether a given HasValue qualifies in the current Context.

Determines whether a given HasValue qualifies in the current Context.

This method evaluates the provided HasValue object to check if it meets the criteria defined by the Context. The qualification logic is based on the specific type of HasValue. Natural numbers (Nat) automatically qualify, whereas scalar values (Scalar) qualify only if their associated factor meets the required conditions.

Value parameters

v

the HasValue object to check for qualification

Attributes

Returns

true if the HasValue qualifies; otherwise, throws a AlgebraException for unsupported types

Inherited from:
Context