Stack.java presents a Stack class whose integrity cannot be violated(unlike Java's Stack class). It is built using Java's standard LinkedList class.
Stack constructorPostcondition: Empty stack is constructed.
Check if stack is emptyReturn: true if stack is empty, and false otherwise
Top operationReturn: Object at the top of the stack; null if stack is empty
Push operationReceive: Object value
Postcondition: value has been added at the top of the stack
Pop operationReturn: Object at the top of the stack; null if stack is empty
Postcondition: Value at the top of the stack has been removed.
Back to the package documentation index