Code example for Stack

Methods: peekisEmpty

	/** Returns the current document; meaning the first document in the stack */ 
	public Document getCurrentDocument() {
		if (!documents.isEmpty()) {
			return documents.peek();
		return null; 
	/** Retuns the last procssed document */ 
	public Document getLastDocument() {
		return lastDocument;
	/** Returns the current element; meaning the first element in the stack */ 
	public Node getCurrentElement() {
		if (!elements.isEmpty()) {
			return elements.peek();
Contextual code suggestions in your IDE  Get Codota for Java