Current Page:
NeXtMidas Training
Getting Started - Part 2
Advanced Results Parameters
Objects
|
|
- Objects
- NeXtMidas allows results to be any type of Java Object, not just a number, String or
Table.
- NeXtMidas allows objects to be accessed using the same dot syntax
used to access a table.
- Finding methods in objects can vary based on the type of class
and how it is implemented. The exact details of this can be found in the
KeyObject section of the NeXtMidas
User's Guide.
- Generally, from the macro language, objects may also be reference by a digraph
formed by the upper case letters in the name. For instance, the method
getMyValue in the class MyStuff may be accessed
as MyStuff.MV from the macro language. While this may be convenient, especially from
the command line, spelling out the entire method is encouraged!
- Most objects are accessed via their get/set/is methods.
- An object with a value
FOO will make that value visible by providing
getFoo() or an isFoo() method.
- An object with a value
FOO that can be modified can make it modifiable
by providing a setFoo(..) method.
- When an object has a
getFoo() method but no setFoo(..)
method the value FOO is said to be "read only."
- Constants are accessible via the dot syntax as well.
- Previously, public variables were accessible via the dot syntax. However,
this behavior has been deprecated as it is bad practice to declare public variables and it
causes problems for backward-compatibility.
Java Experts Take Note: |
The use of the getFoo() , isFoo() , and setFoo(..)
methods follows the definition of a Java Bean. This provides for immediate compatibility
with all objects that follow the Java Bean specification.
|
|
|
|