Package org.armedbear.lisp
Class JavaObject
java.lang.Object
org.armedbear.lisp.LispObject
org.armedbear.lisp.JavaObject
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJavaObject
(Object obj) JavaObject
(Object obj, Class<?> intendedClass) Constructs a Java Object with the given intended class, used to access the object reflectively. -
Method Summary
Modifier and TypeMethodDescriptionclassOf()
static String
describeJavaObject
(JavaObject javaObject) static void
doClassHierarchy
(Class<?> clss, LispObject callback) Executes a function recursively overand its superclasses and interfaces. final boolean
equal
(LispObject other) final boolean
equalp
(LispObject other) static LispObject
findJavaClass
(Class<?> javaClass) static final LispObject
getInstance
(Object obj) Encapsulates obj, if required.static final LispObject
getInstance
(Object obj, boolean translated) Encapsulates obj, if required.static final LispObject
getInstance
(Object obj, boolean translated, Class<?> intendedClass) Encapsulates obj, if required.static final LispObject
getInstance
(Object obj, Class<?> intendedClass) Encapsulates obj, if required.Class
<?> final Object
static final Object
getParts()
Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject.javaInstance
(Class<?> c) Returns the encapsulated Java object for interoperability with wait, notify, synchronized, etc.static LispObject
mapcarClassHierarchy
(Class<?> clss, LispObject fn) static LispObject
registerJavaClass
(Class<?> javaClass, LispObject classMetaObject) STRING()
int
sxhash()
typeOf()
typep
(LispObject type) Methods inherited from class org.armedbear.lisp.LispObject
ABS, add, add, aref, AREF, AREF, aref_long, aset, aset, aset, ash, ash, atom, ATOM, caddr, cadr, car, cddr, cdr, CHAR, characterp, CHARACTERP, chars, COMPLEXP, constantp, CONSTANTP, copyToArray, decr, DENOMINATOR, dispatch, divideBy, doubleValue, elt, endp, ENDP, EQ, eql, eql, eql, EQL, equal, EQUAL, equalp, evenp, EVENP, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, floatp, FLOATP, floatValue, getBooleanValue, getCallCount, getDocumentation, getFixnumSlotValue, getHotCount, getInstance, getPropertyList, getSlotValue, getSlotValue_0, getSlotValue_1, getSlotValue_2, getSlotValue_3, getSlotValueAsBoolean, getStringChars, getStringValue, getSymbolFunction, getSymbolFunctionOrDie, getSymbolSetfFunction, getSymbolSetfFunctionOrDie, getSymbolValue, incr, incrementCallCount, incrementHotCount, integerp, INTEGERP, intValue, IS_E, IS_GE, IS_GT, IS_LE, IS_LT, IS_NE, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNotEqualTo, isNotEqualTo, isSpecialOperator, isSpecialVariable, LDB, length, LENGTH, listp, LISTP, LOGAND, LOGAND, LOGIOR, LOGIOR, LOGNOT, LOGXOR, LOGXOR, longValue, minusp, MINUSP, MOD, MOD, multiplyBy, multiplyBy, negate, noFillPointer, NOT, nreverse, NTH, NTH, nthcdr, numberp, NUMBERP, NUMERATOR, oddp, ODDP, plusp, PLUSP, princToString, psxhash, psxhash, push, rationalp, RATIONALP, realp, REALP, resolve, reverse, RPLACA, RPLACD, SCHAR, setCallCount, setCar, setCdr, setDocumentation, setHotCount, setPropertyList, setSlotValue, setSlotValue, setSlotValue_0, setSlotValue_1, setSlotValue_2, setSlotValue_3, SIMPLE_STRING_P, SLOT_VALUE, stringp, STRINGP, subtract, subtract, SVREF, svset, SYMBOLP, truncate, unreadableString, unreadableString, VECTOR_PUSH_EXTEND, VECTOR_PUSH_EXTEND, vectorp, VECTORP, vectorPushExtend, zerop, ZEROP
-
Field Details
-
JAVA_CLASS_JCLASS
-
JAVA_CLASS
-
ENSURE_JAVA_CLASS
-
JAVA_OBJECT_TO_STRING_LENGTH
-
_JAVA_OBJECT_TO_STRING_LENGTH
-
NULL
-
TRUE
-
FALSE
-
-
Constructor Details
-
JavaObject
-
JavaObject
Constructs a Java Object with the given intended class, used to access the object reflectively. If the class represents a primitive type, the corresponding wrapper type is used instead.- Throws:
ClassCastException
- if the object is not an instance of the intended class.
-
-
Method Details
-
typeOf
- Overrides:
typeOf
in classLispObject
-
classOf
- Overrides:
classOf
in classLispObject
-
typep
- Overrides:
typep
in classLispObject
-
STRING
- Overrides:
STRING
in classLispObject
-
getObject
-
getInstance
Encapsulates obj, if required. If obj is aLispObject
, it's returned as-is.- Parameters:
obj
- Any java object- Returns:
- obj or a new JavaObject encapsulating obj
-
getInstance
Encapsulates obj, if required. If obj is aLispObject
, it's returned as-is. If not, a java object with the specified intended class is returned.- Parameters:
obj
- Any java objectintendedClass
- the class that shall be used to access obj- Returns:
- obj or a new JavaObject encapsulating obj
-
getInstance
Encapsulates obj, if required. If obj is aLispObject
, it's returned as-is. If obj is of a type which can be mapped to a lisp type, an object of the mapped type is returned, if translated is true.- Parameters:
obj
-translated
-- Returns:
- a LispObject representing or encapsulating obj
-
getInstance
Encapsulates obj, if required. If obj is aLispObject
, it's returned as-is. If obj is of a type which can be mapped to a lisp type, an object of the mapped type is returned, if translated is true.- Parameters:
obj
-translated
-intendedClass
- the class that shall be used to reflectively access obj; it is an error for obj not to be an instance of this class. This parameter is ignored if translated == true and the object can be converted to a Lisp object.- Returns:
- a LispObject representing or encapsulating obj
-
javaInstance
- Overrides:
javaInstance
in classLispObject
-
javaInstance
- Overrides:
javaInstance
in classLispObject
-
lockableInstance
Returns the encapsulated Java object for interoperability with wait, notify, synchronized, etc.- Overrides:
lockableInstance
in classLispObject
- Returns:
- The encapsulated object
-
getIntendedClass
-
getObject
-
equal
- Overrides:
equal
in classLispObject
-
equalp
- Overrides:
equalp
in classLispObject
-
sxhash
public int sxhash()- Overrides:
sxhash
in classLispObject
-
printObject
- Overrides:
printObject
in classLispObject
-
getDescription
- Overrides:
getDescription
in classLispObject
-
getParts
Description copied from class:LispObject
Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject. The protocol is to return a List of Cons pairs, where the car of each pair contains a decriptive string, and the cdr returns a subobject for inspection.- Overrides:
getParts
in classLispObject
-
doClassHierarchy
Executes a function recursively overand its superclasses and interfaces. -
mapcarClassHierarchy
-
describeJavaObject
-
registerJavaClass
-
findJavaClass
-