de.heineken.studienarbeit
Class Algorithmus
java.lang.Object
de.heineken.studienarbeit.Algorithmus
public class Algorithmus
extends java.lang.Object
The class Algorithmus is the super-class of all other algorithms and implements
their common functions
protected int[] | eingabe - input array of the random numbers
|
protected int | eingabegroesse - scheduled size of the attribute 'eingabe'
|
protected int | fortschrittszeiger - index pointer for the attribute 'eingabe', represents
the current working progress
|
private int[] | puffer - numbers in the buffer
|
protected int | puffergroesse - number of elements in the buffer
|
Algorithmus(int puffergroesse, int[] eingabe) - Constructor
|
protected int | getpufferzahl(int pufferindex) - Wrapper-Method for reading the content of the buffer at a given position
|
protected boolean | ladepuffer(int leerpos) - takes the next data element from the input arrray and store it at the given
empty position in the buffer
|
int[] | run() - Run Method
will be overwritten by other algorithms
|
eingabe
protected int[] eingabe
input array of the random numbers
eingabegroesse
protected int eingabegroesse
scheduled size of the attribute 'eingabe'
fortschrittszeiger
protected int fortschrittszeiger
index pointer for the attribute 'eingabe', represents
the current working progress
puffer
private int[] puffer
numbers in the buffer
puffergroesse
protected int puffergroesse
number of elements in the buffer
Algorithmus
public Algorithmus(int puffergroesse,
int[] eingabe)
Constructor
eingabe
- contains the random numbers for input
getpufferzahl
protected int getpufferzahl(int pufferindex)
Wrapper-Method for reading the content of the buffer at a given position
pufferindex
- index of position in the buffer
- number at the index position in the buffer
ladepuffer
protected boolean ladepuffer(int leerpos)
takes the next data element from the input arrray and store it at the given
empty position in the buffer
leerpos
- empty position for storing the new value
- true, if there was a new number for storing
false in other cases
run
public int[] run()
Run Method
will be overwritten by other algorithms