Class TensoricScript<E,​T>

  • Type Parameters:
    E - the type of the elements of the field on which all the calculations are based on.
    T - the type which shall be returned by the script, after it is executed (resolved)
    All Implemented Interfaces:
    java.io.Serializable, Expression<T>, Node
    Direct Known Subclasses:
    DoubleScript

    public abstract class TensoricScript<E,​T>
    extends TensoricExpressionSupport<E>
    implements Expression<T>, java.io.Serializable
    This class is intended to be subclassed in order to describe calculations with tensorics, which shall be executed at a later time. This class itself inherits from TensoricExpressionSupport such that it provides the full capability of the eDSL.

    To define a script, a field has to be given in the constructor, which describes all the operations which can be performed on its elements.

    The script logic itself has to be implemented in the describe() method. To resolve a script, a ResolvingEngine has to be used.

    See Also:
    Serialized Form
    • Constructor Detail

    • Method Detail

      • describe

        protected abstract Expression<T> describe()
      • getChildren

        public java.util.List<Node> getChildren()
        Description copied from interface: Node
        Has to return the children of the node. This must never return null
        Specified by:
        getChildren in interface Node
        Returns:
        a list containing all the children of the node
      • isResolved

        public boolean isResolved()
        Description copied from interface: Expression
        returns true if the expression contains a concrete value. Thus the method Expression.get() can be used to retrieve the actual value. If this method returns false, then the get method will throw an exception.
        Specified by:
        isResolved in interface Expression<E>
        Returns:
        true if the value can be retrieved, false otherwise.
      • get

        public T get()
        Description copied from interface: Expression
        Retrieves the value of the expression. If the expression is deferred, then an expression will be thrown.
        Specified by:
        get in interface Expression<E>
        Returns:
        the value of the expression.
      • getInternalExpression

        public Expression<T> getInternalExpression()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object