forked from IF-LK-2020/queue-stack
Initial commit
This commit is contained in:
47
StackNode.java
Normal file
47
StackNode.java
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
public class StackNode<ContentType> {
|
||||
|
||||
private ContentType contentObject = null;
|
||||
|
||||
private StackNode nextNode = null;
|
||||
|
||||
/**
|
||||
* Ein neues Objekt vom Typ Node<ContentType> wird erschaffen.
|
||||
* Der Inhalt wird per Parameter gesetzt. Der Verweis ist leer.
|
||||
*
|
||||
* @param pContentObject das Inhaltselement des Knotens vom Typ ContentType
|
||||
*/
|
||||
public StackNode( ContentType pContentObject) {
|
||||
contentObject = pContentObject;
|
||||
nextNode = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Der Verweis wird auf das Objekt, das als Parameter uebergeben wird,
|
||||
* gesetzt.
|
||||
*
|
||||
* @param pNext der Nachfolger des Knotens
|
||||
*/
|
||||
public void setNext( StackNode pNext) {
|
||||
nextNode = pNext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert das naechste Element des aktuellen Knotens.
|
||||
*
|
||||
* @return das Objekt vom Typ QueueNode, auf das der aktuelle Verweis zeigt
|
||||
*/
|
||||
public StackNode getNext() {
|
||||
return nextNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert das Inhaltsobjekt des Knotens vom Typ ContentType.
|
||||
*
|
||||
* @return das Inhaltsobjekt des Knotens
|
||||
*/
|
||||
public ContentType getContent() {
|
||||
return contentObject;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user