⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 algthread.html

📁 Java算法大全(近100种算法打包),內容詳實,很好的學習資料.
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><!--NewPage--><html><head><!-- Generated by javadoc on Tue Nov 03 15:31:36 EST 1998 --><title>  Class AlgThread</title></head><body><a name="_top_"></a><h1>  Class AlgThread</h1><pre>java.lang.Object   |   +----java.lang.Thread           |           +----AlgThread</pre><hr><dl>  <dt> public class <b>AlgThread</b>  <dt> extends Thread</dl><code>AlgThread</code> is an extension of the provided Java  multi-threading package. It enables the graphical display of the main execution thread to be updated during the execution of the algorithm. <p> A section of this source file is normally displayed on the TextFrame. This section starts with the line after  <code>/*------------------*</code><code>/ </code> and finishes before the line <code>//------------ </code>. Every line starting with <code>/*-*</code><code>/</code> will be discarded in the source code display area and each line is terminated by the first encounter of <code>/*-*</code><code>/</code>. <p> The source file <code>AlgThread.java</code> is <b>to be modified/completed</b> for separate animation algorithms.<p><hr><a name="index"></a><h2>  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index"></h2><dl>  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#dataSets"><b>dataSets</b></a>  <dd>  Array of strings used to set the choices of the data choice button in data menu.  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#drawingPanel"><b>drawingPanel</b></a>  <dd>  A reference to the drawing panel in order to update the animation during the execution of the algorithm.  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#frame"><b>frame</b></a>  <dd>  The initial caller of the constructor of this class.  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#max_data"><b>max_data</b></a>  <dd>  Size of the data set appropriate for algorighm animation.</dl><h2>  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index"></h2><dl>  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#AlgThread(AlgAnimFrame)"><b>AlgThread</b></a>(AlgAnimFrame)  <dd>  Creates a new thread using the frame passed in as the parameter.</dl><h2>  <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></h2><dl>  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#generateData()"><b>generateData</b></a>()  <dd>  Generate data based on the choice made on the menu.  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#restoreDrawingPanel()"><b>restoreDrawingPanel</b></a>()  <dd>  Restore the drawing panel at the beginning or the end of each simulation.  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#run()"><b>run</b></a>()  <dd>  This method is invoked when the <code>Thread</code> class <code>start()</code> method is called.  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#setDelay(int)"><b>setDelay</b></a>(int)  <dd>  Sets the delay between each animation step.  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">	<a href="#waitSkip()"><b>waitSkip</b></a>()  <dd>  This method is to be placed after the line where the fast forward function is to be performed.</dl><a name="variables"></a><h2>  <img src="images/variables.gif" width=153 height=38 alt="Variables"></h2><a name="max_data"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>max_data</b><pre> public int max_data</pre><dl>  <dd> Size of the data set appropriate for algorighm animation.<p></dl><a name="dataSets"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a><b>dataSets</b><pre> public static String dataSets[]</pre><dl>  <dd> Array of strings used to set the choices of the data choice button in data menu.<p></dl><a name="frame"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>frame</b><pre> public <a href="AlgAnimFrame.html#_top_">AlgAnimFrame</a> frame</pre><dl>  <dd> The initial caller of the constructor of this class. It holds the references to all existing panels.<p></dl><a name="drawingPanel"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>drawingPanel</b><pre> public <a href="DrawingPanel.html#_top_">DrawingPanel</a> drawingPanel</pre><dl>  <dd> A reference to the drawing panel in order to update the animation during the execution of the algorithm.<p>  <dd><dl>     <dt> <b>See Also:</b>    <dd> <a href="DrawingPanel.html#_top_">DrawingPanel</a>  </dl></dd></dl><a name="constructors"></a><h2>  <img src="images/constructors.gif" width=231 height=38 alt="Constructors"></h2><a name="AlgThread"></a><a name="AlgThread(AlgAnimFrame)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a><b>AlgThread</b><pre> public AlgThread(<a href="AlgAnimFrame.html#_top_">AlgAnimFrame</a> frame)</pre><dl>  <dd> Creates a new thread using the frame passed in as the parameter. If this constructor is called from the frame constructor, a drawingPanel will be initialized and assigned to the frame class.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> frame - An extended frame where the algorithm is going to execute in.    <dt> <b>See Also:</b>    <dd> <a href="AlgAnimFrame.html#_top_">AlgAnimFrame</a>  </dl></dd></dl><a name="methods"></a><h2>  <img src="images/methods.gif" width=151 height=38 alt="Methods"></h2><a name="setDelay(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setDelay"><b>setDelay</b></a><pre> public void setDelay(int delay)</pre><dl>  <dd> Sets the delay between each animation step. This determines the rate the drawingPanel is updated. The <code>setDelay</code> method is normally called by the action listener of the <code>delay choice button</code> on the control panel.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> delay - The delay set in milliseconds.  </dl></dd></dl><a name="generateData()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="generateData"><b>generateData</b></a><pre> public void generateData()</pre><dl>  <dd> Generate data based on the choice made on the menu. This method is application specific and the contents for the satisfaction of each 'if' statement have to be filled in based on the algorithm.<p></dl><a name="run()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="run"><b>run</b></a><pre> public void run()</pre><dl>  <dd> This method is invoked when the <code>Thread</code> class <code>start()</code> method is called. It contains the statements to execute the methods which perform the algorithm. This method is to be completed based on separate animation algorithms.<p>  <dd><dl>    <dt> <b>Overrides:</b>    <dd> <a href="java.lang.Thread.html#run()">run</a> in class Thread    <dt> <b>See Also:</b>    <dd> Thread  </dl></dd></dl><a name="restoreDrawingPanel()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="restoreDrawingPanel"><b>restoreDrawingPanel</b></a><pre> public void restoreDrawingPanel()</pre><dl>  <dd> Restore the drawing panel at the beginning or the end of each simulation.<p></dl><a name="waitSkip()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="waitSkip"><b>waitSkip</b></a><pre> public void waitSkip()</pre><dl>  <dd> This method is to be placed after the line where the fast forward function is to be performed.<p></dl></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -