Documentation of 'org.matheclipse.core.eval.exception.Validate' Java class
Validate
org.matheclipse.core.eval.exception

Class Validate



  • public final class Validate
    extends java.lang.Object
    Static methods to be called at the start of the built-in IFunctionEvaluator#evaluate() methods to verify correct arguments and state.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static ISymbol checkAssignedVariable(IExpr expr)
      Check if the argument is a symbol and has an assigned value.
      static IAST checkASTType(IAST ast, int position)
      Check if the argument at the given position is an AST.
      static IAST checkASTType(IExpr expr)
      Check if the expression is an AST.
      static IAST checkASTUpRuleType(IExpr expr)
      Check if the argument at the given position is an AST.
      static IAST checkEven(IAST ast)
      If ast.size()-1 is not even throw a WrongNumberOfArguments exception.
      static IInteger checkIntegerType(IAST ast, int position)
      Check if the argument at the given position is a integer.
      static int checkIntType(IAST ast, int pos)
      Check the argument, if it's a Java int value in the range [0, Integer.MAX_VALUE]
      static int checkIntType(IAST ast, int pos, int startValue)
      Check the argument, if it's a Java int value in the range [ startValue, Integer.MAX_VALUE]
      static int checkIntType(IExpr expr) 
      static int checkIntType(IExpr expr, int startValue)
      Check the expression, if it's a Java int value in the range [ startValue, Integer.MAX_VALUE]
      static IAST checkOdd(IAST ast)
      If ast.size()-1 is not odd throw a WrongNumberOfArguments exception.
      static int checkPowerExponent(IAST ast)
      Get the exponent int value of the ast expressions, which is identified as a Power[<something>, exponent] expression.
      static IAST checkRange(IAST ast, int from)
      If ast.size() < from throw a WrongNumberOfArguments exception.
      static IAST checkRange(IAST ast, int from, int to)
      If ast.size() < from || ast.size() > to throw a WrongNumberOfArguments exception.
      static IAST checkSize(IAST ast, int size)
      If ast.size() != size throw a WrongNumberOfArguments exception.
      static IStringX checkStringType(IAST ast, int position)
      Check if the argument at the given position is a IStringX string object.
      static IAST checkSymbolList(IAST ast, int position)
      Check if the argument at the given position is a single symbol or a list of symbols.
      static IAST checkSymbolOrSymbolList(IAST ast, int position)
      Check if the argument at the given position is a single symbol or a list of symbols.
      static ISymbol checkSymbolType(IAST ast, int position)
      Check if the argument at the given position is a symbol.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkIntType

        public static int checkIntType(IAST ast,
                                       int pos)
        Check the argument, if it's a Java int value in the range [0, Integer.MAX_VALUE]
        Throws:
        WrongArgumentType
      • checkPowerExponent

        public static int checkPowerExponent(IAST ast)
        Get the exponent int value of the ast expressions, which is identified as a Power[<something>, exponent] expression. The int value can be determined from an IInteger or INum expression.
        Parameters:
        ast -
        Returns:
        the exponent int value of the Power[<something>, exponent] expression.
        Throws:
        WrongArgumentType
      • checkIntType

        public static int checkIntType(IAST ast,
                                       int pos,
                                       int startValue)
        Check the argument, if it's a Java int value in the range [ startValue, Integer.MAX_VALUE]
        Throws:
        WrongArgumentType
      • checkIntType

        public static int checkIntType(IExpr expr)
      • checkIntType

        public static int checkIntType(IExpr expr,
                                       int startValue)
        Check the expression, if it's a Java int value in the range [ startValue, Integer.MAX_VALUE]
        Throws:
        WrongArgumentType
      • checkIntegerType

        public static IInteger checkIntegerType(IAST ast,
                                                int position)
        Check if the argument at the given position is a integer.
        Parameters:
        position - the position which has to be a symbol.
        Throws:
        WrongArgumentType - if it's not a symbol.
      • checkRange

        public static IAST checkRange(IAST ast,
                                      int from)
        If ast.size() < from throw a WrongNumberOfArguments exception.
        Throws:
        WrongNumberOfArguments - if size is not in the range from to Integer.MAX_VALUE
      • checkRange

        public static IAST checkRange(IAST ast,
                                      int from,
                                      int to)
        If ast.size() < from || ast.size() > to throw a WrongNumberOfArguments exception.
        Throws:
        WrongNumberOfArguments - if size is not in the range from to to
      • checkSize

        public static IAST checkSize(IAST ast,
                                     int size)
        If ast.size() != size throw a WrongNumberOfArguments exception.
        Throws:
        WrongNumberOfArguments - if size unequals the list size
      • checkEven

        public static IAST checkEven(IAST ast)
        If ast.size()-1 is not even throw a WrongNumberOfArguments exception.
        Throws:
        WrongNumberOfArguments - if ast.size()-1 is not even
      • checkOdd

        public static IAST checkOdd(IAST ast)
        If ast.size()-1 is not odd throw a WrongNumberOfArguments exception.
        Throws:
        WrongNumberOfArguments - if ast.size()-1 is not odd
      • checkStringType

        public static IStringX checkStringType(IAST ast,
                                               int position)
        Check if the argument at the given position is a IStringX string object.
        Parameters:
        position - the position which has to be a string.
        Throws:
        WrongArgumentType - if it's not a symbol.
      • checkSymbolOrSymbolList

        public static IAST checkSymbolOrSymbolList(IAST ast,
                                                   int position)
        Check if the argument at the given position is a single symbol or a list of symbols.
        Parameters:
        position - the position which has to be a symbol or list.
        Throws:
        WrongArgumentType - if it's not a symbol.
      • checkSymbolList

        public static IAST checkSymbolList(IAST ast,
                                           int position)
        Check if the argument at the given position is a single symbol or a list of symbols.
        Parameters:
        position - the position which has to be a symbol or list.
        Throws:
        WrongArgumentType - if it's not a symbol.
      • checkAssignedVariable

        public static ISymbol checkAssignedVariable(IExpr expr)
        Check if the argument is a symbol and has an assigned value.
        Parameters:
        expr - the expr which has to be a symbol.
        Throws:
        WrongArgumentType - if it's not a symbol.
      • checkSymbolType

        public static ISymbol checkSymbolType(IAST ast,
                                              int position)
        Check if the argument at the given position is a symbol.
        Parameters:
        position - the position which has to be a symbol.
        Throws:
        WrongArgumentType - if it's not a symbol.
      • checkASTUpRuleType

        public static IAST checkASTUpRuleType(IExpr expr)
        Check if the argument at the given position is an AST.
        Parameters:
        position - the position which has to be an AST.
        Throws:
        WrongArgumentType - if it's not an AST.
      • checkASTType

        public static IAST checkASTType(IAST ast,
                                        int position)
        Check if the argument at the given position is an AST.
        Parameters:
        position - the position which has to be an AST.
        Throws:
        WrongArgumentType - if it's not an AST.
      • checkASTType

        public static IAST checkASTType(IExpr expr)
        Check if the expression is an AST.
        Throws:
        WrongArgumentType - if it's not an AST.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.