[mFns, mexFns, javaClasses] = inmem; %Check which classes in memory
% classpath
which classpath.txt
edit classpath.txt
% imports
import java.lang.String
L = import % return import list
% creating objects
strObj = javaObject('java.lang.String', 'Hello World')
frame = java.awt.Frame('Frame A')
setSize(frame, 800, 400)
newFrameRef = frame
% concatenating object using cat or []
myObjs = [strObj; frame]
% save trial.mat myObjs
% load trial.mat
% getting class attributes
names = fieldnames(strObj, '-full') % second argument optional
% accessing object data
frameDim = getSize(frame)
h = frameDim.height
w = java.awt.Frame.WIDTH % static data, say, counters
% test class name
if (isjava(obj))
name = isa(obj, 'class_name')
end
% invoking methods
% obj.method(args) OR method(obj, args)
getTitle(frame)
javaMethod('startsWith' , gAddress, str) % longer method names
java.lang.Double.isNaN(2.2) % static methods
javaMethod('isNaN' , 'java.lang.Double', 2.2) % static javaMethod
methodsview java.awt.Frame % class name
javaArray('java.lang.Double', 4, 5)
Coronavirus and Machine Learning Conferences
4 years ago