Code example for Stack

Methods: isEmpty, peek

0
		elements.push(element);
	} 
 
	/** 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();
		}