Documentation of 'org.matheclipse.core.visit.VisitorLevelSpecification' Java class
VisitorLevelSpecification
org.matheclipse.core.visit

Class VisitorLevelSpecification

  • All Implemented Interfaces:
    IVisitor<IExpr>


    public class VisitorLevelSpecification
    extends AbstractVisitor<IExpr>
    A level specification visitor for levels in abstract syntax trees (AST). Example: the nested list [x,[y]] has depth 3
    • Constructor Detail

      • VisitorLevelSpecification

        public VisitorLevelSpecification(Function<IExpr,IExpr> function,
                                         IExpr expr,
                                         boolean includeHeads)
        Create a LevelSpecification from an IInteger or IAST list-object.

        An expr is interpreted as a level specification for the allowed levels in an AST.
        If expr is a non-negative IInteger iValue set Level {1,iValue};
        If expr is a negative IInteger iValue set Level {iValue, 0};
        If expr is a List {i0Value, i1Value} set Level {i0Value, i1Value};
        Parameters:
        function - the function which should be applied for an element
        expr - the given level specification
        includeHeads - set to true, if the header of an AST expression should be included
        Throws:
        MathException - if the expr is not a level specification
      • VisitorLevelSpecification

        public VisitorLevelSpecification(Function<IExpr,IExpr> function,
                                         int level)
        Define a level specification for all elements on level level .
        Parameters:
        level -
      • VisitorLevelSpecification

        public VisitorLevelSpecification(Function<IExpr,IExpr> function,
                                         int level,
                                         boolean includeHeads)
      • VisitorLevelSpecification

        public VisitorLevelSpecification(Function<IExpr,IExpr> function,
                                         int fromLevel,
                                         int toLevel)
      • VisitorLevelSpecification

        public VisitorLevelSpecification(Function<IExpr,IExpr> function,
                                         int fromLevel,
                                         int toLevel,
                                         boolean includeHeads)
      • VisitorLevelSpecification

        public VisitorLevelSpecification(Function<IExpr,IExpr> function,
                                         int fromLevel,
                                         int toLevel,
                                         int fromDepth,
                                         int toDepth,
                                         boolean includeHeads)
        Example value set for including all levels:
        fromLevel = 0;
        toLevel = Integer.MAX_VALUE;
        fromDepth = Integer.MIN_VALUE;
        toDepth = -1;
        Parameters:
        function - the function which should be applied for an element
        fromLevel -
        toLevel -
        fromDepth -
        toDepth -
        includeHeads -

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.