Class JxnObject


  • public class JxnObject
    extends Object
    Collection of static methods adding to the methods of  java.lang.Object.

    JxnObject.getClass(arg) and JxnObject.toString(arg) by overloading can be called for an argument arg, which may be a java primitive, an object or an array object.   JxnObject.getClass(arg).isPrimitive() can be used to check arguments  arg  of any type (object including array object as well as java primitive or java primitive wrapper).

    Using @JxnUnroll(arg) the methods JxnObject.equals( @JxnUnroll arg1, @JxnUnroll args2 ) and JxnObject.hashCode( @JxnUnroll arg ) can be called with array argument(s) and then return an array as result.
    • Method Detail

      • getClass

        public static Class getClass​(double x)
        Returns double.classDouble.TYPE.
      • getClass

        public static Class getClass​(Double o)
        Returns java.lang.Double.class.
      • getClass

        public static Class getClass​(float x)
        Returns float.classFloat.TYPE.
      • getClass

        public static Class getClass​(Float o)
        Returns java.lang.Float.class.
      • getClass

        public static Class getClass​(long x)
        Returns long.classLong.TYPE.
      • getClass

        public static Class getClass​(Long o)
        Returns java.lang.Long.class.
      • getClass

        public static Class getClass​(int x)
        Returns int.classInteger.TYPE.
      • getClass

        public static Class getClass​(Integer o)
        Returns java.lang.Integer.class.
      • getClass

        public static Class getClass​(short x)
        Returns short.classShort.TYPE.
      • getClass

        public static Class getClass​(Short o)
        Returns java.lang.Short.class.
      • getClass

        public static Class getClass​(byte x)
        Returns byte.classByte.TYPE.
      • getClass

        public static Class getClass​(Byte o)
        Returns java.lang.Byte.class.
      • getClass

        public static Class getClass​(Character o)
        Returns java.lang.Character.class.
      • getClass

        public static Class getClass​(boolean x)
        Returns boolean.classBoolean.TYPE.
      • getClass

        public static Class getClass​(Boolean o)
        Returns java.lang.Boolean.class.
      • getClassArray

        public static Class[] getClassArray​(Object[] oa)
        Returns an array of  java.lang.Class  objects of the element objects of  oa.
        Example:
           arr = { PI, j, t, { 2, 3, 5, 7 } }
            = { 3.141592653589793, 0.0 + j 1.0 = 1.0 <) 90.0° ... [I@10ed0d8 } (java.lang.Object[4])
           arr.getClass()
            = class [Ljava.lang.Object; (java.lang.Class:java.lang.Object[])
           JxnObject.getClass arr
            = class [Ljava.lang.Object; (java.lang.Class:java.lang.Object[])
           JxnObject.getClassArray arr
            = { double, class JxnComplexAlgebra, class JxnRealArrayAlgebra, class [I } (java.lang.Class[4])
           JxnObject.getClass @JxnUnroll arr
            = { class java.lang.Double, class JxnComplexAlgebra ... class [I } (java.lang.Class[4])
         
        See Also:
        Object.getClass()
      • toString

        public static String toString​(double x)
        Formats  x  as String.
        Returns:
        "" + x
      • toString

        public static String toString​(float x)
        Formats  x  as String.
        Returns:
        "" + x
      • toString

        public static String toString​(long i)
        Formats  i  as String.
        Returns:
        "" + i
      • toString

        public static String toString​(int i)
        Formats  i  as String.
        Returns:
        "" + i
      • toString

        public static String toString​(short i)
        Formats  i  as String.
        Returns:
        "" + i
      • toString

        public static String toString​(byte i)
        Formats  i  as String.
        Returns:
        "" + i
      • toString

        public static String toString​(char ch)
        Formats  ch  as String.
        Returns:
        "" + ch
      • toString

        public static String toString​(boolean z)
        Formats  z  as String.
        Returns:
        "" + z
      • toStringArray

        public static String[] toStringArray​(Object[] oa)
        Returns the element objects of  oa  as an array of String. In Jxn simply use  "" + oa.
        Example:
           arr = { PI, j, t, { 2, 3, 5, 7 } }
            = { 3.141592653589793, 0.0 + j 1.0 = 1.0 <) 90.0° ... [I@d56e3a } (java.lang.Object[4])
           arr.toString()
            = [Ljava.lang.Object;@1d4329 (java.lang.String)
           JxnObject.toString arr
            = [Ljava.lang.Object;@1d4329 (java.lang.String)
           JxnObject.toStringArray arr
            = { 3.141592653589793, 0.0 + j 1.0 = 1.0 <) 90.0° ... [I@d56e3a } (java.lang.String[4])
           JxnObject.toString @JxnUnroll arr
            = { 3.141592653589793, 0.0 + j 1.0 = 1.0 <) 90.0° ... [I@d56e3a } (java.lang.String[4])     
         
        See Also:
        JxnUtilities.toStringArray(java.lang.Object), Object.toString(), Arrays.toString(Object[]), Arrays.deepToString(java.lang.Object[])