<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Extending a Java class with UDD	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=extending-a-java-class-with-udd</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Tue, 13 Sep 2016 12:05:26 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: Yuri Shirman		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-388127</link>

		<dc:creator><![CDATA[Yuri Shirman]]></dc:creator>
		<pubDate>Tue, 13 Sep 2016 12:05:26 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-388127</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387342&quot;&gt;Yuri Shirman&lt;/a&gt;.

It appears that only with static path I was able to run the example.
However the virtual function override does not catch: is it parameters problem?

onRequest.m:
&lt;pre lang=&quot;matlab&quot;&gt;
function res  = onRequest(this, cmd)
res = cmd;
&lt;/pre&gt;
schema.m:
&lt;pre lang=&quot;matlab&quot;&gt;
% ...
% define class methods
% onRequest.m overloads java onRequest method
m = schema.method(svrClass, &#039;onRequest&#039;);
s = m.Signature;
s.varargin    = &#039;off&#039;;
s.InputTypes  = {&#039;string&#039;};
s.OutputTypes = {&#039;string&#039;};
&lt;/pre&gt;
However, I see only the method of the base class running (the override does not catch):
&lt;pre lang=&quot;java&quot;&gt;
@Override
public String onRequest(String request) {
    System.out.println(&quot;### (onRequest)&quot;);
    return &quot;&quot;;
}
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387342">Yuri Shirman</a>.</p>
<p>It appears that only with static path I was able to run the example.<br />
However the virtual function override does not catch: is it parameters problem?</p>
<p>onRequest.m:</p>
<pre lang="matlab">
function res  = onRequest(this, cmd)
res = cmd;
</pre>
<p>schema.m:</p>
<pre lang="matlab">
% ...
% define class methods
% onRequest.m overloads java onRequest method
m = schema.method(svrClass, 'onRequest');
s = m.Signature;
s.varargin    = 'off';
s.InputTypes  = {'string'};
s.OutputTypes = {'string'};
</pre>
<p>However, I see only the method of the base class running (the override does not catch):</p>
<pre lang="java">
@Override
public String onRequest(String request) {
    System.out.println("### (onRequest)");
    return "";
}
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387372</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 04 Sep 2016 18:57:07 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-387372</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387369&quot;&gt;Donn Shull&lt;/a&gt;.

I fixed the post text]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387369">Donn Shull</a>.</p>
<p>I fixed the post text</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Donn Shull		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387369</link>

		<dc:creator><![CDATA[Donn Shull]]></dc:creator>
		<pubDate>Sun, 04 Sep 2016 18:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-387369</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387342&quot;&gt;Yuri Shirman&lt;/a&gt;.

Hi Yuri,

This example works with most MATLAB releases through R2016a. If you download the zip file and use those files it should work. If you are copying the code from the text of the article there is a syntax error in the schema.m file for simple.ServerSocket. Line 1 should be:

&lt;pre lang=&quot;matlab&quot;&gt;function schema&lt;/pre&gt;
rather than:
&lt;pre lang=&quot;matlab&quot;&gt;function schema.m&lt;/pre&gt;

Donn]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387342">Yuri Shirman</a>.</p>
<p>Hi Yuri,</p>
<p>This example works with most MATLAB releases through R2016a. If you download the zip file and use those files it should work. If you are copying the code from the text of the article there is a syntax error in the schema.m file for simple.ServerSocket. Line 1 should be:</p>
<pre lang="matlab">function schema</pre>
<p>rather than:</p>
<pre lang="matlab">function schema.m</pre>
<p>Donn</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yuri Shirman		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-387342</link>

		<dc:creator><![CDATA[Yuri Shirman]]></dc:creator>
		<pubDate>Sun, 04 Sep 2016 08:22:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-387342</guid>

					<description><![CDATA[Yair,

I have a couple of questions:
1. Is this sample compatible with Matlab 2014b?
2. How this sample would look with &lt;code&gt;+package&lt;/code&gt; and &lt;code&gt;classdef&lt;/code&gt; definitions?

Currently I get the following error when I try your sample (everything relevant is added on the matlab path)
&lt;pre lang=&quot;matlab&quot;&gt;ss = simple.SeverSocket&lt;/pre&gt;
&lt;i&gt;Undefined variable &quot;simple&quot; or function &quot;simple.SeverSocket&quot;.&lt;/i&gt;]]></description>
			<content:encoded><![CDATA[<p>Yair,</p>
<p>I have a couple of questions:<br />
1. Is this sample compatible with Matlab 2014b?<br />
2. How this sample would look with <code>+package</code> and <code>classdef</code> definitions?</p>
<p>Currently I get the following error when I try your sample (everything relevant is added on the matlab path)</p>
<pre lang="matlab">ss = simple.SeverSocket</pre>
<p><i>Undefined variable &#8220;simple&#8221; or function &#8220;simple.SeverSocket&#8221;.</i></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386724</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 27 Aug 2016 19:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-386724</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386654&quot;&gt;Edward Maros&lt;/a&gt;.

@Ed - I&#039;m not exactly sure what you mean, but if you&#039;re saying that you only have the class name and wish to avoid instantiating a class object, then you can use Matlab&#039;s &lt;i&gt;&lt;b&gt;eval&lt;/b&gt;&lt;/i&gt; function to evaluate it in run-time. If you need additional assistance then contact me by email (altmany at gmail) for a short consultancy.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386654">Edward Maros</a>.</p>
<p>@Ed &#8211; I&#8217;m not exactly sure what you mean, but if you&#8217;re saying that you only have the class name and wish to avoid instantiating a class object, then you can use Matlab&#8217;s <i><b>eval</b></i> function to evaluate it in run-time. If you need additional assistance then contact me by email (altmany at gmail) for a short consultancy.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Edward Maros		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386654</link>

		<dc:creator><![CDATA[Edward Maros]]></dc:creator>
		<pubDate>Fri, 26 Aug 2016 18:56:53 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-386654</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386643&quot;&gt;Edward Maros&lt;/a&gt;.

Correction. Using MATLAB, can I get the JAVA base class of my UDD based extension?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386643">Edward Maros</a>.</p>
<p>Correction. Using MATLAB, can I get the JAVA base class of my UDD based extension?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Edward Maros		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386653</link>

		<dc:creator><![CDATA[Edward Maros]]></dc:creator>
		<pubDate>Fri, 26 Aug 2016 18:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-386653</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386643&quot;&gt;Edward Maros&lt;/a&gt;.

Yair,

If I need to use the java class directly, I need help on one other piece. My MATLAB class is derived from one of two java classes. This decision is made in the schema.m file and is based on an environment variable. Using UDD, can I get the java class that is used without having to instantiate an object?

PS. Sorry if this is posted out of order, but there was no reply button under your helpful suggestion.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386643">Edward Maros</a>.</p>
<p>Yair,</p>
<p>If I need to use the java class directly, I need help on one other piece. My MATLAB class is derived from one of two java classes. This decision is made in the schema.m file and is based on an environment variable. Using UDD, can I get the java class that is used without having to instantiate an object?</p>
<p>PS. Sorry if this is posted out of order, but there was no reply button under your helpful suggestion.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386646</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 26 Aug 2016 16:43:23 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-386646</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386643&quot;&gt;Edward Maros&lt;/a&gt;.

@Ed - assuming your static constants are &lt;code&gt;public&lt;/code&gt; (which they must be, otherwise you cannot use them in Matlab), you can simply use the classname:

&lt;pre lang=&quot;matlab&quot;&gt;myField = MyJavaClassName.static_field_name;&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386643">Edward Maros</a>.</p>
<p>@Ed &#8211; assuming your static constants are <code>public</code> (which they must be, otherwise you cannot use them in Matlab), you can simply use the classname:</p>
<pre lang="matlab">myField = MyJavaClassName.static_field_name;</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Edward Maros		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-386643</link>

		<dc:creator><![CDATA[Edward Maros]]></dc:creator>
		<pubDate>Fri, 26 Aug 2016 16:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-386643</guid>

					<description><![CDATA[I have enjoyed this series and have found it to be very useful as I am creating a MATLAB wrapping of my java classes. The one question that I have concerns constants.

My java class defines several static constants that I want to expose to the matlab class. I want them to be referenced without having to have instantiated the MATLAB class. If this is possible, what is the syntax.

Thanks,
Ed]]></description>
			<content:encoded><![CDATA[<p>I have enjoyed this series and have found it to be very useful as I am creating a MATLAB wrapping of my java classes. The one question that I have concerns constants.</p>
<p>My java class defines several static constants that I want to expose to the matlab class. I want them to be referenced without having to have instantiated the MATLAB class. If this is possible, what is the syntax.</p>
<p>Thanks,<br />
Ed</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Augustin		</title>
		<link>https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-307021</link>

		<dc:creator><![CDATA[Augustin]]></dc:creator>
		<pubDate>Tue, 31 Dec 2013 12:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2824#comment-307021</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-306587&quot;&gt;Augustin&lt;/a&gt;.

@Donn,

Thanks for your help, that&#039;s what I had done before reading your article. It would have been nice to keep all the code in matlab but if it&#039;s not possible..

Thanks anyway, Happy new year.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/extending-a-java-class-with-udd#comment-306587">Augustin</a>.</p>
<p>@Donn,</p>
<p>Thanks for your help, that&#8217;s what I had done before reading your article. It would have been nice to keep all the code in matlab but if it&#8217;s not possible..</p>
<p>Thanks anyway, Happy new year.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
