de.heineken.studienarbeit

Class Algorithmus

Known Direct Subclasses:
CScan, FCFS, ScanDisk, SSTF

public class Algorithmus
extends java.lang.Object

The class Algorithmus is the super-class of all other algorithms and implements their common functions

Field Summary

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

Constructor Summary

Algorithmus(int puffergroesse, int[] eingabe)
Constructor

Method Summary

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

Field Details

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

Constructor Details

Algorithmus

public Algorithmus(int puffergroesse,
                   int[] eingabe)
Constructor
Parameters:
eingabe - contains the random numbers for input

Method Details

getpufferzahl

protected int getpufferzahl(int pufferindex)
Wrapper-Method for reading the content of the buffer at a given position
Parameters:
pufferindex - index of position in the buffer
Returns:
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
Parameters:
leerpos - empty position for storing the new value
Returns:
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