<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="mxj~" module="msp" category="Languages">
	<digest>
		Java in MSP
	</digest>
	<description>
		The <o>mxj~</o> object (and its Max equivalent <o>mxj</o>) instantiate specially-written Java classes and acts as a Max-level peer object, passing data that originates in Max to the Java object and vice versa.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<!--OUTLETS-->
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="Java-class" optional="0" type="symbol">
			<digest>
				Java class
			</digest>
			<description>
				The <o>mxj~</o> object must be given the name of a valid Java class as the first argument. The Java class file must exist somewhere within the classpath, and it must be a class that was designed for use with the <o>mxj~</o> object (the class must subclass com.cycling74.max.MaxObject). The number of inlets that an instance of <o>mxj~</o> creates and the messages that it will respond to are determined by declarations made in the peer Java class.
			</description>
		</objarg>
		<objarg name="attributes" optional="0" type="list">
			<digest>
				Attributes
			</digest>
			<description>
				The <o>mxj~</o> object supports the definition of attributes within the Java code for a peer class. The attributes that are settable at the time of instantiation using the @ paradigm. For instance, if a particular class Foo defined an integer attribute called intBar, one could create an instance of the class with the attribute set to the value 74 by typing <m>mxj~ Foo @intBar 74</m> in an object box.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Function depends on Java class instantiated
			</digest>
			<description>
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on Java class instantiated
			</digest>
			<description>
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on Java class instantiated
			</digest>
			<description>
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Function depends on Java class instantiated
			</digest>
			<description>
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Function depends on Java class instantiated
			</digest>
			<description>
			</description>
		</method>
		<method name="benchmark">
			<arglist>
				<arg name="benchmark-flag" optional="0" type="int" />
				<arg name="post-interval" optional="0" type="int" />
			</arglist>
			<digest>
				Disable/enable benchmarking the <o>mxj~</o> object's perform method
			</digest>
			<description>
				The word <m>benchmark</m>, followed by a zero or one and a number that specifies a posting interval (number of executions of the perform method), disables benchmarking the <o>mxj~</o> object's perform method, posting into the Max Console. The default is zero (disabled)
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Open a text editing window
			</digest>
			<description>
				Double-clicking with the mouse on the <o>mxj~</o> object displays its contents as text in an editing window which the user can modify.
			</description>
		</method>
		<method name="exceptioncheck">
			<arglist>
				<arg name="exception-flag" optional="0" type="int" />
			</arglist>
			<digest>
				Disable/enable Java exception checking
			</digest>
			<description>
				The word <m>exceptioncheck</m>, followed by a zero or one, disables/enables Java exception checking in the <o>mxj~</o> object's perform method. The default is zero (disabled).
			</description>
		</method>
		<method name="get">
			<arglist>
				<arg name="attribute-name" optional="0" type="list" />
			</arglist>
			<digest>
				Post an attribute value in the Max Console
			</digest>
			<description>
				The word <m>get</m> followed by an attribute-name will post the attribute value in the Max window.
			</description>
		</method>
		<method name="viewsource">
			<arglist />
			<digest>
				Open a text editor window for source code
			</digest>
			<description>
				The <m>viewsource</m> message brings up a text editor window and loads the source code for the peer Java object. If the source code is not in the same directory as the peer class's .java file, a decompilation of the class file is attempted and the resulting decompiled source is presented. From within the editor window it's possible to make edits to the source, save the file, and recompile the class.
			</description>
		</method>
		<method name="zap">
			<arglist />
			<digest>
				Create an instance of new class without quitting/restart the Max
			</digest>
			<description>
				When a <m>zap</m> message is sent to an <o>mxj~</o> object with Java peer class Foo, the next <o>mxj~</o> object that's instantiated with the same peer Java class Foo (ie typing &quot;mxj Foo&quot; in an object box) will cause the class to reload itself from disk. This is most useful in a programming context: if one makes a change to Foo.java and recompiles a new Foo.class the <m>zap</m> message allows one to create an instance of the new class without having to quit and restart the Max environment. Without sending the <m>zap</m> message Max would simply use the cached definition of the class that was loaded when a Foo object was instantiated prior to the changes being made.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="mxj~.png" caption="An mxj~ object producing noise" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="mxj" />
	</seealsolist>
	<discussion>
		The form that an <o>mxj~</o> object takes -- the number of inlets, outlets and the messages it understands -- is determined by the Java class that it instantiates. Unlike the Max <o>mxj</o> object, the <o>mxj~</o> object is able to perform operations on signal vectors in an MSP processing chain. Using <o>mxj~</o> requires that the host computer have a recent version of the Java Virtual Machine (JVM) installed. Macintosh users can ensure that they have the most up-to-date version of the JVM by running Software Update from the System Preferences. By default, Windows XP does not have a version of the JVM installed. As of the writing of this document the most recent version of the JVM can be downloaded from this
		<a href="http://java.sun.com/j2se/1.4.2/download.html">
			link
		</a>
		<br />
		Max includes a directory called &quot;java-doc&quot;, which can be found on Windows machines at
		<br />
		<br />
		C:\Program Files\Common Files\Cycling '74\java-doc
		<br />
		<br />
		and on Macintosh machines at
		<br />
		<br />
		/Applications/Max*/java-doc
		<br />
		<br />
		The following important subdirectories are in the java-doc directory:
		<br />
		<br />
		&quot;classes&quot; - contains the source code and class files of the example Java classes that are included with Max.
		<br />
		<br />
		&quot;help&quot; - contains the help files that are associated with the example Java classes. Exploring these patches is a good, quick way to see how <o>mxj~</o> has extended and will extend the Max universe.
		<br />
		<br />
		&quot;doc/tutorial&quot; - contains a step-by-step tutorial that leads you through the process of creating your first Java class to the application of advanced <o>mxj~</o> programming techniques. The tutorial is in HTML format.
		<br />
		<br />
		&quot;doc/api&quot; - contains html files that specify <o>mxj~</o>'s Application Programming Interface (API). These pages will serve as an invaluable resource when you are coding your own Java classes.
		<br />
		<br />
		&quot;doc/ide&quot; - contains example projects for some of the Integrated Development Environments (IDEs) we think you may want to use to create Java classes.
		<br />
		<br />
		&quot;doc/mxj~ examples&quot; - contains example classes for signal processing
		<br />
		<br />
		&quot;lib&quot; - contains the code libraries that the <o>mxj~</o> object uses to bridge the worlds of Max and Java.
		<br />
		<br />
		In addition, a file named &quot;max.java.config.txt&quot; is also located in the java directory. This file allows you to specify which diretories should be in Java's classpath - a concept roughly analogous to the Max search path.
	</discussion>
	<misc name="Output">
		<entry name="various">
			<description>
				The number of outlets that an instance of <o>mxj~</o> creates is determined by declarations made in the constructor of the peer Java class. The furthest outlet to the right may or may not be an info outlet whose sole responsibility is to report information about the attributes when queried.
			</description>
		</entry>
	</misc>
</c74object>
