|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectikg.eleven.sortarray.SortArray
public class SortArray
This class gives an array of integers for testing sorting algorithms.
| Constructor Summary | |
|---|---|
SortArray(int number)
Constructor with the maximum number of elemnts. |
|
| Method Summary | |
|---|---|
boolean |
equal(int posOne,
int posTwo)
Two elements are compared. |
void |
fillInvers()
Invers filling with values from maximum to zero. |
void |
fillNormal()
Ordered filling with values from zero to maximum -1. |
void |
fillRandom()
The array is filled with random numbers between 1 and the maximum given by the constructor. |
java.lang.String |
getElapsedTime()
The actual elapsed time is returned as String |
int |
getStart()
The lowest array index is returned. |
int |
getStop()
The highest array index is returned. |
boolean |
greater(int posOne,
int posTwo)
Two elements are compared. |
boolean |
isEqual(int pos,
int value)
One element of the array at position pos and the number value are compared. |
boolean |
isGreater(int pos,
int value)
One element of the array at position pos and the number value are compared. |
boolean |
isLess(int pos,
int value)
One element of the array at position pos and the number value are compared. |
boolean |
less(int posOne,
int posTwo)
Two elements are compared. |
void |
replace(int from,
int to)
Two array elements change their places. |
void |
setObserver(char oType)
Determine which type of Observer is used |
void |
showTime()
The difference between the two saved timestamps is written to the terminal. |
void |
startClock()
The actual time is determined and saved. |
void |
stopClock()
The actual time is determined and saved. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SortArray(int number)
| Method Detail |
|---|
public void setObserver(char oType)
public void replace(int from,
int to)
public boolean equal(int posOne,
int posTwo)
public boolean isGreater(int pos,
int value)
public boolean isLess(int pos,
int value)
public boolean isEqual(int pos,
int value)
public boolean less(int posOne,
int posTwo)
public boolean greater(int posOne,
int posTwo)
public void startClock()
public void stopClock()
public void showTime()
public java.lang.String getElapsedTime()
public int getStart()
public int getStop()
public void fillRandom()
public void fillNormal()
public void fillInvers()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||