de.heineken.studienarbeit

Class Puffer


public class Puffer
extends JPanel

The class Puffer builds up the buffer which later visualizes the solution

Field Summary

private int
groesse
private JLabel[]
label

Constructor Summary

Puffer()
Constructor turns the buffer's size to a standard value of 3

Method Summary

void
blendeab(int index)
clears the highlighting of an entry
void
clear()
Clears the buffer's entries.
int
getpuffersize()
Getter Method for the buffer's size
void
markiere(int index)
highlights an entry
void
rutscherunter(int index)
clears an entry; the rest of entries will drop down and fill the space, ensuring that the cleared entry is always at the top of the buffer
void
setpuffersize(int groesse)
size of the buffer will be shown as a GUI puffer picture
private void
setzelabel(int index, String text)
Sets an entry
void
setzeneu(int zahl)
New entry can be made
int
sucheindex(int zahl)
Searches for the entry's index of an given head position

Field Details

groesse

private int groesse

label

private JLabel[] label

Constructor Details

Puffer

public Puffer()
Constructor turns the buffer's size to a standard value of 3

Method Details

blendeab

public void blendeab(int index)
clears the highlighting of an entry
Parameters:
index - position of the entry to be highlighted

clear

public void clear()
Clears the buffer's entries.

getpuffersize

public int getpuffersize()
Getter Method for the buffer's size

markiere

public void markiere(int index)
highlights an entry
Parameters:
index - position of the entry to be highlighted

rutscherunter

public void rutscherunter(int index)
clears an entry; the rest of entries will drop down and fill the space, ensuring that the cleared entry is always at the top of the buffer
Parameters:

setpuffersize

public void setpuffersize(int groesse)
size of the buffer will be shown as a GUI puffer picture
Parameters:
groesse - new size of shown buffer

setzelabel

private void setzelabel(int index,
                        String text)
Sets an entry
Parameters:

setzeneu

public void setzeneu(int zahl)
New entry can be made
Parameters:
zahl - position entry that should to be overwritten

sucheindex

public int sucheindex(int zahl)
Searches for the entry's index of an given head position
Parameters:
zahl - head position to be searched for
Returns:
in case of an error -1, otherwise the entry's position is returned to the caller