de.heineken.studienarbeit

Class ScanDisk


public class ScanDisk
extends Algorithmus

implements the algorithm "Scan Disk".

Field Summary

private int
anfangszahl
private boolean
richtung

Fields inherited from class de.heineken.studienarbeit.Algorithmus

eingabe, eingabegroesse, fortschrittszeiger, puffer, puffergroesse

Constructor Summary

ScanDisk(int puffergroesse, int[] eingabe, int anfangszahl, boolean richtung)
Constructor of the Algorithm

Method Summary

private int
minimaledistanz(int anfangszahl, boolean richtung)
The method Minimaldistanz computes for the min.
int[]
run()
run starts the algorithms work

Methods inherited from class de.heineken.studienarbeit.Algorithmus

getpufferzahl, ladepuffer, run

Field Details

anfangszahl

private int anfangszahl

richtung

private boolean richtung

Constructor Details

ScanDisk

public ScanDisk(int puffergroesse,
                int[] eingabe,
                int anfangszahl,
                boolean richtung)
Constructor of the Algorithm
Parameters:

Method Details

minimaledistanz

private int minimaledistanz(int anfangszahl,
                            boolean richtung)
The method Minimaldistanz computes for the min. distance from one number to an other
Parameters:
anfangszahl - , current position of the head
richtung - in which direction the head currently moves
Returns:
index of the element in the buffer that is next to the current position

run

public int[] run()
run starts the algorithms work
Overrides:
run in interface Algorithmus
Returns:
gives back correct number