示例#1
0
 /// <summary>
 /// Checks that an object is not null.
 /// </summary>
 /// <param name="o"> Object to be checked. </param>
 /// <param name="pattern"> Message pattern. </param>
 /// <param name="args"> Arguments to replace the placeholders in {@code pattern}. </param>
 /// <exception cref="NullArgumentException"> if {@code o} is {@code null}. </exception>
 public static void CheckNotNull(object o, Localizable pattern, params object[] args)
 {
     if (o == null)
     {
         throw new NullArgumentException(pattern, args);
     }
 }
 /// <summary>
 /// Construct an exception from the mismatched dimensions.
 /// </summary>
 /// <param name="specific"> Message pattern providing the specific context of
 /// the error. </param>
 /// <param name="wrong"> Wrong dimensions. </param>
 /// <param name="expected"> Expected dimensions. </param>
 public MultiDimensionMismatchException(Localizable specific, Integer[] wrong, Integer[] expected) : base(specific, wrong, expected)
 {
     this.wrong    = wrong.Clone();
     this.expected = expected.Clone();
 }
示例#3
0
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="specific"> Contextual information on what caused the exception. </param>
 public NoDataException(Localizable specific) : base(specific)
 {
 }
示例#4
0
 /// <summary>
 /// Constructor with a specific message.
 /// </summary>
 /// <param name="pattern"> Message pattern providing the specific context of
 /// the error. </param>
 /// <param name="args"> Arguments. </param>
 public MathArithmeticException(Localizable pattern, params object[] args)
 {
     context = new ExceptionContext(this);
     context.AddMessage(pattern, args);
 }
示例#5
0
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="specific"> Specific context where the error occurred. </param>
 /// <param name="value"> Argument. </param>
 public NotStrictlyPositiveException(Localizable specific, Number value) : base(specific, value, INTEGER_ZERO, false)
 {
 }
示例#6
0
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="specific"> Specific context pattern. </param>
 /// <param name="arguments"> Arguments. </param>
 public ZeroException(Localizable specific, params object[] arguments) : base(specific, INTEGER_ZERO, arguments)
 {
 }
示例#7
0
 /// <summary>
 /// Construct an exception from the mismatched dimensions with a
 /// specific context information.
 /// </summary>
 /// <param name="specific"> Context information. </param>
 /// <param name="wrong"> Requested value. </param>
 /// <param name="lo"> Lower bound. </param>
 /// <param name="hi"> Higher bound. </param>
 public OutOfRangeException(Localizable specific, Number wrong, Number lo, Number hi) : base(specific, wrong, lo, hi)
 {
     this.lo = lo;
     this.hi = hi;
 }
示例#8
0
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="specific"> Specific context pattern. </param>
 /// <param name="max"> Maximum. </param>
 /// <param name="args"> Additional arguments. </param>
 public MaxCountExceededException(Localizable specific, Number max, params object[] args)
 {
     GetContext().AddMessage(specific, max, args);
     this.max = max;
 }
示例#9
0
        /// <summary>
        /// Construct the exception with a specific context.
        /// </summary>
        /// <param name="specific"> Specific context pattern. </param>
        /// <param name="wrong"> Value that is smaller than the minimum. </param>
        /// <param name="min"> Minimum. </param>
        /// <param name="boundIsAllowed"> Whether {@code min} is included in the allowed range. </param>
        public NumberIsTooSmallException(Localizable specific, Number wrong, Number min, bool boundIsAllowed) : base(specific, wrong, min)
        {

            this.min = min;
            this.boundIsAllowed = boundIsAllowed;
        }
示例#10
0
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="pattern"> Message pattern providing the specific context of the error. </param>
 /// <param name="arguments"> Values for replacing the placeholders in {@code pattern}. </param>
 public InsufficientDataException(Localizable pattern, params object[] arguments) : base(pattern, arguments)
 {
 }
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="specific"> Specific context pattern. </param>
 /// <param name="wrong"> Value that is infinite or NaN. </param>
 /// <param name="args"> Optional arguments. </param>
 public NotFiniteNumberException(Localizable specific, Number wrong, params object[] args) : base(specific, wrong, args)
 {
 }
示例#12
0
 /// <summary>
 /// Construct an exception from the mismatched dimensions.
 /// </summary>
 /// <param name="specific"> Message pattern providing the specific context of
 /// the error. </param>
 /// <param name="wrong"> Wrong dimensions. </param>
 /// <param name="expected"> Expected dimensions. </param>
 public MultiDimensionMismatchException(Localizable specific, int[] wrong, int[] expected) : base(specific, wrong, expected)
 {
     this.wrong    = (int[])wrong.Clone();
     this.expected = (int[])expected.Clone();
 }
 /// <param name="pattern"> Message pattern providing the specific context of
 /// the error. </param>
 /// <param name="args"> Arguments. </param>
 public MathUnsupportedOperationException(Localizable pattern, params object[] args)
 {
     context = new ExceptionContext(this);
     context.AddMessage(pattern, args);
 }
示例#14
0
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="specific"> Specific context where the error occurred. </param>
 /// <param name="value"> Argument. </param>
 public NotPositiveException(Localizable specific, Number value) : base(specific, value, INTEGER_ZERO, true)
 {
 }
示例#15
0
 /// <param name="pattern"> Message pattern providing the specific context of
 /// the error. </param>
 /// <param name="arguments"> Values for replacing the placeholders in {@code pattern}. </param>
 public NullArgumentException(Localizable pattern, params object[] arguments) : base(pattern, arguments)
 {
 }
示例#16
0
 /// <summary>
 /// Construct the exception with a specific context.
 /// </summary>
 /// <param name="specific"> Specific context pattern. </param>
 /// <param name="wrong"> Value that is larger than the maximum. </param>
 /// <param name="max"> Maximum. </param>
 /// <param name="boundIsAllowed"> if true the maximum is included in the allowed range. </param>
 public NumberIsTooLargeException(Localizable specific, Number wrong, Number max, bool boundIsAllowed) : base(specific, wrong, max)
 {
     this.max            = max;
     this.boundIsAllowed = boundIsAllowed;
 }
示例#17
0
 /// <summary>
 /// Construct the exception with a specific context and arguments.
 /// </summary>
 /// <param name="pattern"> Message pattern providing the specific context of
 /// the error. </param>
 /// <param name="args"> Arguments. </param>
 public ConvergenceException(Localizable pattern, params object[] args)
 {
     GetContext().AddMessage(pattern, args);
 }
 /// <param name="pattern"> Message pattern explaining the cause of the error. </param>
 /// <param name="args"> Arguments. </param>
 public MathIllegalArgumentException(Localizable pattern, params object[] args)
 {
     context = new ExceptionContext(this);
     context.AddMessage(pattern, args);
 }