Mercurial > hg > octave-lojdl
comparison libinterp/octave-value/ov-java.cc @ 15770:e61405133a76
Add new isjava function.
* libinterp/octave-value/ov-base.h: Add new virtual function is_java ().
Returns false.
libinterp/octave-value/ov-java.h: Overload virtual function is_java to return
true for objects in class octave_java.
libinterp/octave-value/ov.h: Add is_java function that calls objects
is_java function.
* libinterp/octave-value/ov-java.cc: Add new DEFUN (isjava) which uses
is_java. Placed outside HAVE_JAVA ifdef so that it is always available.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 12 Dec 2012 13:15:31 -0800 |
parents | 56239ff815a3 |
children | 4698ea77aa75 |
comparison
equal
deleted
inserted
replaced
15769:eade542fedaa | 15770:e61405133a76 |
---|---|
2207 return retval; | 2207 return retval; |
2208 } | 2208 } |
2209 | 2209 |
2210 #endif | 2210 #endif |
2211 | 2211 |
2212 // Outside of #ifdef HAVE_JAVA because it is desirable to be able to | |
2213 // merely test for the presence of a Java object without having Java installed. | |
2214 DEFUN (isjava, args, , | |
2215 "-*- texinfo -*-\n\ | |
2216 @deftypefn {Built-in Function} {} isjava (@var{x})\n\ | |
2217 Return true if @var{x} is a Java object.\n\ | |
2218 @seealso{class, typeinfo, isa}\n\ | |
2219 @end deftypefn") | |
2220 { | |
2221 octave_value retval; | |
2222 | |
2223 if (args.length () != 1) | |
2224 print_usage (); | |
2225 else | |
2226 retval = args(0).is_java (); | |
2227 | |
2228 return retval; | |
2229 } | |
2230 |