java.lang.Object
org.daiitech.naftah.builtin.lang.NaN

public final class NaN extends Object
Represents a singleton instance of a non-numeric value (NaN).

This class is used to indicate an invalid or undefined result in custom expression evaluation, similar to Double.NaN but at the object level.

يستخدم هذا الكائن لتمثيل قيمة غير رقمية (NaN) في لغة مخصصة أو مفسر، وهو بديل مخصص لـ Double.NaN يمكن استخدامه في القيم الديناميكية.

Author:
Chakib Daii
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final NaN
    The single instance of NaN.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    NaN()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Object
    get()
    Returns the singleton NaN instance.
    static boolean
    isNaN(Object object)
    Checks whether the given object is the singleton NaN instance.
    Returns a string representation of the NaN value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • INSTANCE

      private static final NaN INSTANCE
      The single instance of NaN.

      النسخة الوحيدة المتاحة من NaN.

  • Constructor Details

    • NaN

      private NaN()
  • Method Details

    • get

      public static Object get()
      Returns the singleton NaN instance.

      يُرجع النسخة الوحيدة من NaN.

      Returns:
      the singleton instance representing "not a number"
    • isNaN

      public static boolean isNaN(Object object)
      Checks whether the given object is the singleton NaN instance.

      يتحقق مما إذا كان الكائن المُعطى هو قيمة NaN.

      Parameters:
      object - the object to check
      Returns:
      true if the object is the NaN instance, otherwise false
    • toString

      public String toString()
      Returns a string representation of the NaN value.

      يُرجع تمثيلاً نصياً للقيمة غير الرقمية.

      Overrides:
      toString in class Object
      Returns:
      the string "<قيمة_غير_رقمية>"