Class JxnObject
- java.lang.Object
-
- JxnObject
-
public class JxnObject extends Object
Collection of static methods adding to the methods ofjava.lang.
Object
.
JxnObject.
getClass
(arg)
andJxnObject.
toString
(arg)
by overloading can be called for an argumentarg
, which may be a java primitive, an object or an array object.JxnObject.getClass(arg).
isPrimitive()
can be used to check argumentsarg
of any type (object including array object as well as java primitive or java primitive wrapper).
Using@JxnUnroll(arg)
the methodsJxnObject.
equals
( @JxnUnroll arg1, @JxnUnroll args2 )
andJxnObject.
hashCode
( @JxnUnroll arg )
can be called with array argument(s) and then return an array as result.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equals(Object o1, Object o2)
Returnso1.equals(o2)
(java.lang.Object
).static Class
getClass(boolean x)
Returnsboolean.class
≡Boolean.TYPE
.static Class
getClass(byte x)
Returnsbyte.class
≡Byte.TYPE
.static Class
getClass(char x)
Returnschar.class
≡Character.TYPE
.static Class
getClass(double x)
Returnsdouble.class
≡Double.TYPE
.static Class
getClass(float x)
Returnsfloat.class
≡Float.TYPE
.static Class
getClass(int x)
Returnsint.class
≡Integer.TYPE
.static Class
getClass(long x)
Returnslong.class
≡Long.TYPE
.static Class
getClass(short x)
Returnsshort.class
≡Short.TYPE
.static Class
getClass(Boolean o)
Returnsjava.lang.Boolean.class
.static Class
getClass(Byte o)
Returnsjava.lang.Byte.class
.static Class
getClass(Character o)
Returnsjava.lang.Character.class
.static Class
getClass(Double o)
Returnsjava.lang.Double.class
.static Class
getClass(Float o)
Returnsjava.lang.Float.class
.static Class
getClass(Integer o)
Returnsjava.lang.Integer.class
.static Class
getClass(Long o)
Returnsjava.lang.Long.class
.static Class
getClass(Object o)
Returnso.getClass()
(java.lang.Object
).static Class
getClass(Short o)
Returnsjava.lang.Short.class
.static Class[]
getClassArray(Object[] oa)
Returns an array ofjava.lang.Class
objects of the element objects ofoa
.static int
hashCode(Object obj)
Returnsobj.hashCode()
(java.lang.Object
).static String
toString(boolean z)
Formatsz
as String.static String
toString(byte i)
Formatsi
as String.static String
toString(char ch)
Formatsch
as String.static String
toString(double x)
Formatsx
as String.static String
toString(float x)
Formatsx
as String.static String
toString(int i)
Formatsi
as String.static String
toString(long i)
Formatsi
as String.static String
toString(short i)
Formatsi
as String.static String
toString(Object obj)
Formatsobj
as String.static String[]
toStringArray(Object[] oa)
Returns the element objects ofoa
as an array of String.
-
-
-
Method Detail
-
equals
public static boolean equals(Object o1, Object o2)
Returnso1.equals(o2)
(java.lang.Object
).
In JXNJxnObject.equals( @JxnUnroll arr1, @JxnUnroll arr2 )
returns an array of boolean.
-
getClass
public static Class getClass(double x)
Returnsdouble.class
≡Double.TYPE
.
-
getClass
public static Class getClass(float x)
Returnsfloat.class
≡Float.TYPE
.
-
getClass
public static Class getClass(int x)
Returnsint.class
≡Integer.TYPE
.
-
getClass
public static Class getClass(short x)
Returnsshort.class
≡Short.TYPE
.
-
getClass
public static Class getClass(char x)
Returnschar.class
≡Character.TYPE
.
-
getClass
public static Class getClass(boolean x)
Returnsboolean.class
≡Boolean.TYPE
.
-
getClass
public static Class getClass(Object o)
Returnso.getClass()
(java.lang.Object
).- See Also:
Object.getClass()
-
getClassArray
public static Class[] getClassArray(Object[] oa)
Returns an array ofjava.lang.Class
objects of the element objects ofoa
.
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()
-
hashCode
public static int hashCode(Object obj)
Returnsobj.hashCode()
(java.lang.Object
).
In JXNJxnObject.hashCode( @JxnUnroll obj )
returns an array of int.
-
toString
public static String toString(double x)
Formatsx
as String.- Returns:
"" + x
-
toString
public static String toString(float x)
Formatsx
as String.- Returns:
"" + x
-
toString
public static String toString(long i)
Formatsi
as String.- Returns:
"" + i
-
toString
public static String toString(int i)
Formatsi
as String.- Returns:
"" + i
-
toString
public static String toString(short i)
Formatsi
as String.- Returns:
"" + i
-
toString
public static String toString(byte i)
Formatsi
as String.- Returns:
"" + i
-
toString
public static String toString(char ch)
Formatsch
as String.- Returns:
"" + ch
-
toString
public static String toString(boolean z)
Formatsz
as String.- Returns:
"" + z
-
toString
public static String toString(Object obj)
Formatsobj
as String.- Returns:
"" + obj
- See Also:
Object.toString()
-
toStringArray
public static String[] toStringArray(Object[] oa)
Returns the element objects ofoa
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])
-
-