Crossfire JXClient, Trunk
Public Member Functions | Protected Member Functions | Protected Attributes | Package Functions | Private Attributes | List of all members
SortAlgorithm Class Reference
Inheritance diagram for SortAlgorithm:
Inheritance graph
Collaboration diagram for SortAlgorithm:
Collaboration graph

Public Member Functions

void init ()
 
void setParent (SortItem p)
 
void stop ()
 

Protected Member Functions

void pause () throws Exception
 
void pause (int H1) throws Exception
 
void pause (int H1, int H2) throws Exception
 

Protected Attributes

boolean stopRequested = false
 

Package Functions

void sort (int a[]) throws Exception
 

Private Attributes

SortItem parent
 

Detailed Description

A generic sort demonstration algorithm SortAlgorithm.java, Thu Oct 27 10:32:35 1994

Author
James Gosling

Definition at line 48 of file SortAlgorithm.java.

Member Function Documentation

◆ init()

void SortAlgorithm.init ( )

Initialize

Definition at line 106 of file SortAlgorithm.java.

References stopRequested.

Referenced by SortItem.run().

Here is the caller graph for this function:

◆ pause() [1/3]

void SortAlgorithm.pause ( ) throws Exception
protected

Pause for a while.

Definition at line 69 of file SortAlgorithm.java.

References SortItem.h1, SortItem.h2, parent, SortItem.pause(), and stopRequested.

Referenced by BidirBubbleSortAlgorithm.sort(), and BubbleSortAlgorithm.sort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pause() [2/3]

void SortAlgorithm.pause ( int  H1) throws Exception
protected

Pause for a while and mark item 1.

Definition at line 79 of file SortAlgorithm.java.

References SortItem.h2, parent, SortItem.pause(), and stopRequested.

Here is the call graph for this function:

◆ pause() [3/3]

void SortAlgorithm.pause ( int  H1,
int  H2 
) throws Exception
protected

Pause for a while and mark item 1 & 2.

Definition at line 89 of file SortAlgorithm.java.

References parent, SortItem.pause(), and stopRequested.

Here is the call graph for this function:

◆ setParent()

void SortAlgorithm.setParent ( SortItem  p)

Set the parent.

Definition at line 62 of file SortAlgorithm.java.

References parent.

Referenced by SortItem.run().

Here is the caller graph for this function:

◆ sort()

void SortAlgorithm.sort ( int  a[]) throws Exception
package

This method will be called to sort an array of integers.

Reimplemented in QSortAlgorithm, BidirBubbleSortAlgorithm, and BubbleSortAlgorithm.

Definition at line 114 of file SortAlgorithm.java.

Referenced by SortItem.run().

Here is the caller graph for this function:

◆ stop()

void SortAlgorithm.stop ( )

Stop sorting.

Definition at line 99 of file SortAlgorithm.java.

References stopRequested.

Referenced by SortItem.stop().

Here is the caller graph for this function:

Member Data Documentation

◆ parent

SortItem SortAlgorithm.parent
private

The sort item.

Definition at line 53 of file SortAlgorithm.java.

Referenced by pause(), and setParent().

◆ stopRequested

boolean SortAlgorithm.stopRequested = false
protected

When true stop sorting.

Definition at line 57 of file SortAlgorithm.java.

Referenced by init(), pause(), BubbleSortAlgorithm.sort(), BidirBubbleSortAlgorithm.sort(), and stop().


The documentation for this class was generated from the following file: